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

chore: bump to Java 11 #1190

Merged
merged 15 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .ci/ci-dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM maven:3.6-openjdk-8
FROM maven:3.6-openjdk-11

RUN apt-get update
RUN apt-get install xmlstarlet -y
Expand Down
1 change: 1 addition & 0 deletions src/maven-repair/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@
<id>noNopol</id>
<activation>
<jdk>[1.9,1.16)</jdk>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public class NopolMojo extends AbstractRepairMojo {
@Parameter( defaultValue = "10", property = "maxTime", required = true )
private int maxTime;

@Parameter( defaultValue = "gzoltar", property = "localizer", required = true )
@Parameter( defaultValue = "cocospoon", property = "localizer", required = true )
private String localizer;

@Parameter( defaultValue = "dynamoth", property = "synthesis", required = true )
@Parameter( defaultValue = "smt", property = "synthesis", required = true )
private String synthesis;

@Parameter( defaultValue = "z3", property = "solver", required = true )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import fr.inria.lille.repair.nopol.NopolStatus;
import org.apache.maven.plugin.Mojo;
import org.junit.Test;

import java.io.File;

Expand All @@ -23,6 +24,7 @@ protected void tearDown() throws Exception {
mvn_clean.waitFor();
}

@Test
public void testNopolRepair() throws Exception {
File f = getTestFile(projectPath + "pom.xml");
Mojo mojo = lookupConfiguredMojo(f, "nopol");
Expand Down
Binary file not shown.
Binary file added src/maven-repair/src/test/resources/z3/z3_for_mac
Binary file not shown.
2 changes: 1 addition & 1 deletion src/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven-jacoco-plugin.version>0.7.9</maven-jacoco-plugin.version>
<maven-jacoco-plugin.version>0.8.3</maven-jacoco-plugin.version>
<maven-coveralls-plugin.version>4.0.0</maven-coveralls-plugin.version>
</properties>

Expand Down
1 change: 1 addition & 0 deletions src/repairnator-pipeline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
<id>noNopol</id>
<activation>
<jdk>[1.9,1.16)</jdk>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import fr.inria.lille.commons.synthesis.smt.solver.SolverFactory;
import fr.inria.lille.repair.common.config.NopolContext;
import fr.inria.lille.repair.common.patch.Patch;
import fr.inria.lille.repair.common.synth.RepairType;
Expand Down Expand Up @@ -134,7 +135,7 @@ protected void runNopol(Set<FailureLocation> failureLocation, List<String> tests
nopolContext.setMaxTimeInMinutes(timeout);
nopolContext.setLocalizer(NopolContext.NopolLocalizer.COCOSPOON);
nopolContext.setSolverPath(this.getConfig().getZ3solverPath());
nopolContext.setSynthesis(NopolContext.NopolSynthesis.DYNAMOTH);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a comment to explain why we cannot use DYNAMOTH?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

nopolContext.setSynthesis(NopolContext.NopolSynthesis.SMT); // We cannout use Dynamoth because it currently depends on tolls.jar
nopolContext.setType(RepairType.COND_THEN_PRE);
nopolContext.setOnlyOneSynthesisResult(false);
nopolContext.setOutputFolder(patchDir.getAbsolutePath());
Expand All @@ -149,7 +150,7 @@ protected void runNopol(Set<FailureLocation> failureLocation, List<String> tests
nopolInformation.setNopolContext(nopolContext);

// not required in Dynamoth mode
// SolverFactory.setSolver(nopolContext.getSolver(), nopolContext.getSolverPath());
SolverFactory.setSolver(nopolContext.getSolver(), nopolContext.getSolverPath());

long beforeNopol = new Date().getTime();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void testPipelineOnlyGitRepository() throws Exception {
public void testPipelineGitRepositoryAndBranch() throws Exception {
GitRepositoryLauncher l = new GitRepositoryLauncher(new String[]{
"--gitrepo",
"--gitrepourl", "https://github.com/surli/failingProject",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using https://github.com/repairnator/failingProject/ instead? (sent you an invitation)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

"--gitrepourl", "https://github.com/repairnator/failingProject",
"--gitrepobranch", "astor-jkali-failure",
"--repairTools", "AstorJKali",
"--workspace", workspaceFolder.getRoot().getAbsolutePath(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testPipelineOnlyGitRepository() throws Exception {
public void testPipelineGitRepositoryAndBranch() throws Exception {
GithubMainProcess mainProc = (GithubMainProcess) MainProcessFactory.getGithubMainProcess(new String[]{
"--gitrepo",
"--gitrepourl", "https://github.com/surli/failingProject",
"--gitrepourl", "https://github.com/repairnator/failingProject",
"--gitrepobranch", "astor-jkali-failure",
"--repairTools", "AstorJKali",
"--workspace", workspaceFolder.getRoot().getAbsolutePath(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public void testODSPatchClassification() throws IOException {
String.valueOf(buildId));

// There are 10 patches are generated for this failing build
assertThat(classifyPatcheswithODS.size(), is(10));
assertThat(classifyPatcheswithODS.size(), is(1));

int overfittingCount = 0;

Expand All @@ -196,7 +196,7 @@ public void testODSPatchClassification() throws IOException {
}
}

assertThat(overfittingCount, is(10));
assertThat(overfittingCount, is(1));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,14 @@ public void testGatherTestInformationOnlyOneErroring() throws IOException {

FailureLocation expectedFailureLocation = new FailureLocation("nopol_examples.nopol_example_1.NopolExampleTest");
ErrorType errorType = new ErrorType("java.lang.StringIndexOutOfBoundsException", "java.lang.StringIndexOutOfBoundsException: String index out of range: -5\n" +
"\tat java.lang.String.charAt(String.java:658)\n" +
"\tat java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47)\n" +
"\tat java.base/java.lang.String.charAt(String.java:693)\n" +
"\tat nopol_examples.nopol_example_1.NopolExample.charAt(NopolExample.java:16)\n" +
"\tat nopol_examples.nopol_example_1.NopolExampleTest.test5(NopolExampleTest.java:39)\n" +
"\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" +
"\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n" +
"\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" +
"\tat java.lang.reflect.Method.invoke(Method.java:498)\n" +
"\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" +
"\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n" +
"\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" +
"\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\n" +
"\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)\n" +
"\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n" +
"\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)\n" +
Expand All @@ -183,10 +184,10 @@ public void testGatherTestInformationOnlyOneErroring() throws IOException {
"\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)\n" +
"\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)\n" +
"\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)\n" +
"\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" +
"\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n" +
"\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" +
"\tat java.lang.reflect.Method.invoke(Method.java:498)\n" +
"\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" +
"\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n" +
"\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" +
"\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\n" +
"\tat org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)\n" +
"\tat org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)\n" +
"\tat org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void testNopolRepairWithExclusion() throws IOException {
assertThat(finalStatus, is("PATCHED"));

List<RepairPatch> allPatches = inspector.getJobStatus().getAllPatches();
assertThat(allPatches.size(), is(77));
assertThat(allPatches.size(), is(9));
assertThat(inspector.getJobStatus().getToolDiagnostic().get(nopolRepair.getRepairToolName()), notNullValue());
}

Expand Down