Skip to content

Commit

Permalink
do not return null when set is expected
Browse files Browse the repository at this point in the history
  • Loading branch information
firestar committed Nov 8, 2023
1 parent bd3e2d8 commit c9a4fde
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/groovy/nucleodb.library.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group = 'com.nucleodb'
version = '1.9.14'
version = '1.9.15'

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,51 +148,51 @@ public Set<Connection> getByFrom(DataEntry de){
if(tmp!=null){
return tmp.stream().map(c->c.clone()).collect(Collectors.toSet());
}
return null;
return new TreeSetExt<>();
}

public Set<Connection> getByFromAndLabel(DataEntry from, String label){
Set<Connection> tmp = connections.get(from.getKey()+label);
if(tmp!=null) {
return tmp.stream().map(c->c.clone()).collect(Collectors.toSet());
}
return null;
return new TreeSetExt<>();
}

public Set<Connection> getByFromAndLabelAndTo(DataEntry from, String label, DataEntry to){
Set<Connection> tmp = connections.get(from.getKey()+to.getKey()+label);
if(tmp!=null) {
return tmp.stream().map(c->c.clone()).collect(Collectors.toSet());
}
return null;
return new TreeSetExt<>();
}
public Set<Connection> getByFromAndTo(DataEntry from, DataEntry to){
Set<Connection> tmp = connections.get(from.getKey()+to.getKey());
if(tmp!=null) {
return tmp.stream().map(c->c.clone()).collect(Collectors.toSet());
}
return null;
return new TreeSetExt<>();
}
public Set<Connection> getReverseByLabelAndTo(String label, DataEntry to){
Set<Connection> tmp = connectionsReverse.get(to.getKey()+label);
if(tmp!=null) {
return tmp.stream().map(c->c.clone()).collect(Collectors.toSet());
}
return null;
return new TreeSetExt<>();
}
public Set<Connection> getReverseByFromAndLabelAndTo(DataEntry de, String label, DataEntry toDe){
Set<Connection> tmp = connectionsReverse.get(de.getKey()+toDe.getKey()+label);
if(tmp!=null) {
return tmp.stream().map(c->c.clone()).collect(Collectors.toSet());
}
return null;
return new TreeSetExt<>();
}
public Set<Connection> getReverseByFromAndTo(DataEntry from, DataEntry to){
Set<Connection> tmp = connectionsReverse.get(from.getKey()+to.getKey());
if(tmp!=null) {
return tmp.stream().map(c->c.clone()).collect(Collectors.toSet());
}
return null;
return new TreeSetExt<>();
}

private void putConnectionInKey(String key, Connection connection){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public Set<DataEntry> createNewObject(Set<DataEntry> o) {
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return null;
return new TreeSetExt<>();
}

DataEntry createNewObject(DataEntry o) {
Expand Down

0 comments on commit c9a4fde

Please sign in to comment.