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

Support Java 11 #206

Open
khatchad opened this issue Aug 9, 2019 · 3 comments
Open

Support Java 11 #206

khatchad opened this issue Aug 9, 2019 · 3 comments

Comments

@khatchad
Copy link
Member

khatchad commented Aug 9, 2019

Looks like this plug-in does not support JDK 11. The problem seems to be in WALA; it can't find java.lang.Object. The class hierarchy is quite different in Java > 8 because of the module system. There's also significant changes to the JDK structure, e.g., rt.jar no longer exists and has been replaced with something else.

@yanntm
Copy link

yanntm commented Apr 21, 2020

It seems that in Java 9+, we cannot really navigate the basic libraries like rt.jar, perhaps a patch would consist in resolving dependencies to "Primordial" elements in the runtime on the fly ; there is a mechanism to examine a class once you have it's qualified name, but we cannot start by loading the whole runtime just so that any dependency to it is resolvable when it comes to building call graphs.

Basically currently the algorithm is 2 passes : first build all nodes that could belogn to the graph, then collect "edges" that represent dependencies. We need to go for a more progressive version, where during construction of edges if the source or target node is not found, we try to load it on the fly by asking the classloader to give it to us.

So instead of NPE, if we cannot resolve a dependency in the existing nodes, try to build the node at that moment.

We are also interested in getting support for Java 9+, particularly since Java 8 is so hard to obtain nowadays.

@khatchad
Copy link
Member Author

Thanks for the feedback, @yanntm. As I mentioned above, I believe that this issue needs to ultimately be tackled in WALA. I believe that there is new bytecode not yet being processed by WALA. However, it would be nice, as you point out, to at least deal with the exception in a more elegant way for the time being.

@yanntm
Copy link

yanntm commented May 25, 2020

This configuration trick can work if you do have java 8 libraries on the system

wala/WALA#442

Maybe we could package our own version of the java 8 rt.jar and others into the distribution and rely on these artifacts to overcome current issues regarding recent Java.
ie. Configure WALA to use these jar instead of those taken from the system JVM folder.

OTOH they say they are building an update to WALA so it will work with recent JRE out of the box so maybe we could wait for that release.

yanntm added a commit to yanntm/Optimize-Java-8-Streams-Refactoring that referenced this issue Jun 21, 2020
from Java 9 up, these files that are needed by Wala no longer exist in
the JRE.

This is an attempt to package them with the tool, see also
ponder-lab#206
yanntm added a commit to yanntm/Optimize-Java-8-Streams-Refactoring that referenced this issue Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants