Project

General

Profile

« Previous | Next » 

Revision 38362

utility methods and avoid NPEs

View differences:

GTAuthor.java
26 26

  
27 27
	public GTAuthor(final String id, final Authors merged, final CoAuthors coAuthors, final boolean anchor) {
28 28
		super();
29

  
30
		if ((merged == null) || merged.isEmpty())
31
			throw new IllegalArgumentException("empty merged author set, id: " + id);
32

  
29 33
		this.author = pickAuthor(merged);
30 34
		this.id = id;
31 35
		this.merged = merged;
......
107 111
		this.author = author;
108 112
	}
109 113

  
114
	public boolean hasMerged() {
115
		return (getMerged() != null) && !getMerged().isEmpty();
116
	}
117

  
110 118
	public Authors getMerged() {
111 119
		return merged;
112 120
	}
......
115 123
		this.merged = merged;
116 124
	}
117 125

  
126
	public boolean hasCoAuthors() {
127
		return (getCoAuthors() != null) && !getCoAuthors().isEmpty();
128
	}
129

  
118 130
	public CoAuthors getCoAuthors() {
119 131
		return coAuthors;
120 132
	}

Also available in: Unified diff