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

JDepend can't read Java 8 code (patch included) #7

Closed
iloveeclipse opened this issue Jun 24, 2014 · 6 comments
Closed

JDepend can't read Java 8 code (patch included) #7

iloveeclipse opened this issue Jun 24, 2014 · 6 comments

Comments

@iloveeclipse
Copy link

Hi,
thnaks for the great tool!
I'm the author of JDepend4Eclipse plugin (which uses JDepend), and just found out that JDepend 2.9.1 can't read Java 8 code (there are 3 new class pool constants added, see [1]).
After a small check in debugger it looks like I have a fix for the ClassFileParser, see [2]. Please sorry for the different formatting of the code, it was never intended to be used as patch source.

Check occurencies of CONSTANT_METHOD_HANDLE, CONSTANT_METHOD_TYPE and CONSTANT_INVOKEDYNAMIC. Tha patch is pretty straightforward and at least fixes class reading errors for me. Might be something is still not working as expected, but I hope that this small change helps to fix JDepend for Java 8.

Regards,
Andrey Loskutov.

[1] http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4
[2] https://code.google.com/a/eclipselabs.org/p/jdepend4eclipse/source/detail?r=8ad3369866f7e3e2c45f07b708f75570d79a0be0

@stephanos
Copy link

Would love to see this.
But this project is dead, isn't it?

mmichaelis added a commit to mmichaelis/describeme that referenced this issue Mar 27, 2015
As mentioned here

http://forums.gradle.org/gradle/topics/fyi-jdepend-does-support-java-8

and here

clarkware/jdepend#7

`JDepend` does not support Java 8 and leads to messages like "Unknown constant: 18"
in Maven build. Thus removing the report.
@dridi
Copy link

dridi commented Jun 16, 2015

@jcestibariz
Copy link

The patch works for me, I created this pull request

@Petikoch
Copy link

Petikoch commented Mar 6, 2020

Is this project dead @clarkware ?

Under the menu "settings" there is the "Archive this repository" button for this situation.

Best regards,
Peti

@clarkware
Copy link
Owner

Thanks very much for the patch, @jcestibariz! I merged it in 2015, but for some reason I can't quite recall, I didn't push out an official release. My fault! Version 2.10 released today includes the patch supporting Java 8.

@PYangDizzle
Copy link

PYangDizzle commented Mar 23, 2020

Hi @clarkware,

I tried updating the jar version to 2.10 and noticed that the classes were compiled with major version 57, Java 13. Is that necessary? My environment is on Java 8 and it can't load the classes.

I could compile the source myself and target Java 8, Wouldn't you want to keep the major version down to 46, Java 1.2 just like 2.9 or Java 8 which was the reason why you needed the update.

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

7 participants