Skip to content

Commit 47df456

Browse files
committed
finalize local vars and comments
1 parent 5dfc445 commit 47df456

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/main/java/com/github/canbabel/canio/dbc/DbcReader.java

100644100755
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ public class DbcReader {
9292
private Document document = null;
9393
private static Bus bus = null;
9494
private Map<Long, Set<Signal>> muxed = new TreeMap<Long, Set<Signal>>();
95-
private Set<LabelDescription> labels = new HashSet<LabelDescription>();
96-
private Set<SignalComment> signalComments = new HashSet<SignalComment>();
95+
private final Set<LabelDescription> labels = new HashSet<LabelDescription>();
96+
private final Set<SignalComment> signalComments = new HashSet<SignalComment>();
9797
private String version = "";
9898
private static PrintWriter logWriter;
9999

@@ -342,8 +342,9 @@ public boolean parseFile(File file, OutputStream logStream) {
342342
/**
343343
* Produces a file in KCD format.
344344
*
345-
* @param file
346-
* File to save.
345+
* @param file File to save.
346+
* @param prettyPrint True, if the output file shall be easy to view for human readers.
347+
* @param gzip True, if the output file shall be compressed.
347348
* @return True, if operation successful.
348349
*/
349350
public boolean writeKcdFile(File file, boolean prettyPrint, boolean gzip) {
@@ -398,20 +399,16 @@ public List<String> getNodes() {
398399

399400
/**
400401
* Returns true, if a line from the input file starts with a keyword from
401-
* the list of
402-
* <p>
403-
* KEYWORDS
404-
* </p>
405-
* .
402+
* the list of <p>KEYWORDS</p>.
406403
*
407404
* @param line
408405
* String to check for Keyword
409406
* @return true, if line starts with a keyword.
410407
*/
411408
private static boolean startsWithKeyword(String line) {
412409
boolean retval = false;
413-
for (int i = 0; i < KEYWORDS.length; i++) {
414-
if (line.startsWith(KEYWORDS[i])) {
410+
for (String keyword : KEYWORDS) {
411+
if (line.startsWith(keyword)) {
415412
retval = true;
416413
}
417414
}
@@ -630,7 +627,7 @@ public static int getCanIdFromString(String canIdStr) {
630627
public static boolean isExtendedFrameFormat(String canIdStr) {
631628

632629
long canIdLong = Long.valueOf(canIdStr).longValue();
633-
return ((canIdLong >>> 31 & 1) == 1) ? true : false;
630+
return ((canIdLong >>> 31 & 1) == 1);
634631
}
635632

636633
private enum SignalType {

0 commit comments

Comments
 (0)