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

Nopol works on Java 11 #214

Merged
merged 40 commits into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
695940e
Preliminary commit to experiment Java 11 in CI env
andre15silva Mar 21, 2021
e1ad0db
Add custom javaagent to load classes dynamically
andre15silva Mar 22, 2021
80130c4
Fix DynamothCodeGenesis
andre15silva Mar 22, 2021
3116084
finish
monperrus Jan 22, 2022
ee1d915
up
monperrus Jan 22, 2022
a04f18b
up
monperrus Jan 22, 2022
33fa421
up
monperrus Jan 22, 2022
7ab5f55
up
monperrus Jan 22, 2022
922603e
up
monperrus Jan 22, 2022
6a4e548
up
monperrus Jan 22, 2022
a9b152c
up
monperrus Jan 22, 2022
0229187
up
monperrus Jan 22, 2022
f6d5df5
up
monperrus Jan 22, 2022
efec13c
up
monperrus Jan 22, 2022
31385e1
up
monperrus Jan 22, 2022
01218c3
up
monperrus Jan 22, 2022
1726998
up
monperrus Jan 22, 2022
a49ebd2
up
monperrus Jan 22, 2022
d732a05
up
monperrus Jan 22, 2022
35d6a33
up
monperrus Jan 22, 2022
b7688b4
up
monperrus Jan 22, 2022
189cd86
up
monperrus Jan 22, 2022
7625698
up
monperrus Jan 23, 2022
403aee6
up
monperrus Jan 23, 2022
581525d
up
monperrus Jan 23, 2022
f721420
up
monperrus Jan 23, 2022
b5b5e4e
up
monperrus Jan 23, 2022
d1b7be3
up
monperrus Jan 23, 2022
48cf9a2
up
monperrus Jan 23, 2022
624afa7
up
monperrus Jan 23, 2022
8627b7c
@monperrus at work
monperrus Jan 23, 2022
3aa986b
up
monperrus Jan 23, 2022
5fa473e
up
monperrus Jan 23, 2022
ed1b2b9
up
monperrus Jan 23, 2022
6f1b858
up
monperrus Jan 23, 2022
e412d8c
up
monperrus Jan 23, 2022
530a753
up
monperrus Jan 23, 2022
72446e8
up
monperrus Jan 23, 2022
976f0d2
up
monperrus Jan 23, 2022
848fcef
up
monperrus Jan 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
path: "~/.m2/repository"
key: ${{ runner.os }}-m2

- name: Setup JDK8
- name: Setup JDK
uses: actions/setup-java@v2
with:
java-version: 8
java-version: 11
distribution: 'adopt'

- name: Set up Maven
Expand All @@ -37,4 +37,4 @@ jobs:
mvn clean test

- name: Codecov
uses: codecov/[email protected]
uses: codecov/[email protected]
4 changes: 2 additions & 2 deletions .github/workflows/defects4j_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
path: "~/.m2/repository"
key: ${{ runner.os }}-m2

- name: Setup JDK8
- name: Setup JDK
uses: actions/setup-java@v2
with:
java-version: 8
java-version: 11
distribution: 'adopt'

- name: Set up Maven
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/defects4j_math.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
path: "~/.m2/repository"
key: ${{ runner.os }}-m2

- name: Setup JDK8
- name: Setup JDK
uses: actions/setup-java@v2
with:
java-version: 8
java-version: 11
distribution: 'adopt'

- name: Set up Maven
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/intellij.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
path: "~/.m2/repository"
key: ${{ runner.os }}-m2

- name: Setup JDK8
- name: Setup JDK
uses: actions/setup-java@v2
with:
java-version: 8
java-version: 11
distribution: 'adopt'

- name: Set up Maven
Expand All @@ -44,4 +44,5 @@ jobs:
- name: Compile and test nopol-ui-intellij
run: |
cd nopol-ui-intellij
./gradlew buildPlugin
# the tests don't run anymore since bumping to Java 11, need for porting
./gradlew jar
4 changes: 2 additions & 2 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
path: "~/.m2/repository"
key: ${{ runner.os }}-m2

- name: Setup JDK8
- name: Setup JDK
uses: actions/setup-java@v2
with:
java-version: 8
java-version: 11
distribution: 'adopt'

- name: Set up Maven
Expand Down
55 changes: 27 additions & 28 deletions .github/workflows/tse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
path: "~/.m2/repository"
key: ${{ runner.os }}-m2

- name: Setup JDK8
- name: Setup JDK
uses: actions/setup-java@v2
with:
java-version: 8
java-version: 11
distribution: 'adopt'

