Skip to content
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

ECD incompatible to Eclipse 2024-03 - NoSuchMethodError: 'java.lang.Object org.eclipse.jdt.internal.core.BinaryType.getElementInfo()' #103

Closed
jochenw opened this issue Feb 5, 2024 · 32 comments

Comments

@jochenw
Copy link

jochenw commented Feb 5, 2024

When attempting to use the plugin in Eclipse 4.31M2, I get the stacktrace below. My understanding is, that this indicates a change in the plugin API, which requires corresponding changes in the plugin.

java.lang.NoSuchMethodError: 'java.lang.Object org.eclipse.jdt.internal.core.BinaryType.getElementInfo()'
	at org.sf.feeling.decompiler.editor.DecompilerSourceMapper.findSource(DecompilerSourceMapper.java:61)
	at org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.doOpenBuffer(JavaDecompilerClassFileEditor.java:158)
	at org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.doOpenBuffer(JavaDecompilerClassFileEditor.java:140)
	at org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.doOpenBuffer(JavaDecompilerClassFileEditor.java:133)
	at org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.doSetInput(JavaDecompilerClassFileEditor.java:379)
	at org.eclipse.ui.texteditor.AbstractTextEditor.lambda$1(AbstractTextEditor.java:3171)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:434)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:354)
	at org.eclipse.ui.internal.WorkbenchWindow.lambda$7(WorkbenchWindow.java:2335)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2332)
	at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3188)
	at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3213)
	at org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditor.lambda$0(ClassFileEditor.java:656)
	at org.eclipse.jdt.core.JavaCore.lambda$0(JavaCore.java:6142)
	at org.eclipse.jdt.internal.core.JavaModelManager.cacheZipFiles(JavaModelManager.java:5832)
	at org.eclipse.jdt.internal.core.JavaModelManager.callReadOnlyUnchecked(JavaModelManager.java:5820)
	at org.eclipse.jdt.internal.core.JavaModelManager.callReadOnly(JavaModelManager.java:5808)
	at org.eclipse.jdt.core.JavaCore.callReadOnly(JavaCore.java:6126)
	at org.eclipse.jdt.core.JavaCore.runReadOnly(JavaCore.java:6141)
	at org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditor.init(ClassFileEditor.java:656)
	at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:353)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:344)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:976)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:938)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:138)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:385)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:311)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:203)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:90)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:59)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:991)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.lambda$0(PartServiceImpl.java:105)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.lambda$0(UIEventHandler.java:38)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:183)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4802)
	at org.eclipse.e4.ui.workbench.swt.DisplayUISynchronize.syncExec(DisplayUISynchronize.java:34)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:207)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:201)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:133)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElementGen(ElementContainerImpl.java:168)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:187)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:654)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:618)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:796)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:401)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1271)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3228)
	at org.eclipse.ui.internal.WorkbenchPage.lambda$11(WorkbenchPage.java:3118)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3116)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3086)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3077)
	at org.sf.feeling.decompiler.actions.OpenClassWithContributionFactory$OpenClassesAction.run(OpenClassWithContributionFactory.java:109)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
	at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:417)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4273)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4071)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3659)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:648)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:555)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1432)
@jpstotz
Copy link
Collaborator

jpstotz commented Mar 4, 2024

@jochenw Is there a simply way to get this beta version so I could look at it myself?
The Eclipse download page is very confusing. So I found a lot of items for 4.31RC2 however nothing usable, only single components.

@jochenw
Copy link
Author

jochenw commented Mar 4, 2024

@jpstotz First of all, thanks for your response. It's good to see the plugin not abandoned.

I have just used the following procedure to reproduce the issue:

1.) Download the Eclipse distribution:

    mkdir tmp
    cd tmp
    wget"https://ftp.fau.de/eclipse/eclipse/downloads/drops4/S-4.31RC2-202402290520/eclipse-SDK-4.31RC2-linux-gtk-x86_64.tar.gz"

