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

Vicente Romero vicente.romero at oracle.com
Tue Jul 7 18:56:33 UTC 2020


Hi Bernard,

Adam located the other issue [1] that needs to be backported before the 
backport for JDK-8193367. Once [1] has been backported JDK-8193367 can 
also be backporte as-is,

Thanks,
Vicente

[1] https://bugs.openjdk.java.net/browse/JDK-8213703

On 7/6/20 3:39 PM, B. Blaser wrote:
> Hi Adam & Vicente,
>
> I wrote the original patch and as far as I can remember, Adam is right
> that it's only replacing 'bound' with 'getUpperBound()' and the
> current difference looks therefore pertinent in the sense that the
> call to 'isIntersectionOrUnionType' seems to come from another patch
> that might be backported too? But note that this isn't an approval as
> I'm not a Reviewer and I would need to look at your patch more
> attentively.
>
> Cheers,
> Bernard
>
> On Mon, 29 Jun 2020 at 11:40, Adam Sotona <adam.sotona at oracle.com> wrote:
>> 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> 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 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
>>
>>
>>
>>



More information about the jdk-updates-dev mailing list