SpoonLabs / nopol

Automatic program repair system for Java based on dynamic analysis and code synthesis with SMT. Also contains the code of Dynamoth.
https://hal.archives-ouvertes.fr/hal-01285008/document
GNU General Public License v2.0
97 stars 40 forks source link

Support Java 11 #211

Closed andre15silva closed 2 years ago

andre15silva commented 3 years ago

Currently Java >8 support is limited due to the tools.jar dependency.

It would be important to fix these compatibility issues as Nopol's usage in https://github.com/eclipse/repairnator will be limited when it moves to Java 11.

monperrus commented 3 years ago

Per the discussion in Repairnator, the blocking factor is the need of JDI for Dynamoth.

As solution, we will likely move on to Java 11 by only keeping the SMT-based synthesis (the one described in the TSE paper). The users of Dynamoth would then use a past commit.

monperrus commented 3 years ago

The question is: where is com.sun.jdi in Java 11? by default in the JVM? Somewhere else?

andre15silva commented 3 years ago

The change was made in https://openjdk.java.net/jeps/220

Removed: rt.jar and tools.jar

The class and resource files previously stored in lib/rt.jar, lib/tools.jar, lib/dt.jar, and various other internal JAR files are now stored in a more efficient format in implementation-specific files in the lib directory. The format of these files is not specified and is subject to change without notice.

I have to dig more into it, but it's still in jdk11 https://docs.oracle.com/en/java/javase/11/docs/api/jdk.jdi/com/sun/jdi/package-summary.html

monperrus commented 3 years ago

Does it mean that it is available by default (no need to add another jar as before)?

andre15silva commented 3 years ago

Does it mean that it is available by default (no need to add another jar as before)?

I think so. There are probably changes in the behaviour/API that impact Nopol, so I have to experiment to be sure it's that straightforward.

monperrus commented 3 years ago

have to experiment to be sure it's that straightforward.

great, looking forward to the results

monperrus commented 3 years ago

FTR, @Twonki @martinezmatias the tools.jar problem is fixed, see https://github.com/SpoonLabs/nopol/pull/214#issuecomment-804299594 thanks @andre15silva

GZoltar is the remaining problem. André, we have an ongoing effort to replace Gzoltar, by a new project called flacoco, see https://github.com/eclipse/repairnator/issues/1029 We may soon give Flacoco a high priority.

monperrus commented 3 years ago

FYI @gynther-k is able to use GZoltar with Java 11, with the latest version as of commit https://github.com/gynther-k/TBar/commit/d1b15552b5622d36cbf32cf1f0801ced207d73da

andre15silva commented 3 years ago

FYI @gynther-k is able to use GZoltar with Java 11, with the latest version as of commit gynther-k/TBar@d1b1555

I will take a look and update the PR

gynther-k commented 3 years ago

@monperrus @andre15silva The modified Java11 .jar files is not used by default in my project but are located here: https://github.com/gynther-k/TBar/tree/test-1/lib/java11modified

I have made a PR to gzoltar with a more detailed description https://github.com/GZoltar/gzoltar/pull/41 . I have no previous experience of gzoltar so please come with suggestions .

monperrus commented 3 years ago

Thanks for the PR!

monperrus commented 3 years ago

@martinezmatias @andre15silva FYI PR merged in GZoltar https://github.com/GZoltar/gzoltar/pull/41

andre15silva commented 3 years ago

Nice. Thanks @gynther-k !