RFR: JDK-8196519: Incomplete classpath causes infinite recursion in Resolve.isAccessible

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Mar 9 13:03:59 UTC 2018

Whoops - looks good


On 07/03/18 13:01, Jan Lahoda wrote:
> Hi,
> The problem here is that 
> c.s.t.javac.code.Type.ErrorType.getEnclosingType returns "this", so if 
> some code recursively analyses types and their enclosing types, it may 
> get into trouble. In this case, it is Resolve.isAccessible which 
> crashes with a StackOverflow.
> It would be possible to break the infinite recursion in isAccessible, 
> but it seems as not quite correct to return "this" from 
> getEnclosingType. The proposal is to return Type.noType.
> Bug: https://bugs.openjdk.java.net/browse/JDK-8196519
> Webrev: http://cr.openjdk.java.net/~jlahoda/8196519/webrev.00/
> How does this look?
> Thanks,
>     Jan

More information about the compiler-dev mailing list