Closed andy-goryachev-oracle closed 6 months ago
Session data:
eclipse.buildId=4.29.0.20230907-1200
java.version=20.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=aarch64, WS=cocoa, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product -keyring /Users/REDACTED/.eclipse_keyring
Command-line arguments: -os macosx -ws cocoa -arch aarch64 -product org.eclipse.epp.package.java.product -keyring /Users/REDACTED/.eclipse_keyring
Stack trace for Map:
java.lang.IllegalStateException: The method entrySet() is undefined for the type Map___
at org.eclipse.jdt.internal.debug.core.logicalstructures.JavaLogicalStructure$EvaluationBlock.log(JavaLogicalStructure.java:200)
at org.eclipse.jdt.internal.debug.core.logicalstructures.JavaLogicalStructure$EvaluationBlock.evaluate(JavaLogicalStructure.java:149)
at org.eclipse.jdt.internal.debug.core.logicalstructures.JavaLogicalStructure.getLogicalStructure(JavaLogicalStructure.java:323)
at org.eclipse.debug.internal.ui.views.variables.LogicalStructureCache$LogicalStructureTypeCache.getLogicalStructure(LogicalStructureCache.java:144)
at org.eclipse.debug.internal.ui.views.variables.LogicalStructureCache.getLogicalStructure(LogicalStructureCache.java:57)
at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getLogicalValue(VariableContentProvider.java:215)
at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getLogicalValue(VariableContentProvider.java:114)
at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getValueChildren(VariableContentProvider.java:132)
at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getAllChildren(VariableContentProvider.java:77)
at org.eclipse.jdt.internal.debug.ui.variables.JavaVariableContentProvider.getAllChildren(JavaVariableContentProvider.java:144)
at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getChildCount(VariableContentProvider.java:48)
at org.eclipse.jdt.internal.debug.ui.variables.JavaVariableContentProvider.getChildCount(JavaVariableContentProvider.java:73)
at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider.retrieveChildCount(ElementContentProvider.java:126)
at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider$2.run(ElementContentProvider.java:76)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Is this the right place to log the issue?
Yes, it is. Please beso kindand attach small self containing example demonstrating the issue.
Thank you.
I've downgraded my eclipse yesterday, so i cannot provide an SCCE. Updated the description and how to reproduce.
This reminds me on https://bugs.eclipse.org/bugs/show_bug.cgi?id=543604 , but that was fixed long time ago. I can't reproduce on master, running on Java 20.0.2 / Linux.
import java.util.HashMap;
import java.util.Map;
public class Test {
public static void main(String[] args) {
Map<String, String> map = new HashMap<>();
map.put("key1", "value1");
map.put("key2", "value2");
map.put("key3", "value3");
System.out.println(map);
}
}
So if you want a fix for your issue, please provide exact steps to reproduce. May be you can try with the fresh new workspace / clean SDK install etc, may be there are some 3rd party plugins breaking JDT, may be something Mac / Mac JDK specific.
Interesting, thank you for looking at this! Would it be possible to check it on macOS on M1 (arm)? I'll do a clean install later tonight.
Would it be possible to check it on macOS
Not for me, I have no access to any Mac machine.
Don't see the issue with a clean install and a blank project.
Next will try to open a copy of my old workspace.
Behaviour on Mac: I was able to reproduce with existing workspace which had just 1 basic java file. For same install when I switched to new workspace, this error was not there.
This issue cannot be reproduced when opening (with 2023-09) a clean workspace created with 2023-06. This indicates that some, possibly much earlier, version leaves the workspace in a state that 2023-09 cannot deal with.
This is still a blocker for migration to 2023-09. Due to corporate restrictions, I cannot attach a copy of the workspace.
I guess you can try to regenerate Java index under Preferences / Java. May be some types aren't properly resolved because of broken / not properly updated index?
let me try that, but doesn't 'clean all projects' should take care of everything?
No, index is independent from "clean". There are also such things like shared JDK / library symbols etc
[rebuild index] did not help.
is there a specific file or files in the workspace I need to check?
No. Please note, you need to wait till index is rebuilt before trying. If this doesn't help, another possibility to play with advanced lookup preference under Java / Debugger.
waited, even reloaded eclipse.
I respectfully disagree: this is a regression, and a serious one. Pretty much every version since early 2000's could open and work with a workspace created by earlier versions (some even upgraded multiple times) with no issues, at least on my memory. I know it's a complex system, we are also dealing with ever increasing entropy in the Universe, but still - it's a blocker.
What can I do to escalate?
What can I do to escalate?
Well, if your organization is member of Eclipse IDE working group, you could ask your representative in that group to raise the priority of this issue on the next IDE WG meeting.
Or you can ask your organization to hire some developer to debug & fix this issue.
Unfortunately, my organization is not a member of Eclipse IDE working group.
How to Become a Member: https://eclipseide.org/membership/
Same here with 2023-12. I get this if the application is started as modular only. That is if the application is modular itself or inside a workspace dependency if it is modular.
How to Become a Member:
not an option for my org, unfortunately.
That is if the application is modular itself or inside a workspace dependency if it is modular.
Thank you, you might be on something! This was the case for the original report. The other project I tried wasn't a modular one.
@iloveeclipse please remove [needinfo] label. the issue is still present in 2024-03 version, and as @alerosmile mentioned it occurs in any modular project.
@iloveeclipse please remove [needinfo] label. the issue is still present in 2024-03 version, and as @alerosmile mentioned it occurs in any modular project.
I don't see exact steps to reproduce yet, sorry. If someone can provide something that I (or anyone else) would be able to reproduce, I would remove "needinfo".
okay, here are the steps:
observe the error:
java.lang.IllegalStateException: The method entrySet() is undefined for the type Map___
at org.eclipse.jdt.internal.debug.core.logicalstructures.JavaLogicalStructure$EvaluationBlock.log(JavaLogicalStructure.java:194)
at org.eclipse.jdt.internal.debug.core.logicalstructures.JavaLogicalStructure$EvaluationBlock.evaluate(JavaLogicalStructure.java:143)
at org.eclipse.jdt.internal.debug.core.logicalstructures.JavaLogicalStructure.getLogicalStructure(JavaLogicalStructure.java:317)
at org.eclipse.debug.internal.ui.views.variables.LogicalStructureCache$LogicalStructureTypeCache.getLogicalStructure(LogicalStructureCache.java:143)
at org.eclipse.debug.internal.ui.views.variables.LogicalStructureCache.getLogicalStructure(LogicalStructureCache.java:56)
at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getLogicalValue(VariableContentProvider.java:211)
at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getLogicalValue(VariableContentProvider.java:111)
at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getValueChildren(VariableContentProvider.java:128)
at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getAllChildren(VariableContentProvider.java:76)
at org.eclipse.jdt.internal.debug.ui.variables.JavaVariableContentProvider.getAllChildren(JavaVariableContentProvider.java:143)
at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.getChildCount(VariableContentProvider.java:48)
at org.eclipse.jdt.internal.debug.ui.variables.JavaVariableContentProvider.getChildCount(JavaVariableContentProvider.java:73)
at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider.retrieveChildCount(ElementContentProvider.java:122)
at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider$2.run(ElementContentProvider.java:76)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
package testing;
import java.util.HashMap;
public class Test {
public static void main(String[] a) {
HashMap<Object,Object> m = new HashMap<>();
m.put(1, 2);
m.put(2, 3);
System.out.println(m);
}
}
version:
error:
Thank you @alerosmile for providing an important insight that this error occurs in a modular project!
Not to stress it, but I would say it's a [bug]: the major functionality (introspecting any collection) is disabled in the debugger.
Please keep in mind that this is free software - "free" like freebase. Use with care and better fix the aftermath yourself.
This bug was once fixed: https://bugs.eclipse.org/bugs/show_bug.cgi?format=multiple&id=543604
In this commit: https://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=9102ba8a08ec853cd91765082ce10478c2c3c1ba
But it got reintroduced (probably in this commit): https://github.com/eclipse-jdt/eclipse.jdt.debug/commit/f52ee5758f0fe241abae4e718d4e3cfc2b0a0e6c
I tried @andy-goryachev-oracle's example in 2023-06 and it worked as expected. But it failed in 2023-09.
I suspect this failure might happen with any Map or Collection:
okay, here are the steps:
- macOS 14.4.1 on M1
- launch eclipse 2024-03
Which Eclipse package do you use? I assume it is not the plain SDK?
Could you please check 4.32 M1 from https://download.eclipse.org/eclipse/downloads/drops4/S-4.32M1-202404061800/ ?
from the Installation Details -> Configuration: (redacted)
-
eclipse.buildId=4.31.0.20240307-1200
eclipse.commands=-os
macosx
-ws
cocoa
-arch
aarch64
-showsplash
/Applications/Eclipse.app/Contents/MacOS//../Eclipse/plugins/org.eclipse.epp.package.common_4.31.0.20240307-1200/splash.bmp
-launcher
/Applications/Eclipse.app/Contents/MacOS/eclipse
-name
Eclipse
--launcher.library
/Applications/Eclipse.app/Contents/MacOS//../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.aarch64_1.2.900.v20240129-1338/eclipse_11900.so
-startup
/Applications/Eclipse.app/Contents/MacOS//../Eclipse/plugins/org.eclipse.equinox.launcher_1.6.700.v20240213-1244.jar
--launcher.appendVmargs
-product
org.eclipse.epp.package.java.product
-vm
/Applications/Eclipse.app/Contents/MacOS//../Eclipse/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.macosx.aarch64_17.0.10.v20240120-1143/jre/lib/libjli.dylib
eclipse.e4.inject.javax.warning=false
eclipse.home.location=file:/Applications/Eclipse.app/Contents/Eclipse/
eclipse.launcher=/Applications/Eclipse.app/Contents/MacOS/eclipse
eclipse.launcher.name=Eclipse
eclipse.p2.data.area=@config.dir/../p2
eclipse.p2.profile=epp.package.java
eclipse.product=org.eclipse.epp.package.java.product
eclipse.startTime=1712598201961
eclipse.stateSaveDelayInterval=30000
eclipse.vm=/Applications/Eclipse.app/Contents/MacOS//../Eclipse/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.macosx.aarch64_17.0.10.v20240120-1143/jre/lib/libjli.dylib
eclipse.vmargs=-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclientjava
-Dosgi.requiredJavaVersion=17
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-Dosgi.dataAreaRequiresExplicitInit=true
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
-Declipse.e4.inject.javax.warning=false
-Dsun.java.command=Eclipse
-Xms256m
-Xmx8048m
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Xdock:icon=../Resources/Eclipse.icns
-Djava.class.path=/Applications/Eclipse.app/Contents/MacOS//../Eclipse/plugins/org.eclipse.equinox.launcher_1.6.700.v20240213-1244.jar
java.vendor.version=Temurin-17.0.10+7
java.version=17.0.10
java.version.date=2024-01-16
java.vm.compressedOopsMode=Zero based
java.vm.info=mixed mode
java.vm.name=OpenJDK 64-Bit Server VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Oracle Corporation
java.vm.specification.version=17
java.vm.vendor=Eclipse Adoptium
java.vm.version=17.0.10+7
*** Features:
org.eclipse.buildship (3.1.9.v20240115-1636) "Buildship, Eclipse Plug-ins for Gradle"
org.eclipse.eclemma.feature (3.1.8.202312121452) "EclEmma UI"
org.eclipse.egit (6.9.0.202403050737-r) "Git integration for Eclipse"
org.eclipse.emf.common (2.31.0.v20231210-0956) "EMF Common"
org.eclipse.emf.ecore (2.37.0.v20240203-0859) "EMF Ecore"
org.eclipse.epp.mpc (1.10.3.v20240228-1000) "Marketplace Client"
org.eclipse.epp.package.java.feature (4.31.0.20240307-1200) "EPP Java Package"
org.eclipse.help (2.3.1700.v20240229-0520) "Help System Base"
org.eclipse.jdt (3.19.400.v20240229-0520) "Eclipse Java Development Tools"
org.eclipse.jgit (6.9.0.202403050737-r) "JGit Core"
org.eclipse.jgit.gpg.bc (6.9.0.202403050737-r) "JGit GPG support based on bouncycastle"
org.eclipse.jgit.http.apache (6.9.0.202403050737-r) "JGit Apache httpclient based HTTP support"
org.eclipse.jgit.ssh.apache (6.9.0.202403050737-r) "JGit SSH support based on Apache MINA sshd"
org.eclipse.justj.epp (17.0.0.v20240120-1430) "JustJ JRE for IDE Packages"
org.eclipse.m2e.feature (2.6.0.20240220-1109) "M2E Maven Integration for Eclipse Core"
org.eclipse.m2e.logback.feature (2.6.0.20240217-1525) "M2E Maven Integration for Eclipse Core"
org.eclipse.mylyn.builds.feature (4.2.0.v20240212-0246) "Mylyn Builds"
org.eclipse.mylyn.commons.activity.feature (4.2.0.v20240203-1124) "Mylyn Tasks"
org.eclipse.mylyn.commons.feature (4.2.0.v20240220-1942) "Mylyn Commons"
org.eclipse.mylyn.commons.identity.feature (4.2.0.v20240203-1124) "Mylyn Commons"
org.eclipse.mylyn.commons.notifications.feature (4.2.0.v20240203-1124) "Mylyn Commons"
org.eclipse.mylyn.commons.repositories.feature (4.2.0.v20240203-1124) "Mylyn Commons"
org.eclipse.mylyn.context.feature (4.2.0.v20240221-0556) "Mylyn Context"
org.eclipse.mylyn.egit.feature (4.2.0.v20240202-0700) "Mylyn Tasks Core"
org.eclipse.mylyn.git.feature (4.2.0.v20240208-0919) "Mylyn Versions"
org.eclipse.mylyn.github.feature (6.4.0.v20240209-1319) "Mylyn Tasks Core"
org.eclipse.mylyn.ide.feature (4.2.0.v20240220-1733) "Mylyn Context"
org.eclipse.mylyn.jdt.feature (4.2.0.v20240220-1733) "Mylyn Context"
org.eclipse.mylyn.jenkins.feature (4.2.0.v20240212-0246) "Mylyn Builds"
org.eclipse.mylyn.monitor.feature (4.2.0.v20240203-1124) "Mylyn Commons"
org.eclipse.mylyn.reviews.feature (4.2.0.v20240207-0731) "Mylyn Reviews"
org.eclipse.mylyn.tasks.feature (4.2.0.v20240305-1805) "Mylyn Tasks Core"
org.eclipse.mylyn.team.feature (4.2.0.v20240220-1733) "Mylyn Context"
org.eclipse.mylyn.versions.feature (4.2.0.v20240208-0919) "Mylyn Versions"
org.eclipse.mylyn.wikitext.feature (4.2.0.v20240302-0923) "Mylyn WikiText"
org.eclipse.oomph.p2 (1.29.0.v20240120-1356) "Oomph P2 Management"
org.eclipse.oomph.setup (1.31.0.v20240306-1109) "Oomph Setup"
org.eclipse.oomph.setup.core (1.30.0.v20240211-0940) "Oomph Setup Core"
org.eclipse.platform (4.31.0.v20240229-1022) "Eclipse Platform"
org.eclipse.rcp (4.31.0.v20240229-0520) "Eclipse RCP"
org.eclipse.tm.terminal.connector.ssh.feature (11.5.0.202312281935) "Terminal SSH Connector"
org.eclipse.tm.terminal.control.feature (11.5.0.202312281935) "Terminal Control (Embeddable Widget)"
org.eclipse.tm.terminal.feature (11.5.0.202312062348) "Terminal View Core"
org.eclipse.tm.terminal.view.feature (11.5.0.202312281935) "Terminal View"
org.eclipse.userstorage (1.2.0.v20210517-0327) "Eclipse User Storage"
Code is run with a standard Oracle JDK
java.vm.version=21.0.2+13-LTS-58
will check 4.32 M1 a bit later today, thank you.
Looking on your config, some extra bundle might mess up with classpath, may be m2e or gradle support. Please try with plain SDK and a new workspace.
this is a standard eclipse downloaded from the official site. the only change I've made was to increase -Xmx8048m
because we are building openjfx.
I am not sure how gradle got there. I suppose when I installed a new macOS version it might have kept the gradle jars in the Application/Eclipse.app folders?
(the gradle support is absolutely required, but not for the workspace or code in question)
here is the complete test case:
tried with eclipse-SDK-4.32M1-macosx-cocoa-aarch64.dmg copied from .dmb to an empty directory, launched from there, opened the workspace.
same issue. I think, as @alerosmile has identified, the issue might be caused by a modular project (notice module-info.java in the zip I've sent earlier).
Thanks, I can't promise but I will try to debug this this week.
many thanks indeed!
@andy-goryachev-oracle: Can you please confirm that this issue doesn't exist with Eclipse 2023-06?
Yes, it works with built-in JDK17 and JDK21, using Eclipse 4.28.0.20230608-1200 downloaded from https://www.eclipse.org/downloads/packages/release/2023-06/r
Changing this line to OPTION_JdtDebugCompileMode
will fix the error.
But as stated in this commit, this option seems to cause side effects I don't have knowledge of.
OK, finally got time to test the reproducer. I confirm this is easily reproducible, and related to https://github.com/eclipse-jdt/eclipse.jdt.debug/issues/260 change.
What was surprising for me: if testing in a Java perspective (with Variables view not activated), the hover over variables shows proper (but not "logical") content without errors. Only after opening Variables view the hover "remembers" it should actually show logical structures and starts to misbehave. So we have another bug here, but that's not important one.
To reproduce:
I can see it on macOS with 2023-09. Is this a resurrection of https://bugs.eclipse.org/bugs/show_bug.cgi?id=559505 ?
This is bad enough, I am forced to downgrade.
Error log: