-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
a:bugPMD crashes or fails to analyse a file.PMD crashes or fails to analyse a file.in:symbol-tableAffects the symbol table codeAffects the symbol table code
Milestone
Description
Affects PMD Version: 7.0.0
Make sure, to test with the latest PMD version.
Description:
Java reference resolution reports an ambiguity error where there is none, when a statically imported type shadows a java.lang member.
See https://github.com/pmd/pmd/runs/5091674249?check_suite_focus=true#step:7:9523
Exception Stacktrace:
Reference 'Exception' is ambiguous, both net.sourceforge.pmd.renderers.internal.sarif.SarifLog.Exception and java.lang.Exception match
Code Sample demonstrating the issue:
Container.java
package p;
public class Container {
public static class Exception {}
}
Foo.java
import static p.Container.Exception;
public class Foo {
static {
Exception e; // should be unambiguously p.Container.Exception
}
}
at Foo.java: Reference 'Exception' is ambiguous, both p.Container.Exception and java.lang.Exception match
Metadata
Metadata
Assignees
Labels
a:bugPMD crashes or fails to analyse a file.PMD crashes or fails to analyse a file.in:symbol-tableAffects the symbol table codeAffects the symbol table code