2.) Extract the distribution, and launch Eclipse 4.31RC2:

    tar xzvf eclipse-SDK-4.31RC2-linux-gtk-x86_64.tar.gz
    eclipse/eclipse -vm/usr/lib/jvm/temurin-17-jdk-amd64/bin/java

3.) Switch to a new, empty workspace.
Open the Marketplace ("Help/Eclipse Marketplace"), and install the plugin "Enhanced Class Decompiler 3.4.0").
4.) Create a new, empty Java project ("Dummy")
5.) In the project, declare an external jar file as a dependency without source. (I choose /home/jwi/.m2/repository/junit/junit/4.13.2/junit-4.13.2.jar.)
6.) Open the jar file (under "Referenced Libraries"), select a Java class in the jar file (for example org.junit.After), right click on the Java class, and select "Open class with... / CFR". Observe the crash.

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 7, 2024

Thanks for the detailed explanation. Unfortunately testing the ecd release version is not what I want to do, instead I am using the latest development version, as it doesn't make sense to fix bugs in a version that may have been already fixed (or just do not occur) in the development version.

Unfortunately using ecd dev version I am not able to reproduce the NoSuchMethodError: BinaryType.getElementInfo(). Using the beta version of Eclipse as target platform to compile the ecd code also does not show any errors regarding getElementInfo() in DecompilerSourceMapper.findSource(..). Therefore I can not confirm an API change at this point.

However CFR has other problems, may be what you have encountered was a follow-up error if the CFR problem.
I get

Caused by: java.lang.NullPointerException: Cannot invoke "org.benf.cfr.reader.state.ClassFileRelocator.correctPath(String)" because "this.classRelocator" is null
	at org.benf.cfr.reader.state.ClassFileSourceImpl.getClassFileContent(ClassFileSourceImpl.java:106)
	at org.benf.cfr.reader.state.DCCommonState.loadClassFileAtPath(DCCommonState.java:117)

Or the problem is related to the org.sf.feeling.decompiler.source.attach plugin/feature. I can not run this at the moment because the beta version misses the package org.eclipse.m2e.jdt.

@jochenw
Copy link
Author

jochenw commented Mar 12, 2024

@jpstotz Could you, please, clarify, what the "latest development version" means, exactly? I am askin, because I can reproduce the same error with the latest nightly build (I20240311-1800).

Besides, the problem is not related to CFR. I get the same error with JD-Core, or Fernflower.

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 12, 2024

@jochenw Sorry this is a misunderstanding, I was talking about the latest development version of ecd, not Eclipse.

@jochenw
Copy link
Author

jochenw commented Mar 12, 2024

@jpstotz Okay. Are there any instructions for building from source?

@jochenw
Copy link
Author

jochenw commented Mar 12, 2024

Silly me. Found the README.md. Doesn't work, though:

jwi@penguin:~/git/github.com/ecd-plugin$ git clone https://github.com/ecd-plugin/ecd
Cloning into 'ecd'...
remote: Enumerating objects: 7383, done.
remote: Counting objects: 100% (828/828), done.
remote: Compressing objects: 100% (270/270), done.
remote: Total 7383 (delta 398), reused 723 (delta 326), pack-reused 6555
Receiving objects: 100% (7383/7383), 52.37 MiB | 3.01 MiB/s, done.
Resolving deltas: 100% (4368/4368), done.
jwi@penguin:~/git/github.com/ecd-plugin$ cd ecd
jwi@penguin:~/git/github.com/ecd-plugin/ecd$ export JAVA_HOME=/usr/lib/jvm/temurin-21-jdk-amd64
jwi@penguin:~/git/github.com/ecd-plugin/ecd$ mvn3 -V
Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Maven home: /home/jwi/opt/mvn/3.9.6
Java version: 21.0.2, vendor: Eclipse Adoptium, runtime: /usr/lib/jvm/temurin-21-jdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.6.17-01102-gd3cec3c11146", arch: "amd64", family: "unix"
[INFO] Scanning for projects...
[ERROR] Internal error: org.eclipse.tycho.core.ee.UnknownEnvironmentException: Unknown OSGi execution environment: 'JavaSE-21' -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: org.eclipse.tycho.core.ee.UnknownEnvironmentException: Unknown OSGi execution environment: 'JavaSE-21'

