<div dir="ltr"><div style="font-family:monospace" class="gmail_default"></div><div dir="ltr"><div class="gmail_default" style="font-family:monospace">Hello Amber Dev Team,</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default"><span style="font-family:monospace">I ran into a problem that I am not sure what the cause is. It only seems to occur when I am using unnamed variables.</span></div><div class="gmail_default"><span style="font-family:monospace"><br></span></div><div class="gmail_default"><span style="font-family:monospace"><br></span></div><div class="gmail_default"><span style="font-family:monospace">Here are the commands that I am using, as well as their outputs.</span></div><div class="gmail_default"><span style="font-family:monospace"><br></span></div><span style="font-family:monospace"><br>$ javac -g -Xlint:all,-preview,-serial -Xdiags:verbose --enable-preview --source 21 GUI.java<br>Note: GUI.java uses preview features of Java SE 21.<br></span><div><span style="font-family:monospace">Note: Recompile with -Xlint:preview for details.</span></div><div><span style="font-family:monospace"><br></span></div><div><div style="font-family:monospace" class="gmail_default"><br>$ java --enable-preview GUI<br>Error: LinkageError occurred while loading main class GUI<br> java.lang.ClassFormatError: Illegal field name "" in class GUI</div><div style="font-family:monospace" class="gmail_default"><br></div><div style="font-family:monospace" class="gmail_default">And here is the file that I am using.</div><div style="font-family:monospace" class="gmail_default"><br></div><div style="font-family:monospace" class="gmail_default"><br>import javax.swing.JPanel;<br>import javax.swing.JLabel;<br>import javax.swing.JButton;<br>import java.util.function.BiFunction;<br><br>public class GUI<br>{<br><br> public static void main(String[] args)<br> {<br> <br> new GUI(null, null);<br> <br> }<br> <br> public GUI(final Object characterType, final Object icon)<br> {<br> <br> }<br><br> private Object createConstraintPanel()<br> {<br> <br> final JPanel constraintPanel = new JPanel();<br> final JButton button = new JButton();<br> <br> CREATE_INPUT_SANITIZATION:<br> {<br> <br> BUTTON_ACTION_LISTENER:<br> {<br> <br> button<br> .addActionListener<br> (<br> _ -><br> {<br> <br> final BiFunction<String, Integer, JLabel> createLabel =<br> (text, width) -><br> {<br> <br> return null;<br> <br> }<br> ;<br> <br> final JButton remove = new JButton();<br> remove<br> .addActionListener<br> (<br> _ -> <br> {<br> <br> <br> }<br> );<br> <br> }<br> )<br> ;<br> <br> }<br> <br> }<br> <br> return constraintPanel;<br> <br> }<br><br>}<br></div></div><div><br></div><div><div style="font-family:monospace" class="gmail_default">Technically, this issue also occurs if even 1 of the 2 unnamed variables is turned into a real variable. But regardless, the point is, this fails at run time.</div><div style="font-family:monospace" class="gmail_default"><br></div><div style="font-family:monospace" class="gmail_default">Please let me know if there is anything I am missing.</div><div style="font-family:monospace" class="gmail_default"><br></div><div style="font-family:monospace" class="gmail_default">Thank you for your time and help!</div><div style="font-family:monospace" class="gmail_default">David Alayachew<br></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 18, 2023 at 1:54 AM David Alayachew <<a href="mailto:davidalayachew@gmail.com">davidalayachew@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:monospace">Ok, ty for the heads up.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 18, 2023 at 1:18 AM - <<a href="mailto:liangchenblue@gmail.com" target="_blank">liangchenblue@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi David,<div>Please do not ask for technical support in the development mailing list. There's no proof that this issue is with the core libraries instead of the Java compiler or another component.</div><div>I have already downloaded your zip, compiled the 4 files with JDK 22 (my local dev build for another unrelated patch) javac --enable-preview -release 22 *.java and java --enable-preview ToDoList, which just shows up a UI without any crash. Without enable-preview, yoru code does not compile at all for the usage of _ as an identifier.</div><div><br></div><div>This is most likely a problem with the compiler you are using; you have a gpj file, which probably means you are using jGrasp. Please report this issue to the relevant parties (i.e. the 3rd-party IDE or whatever supports using _ as identifer without --enable-preview) instead.</div><div><br></div><div>Chen Liang</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 18, 2023 at 11:43 AM David Alayachew <<a href="mailto:davidalayachew@gmail.com" target="_blank">davidalayachew@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:monospace">Wait, nevermind. Don't ignore. I was able to recreate this issue on the command line using the abovementioned JDK. Could someone come back and take a look at this please?</div><div style="font-family:monospace"><br></div><div style="font-family:monospace">Sorry for jerking everyone around here. I have multiple JDK's and got mixed up on which one I was using.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 16, 2023 at 2:26 AM David Alayachew <<a href="mailto:davidalayachew@gmail.com" target="_blank">davidalayachew@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:monospace">Hmmmm, this one might actually be IDE specific. Please ignore.<br></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div></div>