RFR: [Backport] JDK11-8193367 annotated type variables bounds crash javac

Vicente Romero vicente.romero at oracle.com
Thu Jun 25 19:57:37 UTC 2020


Hi Adam,

On 6/23/20 6:55 AM, Adam Sotona wrote:
> Hi,
> Please review backport of 8193367 into JDK 11.
>
> Original patch at 
> http://hg.openjdk.java.net/jdk/jdk/rev/a772e65727c5 has just minor 
> conflicts in copyright headers and in one code fragment with JDK 11 
> repository.
>
> New patch differs in functionality with the original just in one block 
> in 
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java:
> < -                            if (tv.bound.getKind() == 
> TypeKind.INTERSECTION) {
> < +                            if (tv.getUpperBound().getKind() == 
> TypeKind.INTERSECTION) {

this difference seems like an important semantic change compared to what 
the original patch is doing. I guess you will need to port method: 
`boolean isIntersectionOrUnionType(Type t)` too

> versus:
> > -                        return isIntersectionOrUnionType(tv.bound);
> > +                        return 
> isIntersectionOrUnionType(tv.getUpperBound());
>
> Patched JDK 11 passed all Tier 1, 2 and 3 tests.
>
> Original JBS: https://bugs.openjdk.java.net/browse/JDK-8193367
> Webrev: http://cr.openjdk.java.net/~asotona/8193367/webrev.00/
> Backport JBS: https://bugs.openjdk.java.net/browse/JDK-8248014
>
> Thanks,
> Adam

Thanks,
Vicente
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20200625/6147175c/attachment.htm>


More information about the compiler-dev mailing list