@rhoehener
Copy link

rhoehener commented Mar 13, 2024

I installed Eclipse 2024-03 today. The ECD-plugin fails with the reported exception in the first comment.

@pmorange
Copy link

Hi, same here.
Using the latest stable release of eclipse for Java Developers (2024-03) on macos, the plugin fails to decompile, giving the same error as stated in the issue.

@jpstotz jpstotz changed the title NoSuchMethodError: 'java.lang.Object org.eclipse.jdt.internal.core.BinaryType.getElementInfo()' ECD incompatible to Eclipse 2024-03 - NoSuchMethodError: 'java.lang.Object org.eclipse.jdt.internal.core.BinaryType.getElementInfo()' Mar 14, 2024
@jpstotz
Copy link
Collaborator

jpstotz commented Mar 14, 2024

@jochenw I use mvn clean package for building ecd.
It will create a zip archive of the update site in update_site/target. For compiling I use JDK 17 (configured as JAVA_HOME). I have never tested newer JDK versions with ecd.

My latest code updates can be found in branch https://github.com/ecd-plugin/ecd/tree/develop341

My main problem at the moment is that the error only occurs when the plugin is actually installed from an update site as jar. In development mode where I can debug everything works fine. After building the JAR files, installing and running them I also get the NoSuchMethodError this issue is about. This makes development really complicated...

BTW: I am planning to delete the source.attach plugin as it would be a lot of work to adapt it to Eclipse 2023-04. Any dissenting votes?

@miller79
Copy link

I don't personally use that plugin if my vote counts at all. 🙂 Definitely appreciate you looking into the cause of this even though the code seems to be fighting back at you with this Eclipse upgrade.

@OlivierJaquemet
Copy link

Hi all, I was following this thread having the same issue.

@jpstotz Regarding your last request regarding "source.attach plugin", which feature does it provide ?

My personal use of the ECD plugin is as follows :

  • automatically decompile and source display of any class opened using ctrl-shift-T
  • automatically decompile of any class opened when stepping into unknown code when debugging

Would it still be working if you delete the source.attach plugin ?

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 15, 2024

@OlivierJaquemet From what I have seen in the code sources.attach.plugin searches for source code in various online sources like Maven repos, grepcode.com, Java 6/7 JDK HG repos, some FTP servers. The idea seemed to be to better use actual source code if available than decompiling Java byte code class files.

In my understanding Eclipse can already retrieve sources from most of the providers itself, so this plugin is no longer necessary. I already removed some of the online sources that were down for years.

The full list of source can be seen in the source code:
https://github.com/ecd-plugin/ecd/tree/master/org.sf.feeling.decompiler.source.attach/src/org/sf/feeling/decompiler/source/attach/finder

Note that I have joined ecd project some years ago, long after this plugin was coded (my guess is that this plugin was mainly developed between 2000 and 2010). So none of the code in sources.attach has been written by me. So everything I know about this plugin is what I learned by reading the source code.

@bobfields
Copy link

I have the same issue...
Updated Eclipse JDT Core from 3.19.300.v20231201-0110 to 3.19.400.v20240229-0520. Enhanced Class Decompiler (Core) is version 3.4.0 for both installations. When debugging and opening source I get:

NoSuchMethodError: 'java.lang.Object org.eclipse.jdt.internal.core.BinaryType.getElementInfo()'
at org.sf.feeling.decompiler.editor.DecompilerSourceMapper.findSource(DecompilerSourceMapper.java:61)

It looks like that method was removed in the latest update ? It worked before the update.
Eclipse running on Windows 10 with all current plugins.
java version "17.0.8" 2023-07-18 LTS
Java(TM) SE Runtime Environment (build 17.0.8+9-LTS-211)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.8+9-LTS-211, mixed mode, sharing)

