JDK-8312814 : Compiler crash when template processor type is a captured wildcard
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 21,22
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-07-25
  • Updated: 2023-08-10
  • Resolved: 2023-08-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21 JDK 22
21Fixed 22 b09Fixed
Related Reports
Relates :  
Description
Code sample:

import java.util.List;

public class Demo {

    void x(List<? extends StringTemplate.Processor<String,
RuntimeException>> list) {
        list.get(0)."";
    }
}

Output (build 22-ea+7-489):
java: An exception has occurred in the compiler (22-ea). Please file a
bug against the Java compiler via the Java bug reporting page
(https://bugreport.java.com) after checking the Bug Database
(https://bugs.java.com) for duplicates. Include your program, the
following diagnostic, and the parameters passed to the Java compiler
in your report. Thank you.
java: java.lang.AssertionError: <captured wildcard>.process
java: at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:162)
java: at jdk.compiler/com.sun.tools.javac.code.Symbol$MethodSymbol.<init>(Symbol.java:1942)
java: at jdk.compiler/com.sun.tools.javac.code.Symbol$MethodSymbol$1.<init>(Symbol.java:1948)
java: at jdk.compiler/com.sun.tools.javac.code.Symbol$MethodSymbol.clone(Symbol.java:1948)
java: at jdk.compiler/com.sun.tools.javac.code.Symbol$MethodSymbol.clone(Symbol.java:1918)
java: at jdk.compiler/com.sun.tools.javac.jvm.Gen.binaryQualifier(Gen.java:265)
java: at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitSelect(Gen.java:2388)
java: at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2581)
java: at jdk.compiler/com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:885)
java: at jdk.compiler/com.sun.tools.javac.jvm.Gen.visitApply(Gen.java:1921)
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk21/pull/167 Date: 2023-08-08 19:30:48 +0000
08-08-2023

Fix request approved
08-08-2023

Changeset: f14245b3 Author: Jim Laskey <jlaskey@openjdk.org> Date: 2023-08-02 00:47:20 +0000 URL: https://git.openjdk.org/jdk/commit/f14245b3880ff735ae231b4c7d2c6b6907c5f7d4
02-08-2023

jdk21-fix-request: This issue potentially affects any non-simple use of the StringTemplate.Processor type. Low-risk - part of a preview feature.
01-08-2023

Missing JCStringTemplate.processor translation in TransTypes
01-08-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15107 Date: 2023-08-01 16:22:26 +0000
01-08-2023