-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClassCastException when ctrl+hover over a 'case' literal #1764
Comments
@subyssurendran666 would you like to work on this ? |
With pleasure! Could you please assign this to me?
|
I believe this issue is related to JDT.UI In Java 22, a new feature called unnamed variables and patterns has been introduced. To accommodate this, certain changes have been incorporated into JDT.Core. For example, in a case literal like This issue has been addressed by implementing a new method called getPatternVariable2(). I believe the code below, or a similar approach, should resolve the issue.
|
So should this be transferred to jdt.ui? |
@subyssurendran666 - the code you cite is in jdt-core, no ? |
No @srikanth-sankaran, the ASTFlattener(which is in JDT.UI) is calling the |
@noopur2507 - Can you confirm this is a JDT.UI problem ? TIA |
The 'case' becoming clickable is a feature that allows you to click the 'case' to jump to the corresponding 'switch' keyword. This is useful for quickly jumping to the beginning of a long switch-case.
To be fixed. |
Thanks for the analysis, Suby. I will make the corresponding change in UI. However, few changes are required in JDT Core as well:
|
Thank you, @noopur2507 for your insights on JDT.Core. I'll make the necessary arrangements in JDT.Core. |
What an interesting feature. Didn't know about it. |
Should help on errors where they showed up in the logfile but the context is unclear like: eclipse-jdt/eclipse.jdt.core#3262 eclipse-jdt/eclipse.jdt.core#2934 eclipse-jdt#1764
Should help on errors where they showed up in the logfile but the context is unclear like: eclipse-jdt/eclipse.jdt.core#3262 eclipse-jdt/eclipse.jdt.core#2934 eclipse-jdt#1764
Should help on errors where they showed up in the logfile but the context is unclear like: eclipse-jdt/eclipse.jdt.core#3262 eclipse-jdt/eclipse.jdt.core#2934 eclipse-jdt#1764
Should help on errors where they showed up in the logfile but the context is unclear like: eclipse-jdt/eclipse.jdt.core#3262 eclipse-jdt/eclipse.jdt.core#2934 eclipse-jdt#1764 eclipse-jdt/eclipse.jdt.core#3263
Should help on errors where they showed up in the logfile but the context is unclear like: eclipse-jdt/eclipse.jdt.core#3262 eclipse-jdt/eclipse.jdt.core#2934 #1764 eclipse-jdt/eclipse.jdt.core#3263
Should help on errors where they showed up in the logfile but the context is unclear like: eclipse-jdt/eclipse.jdt.core#3262 eclipse-jdt/eclipse.jdt.core#2934 #1764 eclipse-jdt/eclipse.jdt.core#3263
@noopur2507 this has been implemented though eclipse-jdt/eclipse.jdt.core#3261 |
Reopening, after the change was reverted via eclipse-jdt/eclipse.jdt.core#3529 |
Hold Ctrl and hover over the second
case
literal. Thecase
will become clickable as if it's a method or parameter, which is wrong. Then, while still holding Ctrl, move the mouse to the first case label. A bunch of these errors will be thrown:From the stack trace, I'm not sure if this is a bug in jdt.core or jdt.ui, but the exception itself happens in core.
eclipse.buildId=4.34.0.I20241101-1800
java.version=22
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
The text was updated successfully, but these errors were encountered: