[External] : Re: Got a compiler stack trace

Angelos Bimpoudis angelos.bimpoudis at oracle.com
Tue Jul 18 16:45:15 UTC 2023


That's an excellent report. Concise and self-contained!

I created a bug report here with some additional decluttering: https://bugs.openjdk.org/browse/JDK-8312229

Many thanks
________________________________
From: David Alayachew <davidalayachew at gmail.com>
Sent: 18 July 2023 15:13
To: Angelos Bimpoudis <angelos.bimpoudis at oracle.com>
Cc: amber-dev <amber-dev at openjdk.org>
Subject: [External] : Re: Got a compiler stack trace

Hello,

Thank you for your response!

Here is the best that I can do.


import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.RowFilter;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableRowSorter;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Collection;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.stream.Stream;

public class ToDoList
{

   enum Operator
   {

      EQUAL,
      ;

   }

   enum OperatorType
   {

      NUMERIC,
      ;

   }

   public static void main(String[] args)
   {

      final ActionListener hoaisd =
                              hmmm ->
                              {

                                 final RowFilter<DefaultTableModel, Integer> rowFilter =
                                    switch (OperatorType.NUMERIC)
                                    {

                                       case OperatorType.NUMERIC  ->
                                       {

                                          final JTextField filterTextField = new JTextField(10);

                                          yield
                                             new RowFilter<>()
                                             {

                                                public boolean include(final RowFilter.Entry<? extends DefaultTableModel, ? extends Integer> entry)
                                                {

                                                   final double filterNumber = Double.parseDouble(filterTextField.getText());

                                                   return true;

                                                }

                                             };

                                       }
                                    default -> throw new UnsupportedOperationException();
                                    };

                              };

   }

}


I compiled the above with the following command.

$ javac --enable-preview --source 21 ToDoList.java

And I got the exact same error.

Let me know if you need me to approach this differently.

Thank you for your time and help!
David Alayachew

On Tue, Jul 18, 2023 at 4:02 AM Angelos Bimpoudis <angelos.bimpoudis at oracle.com<mailto:angelos.bimpoudis at oracle.com>> wrote:
Hello David,

Many, many thanks for the investigations! 🚀 Much appreciated.

It would be ideal if we can have a minimized test case (self-contained test file without dependencies to other libraries, or code, no zip-attachments) that demonstrates the compiler issue succinctly and possibly fits in the email body (if possible, of course; usually it is possible for compiler bugs).

For example, in your previous email "Found a bug?", even if you didn't include a minimized test file, pasting your code helped to reconstruct the issue, as the code was not attached.

Can you give it a shot with this one and provide a minimized example in your next email? 🙏
________________________________
From: amber-dev <amber-dev-retn at openjdk.org<mailto:amber-dev-retn at openjdk.org>> on behalf of David Alayachew <davidalayachew at gmail.com<mailto:davidalayachew at gmail.com>>
Sent: 18 July 2023 06:12
To: amber-dev <amber-dev at openjdk.org<mailto:amber-dev at openjdk.org>>
Subject: Got a compiler stack trace

Hello Amber Dev Team,

I received the following stack trace when trying to compile the attached project.

david at 123 MINGW64 ~/ToDoList (main)
$ ls
ColumnName.java  Operator.java  OperatorType.java  ToDoList.gpj  ToDoList.java

david at 123 MINGW64 ~/ToDoList (main)
$ javac --version
javac 21-ea

david at 123 MINGW64 ~/ToDoList (main)
$ java --version
openjdk 21-ea 2023-09-19
OpenJDK Runtime Environment (build 21-ea+31-2444)
OpenJDK 64-Bit Server VM (build 21-ea+31-2444, mixed mode, sharing)

david at 123 MINGW64 ~/ToDoList (main)
$ where java
C:\Program Files\Java\jdk-21\bin\java.exe


david at LAPTOP-OAAP0AJG MINGW64 ~/_WORKSPACE/_PROGRAMMING/_JAVA/HelperFunctions/src/main/java/io/github/davidalayachew/ToDoList (main)
$ /c/Progra~1/Java/jdk-21/bin/javac.exe ToDoList.java
An exception has occurred in the compiler (21-ea). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com<https://urldefense.com/v3/__https://bugreport.java.com__;!!ACWV5N9M2RV99hQ!I9sSae9x4wyODzRHy-K-HWmuYfWG4DVOOBKZDkvmvCq73ySUA3RRiON7Rwo9etk-MKPxUct8-zjFRg-QTM5OR2sQifmcnqs$>) after checking the Bug Database (https://bugs.java.com<https://urldefense.com/v3/__https://bugs.java.com__;!!ACWV5N9M2RV99hQ!I9sSae9x4wyODzRHy-K-HWmuYfWG4DVOOBKZDkvmvCq73ySUA3RRiON7Rwo9etk-MKPxUct8-zjFRg-QTM5OR2sQYKg3bIc$>) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.AssertionError
        at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155)
        at jdk.compiler/com.sun.tools.javac.util.Assert.check(Assert.java:46)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.access(Lower.java:1227)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitIdent(Lower.java:3499)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2715)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitSelect(Lower.java:4201)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2581)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitApply(Lower.java:3167)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1816)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2192)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitVarDef(Lower.java:3675)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1022)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:70)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:167)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:3689)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1092)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.visitMethodDef(TreeTranslator.java:150)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitMethodDefInternal(Lower.java:2858)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitMethodDef(Lower.java:2774)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:916)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitClassDef(Lower.java:2323)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:814)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitNewClass(Lower.java:2956)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1871)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2192)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitYield(Lower.java:4181)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCYield.accept(JCTree.java:1677)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:70)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:167)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:3689)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1092)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:70)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.visitCase(TreeTranslator.java:212)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCase.accept(JCTree.java:1343)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translateCases(TreeTranslator.java:94)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.handleSwitch(Lower.java:3801)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitSwitchExpression(Lower.java:3733)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCSwitchExpression.accept(JCTree.java:1399)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2192)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitVarDef(Lower.java:3675)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1022)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:70)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:167)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:3689)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1092)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.visitMethodDef(TreeTranslator.java:150)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitMethodDefInternal(Lower.java:2858)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitMethodDef(Lower.java:2774)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:916)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitClassDef(Lower.java:2323)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:814)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitNewClass(Lower.java:2956)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1871)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2192)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitVarDef(Lower.java:3675)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:1022)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:70)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:167)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:3689)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1092)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.visitMethodDef(TreeTranslator.java:150)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitMethodDefInternal(Lower.java:2858)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitMethodDef(Lower.java:2774)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:916)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.visitClassDef(Lower.java:2323)
        at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:814)
        at jdk.compiler/com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2181)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translate(Lower.java:2200)
        at jdk.compiler/com.sun.tools.javac.comp.Lower.translateTopLevelClass(Lower.java:4293)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1653)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1467)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:978)
        at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:319)
        at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:178)
        at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
        at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)




Please let me know if any more information is needed. I can also post this to the bug database like the directions say, just let me know.

Finally, I have attached another email thread that may be relevant. I don't think it is the same bug, but adding in case it is.

Thank you for your time and efforts!
David Alayachew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230718/16f7e6eb/attachment-0001.htm>


More information about the amber-dev mailing list