hg: valhalla/valhalla: 8237074: [lworld] Compiler should emit a warning if code compares the result of getClass() against the class literal for an interface

srikanth.adayapalam at oracle.com srikanth.adayapalam at oracle.com
Mon Feb 3 09:54:09 UTC 2020


Changeset: b4bf177bac61
Author:    sadayapalam
Date:      2020-02-03 15:23 +0530
URL:       https://hg.openjdk.java.net/valhalla/valhalla/rev/b4bf177bac61

8237074: [lworld] Compiler should emit a warning if code compares the result of getClass() against the class literal for an interface
Reviewed-by: sadayapalam
Contributed-by: jesper at selskabet.org

! src/jdk.compiler/share/classes/com/sun/tools/javac/code/Lint.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java
! src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
! src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties
! test/langtools/tools/javac/diags/CheckExamples.java
+ test/langtools/tools/javac/diags/examples/CheckGetClassComparedWithInterfaceLiteral.java
+ test/langtools/tools/javac/valhalla/lworld-values/CheckInterfaceComparison.java
+ test/langtools/tools/javac/valhalla/lworld-values/CheckInterfaceComparison.out



More information about the valhalla-dev mailing list