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

Decompiler does not work with member sorting and eclipse 4.10 #59

Closed
JanecekPetr opened this issue Dec 28, 2018 · 4 comments
Closed

Decompiler does not work with member sorting and eclipse 4.10 #59

JanecekPetr opened this issue Dec 28, 2018 · 4 comments
Labels
bug upstream This issue has to be resolved upstream (f.e. in the Eclipse project).

Comments

@JanecekPetr
Copy link

After updating to eclipse 2018-12 (4.10, build id I20181206-0815), the decompiler crashes the editor when I try to open a class file. The reported exception:

java.lang.IllegalArgumentException
	at org.eclipse.jdt.core.util.CompilationUnitSorter.checkASTLevel(CompilationUnitSorter.java:62)
	at org.eclipse.jdt.core.util.CompilationUnitSorter.sort(CompilationUnitSorter.java:339)
	at org.eclipse.jdt.internal.corext.codemanipulation.SortMembersOperation.run(SortMembersOperation.java:330)
	at org.sf.feeling.decompiler.util.SortMemberUtil.sortMember(SortMemberUtil.java:90)
	at org.sf.feeling.decompiler.editor.BaseDecompilerSourceMapper.findSource(BaseDecompilerSourceMapper.java:222)
	at org.sf.feeling.decompiler.editor.DecompilerSourceMapper.findSource(DecompilerSourceMapper.java:72)
	at org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.doOpenBuffer(JavaDecompilerClassFileEditor.java:173)
	at org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.doOpenBuffer(JavaDecompilerClassFileEditor.java:148)
	at org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.doOpenBuffer(JavaDecompilerClassFileEditor.java:140)
	at org.sf.feeling.decompiler.editor.JavaDecompilerClassFileEditor.doSetInput(JavaDecompilerClassFileEditor.java:472)
	at org.eclipse.ui.texteditor.AbstractTextEditor.lambda$1(AbstractTextEditor.java:3135)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:440)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:356)

My JDT version: 3.16.0.v20181206-1038
My ECD version: 3.1.1

@JanecekPetr
Copy link
Author

JanecekPetr commented Dec 28, 2018

Hm! This actually looks like a JDT bug.

The SortMembersOperation.run() operation calls CompilationUnitSorter.sort() with AST.JLS11, but it only supports JLS10.

I've filed a bug against JDT and will close this one once the new bug is accepted. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=543073.

@JanecekPetr
Copy link
Author

To whomever faces this in the future:

The workaround is to disable "Use Eclipse member sorter":

image

@RobertZenz RobertZenz added upstream This issue has to be resolved upstream (f.e. in the Eclipse project). bug labels Dec 28, 2018
@JanecekPetr JanecekPetr changed the title Decompiler does not work after updating to eclipse 4.10 Decompiler does not work with member sorting and eclipse 4.10 Dec 28, 2018
@RobertZenz
Copy link
Collaborator

RobertZenz commented Dec 28, 2018

Thanks for the all the digging.

I'm torn whether we should provide a hotfix on that one (or even can). On the one end it would be a good idea to make sure that ECD works everywhere, on the other side I ain't got the time currently to look into this and this will go away in three months anyway...So I'm in favor of the default ticket process, letting it slide until it resolves itself.

@JanecekPetr
Copy link
Author

This has been fixed in eclipse 2020-03 (4.15), for more information see https://bugs.eclipse.org/bugs/show_bug.cgi?id=543073.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug upstream This issue has to be resolved upstream (f.e. in the Eclipse project).
Projects
None yet
Development

No branches or pull requests

2 participants