Skip to content

Commit 66a8bc5

Browse files
committed
Kotlin: Make newerThan symmetric
"0.0 last-modified 0" and "0.0 last-modified 123" were giving different comparisons depending on which way round they were.
1 parent 80968ee commit 66a8bc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/kotlin-extractor/src/main/java/com/semmle/extractor/java/OdasaOutput.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,9 @@ private boolean newerThan(TrapClassVersion tcv) {
521521
// Classes being compiled from source have major version 0 but should take precedence
522522
// over any classes with the same qualified name loaded from the classpath
523523
// in previous or subsequent extractor invocations.
524-
if (tcv.majorVersion==0)
524+
if (tcv.majorVersion == 0 && majorVersion != 0)
525525
return false;
526-
else if (majorVersion==0)
526+
else if (majorVersion == 0 && tcv.majorVersion != 0)
527527
return true;
528528
// Always consider the Kotlin extractor superior to the Java extractor, because we may decode and extract
529529
// Kotlin metadata that the Java extractor can't understand:

0 commit comments

Comments
 (0)