You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[java] UseDiamondOperator: False positive with interdependent generic vars #5441
In a slightly more complex chain of calls, PMD reports a UseDiamondOperator that at least Java 21 is unable to infer the generic types for if the suggestion from PMD is followed.
It seems with a diamond, javac infers the ConcreteCacheLoader<> to CCL<Object, List<Integer>>, while we infer it to CCL<String, List<Integer>>. After investigating I think the issue lies pretty deep within our inference logic. More investigation needed...
changed the title [-][java] UseDiamondOperator reported but Java 21 is unable to infer the type[/-][+][java] UseDiamondOperator: False positive for anonymous class creation[/+]on Aug 14, 2026
changed the title [-][java] UseDiamondOperator: False positive for anonymous class creation[/-][+][java] UseDiamondOperator: False positive for anonymous class with interdependent generic vars[/+]on Aug 14, 2026
changed the title [-][java] UseDiamondOperator: False positive for anonymous class with interdependent generic vars[/-][+][java] UseDiamondOperator: False positive with interdependent generic vars[/+]on Aug 14, 2026
Activity
oowekyala commentedon Feb 18, 2025
Thanks for the report.
It seems with a diamond, javac infers the
ConcreteCacheLoader<>toCCL<Object, List<Integer>>, while we infer it toCCL<String, List<Integer>>. After investigating I think the issue lies pretty deep within our inference logic. More investigation needed...WIP - order of resolved variables is wrong
[java] Exhaust lower bounds before upper bounds within an ivar batch
[-][java] UseDiamondOperator reported but Java 21 is unable to infer the type[/-][+][java] UseDiamondOperator: False positive for anonymous class creation[/+][-][java] UseDiamondOperator: False positive for anonymous class creation[/-][+][java] UseDiamondOperator: False positive for anonymous class with interdependent generic vars[/+][-][java] UseDiamondOperator: False positive for anonymous class with interdependent generic vars[/-][+][java] UseDiamondOperator: False positive with interdependent generic vars[/+][java] Fix pmd#5441: Resolve interdependent inference variables simul…