Looks like the last Eclipse update changed preferences for File Associations for *.class from 'Java Editor' to ;Class Decompiler'. So every class fiel view results in this error. Changing it back fixes the issue when source is attached.
For .class without source, changing the viewer to 'Class File Viewer' will at least open the file without error.

I'm not an Eclipse developer, just a user, I really don't want to rebuild ecd. Is there an easy way to download a fix jar version and add it to the Eclipse installation manually ?

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 15, 2024

Now I understand better what the problem is: The Eclipse developers have changed for some methods the return type. This changes the method signature as

java.lang.Object org.eclipse.jdt.internal.core.BinaryType.getElementInfo()

becomes

org.eclipse.jdt.internal.compiler.env.IBinaryType org.eclipse.jdt.internal.core.BinaryType.getElementInfo()

This means the method getElementInfo() still exists but has a different signature depending on the used Eclipse version. This is the reason why I wasn't able to reproduce this error in my development environment, as changing the run-time Eclipse version also changes the compile Eclipse version and then the method signature were matching again.

Looks like I have to change those method calls to use reflection. As they are called very infrequent this should not cause any performance problem.

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 15, 2024

I managed to make the necessary code changes and built a new beta version. Please give the attached version a try. It seems to work at least partially.

Edit 2024-03-16: Outdated 3.4.1.beta1 removed. Please use the latest beta (see below).

@miller79
Copy link

I managed to make the necessary code changes and built a new beta version. Please give the attached version a try. It seems to work at least partially. com.github.ecd-plugin.update-3.4.1.beta1.zip

Just tried it out and it seems to work for me with a few classes I attempted opening using JD-Core, Procyon, and Vineflower. I am getting this though when opening using CFR:

