Skip to content

Commit

Permalink
Remove unused code (#20)
Browse files Browse the repository at this point in the history
String comparison must be done with .equals() so that the comparison is not done at the object level.

However, if done correctly here, it would lead to a NullPointerException in getFirstToken(). getFirstToken() is actually able to correctly handle empty lines and will return a null string in that case, which is properly handled by the calling code.

Therefore, remove unused code.
  • Loading branch information
michelole committed May 7, 2018
1 parent 5e09e86 commit 525904e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/at/medunigraz/imi/bst/n2c2/model/Patient.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ public ArrayList<PatientVisits> getAllVisits(){
PatientVisits pv = new PatientVisits();

pv.setVisit_number(i);
String line = visits[i].trim();
if(line == "") line = null;
String line = visits[i].trim();

String s_date = getFirstToken(line);
if(s_date != null){
Expand Down

0 comments on commit 525904e

Please sign in to comment.