Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Commit

Permalink
refactor boolean expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
abargnesi committed Jun 12, 2013
1 parent 5003617 commit d0baeb3
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ public boolean exists(final Kam k) {
@Override
public boolean exists(final KamInfo info) {
if (info == null) throw new InvalidArgument(DEFAULT_MSG);
if (exists(info.getName())) return true;
return false;
return exists(info.getName());
}

/**
Expand All @@ -135,12 +134,10 @@ public boolean exists(final String name) {

@Override
public boolean match(KamInfo t) {
if (name.equals(t.getName())) return true;
return false;
return name.equals(t.getName());
}
});
if (ki != null) return true;
return false;
return ki != null;
}

/**
Expand Down Expand Up @@ -456,7 +453,7 @@ public List<BelTerm> getSupportingTerms(KamNode kamNode,
}

// Check for duplicates
if (removeDuplicates == true) {
if (removeDuplicates) {
HashMap<String, BelTerm> map = new HashMap<String, BelTerm>();
// FIXME: this is inefficient
for (BelTerm belTerm : terms) {
Expand Down Expand Up @@ -497,7 +494,7 @@ public KamNode getKamNode(final Kam kam, String belTermString) {
throw new InvalidArgument("belTermString", belTermString);
KamInfo ki = kam.getKamInfo();
if (!exists(ki)) return null;
KamNode kamNode = null;
KamNode kamNode;
Integer nodeID;
try {
nodeID = kamStoreDao(ki).getKamNodeId(belTermString);
Expand Down

0 comments on commit d0baeb3

Please sign in to comment.