Skip to content

Commit

Permalink
Removed a few Coverity warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
oscargus committed Jan 31, 2016
1 parent 0a4058d commit 9d9d466
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/main/java/net/sf/jabref/openoffice/OOBibStyle.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,21 +238,22 @@ private void readFormatFile(Reader in) throws IOException {
}

switch (mode) {
case NAME:
if (!line.trim().isEmpty()) {
name = line.trim();
}
case LAYOUT:
handleStructureLine(line);
break;
case PROPERTIES:
handlePropertiesLine(line, properties);
break;
case CITATION:
handlePropertiesLine(line, citProperties);
break;
case JOURNALS:
handleJournalsLine(line);
case NAME:
if (!line.trim().isEmpty()) {
name = line.trim();
}
break;
case LAYOUT:
handleStructureLine(line);
break;
case PROPERTIES:
handlePropertiesLine(line, properties);
break;
case CITATION:
handlePropertiesLine(line, citProperties);
break;
case JOURNALS:
handleJournalsLine(line);
}

}
Expand Down Expand Up @@ -494,7 +495,7 @@ public String getCitationMarker(BibEntry[] entries, BibDatabase database, boolea
String author = getCitationMarkerField(entries[i], database, authorField);
AuthorList al = AuthorList.getAuthorList(author);
//System.out.println("i="+i+" thisMarker='"+thisMarker+"'");
int prevALim = i > 0 ? unlimAuthors[i - 1] : unlimAuthors[0];
int prevALim = unlimAuthors[i - 1]; // i always at least 1 here
if (!thisMarker.equals(tmpMarker)
|| ((al.size() > maxAuthors) && (unlimAuthors[i] != prevALim))) {
// No match. Update piv to exclude the previous entry. But first check if the
Expand Down Expand Up @@ -891,9 +892,10 @@ public int compareTo(OOBibStyle other) {
public boolean equals(Object o) {
if (o == null) {
return false;
} else {
} else if (o instanceof OOBibStyle) {
return styleFile.equals(((OOBibStyle) o).styleFile);
}
return false;
}

@Override
Expand Down

0 comments on commit 9d9d466

Please sign in to comment.