Skip to content

Commit

Permalink
fixed warning and occasional nullpointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Eichar committed Jul 2, 2013
1 parent 2ec2030 commit c991e18
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
26 changes: 14 additions & 12 deletions core/src/main/java/org/fao/geonet/kernel/SelectionManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,20 @@ public int updateSelection(String type, ServiceContext context, String selected,
this.selections.put(type, selection);
}

if (selected.equals(ADD_ALL_SELECTED))
this.selectAll(type, context);
else if (selected.equals(REMOVE_ALL_SELECTED))
this.close(type);
else if (selected.equals(ADD_SELECTED) && (paramid != null))
selection.add(paramid);
else if (selected.equals(REMOVE_SELECTED) && (paramid != null))
selection.remove(paramid);
else if (selected.equals(CLEAR_ADD_SELECTED) && (paramid != null)) {
this.close(type);
selection.add(paramid);
}
if (selected != null) {
if (selected.equals(ADD_ALL_SELECTED))
this.selectAll(type, context);
else if (selected.equals(REMOVE_ALL_SELECTED))
this.close(type);
else if (selected.equals(ADD_SELECTED) && (paramid != null))
selection.add(paramid);
else if (selected.equals(REMOVE_SELECTED) && (paramid != null))
selection.remove(paramid);
else if (selected.equals(CLEAR_ADD_SELECTED) && (paramid != null)) {
this.close(type);
selection.add(paramid);
}
}

// Remove empty/null element from the selection
Iterator<String> iter = selection.iterator();
Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,6 @@
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down

0 comments on commit c991e18

Please sign in to comment.