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

Vicente Romero vromero at openjdk.org
Mon Sep 15 12:56:04 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 one additional commit since the last revision:

  updating comment

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/1567/files
  - new: https://git.openjdk.org/valhalla/pull/1567/files/c34f98b1..c1b7aaac

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

  Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 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