eclipse.buildId=4.22.0.202403071427
java.version=21.0.2
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.springframework.boot.ide.branding.sts4
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.springframework.boot.ide.branding.sts4 -data file:/***

This is a continuation of log file C:\***
Created Time: 2024-03-15 16:32:23.452

org.sf.feeling.decompiler
Error
Fri Mar 15 16:32:23 CDT 2024
***

org.benf.cfr.reader.util.CannotLoadClassException: *** - java.lang.NullPointerException: Cannot invoke "org.benf.cfr.reader.state.ClassFileRelocator.correctPath(String)" because "this.classRelocator" is null
	at org.benf.cfr.reader.state.DCCommonState.loadClassFileAtPath(DCCommonState.java:122)
	at org.benf.cfr.reader.state.DCCommonState$1.invoke(DCCommonState.java:52)
	at org.benf.cfr.reader.state.DCCommonState$1.invoke(DCCommonState.java:49)
	at org.benf.cfr.reader.util.collections.LazyMap.get(LazyMap.java:44)
	at org.benf.cfr.reader.util.collections.LazyExceptionRetainingMap.get(LazyExceptionRetainingMap.java:19)
	at org.benf.cfr.reader.state.DCCommonState.getClassFile(DCCommonState.java:183)
	at org.benf.cfr.reader.state.DCCommonState.getClassFileMaybePath(DCCommonState.java:212)
	at org.sf.feeling.decompiler.cfr.decompiler.CfrDecompiler.decompile(CfrDecompiler.java:72)
	at org.sf.feeling.decompiler.cfr.decompiler.CfrDecompiler.decompileFromArchive(CfrDecompiler.java:145)
	at org.sf.feeling.decompiler.editor.BaseDecompilerSourceMapper.decompile(BaseDecompilerSourceMapper.java:286)
	at org.sf.feeling.decompiler.editor.BaseDecompilerSourceMapper.findSource(BaseDecompilerSourceMapper.java:160)
	at org.sf.feeling.decompiler.editor.DecompilerSourceMapper.findSource(DecompilerSourceMapper.java:64)
	at org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.doOpenBuffer(JavaDecompilerClassFileEditor.java:159)
	at org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.doOpenBuffer(JavaDecompilerClassFileEditor.java:140)
	at org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.doOpenBuffer(JavaDecompilerClassFileEditor.java:133)
	at org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.doSetInput(JavaDecompilerClassFileEditor.java:381)
	at org.eclipse.ui.texteditor.AbstractTextEditor.lambda$1(AbstractTextEditor.java:3171)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:434)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:354)
	at org.eclipse.ui.internal.WorkbenchWindow.lambda$7(WorkbenchWindow.java:2335)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2332)
	at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3188)
	at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3213)
	at org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditor.lambda$0(ClassFileEditor.java:656)
	at org.eclipse.jdt.core.JavaCore.lambda$0(JavaCore.java:6142)
	at org.eclipse.jdt.internal.core.JavaModelManager.cacheZipFiles(JavaModelManager.java:5839)
	at org.eclipse.jdt.internal.core.JavaModelManager.callReadOnly(JavaModelManager.java:5828)
	at org.eclipse.jdt.core.JavaCore.callReadOnly(JavaCore.java:6126)
	at org.eclipse.jdt.core.JavaCore.runReadOnly(JavaCore.java:6141)
	at org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditor.init(ClassFileEditor.java:656)
	at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:353)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:344)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:976)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:938)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:138)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:385)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:311)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:203)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:90)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:59)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:991)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.lambda$0(PartServiceImpl.java:105)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.lambda$0(UIEventHandler.java:38)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:183)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4803)
	at org.eclipse.e4.ui.workbench.swt.DisplayUISynchronize.syncExec(DisplayUISynchronize.java:34)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:206)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:201)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:131)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:73)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElementGen(ElementContainerImpl.java:168)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:187)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:654)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:618)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:796)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:401)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1271)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3228)
	at org.eclipse.ui.internal.WorkbenchPage.lambda$11(WorkbenchPage.java:3118)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3116)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3086)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3077)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:383)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:184)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:288)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:254)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:252)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:366)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$3.open(PackageExplorerPart.java:545)
	at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:799)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:796)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1110)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:295)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:330)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4274)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4072)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
Caused by: java.lang.NullPointerException: Cannot invoke "org.benf.cfr.reader.state.ClassFileRelocator.correctPath(String)" because "this.classRelocator" is null
	at org.benf.cfr.reader.state.ClassFileSourceImpl.getClassFileContent(ClassFileSourceImpl.java:106)
	at org.benf.cfr.reader.state.DCCommonState.loadClassFileAtPath(DCCommonState.java:117)
	... 122 more

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 16, 2024

@miller79 It seems like the CFR problem is related to #87. Until Eclipse 2024-03, when the user selected to decompile a class with CFR then ECD did not even try to decompile the class with CFR but internally used FernFlower (seems to be some sort of automatic fallback that is totally defect).

I think the ECD code to use CFR as decompiler was never working. But as FernFlower was used instead of CFR nobody ever realized this (and it even lies about the used decompiler in the decompiler report). What I don't understand at the moment is why ECD never tried to use CFR until now. I would somehow understand if it tries to use CFR, gets an exception and then performs a fallback to FernFlower, but it never tries. Only on Eclipse 2024-03 suddenly it uses CFR as decompiler and then gets this exception as the code to use CFR doesn't work.

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 16, 2024

@miller79 The new version should fix the CFR problem.

Also the decompilation report now shows the really used decompiler.

com.github.ecd-plugin.update-3.4.1.beta2.zip

@miller79
Copy link

@jpstotz I have just tried out the beta2 with the situations I typically use it for and it appears to be working for everything so consider it a checkmark from me at least! Thanks for putting in the weekend oil on this!

@pmorange
Copy link

Hi, latest beta (2) seems to be working fine for me.
Many thanks !

@OlivierJaquemet
Copy link

OlivierJaquemet commented Mar 18, 2024

Hi, I just tried beta 2, on two different Eclipse workspace, and unfortunately got the same two errors on both.

  1. Exception when trying to open a class (without source attached), using ctrl+shift+T
  2. Exception when accessing Decompiler preferences

Are you aware of a common mistake I could have made during the installation of the beta that would lead to the errors below ?

  • When trying to open a class (without source attached), using ctrl+shift+T :
org.eclipse.core.runtime.CoreException: Plug-in org.sf.feeling.decompiler was unable to load class org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:242)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:225)
[...]
Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle org.sf.feeling.decompiler (1059).
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:134)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:620)
[...]
Caused by: org.osgi.framework.BundleException: Exception in org.sf.feeling.decompiler.JavaDecompilerPlugin.start() of bundle org.sf.feeling.decompiler.
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:854)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:775)
[...]
Caused by: java.lang.AbstractMethodError: Receiver class org.sf.feeling.decompiler.jad.decompiler.JadDecompilerDescriptor does not define or inherit an implementation of the resolved method 'abstract int getDefaultPriority()' of interface org.sf.feeling.decompiler.editor.IDecompilerDescriptor.
	at org.sf.feeling.decompiler.util.DefaultDecompilerDescriptorComparator.compare(DefaultDecompilerDescriptorComparator.java:15)
	at org.sf.feeling.decompiler.util.DefaultDecompilerDescriptorComparator.compare(DefaultDecompilerDescriptorComparator.java:1)
	at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:360)
	at java.base/java.util.TimSort.sort(TimSort.java:220)
	at java.base/java.util.Arrays.sort(Arrays.java:1307)
	at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:353)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:528)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
	at org.sf.feeling.decompiler.JavaDecompilerPlugin.getDefaultDecompilerType(JavaDecompilerPlugin.java:329)
	at org.sf.feeling.decompiler.JavaDecompilerPlugin.initializeDefaultDecompilerType(JavaDecompilerPlugin.java:236)
	at org.sf.feeling.decompiler.JavaDecompilerPlugin.start(JavaDecompilerPlugin.java:204)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:833)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:825)
	... 26 more

  • When accessing Decompiler preferences :
    to image
java.lang.ClassNotFoundException: An error occurred while automatically activating bundle org.sf.feeling.decompiler (1059).
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:134)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:620)
[...]
Caused by: org.osgi.framework.BundleException: Exception in org.sf.feeling.decompiler.JavaDecompilerPlugin.start() of bundle org.sf.feeling.decompiler.
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:854)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:775)
[...]
Caused by: java.lang.AbstractMethodError: Receiver class org.sf.feeling.decompiler.jad.decompiler.JadDecompilerDescriptor does not define or inherit an implementation of the resolved method 'abstract int getDefaultPriority()' of interface org.sf.feeling.decompiler.editor.IDecompilerDescriptor.
	at org.sf.feeling.decompiler.util.DefaultDecompilerDescriptorComparator.compare(DefaultDecompilerDescriptorComparator.java:15)
	at org.sf.feeling.decompiler.util.DefaultDecompilerDescriptorComparator.compare(DefaultDecompilerDescriptorComparator.java:1)
	at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:360)
	at java.base/java.util.TimSort.sort(TimSort.java:220)
	at java.base/java.util.Arrays.sort(Arrays.java:1307)
	at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:353)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:528)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
	at org.sf.feeling.decompiler.JavaDecompilerPlugin.getDefaultDecompilerType(JavaDecompilerPlugin.java:329)
	at org.sf.feeling.decompiler.JavaDecompilerPlugin.initializeDefaultDecompilerType(JavaDecompilerPlugin.java:236)
	at org.sf.feeling.decompiler.JavaDecompilerPlugin.start(JavaDecompilerPlugin.java:204)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:833)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:825)
	... 26 more

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 18, 2024

Receiver class org.sf.feeling.decompiler.jad.decompiler.JadDecompilerDescriptor does not define or inherit an implementation

@OlivierJaquemet Is it possible that you use an Eclipse version that still has the old Jad plugin/feature installed?

JAD has been removed in ECD 3.3.0, therefore this plugin should no longer be active. Not sure how Eclipse handles this when you upgrade to a new ECD version but one plugin/feature does no longer exist. Please check your installed feature list in Help -> About Eclipse if you have this outdated feature installed and uninstall it.

Anyway thanks for the stack trace. I will try to enhance ECD to only log such errors or ignore the outdated plugins.

@pmorange
Copy link

Hi,
Make sure you uninstall previous official version that you installed from the Marketplace (or somewhere else). At first I got errors after installing the beta, and then after uninstalling the old version everything worked well again.

@OlivierJaquemet
Copy link

After a manual uninstallation of the old "jad" plugin, everything work as expected.
Thank you @jpstotz 👌 (and @pmorange)

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 18, 2024

Thanks for all the feedback. Looks like ECD on Eclipse 2024-03 is now working stable.

In the end I decided to rename the version to 3.5.0.

ECD 3.5.0 has been published and the software update site has been updated.

@jpstotz jpstotz closed this as completed Mar 18, 2024
@pmorange
Copy link

Thanks for all the feedback. Looks like ECD on Eclipse 2024-03 is now working stable.

In the end I decided to rename the version to 3.5.0.

ECD 3.5.0 has been published and the software update site has been updated.

Hi,
Does it need to propagate?
I tried installing from the store to have the "official" version (although surely it will be the same as the beta2 I have), but I still see 3.4.0 in the Marketplace, and some 14 hours have passed:
image

@e6c31d
Copy link

e6c31d commented Mar 19, 2024

@pmorange
What worked for me is: Go to Available Software Sites in Preferences, click the ecd row, then click "Reload". After that, I did a normal Help -> Check for Updates and it found the update.

image

@pmorange
Copy link

Thanks.
It did not work (really weird I guess), but doing "Check for updates" in Help did.
Too much caching :-p
Anyway, thanks for the help :-)

@jochenw
Copy link
Author

jochenw commented Mar 19, 2024

I am happy to report, that the following procedure works for me with Eclipse 4.31:

1.) Remove all folders with org.sf.feeling.decompiler from the Eclipse "features" folder.
2.) Remove all jar files with org.sf.feeling.decompiler from the Eclipse "plugins" folder. (In other words: Ensure, that the ECD plugin is completely deinstalled.)
3.) Restart Eclipse, to make sure, that the deinstallation works alright.
4.) Drop the file com.github.ecd-plugin.update-3.4.1.beta2.zip from above into the Eclipse "dropins" folder.
5.) Restart Eclipse again, to make it recognize the new file. Use ECD as I normally would.

If possible, I'd hope for an upcoming formal release.

Thanks very much for your efforts, @jpstotz!

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 19, 2024

Hi, Does it need to propagate? I tried installing from the store to have the "official" version (although surely it will be the same as the beta2 I have), but I still see 3.4.0 in the Marketplace, and some 14 hours have passed.

The official version 3.5.0 is the one from the project's update site: https://ecd-plugin.github.io/update/

In difference to 3.4.1 beta 2 a bug was corrected that caused Fernflower not to be available.

Eclipse Marketplace in the end also uses this update site but the description and shown version is stored in their database, thus I wouldn't call it an official release. Yesterday evening I simply did not had the time to update the Eclipse Marketplace database.

@nbauma109
Copy link

I missed that thread.

@miller79 It seems like the CFR problem is related to #87. Until Eclipse 2024-03, when the user selected to decompile a class with CFR then ECD did not even try to decompile the class with CFR but internally used FernFlower (seems to be some sort of automatic fallback that is totally defect).

I think the ECD code to use CFR as decompiler was never working. But as FernFlower was used instead of CFR nobody ever realized this (and it even lies about the used decompiler in the decompiler report). What I don't understand at the moment is why ECD never tried to use CFR until now. I would somehow understand if it tries to use CFR, gets an exception and then performs a fallback to FernFlower, but it never tries. Only on Eclipse 2024-03 suddenly it uses CFR as decompiler and then gets this exception as the code to use CFR doesn't work.

I disagree with this. There was a NPE in the code calling CFR that was causing the fallback. You fixed it in this commit 6c3710c by adding :

classFileSource.informAnalysisRelativePathDetail(null, null);

For the source attach plugin, I called the method getElementInfo with a null parameter in this commit nbauma109@7f1342c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants