@@ -92,8 +92,8 @@ public class DbcReader {
92
92
private Document document = null ;
93
93
private static Bus bus = null ;
94
94
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 >();
97
97
private String version = "" ;
98
98
private static PrintWriter logWriter ;
99
99
@@ -342,8 +342,9 @@ public boolean parseFile(File file, OutputStream logStream) {
342
342
/**
343
343
* Produces a file in KCD format.
344
344
*
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.
347
348
* @return True, if operation successful.
348
349
*/
349
350
public boolean writeKcdFile (File file , boolean prettyPrint , boolean gzip ) {
@@ -398,20 +399,16 @@ public List<String> getNodes() {
398
399
399
400
/**
400
401
* 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>.
406
403
*
407
404
* @param line
408
405
* String to check for Keyword
409
406
* @return true, if line starts with a keyword.
410
407
*/
411
408
private static boolean startsWithKeyword (String line ) {
412
409
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 )) {
415
412
retval = true ;
416
413
}
417
414
}
@@ -630,7 +627,7 @@ public static int getCanIdFromString(String canIdStr) {
630
627
public static boolean isExtendedFrameFormat (String canIdStr ) {
631
628
632
629
long canIdLong = Long .valueOf (canIdStr ).longValue ();
633
- return ((canIdLong >>> 31 & 1 ) == 1 ) ? true : false ;
630
+ return ((canIdLong >>> 31 & 1 ) == 1 );
634
631
}
635
632
636
633
private enum SignalType {
0 commit comments