RFR: JDK-8222035: Unused variable declaration causes inference error

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Apr 9 16:56:29 UTC 2019


Looks good - few comments:

* there's an HashSet still used at line 404:

Set<Type> deps = minMap.getOrDefault(t.qtype, new 
HashSet<>(Collections.singleton(t.qtype)));

This should be fixed too.

* In this statement:

((UndetVar)asUndetVar(eq)).setInst(inferenceContext.asInstType(t));

It would be better to cache the instantiated type outside the loop since 
it doesn't change.

Maurizio


On 09/04/2019 17:51, Vicente Romero wrote:
> Hi all,
>
> Please review fix for [1] at [2]. The issue is random and very hard to 
> reproduce with a regression test. Apart from the use of non-ordering 
> preserving data structures, the root cause was early resolution of the 
> inference context which was leading, in this case, to inexact 
> instantiation of some inference variables.
>
> Thanks,
> Vicente
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8222035
> [2] http://cr.openjdk.java.net/~vromero/8222035/webrev.00/


More information about the compiler-dev mailing list