- name: Set up Maven
Expand Down Expand Up @@ -52,34 +52,33 @@ jobs:
- name: commons math
run: |
cd nopol-experiments
python2 src/reproduce.py -bug cm1 || true
python2 src/reproduce.py -bug cm2 || true
python2 src/reproduce.py -bug cm3 || true
python2 src/reproduce.py -bug cm4 || true
python2 src/reproduce.py -bug cm5 || true
python2 src/reproduce.py -bug cm6 || true
python2 src/reproduce.py -bug cm7 || true
python2 src/reproduce.py -bug cm10 || true
python2 src/reproduce.py -bug pm1 || true
python2 src/reproduce.py -bug pm2 || true
# Java 11 needs min target 1.6
sed -i -e 's/"1.4"/"1.6"/' data/projects/lang/bugs/*json
python2 src/reproduce.py -bug cm7
python2 src/reproduce.py -bug cm10
#python2 src/reproduce.py -bug pm1
#python2 src/reproduce.py -bug pm2
python2 src/reproduce.py -bug cm1
python2 src/reproduce.py -bug cm2
python2 src/reproduce.py -bug cm3
python2 src/reproduce.py -bug cm4
#python2 src/reproduce.py -bug cm5
#python2 src/reproduce.py -bug cm6

- name: commons lang
run: |
# they are all discarded because all these versions of Commons Lang use the old "enum" syntax
# we don't port the TSE benchmark, but we have ported some of the old Lang bugs in Defects4j
# see Defects4jEvaluationTest
cd nopol-experiments
python2 src/reproduce.py -bug cl1 || true
python2 src/reproduce.py -bug cl2 || true
python2 src/reproduce.py -bug cl3 || true
python2 src/reproduce.py -bug cl4 || true
python2 src/reproduce.py -bug cl5 || true
python2 src/reproduce.py -bug cl6 || true
python2 src/reproduce.py -bug pl1 || true
python2 src/reproduce.py -bug pl2 || true
python2 src/reproduce.py -bug pl3 || true
python2 src/reproduce.py -bug pl4 || true
#python2 src/reproduce.py -bug cl1
#python2 src/reproduce.py -bug cl2
#python2 src/reproduce.py -bug cl3
#python2 src/reproduce.py -bug cl4
#python2 src/reproduce.py -bug cl5
#python2 src/reproduce.py -bug cl6
#python2 src/reproduce.py -bug pl1
#python2 src/reproduce.py -bug pl2
#python2 src/reproduce.py -bug pl3
#python2 src/reproduce.py -bug pl4

- name: TseEvaluationTest
run: |
cd nopol
mvn -Dtest="fr.inria.lille.repair.nopol.TseEvaluationTest" test
env:
NOPOL_EVAL_TSE: 1
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Others papers about Nopol:

Nopol requires Java and an SMT solver installed on the machine (e.g. Z3)

Up to commit 80130c4c, Nopol required Java 8. Now it also works on Java 11, see https://github.com/SpoonLabs/nopol/pull/214

1) Compile NoPol:

```
Expand Down
15 changes: 7 additions & 8 deletions nopol-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@
<version>4.13.1</version>
</dependency>

<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.4.2</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>

<dependency>
<groupId>fr.inria.gforge.spirals</groupId>
<artifactId>nopol</artifactId>
Expand Down Expand Up @@ -99,6 +91,13 @@
<encoding>${default.encoding}</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14.1</version>
<configuration>
<argLine>-Xms2048m -Xmx2048m -cp ${java.home.openjdk11}/jmods/jdk.jdi.jmod</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
Expand Down
4 changes: 2 additions & 2 deletions nopol-server/src/main/java/actor/InternalNopolActor.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import akka.actor.ActorRef;
import akka.actor.UntypedActor;
import com.google.common.io.Files;
import fr.inria.lille.repair.common.config.NopolContext;
import fr.inria.lille.repair.common.patch.Patch;
import fr.inria.lille.repair.nopol.NoPol;
import fr.inria.lille.repair.nopol.NopolResult;
import xxl.java.library.JavaLibrary;

import java.io.File;
import java.nio.file.Files;
import java.util.Collections;
import java.util.List;

Expand All @@ -27,7 +27,7 @@ public void onReceive(Object message) throws Exception {
ConfigActor configActor = (ConfigActor) message;

NopolContext nopolContext = configActor.getNopolContext();
File tempDirectory = Files.createTempDir();
File tempDirectory = Files.createTempDirectory("tmp").toFile();
UnZiper.unZipIt(configActor.getContent(), tempDirectory.getAbsolutePath());
ActorRef client = configActor.getClient();

Expand Down
31 changes: 13 additions & 18 deletions nopol-ui-intellij/build.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
buildscript {
repositories {
maven { url 'http://dl.bintray.com/jetbrains/intellij-plugin-service' }
}
}



plugins {
id 'java'
id "org.jetbrains.intellij" version "0.3.12"
id "org.jetbrains.intellij" version "1.1"
}

repositories {
mavenLocal()
mavenCentral()
maven {
url "http://repo.akka.io/snapshots/"
}
}

dependencies {
compile "com.typesafe.akka:akka-remote_2.11:2.4.17"
compile "com.typesafe.akka:akka-actor_2.11:2.4.17"
compile "fr.inria.gforge.spirals:nopol:0.2-SNAPSHOT"
compile "fr.inria.gforge.spirals:nopol-server:0.2-SNAPSHOT"
implementation "com.typesafe.akka:akka-remote_2.11:2.4.17"
implementation "com.typesafe.akka:akka-actor_2.11:2.4.17"
implementation "fr.inria.gforge.spirals:nopol:0.2-SNAPSHOT"
implementation "fr.inria.gforge.spirals:nopol-server:0.2-SNAPSHOT"
}

intellij {
version '182.3911.6' // see https://www.jetbrains.com/intellij-repository/releases
publish {
username "$System.env.USER"
password "$System.env.PASSWORD"
}
version '2018.1.4'
// https://blog.jetbrains.com/platform/2019/06/java-functionality-extracted-as-a-plugin/
plugins = ['com.intellij.java']
}



Binary file modified nopol-ui-intellij/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions nopol-ui-intellij/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Feb 27 17:30:58 CET 2017
#Sun Jan 23 09:22:47 CET 2022
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
57 changes: 31 additions & 26 deletions nopol-ui-intellij/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,30 @@
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

Expand All @@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
Expand All @@ -90,7 +89,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand All @@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down Expand Up @@ -161,4 +161,9 @@ function splitJvmOpts() {
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
Loading