-
Notifications
You must be signed in to change notification settings - Fork 7
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
Java Model #727
Comments
I have, so far, zoomed in to possibly using one of the following two libraries for this, but ... it's not super clear to me if either of them will find references to the types used in the implementation body of methods, and not just the methods' signatures, fields and class declarations... I should probably just try it out to see!
If they both do not provide this, then this probably requires BCEL or ByteBuddy or Javassist? That would likely be quite a bit more involved than I was thinking of doing here, only for this; and I de-prioritize this if that was the case. |
https://github.com/classgraph/classgraph/wiki/ClassInfo-API#generating-a-graphviz-dot-file-for-class-graph-visualization seems to partially answer what I'm after here - but I still don't understand which ClassGraph API would provide me said "relationships between classes that are based on code in method bodies". |
ClassGraph.enableInterClassDependencies() seems to explain it... I think I now see how this could be done! |
Classgraph does not parse they bytecode in a classfile, it only parses the class metadata (including signatures of methods and fields, etc.). The bytecode format is complex and more likely to change than class metadata, so keeping up with the bytecode format is a non-goal for ClassGraph. The only reliable way to read bytecode is to use the ASM library. So basically if the info you need is in the bytecode, ClassGraph can't help, and you have to use ASM. If it's not, ClassGraph can help. |
./enola -v get --load file:bazel-bin/java/dev/enola/cli/enola_deploy.jar enola:/
should list Java Class/Enum/etc. Type Things;get
one of them should show its references.In an integration test, use this.
This could then be used e.g. for #502.
The text was updated successfully, but these errors were encountered: