javapathfinder / jpf-core

JPF is an extensible software analysis framework for Java bytecode. jpf-core is the basis for all JPF projects; you always need to install it. It contains the basic VM and model checking infrastructure, and can be used to check for concurrency defects like deadlocks, and unhandled exceptions like NullPointerExceptions and AssertionErrors.
526 stars 335 forks source link

Improve generic type introspection #152

Open jtoman opened 6 years ago

jtoman commented 6 years ago

Add support for getGenericReturnType, getGenericInterfaces, etc.

This requires either parsing the generic signature within JPF, or reusing the parsing code included in the JVM. The boilerplate code to do this within the JDK cannot be directly copied into the Field, constructor, method, and class definitions (as the jdk is GPL). However thanks to the classpath exception it is possible to include this code in a separate GPL-licensed library (ala jpf-classes.jar) and then link this in at runtime.

manish3499 commented 5 years ago

Hello @jtoman, I'd like to work on this. I couldn't get the last sentence, could you please explain it in a bit more detail?

Thanks

jtoman commented 5 years ago

Hi @manish3499. Basically, the JCL contains a large amount of code to parse and interpret generic type signatures contained within class files. As this code is technically licensed under the GPL, it is incompatible with the license of JPF. However, it is possible to encapsulate the GPL licensed code from the JCL into a separate library (jar) and license that library under the GPL, and then have JPF proper link to that library, using it to perform the type introspection, parsing, etc.

I have actually implemented this already, I just never got around to pushing it because fiddling around with all the licenses seemed above the paygrade of a random contributor. I can make what I have available if you're interested.

manish3499 commented 5 years ago

Sure, please share what you have implemented. I'll work on what's left and add the feature.

Thank you