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

Vicente Romero vromero at openjdk.org
Fri Sep 12 17:44:22 UTC 2025


> 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`

Vicente Romero has updated the pull request incrementally with two additional commits since the last revision:

 - fixing comment
 - addressing review comments

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/1567/files
  - new: https://git.openjdk.org/valhalla/pull/1567/files/33a050b9..55cbe386

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1567&range=02
 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1567&range=01-02

  Stats: 62 lines in 2 files changed: 19 ins; 23 del; 20 mod
  Patch: https://git.openjdk.org/valhalla/pull/1567.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1567/head:pull/1567

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


More information about the valhalla-dev mailing list