[lworld] Integrated: 8367323: [lworld] javac is rejecting valid code after fix for JDK-8359370

Vicente Romero vromero at openjdk.org
Mon Sep 15 13:11:03 UTC 2025


On Thu, 11 Sep 2025 02:14:37 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> Recent fix for [JDK-8359370](https://bugs.openjdk.org/browse/JDK-8359370) introduced a minor bug. This code should be accepted by javac:
> 
> class SuperClass<T> {
>     public SuperClass(Object o) {}
> }
> 
> class Sub<T> extends SuperClass<T> {
>     public Sub() {
>         super(new Object() {
>             void foo() {
>                 getClass();
>             }
>         });
>     }
> }
> 
> 
> but it is currently rejected as the `getClass` invocation is considered to be an invocation of an instance method of class `Sub`

This pull request has now been integrated.

Changeset: 04efe5c6
Author:    Vicente Romero <vromero at openjdk.org>
URL:       https://git.openjdk.org/valhalla/commit/04efe5c66b70b9dca1a5c538c9a04e7ad93c107a
Stats:     96 lines in 4 files changed: 52 ins; 23 del; 21 mod

8367323: [lworld] javac is rejecting valid code after fix for JDK-8359370

Reviewed-by: liach, mcimadamore

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

PR: https://git.openjdk.org/valhalla/pull/1567


More information about the valhalla-dev mailing list