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

try with resources decompilation is not accurate #32

Open
sadaaithal opened this issue Nov 10, 2021 · 2 comments
Open

try with resources decompilation is not accurate #32

sadaaithal opened this issue Nov 10, 2021 · 2 comments

Comments

@sadaaithal
Copy link

I was suggested to open this java decompiler issue from here
deathmarine/Luyten#290

A jdk8 class file with "try with resources" code doesnt decompile correctly
Here's the source
image

And here's what the tool outputs ( im using v0.5.4) in my default config

image

I couldn't find past issues around this area.
Is this addressed in any of the recent builds?
thanks in advance!

@mstrobel
Copy link
Owner

mstrobel commented Feb 4, 2022

This is probably fixed for the next release (javac changed the pattern it emits for try-with-resources sometime after JDK8).

@WizGeek
Copy link

WizGeek commented Oct 18, 2022

I'm seeing this same issue with --compiler-target 1.8 as well:
java -jar procyon-decompiler-0.6.0.jar -o ./sources-ROOT/classes --compiler-target 1.8 SomeJava8Class.class

The .class file was compiled with Java 1.8.0_101.

The resulting .java file shows the same odd Throwable t2 = null; try { ... } sequence instead of try (...) { ... }.

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

3 participants