RFR: JDK-8196519: Incomplete classpath causes infinite recursion in Resolve.isAccessible
Jan Lahoda
jan.lahoda at oracle.com
Wed Mar 7 13:01:10 UTC 2018
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