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

Adam Sotona adam.sotona at oracle.com
Mon Jun 29 09:36:23 UTC 2020


I've double-checked it, the patch is only replacing .bound with .getUpperBound() and implementing the .getUpperBound().
The semantical change by implementing .isIntersectionOrUnionType() comes from some other patch.

Adam

> On 26 Jun 2020, at 18:27, Vicente Romero <vicente.romero at oracle.com> wrote:
> 
> but isn't the case the the original patch is returning true if the upper bound of the type variable is a union or an intersection while the patch adapted to 11 is only returning true if that upper bound is an intersection? what would happen if is is an union?
> 
> Vicente
> 
> On 6/26/20 2:39 AM, Adam Sotona wrote:
>> Hi Vicente,
>> I found the code isIntersectionOrUnionType(Type t) is already there - that is why the patch conflict appears.
>> 
>> Thanks,
>> Adam
>> 
>>> On 25 Jun 2020, at 21:57, Vicente Romero <vicente.romero at oracle.com <mailto:vicente.romero at oracle.com>> wrote:
>>> 
>>> 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 <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 <https://bugs.openjdk.java.net/browse/JDK-8193367>
>>>> Webrev: http://cr.openjdk.java.net/~asotona/8193367/webrev.00/ <http://cr.openjdk.java.net/~asotona/8193367/webrev.00/>
>>>> Backport JBS: https://bugs.openjdk.java.net/browse/JDK-8248014 <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/20200629/d097cc65/attachment.htm>


More information about the compiler-dev mailing list