@@ -566,31 +566,31 @@ private boolean setDefine(CompilerOptions options,
566
566
String key , Object value ) {
567
567
boolean success = false ;
568
568
569
- if (value instanceof String ) {
569
+ if (value instanceof String string ) {
570
570
final boolean isTrue = "true" .equals (value );
571
571
final boolean isFalse = "false" .equals (value );
572
572
573
573
if (isTrue || isFalse ) {
574
574
options .setDefineToBooleanLiteral (key , isTrue );
575
575
} else {
576
576
try {
577
- double dblTemp = Double .parseDouble (( String ) value );
577
+ double dblTemp = Double .parseDouble (string );
578
578
options .setDefineToDoubleLiteral (key , dblTemp );
579
579
} catch (NumberFormatException nfe ) {
580
580
// Not a number, assume string
581
- options .setDefineToStringLiteral (key , ( String ) value );
581
+ options .setDefineToStringLiteral (key , string );
582
582
}
583
583
}
584
584
585
585
success = true ;
586
- } else if (value instanceof Boolean ) {
587
- options .setDefineToBooleanLiteral (key , ( Boolean ) value );
586
+ } else if (value instanceof Boolean b ) {
587
+ options .setDefineToBooleanLiteral (key , b );
588
588
success = true ;
589
- } else if (value instanceof Integer ) {
590
- options .setDefineToNumberLiteral (key , ( Integer ) value );
589
+ } else if (value instanceof Integer i ) {
590
+ options .setDefineToNumberLiteral (key , i );
591
591
success = true ;
592
- } else if (value instanceof Double ) {
593
- options .setDefineToDoubleLiteral (key , ( Double ) value );
592
+ } else if (value instanceof Double d ) {
593
+ options .setDefineToDoubleLiteral (key , d );
594
594
success = true ;
595
595
}
596
596
@@ -706,16 +706,14 @@ private long getLastModifiedTime(List<?> fileLists) {
706
706
long lastModified = 0 ;
707
707
708
708
for (Object entry : fileLists ) {
709
- if (entry instanceof FileList ) {
710
- FileList list = (FileList ) entry ;
709
+ if (entry instanceof FileList list ) {
711
710
712
711
for (String fileName : list .getFiles (this .getProject ())) {
713
712
File path = list .getDir (this .getProject ());
714
713
File file = new File (path , fileName );
715
714
lastModified = max (getLastModifiedTime (file ), lastModified );
716
715
}
717
- } else if (entry instanceof Path ) {
718
- Path path = (Path ) entry ;
716
+ } else if (entry instanceof Path path ) {
719
717
for (String src : path .list ()) {
720
718
File file = new File (src );
721
719
lastModified = max (getLastModifiedTime (file ), lastModified );
0 commit comments