[jdk8u-dev] RFR: 8265527: tools/javac/diags/CheckExamples.java fails after JDK-8078024 8u backport

zzambers duke at openjdk.org
Sat Oct 22 02:26:20 UTC 2022


On Fri, 21 Oct 2022 09:28:11 GMT, Peter Zhelezniakov <peterz at openjdk.org> wrote:

> This fix reverts some of the changes made to jtreg tests by the 8078024 backport. Changes to javac itself are not reverted.
> 
> The failing test checks error messages emitted by javac while compiling invalid code. The exact messages differ in JDKs 8 and 9, where 8078024 fix was backported from. So this fix updates the expected messages to match those issued by JDK8.

@petermz Thanks for taking time looking at this

@jerboaa I tested this change by creating branch in my fork where I applied this changeset and enabled langtools_tier1 testing in GHA. It passed on all platforms [1] (including problematic test).

When it comes to compiler messages. I checked compiler messages for jdk8 and jdk11, they are indeed different, but both variants seem OK to me. For reference:
jdk8

javac WhereIntersection.java
WhereIntersection.java:36: error: incompatible types: inference variable T has incompatible bounds
        return f(a, b);
                ^
    upper bounds: Object[],Object
    lower bounds: Float,Integer
  where T is a type-variable:
    T extends Object declared in method <T>f(T,T)
1 error

jdk11

javac WhereIntersection.java
WhereIntersection.java:36: error: incompatible types: inferred type does not conform to upper bound(s)
        return f(a, b);
                ^
    inferred: INT#1
    upper bound(s): Object[],Object
  where INT#1,INT#2 are intersection types:
    INT#1 extends Number,Comparable<? extends INT#2>
    INT#2 extends Number,Comparable<?>
1 error


[1] https://github.com/zzambers/jdk8u-dev/commits/check-examples-test

-------------

PR: https://git.openjdk.org/jdk8u-dev/pull/146


More information about the jdk8u-dev mailing list