better implementation for the fix
This commit is contained in:
parent
b42abc9904
commit
287753417d
|
@ -16,7 +16,7 @@ public class Community implements Serializable {
|
|||
private List<String> subjects = new ArrayList<>();
|
||||
private List<Provider> providers = new ArrayList<>();
|
||||
private List<ZenodoCommunity> zenodoCommunities = new ArrayList<>();
|
||||
private SelectionConstraints constraints = new SelectionConstraints();
|
||||
private SelectionConstraints constraints;
|
||||
|
||||
public String toJson() {
|
||||
final Gson g = new Gson();
|
||||
|
@ -27,7 +27,7 @@ public class Community implements Serializable {
|
|||
return !getSubjects().isEmpty()
|
||||
|| !getProviders().isEmpty()
|
||||
|| !getZenodoCommunities().isEmpty()
|
||||
|| constraints != null;
|
||||
|| !getConstraints().getCriteria().isEmpty();
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
|
|
@ -92,7 +92,7 @@ public class CommunityConfigurationFactory {
|
|||
private static SelectionConstraints parseConstrains(Node node) {
|
||||
Node advConstsNode = node.selectSingleNode("./advancedConstraints");
|
||||
if (advConstsNode == null || StringUtils.isBlank(StringUtils.trim(advConstsNode.getText()))) {
|
||||
return null;
|
||||
return new SelectionConstraints();
|
||||
}
|
||||
SelectionConstraints selectionConstraints = new Gson()
|
||||
.fromJson(advConstsNode.getText(), SelectionConstraints.class);
|
||||
|
|
Loading…
Reference in New Issue