Skip to content

repairnator/repairnator-experiments-one-crashing-test-case

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 

Repository files navigation

Code-removal Patches associated with Travis CI builds having only one crashing test case

This is an open-science repository that collects the Code-removal patches generated by Repairnator during the analysis of the Travis CI builds characterised by only one crashing test case and no failing test cases.

This repository aims to contain the code of the failing Java projects and to analyze the code-removal patches generated using AstorJKali.

Content of the repository

The structure of the repository is as follows:

  • Branch master contains the jkali-patches folder and the documentation of this repository;
  • The jkali-patches folder contains the patches generated by Repairnator (using the AstorJKali repair mode) analyzing the Travis CI build failure related to Java programs that use Maven as building tool;
  • For each of these failing builds, there is a specific branch with all the information related to the building of the project, bug reproduction, failing tests and repair attempts.

Statistics

The builds collected in the dataset repairnator-experiments with only one erroring test case are 1.724. In the following table, there are the different states of the builds detected by Repairnator during the analysis:

Failing Patched Not clonable Not buildable Not checked out Not testable Not failing
Number of the builds 968 21 - 360 - 25 131

In this repository there are 968 branches (excluding master branch), each of them associated with a failure.

Patch Analysis

Arquisoft-Agents_i1a-363526725-20180407-180717

Branch associated with the failure: repairnator-repairnator-experiments-Arquisoft-Agents_i1a-363526725-20180407-180717-firstCommit

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
org.springframework.boot.context.embedded.
tomcat.ConnectorStartFailedException
MainControllerTest.java Application.java

Kali patch:

--- /src/main/java/agent/Application.java
+++ /src/main/java/agent/Application.java
@@ -6,7 +6,6 @@
 @org.springframework.context.annotation.ComponentScan({ "dbmanagement", "validator", "services", "controller", "agent" })
 public class Application {
 	public static void main(java.lang.String[] args) {
-		org.springframework.boot.SpringApplication.run(agent.Application.class, args);
 	}
 }

Overview: The problem is related to the invocation of Spring application in MainController test class, that calls directly the method Application.main().

Reason why the patch has been generated: jKali is able to generate the patch because its action (deletion of the body in the method Application.main()) is semantically equivalent to the human fix. Indeed, the developer removed the call to the method Application.main from the test case to fix the error. After found online some possible methods to test the Spring Boot Application.main(), the program with the Kali patch still passes the test cases. Thus, the reason why jKali managed to create a patch is not related to a weak test suite. Moreover, the main method is not required for Spring Boot applications, but it can be used to simplify the exection of the application from within an IDE (https://stackoverflow.com/a/29791224/4255576).

Useful information for the developer: The developer can check if there is something wrong with the method main(). Since the method is correct, she can focus on the test case.

Human fix:

From 48d727bc10387132621bc51aa0aff14567a2c962 Mon Sep 17 00:00:00 2001
From: PabloSuaGar <[email protected]>
Date: Tue, 10 Apr 2018 12:17:55 +0200
Subject: Removed invocation of Spring application on MainController test
diff --git a/src/test/java/agent/MainControllerTest.java b/src/test/java/agent/MainControllerTest.java
index 7d0ac71..2ee3c25 100644
--- a/src/test/java/agent/MainControllerTest.java
+++ b/src/test/java/agent/MainControllerTest.java
@@ -41,7 +41,6 @@
     public void setUp() throws Exception {
         this.base = new URL("http://localhost:" + port + "/");
         template = new TestRestTemplate();
-        Application.main(new String[0]);
         mockMvc = MockMvcBuilders.webAppContextSetup(context).build();
     }

AudibleAppliances-AudibleAppliances-348327780-20180302-182413

Error type Erroring test case Changed file by AstorJKali
java.lang.NullPointerException ConfigDataTest.java ConfigData.java

Kali patch:

--- /src/main/java/uk/ac/cam/groupprojects/bravo/config/ConfigData.java
+++ /src/main/java/uk/ac/cam/groupprojects/bravo/config/ConfigData.java
@@ -21,17 +21,6 @@
 			com.google.gson.JsonParser parser = new com.google.gson.JsonParser();
 			com.google.gson.JsonObject config = parser.parse(reader).getAsJsonObject();
 			com.google.gson.JsonObject boxes = config.getAsJsonObject("boxes");
-			for (uk.ac.cam.groupprojects.bravo.imageProcessing.ScreenBox type : uk.ac.cam.groupprojects.bravo.imageProcessing.ScreenBox.values()) {
-				java.lang.String typeName = type.name().toLowerCase();
-				com.google.gson.JsonObject box = boxes.getAsJsonObject(typeName);
-				double boxWidth = box.get("width").getAsDouble();
-				double boxHeight = box.get("height").getAsDouble();
-				com.google.gson.JsonArray corner = box.getAsJsonArray("corner");
-				double cornerX = corner.get(0).getAsDouble();
-				double cornerY = corner.get(1).getAsDouble();
-				uk.ac.cam.groupprojects.bravo.imageProcessing.BoxInfo newBox = new uk.ac.cam.groupprojects.bravo.imageProcessing.BoxInfo(type, new java.awt.geom.Point2D.Double(cornerX, cornerY), boxWidth, boxHeight);
-				mBoxes.put(type, newBox);
-			}
 			com.google.gson.JsonPrimitive voice = config.getAsJsonPrimitive("voice");
 			mVoice = voice.getAsString();
 			com.google.gson.JsonObject spoken_fields = config.getAsJsonObject("spoken_fields");
  • Overview: The problem is related to an example config file that has to be parsed in the crashing test case. Indeed, looking at the commit history, there is this commit that changes the file content, so that the program passes all test cases. There other changes associated with previous failing builds. Applying only the change related to the test data, the program passes all the test cases.

  • Reason why the patch has been generated: jKali managed to create the Kali patch because of the test suite. Indeed, adding for example an assert to check the value of attribute width related to the Box ScreenBox.GRAPH, the program patched with the Kali patch doesn't pass the test cases. Indeed, jKali removed the instructions to parse the section of file related to the ScreenBox, and so these properties are not available.

  • Useful information for the developer: The developer can understand that there is some problem with the for-cycle removed by jKali. If after checking that the parsing is correct, she can check the input file test data.

AudibleAppliances-AudibleAppliances-348335601-20180302-184224

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
java.lang.NullPointerException ConfigDataTest.java ConfigData.json

This is a previous build (number 215) compared to the build 348327780 (number 220), and the both the Kali patch and the human fix are the same.

Kali patch:

--- /src/main/java/uk/ac/cam/groupprojects/bravo/config/ConfigData.java
+++ /src/main/java/uk/ac/cam/groupprojects/bravo/config/ConfigData.java
@@ -21,17 +21,6 @@
 			com.google.gson.JsonParser parser = new com.google.gson.JsonParser();
 			com.google.gson.JsonObject config = parser.parse(reader).getAsJsonObject();
 			com.google.gson.JsonObject boxes = config.getAsJsonObject("boxes");
-			for (uk.ac.cam.groupprojects.bravo.imageProcessing.ScreenBox type : uk.ac.cam.groupprojects.bravo.imageProcessing.ScreenBox.values()) {
-				java.lang.String typeName = type.name().toLowerCase();
-				com.google.gson.JsonObject box = boxes.getAsJsonObject(typeName);
-				double boxWidth = box.get("width").getAsDouble();
-				double boxHeight = box.get("height").getAsDouble();
-				com.google.gson.JsonArray corner = box.getAsJsonArray("corner");
-				double cornerX = corner.get(0).getAsDouble();
-				double cornerY = corner.get(1).getAsDouble();
-				uk.ac.cam.groupprojects.bravo.imageProcessing.BoxInfo newBox = new uk.ac.cam.groupprojects.bravo.imageProcessing.BoxInfo(type, new java.awt.geom.Point2D.Double(cornerX, cornerY), boxWidth, boxHeight);
-				mBoxes.put(type, newBox);
-			}
 			com.google.gson.JsonPrimitive voice = config.getAsJsonPrimitive("voice");
 			mVoice = voice.getAsString();
 			com.google.gson.JsonObject spoken_fields = config.getAsJsonObject("spoken_fields");

Human fix: https://github.com/AudibleAppliances/AudibleAppliances/compare/11b75eadf3f7...c3a110e62fa4

AudibleAppliances-AudibleAppliances-348337755-20180302-184636

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
java.lang.NullPointerException ConfigDataTest.java ConfigData.java

The failing build is the number 223, so it is after the other two previous cases (numbers 215 and 220). The passing build is related to an operation of merge, but I didn't find any difference. Actually, I had to put the correct JSON input test file to make the build passing. But in theory, the test file has already changed in the build 218, so it is strange.

Kali patch:

--- /src/main/java/uk/ac/cam/groupprojects/bravo/config/ConfigData.java
+++ /src/main/java/uk/ac/cam/groupprojects/bravo/config/ConfigData.java
@@ -21,17 +21,6 @@
 			com.google.gson.JsonParser parser = new com.google.gson.JsonParser();
 			com.google.gson.JsonObject config = parser.parse(reader).getAsJsonObject();
 			com.google.gson.JsonObject boxes = config.getAsJsonObject("boxes");
-			for (uk.ac.cam.groupprojects.bravo.imageProcessing.ScreenBox type : uk.ac.cam.groupprojects.bravo.imageProcessing.ScreenBox.values()) {
-				java.lang.String typeName = type.name().toLowerCase();
-				com.google.gson.JsonObject box = boxes.getAsJsonObject(typeName);
-				double boxWidth = box.get("width").getAsDouble();
-				double boxHeight = box.get("height").getAsDouble();
-				com.google.gson.JsonArray corner = box.getAsJsonArray("corner");
-				double cornerX = corner.get(0).getAsDouble();
-				double cornerY = corner.get(1).getAsDouble();
-				uk.ac.cam.groupprojects.bravo.imageProcessing.BoxInfo newBox = new uk.ac.cam.groupprojects.bravo.imageProcessing.BoxInfo(type, new java.awt.geom.Point2D.Double(cornerX, cornerY), boxWidth, boxHeight);
-				mBoxes.put(type, newBox);
-			}
 			com.google.gson.JsonPrimitive voice = config.getAsJsonPrimitive("voice");
 			mVoice = voice.getAsString();
 			com.google.gson.JsonObject spoken_fields = config.getAsJsonObject("spoken_fields");

DanielHWe-sonar-fxcop-385681821-20180530-150823

Error type Detail Erroring test case Changed file by AstorJKali
java.lang.IllegalArgumentException Cannot find the FxCop report FxCopSensorTest.java FxCopSensor.java

Kali patch:

--- /src/main/java/org/sonar/plugins/fxcop/FxCopSensor.java
+++ /src/main/java/org/sonar/plugins/fxcop/FxCopSensor.java
@@ -33,7 +33,7 @@
 	void executeImpl(org.sonar.api.batch.sensor.SensorContext context) {
 		GetAlternativeSlnPath(context);
 		fxCopConf.setAlternativeSln(this.altSlnFile);
-		if (!fxCopConf.checkProperties(context.settings())) {
+		if (true) {
 			org.sonar.plugins.fxcop.FxCopSensor.LOG.warn("Skipping FxCop, either the report file or the assembly is missing");
 			return;
 		}
  • Overview: The problem is related to the fact that the program throws an IllegalArgumentException because a file is missing. However, this is the intended behavior, but the test case have not the assert to verify that the program throws the exception.

  • Reason why the patch has been generated: The Kali patch removed the instruction that makes the program throw the exception. jKali managed to create this patch because of an error in the test case. Indeed, looking at the commit history of the project, the developer changed the test case, to fix the error.

  • Useful information for the developer: Since the expected behavior is the throw of the exception, and jKali removed the instruction that throws the exception, th developer can understand that the error in is not in the program, but it the test case itself.

Human fix:

[From 8bb8cccd253f73d81a3120ec0f42bd6bd32f7a90 Mon Sep 17 00:00:00 2001
From: Daniel Wehrle <[email protected]>
Date: Wed, 30 May 2018 15:20:32 +0200
Subject: Extend UnitTests

---
 src/test/java/org/sonar/plugins/fxcop/FxCopSensorTest.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/sonar/plugins/fxcop/FxCopSensorTest.java b/src/test/java/org/sonar/plugins/fxcop/FxCopSensorTest.java
index b1d5143..489610d 100644
--- a/src/test/java/org/sonar/plugins/fxcop/FxCopSensorTest.java
+++ b/src/test/java/org/sonar/plugins/fxcop/FxCopSensorTest.java
@@ -173,10 +173,9 @@ public void testExecute() {
   
   @Test
   public void testExecuteImpl() {  
-	  if (System.getProperty("os.name").startsWith("Windows")) {
-		  thrown.expect(IllegalArgumentException.class);
+	    thrown.expect(IllegalArgumentException.class);
 	    thrown.expectMessage("Cannot find the FxCop report");
-	  }
+	  
 	  
     FxCopSensor sensor = new FxCopSensor(new FxCopConfiguration("foo", "foo-fxcop", "", "", "sonar.cs.fxcop.slnFile", "", "", "", "", "", "sonar.cs.fxcop.report"));
     SensorContext context = mock(SensorContext.class);]

Raaycc-inglesapp-422238225-20180829-220230

Branch associated with the failure: repairnator-repairnator-experiments-Raaycc-inglesapp-422238225-20180829-220230-firstCommit

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
java.lang.IllegalStateException ApplicationTests.java Application.java

Kali patch:

--- /src/main/java/br/edu/fapce/nexti/Application.java
+++ /src/main/java/br/edu/fapce/nexti/Application.java
@@ -13,7 +13,6 @@
 	@org.springframework.context.annotation.Bean
 	public org.springframework.boot.CommandLineRunner commandLineRunner() {
 		return ( args) -> {
-			createDefaultFinalUser();
 		};
 	}

RossBlassingame-JPL-CUSeniorProjects-346537408-20180227-000313

Error type Erroring test case Changed file by AstorJKali
java.lang.NullPointerException OutputTest.java TerminalOutput.java

Kali patch:

--- /src/main/java/mars/out/TerminalOutput.java
+++ /src/main/java/mars/out/TerminalOutput.java
@@ -16,18 +16,18 @@
 	public void writeToOutput() {
 		java.lang.System.out.println("\nOutput path: ");
 		java.lang.System.out.println("------------");
-		if (coordinateType.equals("L") || coordinateType.equals("l")) {
+		if (true) {
 			mars.map.GeoTIFF convert = new mars.map.GeoTIFF();				

Human fix: https://github.com/RossBlassingame/JPL-CUSeniorProjects/commit/b1b88cfacb0a4c3fae653ad2bb8098b27f9b7a0e

Schrotty-DoIT-388971125-20180606-230606

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
java.lang.ClassCastException ToDoTest.java ToDo.java

The failing build is after the one with id 388971125, that has been analyzed above. In this case, the build is related to a commit in a pull request, but the problem is the same.

Kali patch:

--- /src/main/java/de/swtproject/doit/core/ToDo.java
+++ /src/main/java/de/swtproject/doit/core/ToDo.java
@@ -123,7 +123,6 @@
 		ds.put("start", this.getStart());
 		ds.put("deadline", this.getDeadline());
 		ds.put("notifyPoint", this.getNotifyPoint());
-		ds.put("priority", this.getPriority());
 		return ds;
 	}
 }
  • Overview: The problem is related to the fact that there is cast to String in the test case, but it is not allowed to cast the object Priority to a String. This generates the exception.

  • Reason why the patch has been generated: jKali managed to create a patch because the crashing test case is a rotten green test. Since the Kali patch removed a property from the tested object and since the test checks the property only if the object has the property, this is the reason why the program with the Kali patch passes all test cases.

  • Useful information for the developer: Since the Kali patch removes a specific property from the object, she can investigate if the value of the property is correct or not.

Schrotty-DoIT-388971144-20180606-230500

Error type Erroring test case Changed file by AstorJKali
java.lang.ClassCastException ToDoTest.java ToDo.java

Kali patch:

--- /src/main/java/de/swtproject/doit/core/ToDo.java
+++ /src/main/java/de/swtproject/doit/core/ToDo.java
@@ -123,7 +123,6 @@
 		ds.put("start", this.getStart());
 		ds.put("deadline", this.getDeadline());
 		ds.put("notifyPoint", this.getNotifyPoint());
-		ds.put("priority", this.getPriority());
 		return ds;
 	}
 }

Possible Human fix:

From 6f6213bd8ea7ff2348af86e5b113d3f81c4e40f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niklas=20K=C3=BChtmann?= <[email protected]>
Date: Wed, 6 Jun 2018 23:17:14 +0200
Subject: [PATCH] #14 Kidding, one more try.

---
 src/main/java/de/swtproject/doit/core/ToDo.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/main/java/de/swtproject/doit/core/ToDo.java b/src/main/java/de/swtproject/doit/core/ToDo.java
index fc36c38..6fdb097 100644
--- a/src/main/java/de/swtproject/doit/core/ToDo.java
+++ b/src/main/java/de/swtproject/doit/core/ToDo.java
@@ -82,6 +82,7 @@
      */
     public ToDo(String title) {
         this.title = title;
+        this.interval = IntervalType.NONE;
         this.priority = Priority.DEFAULT;
     }

atomix-atomix-389979054-20180609-024703

Information about the failure:

Error type Details Erroring test case Changed file by AstorJKali
java.util.concurrent.CompletionException failed: Address already in use AtomixClusterTest.java NettyMessagingService.java

Kali patch:

--- /src/main/java/io/atomix/cluster/messaging/impl/NettyMessagingService.java
+++ /src/main/java/io/atomix/cluster/messaging/impl/NettyMessagingService.java
@@ -471,12 +471,12 @@
 			b.childHandler(new io.atomix.cluster.messaging.impl.NettyMessagingService.BasicChannelInitializer());
 		}
 		b.bind(localAddress.port()).addListener(((io.netty.channel.ChannelFutureListener) (( f) -> {
-			if (f.isSuccess()) {
-				log.info("{} accepting incoming connections on port {}", localAddress.address(), localAddress.port());
-				serverChannel = f.channel();
+			if (true) {
+				this.log.info("{} accepting incoming connections on port {}", this.localAddress.address(), this.localAddress.port());
+				this.serverChannel = f.channel();
 				future.complete(null);
 			} else {
-				log.warn("{} failed to bind to port {} due to {}", localAddress.address(), localAddress.port(), f.cause());
+				this.log.warn("{} failed to bind to port {} due to {}", this.localAddress.address(), this.localAddress.port(), f.cause());
 				future.completeExceptionally(f.cause());
 			}
 		})));

biojava-biojava-250779242-20170706-162512_bugonly

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
java.io.IOException GenbankCookbookTest.java ProteinSequenceCreator.java

Kali patch:

--- /src/main/java/org/biojava/nbio/core/sequence/io/ProteinSequenceCreator.java
+++ /src/main/java/org/biojava/nbio/core/sequence/io/ProteinSequenceCreator.java
@@ -16,7 +16,6 @@
 	@java.lang.Override
 	public org.biojava.nbio.core.sequence.template.AbstractSequence<org.biojava.nbio.core.sequence.compound.AminoAcidCompound> getSequence(java.util.List<org.biojava.nbio.core.sequence.compound.AminoAcidCompound> list) {
 		org.biojava.nbio.core.sequence.loader.ArrayListProxySequenceReader<org.biojava.nbio.core.sequence.compound.AminoAcidCompound> store = new org.biojava.nbio.core.sequence.loader.ArrayListProxySequenceReader<org.biojava.nbio.core.sequence.compound.AminoAcidCompound>();
-		store.setCompoundSet(compoundSet);
 		store.setContents(list);
 		return new org.biojava.nbio.core.sequence.ProteinSequence(store);
 	}

codingchili-parser-excel-elasticsearch-372415239-20180428-154442

Branch associated with the failure: repairnator-repairnator-experiments-codingchili-parser-excel-elasticsearch-372415239-20180428-154442-firstCommit

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
java.io.FileNotFoundException TestParser.java FileParser.java

Kali patch:

--- /src/main/java/com/codingchili/Model/FileParser.java
+++ /src/main/java/com/codingchili/Model/FileParser.java
@@ -22,14 +22,14 @@
 
 	public FileParser(java.io.File file, int offset, java.lang.String fileName) throws com.codingchili.Model.ParserException, java.io.FileNotFoundException {
 		offset -= 1;
-		if (file.exists()) {
+		if (true) {
 			try {
 				org.apache.poi.ss.usermodel.Workbook workbook = getWorkbook(file, fileName);
 				this.sheet = workbook.getSheetAt(0);
 				this.offset = offset;
 				this.fileName = fileName;
				 this.columns = getColumnCount(sheet.getRow(offset));
				 this.rows = getItemCount(sheet, offset);
 			} catch (java.lang.Exception e) {
 				if (e instanceof com.codingchili.Model.ParserException) {
 					throw ((com.codingchili.Model.ParserException) (e));

Human fix:

From 9f6e0abf2210a832cbaf55b152904161bf841ac3 Mon Sep 17 00:00:00 2001
From: Robin Duda <[email protected]>
Date: Sat, 28 Apr 2018 15:54:28 +0200
Subject: Renamed file used in test-case for invalid excel content.

---
 src/test/java/TestParser.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/java/TestParser.java b/src/test/java/TestParser.java
index f632e03..f2654b0 100644
--- a/src/test/java/TestParser.java
+++ b/src/test/java/TestParser.java
@@ -18,7 +18,7 @@
 public class TestParser {
     public static final String TEST_XLSX_FILE = "src/test/java/test.xlsx";
     public static final String TEST_XLS_FILE = "src/test/java/test.xls";
-    public static final String TEST_INVALID_FILE = "src/test/java/test_invalid.xlsx";
+    public static final String TEST_INVALID_FILE = "src/test/java/invalid.xlsx";
     public static final int ROW_OFFSET = 5;
     private static final String XLSX = ".xlsx";

ctripcorp-apollo-389668297-20180608-125754

Branch associated with the failure: repairnator-repairnator-experiments-ctripcorp-apollo-389668297-20180608-125754-firstCommit

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
java.lang.RuntimeException MetaDomainTest.java NetUtil.java

Kali patch:

--- /src/main/java/com/ctrip/framework/apollo/core/utils/NetUtil.java
+++ /src/main/java/com/ctrip/framework/apollo/core/utils/NetUtil.java
@@ -33,7 +33,7 @@
 		java.lang.String validAddress = null;
 		java.lang.String[] addressArr = com.ctrip.framework.apollo.core.utils.NetUtil.changeAddressArr(metaAddress);
 		for (java.lang.String address : addressArr) {
-			if (com.ctrip.framework.apollo.core.utils.NetUtil.checkUrl(address)) {
+			if (true) {
 				validAddress = address;
 				break;
 			}

dhatim-dropwizard-sentry-386721415-20180601-172805

Error type Erroring test case Changed file by AstorJKali
java.lang.NullPointerException SentryAppenderFactoryTest.java SentryAppenderFactory.java

Kali patch:

--- /src/main/java/org/dhatim/dropwizard/sentry/logging/SentryAppenderFactory.java
+++ /src/main/java/org/dhatim/dropwizard/sentry/logging/SentryAppenderFactory.java
@@ -117,8 +117,8 @@
 			throw new java.lang.RuntimeException(ex);
 		}
 		java.lang.String dsn = this.dsn;
-		if (!new io.sentry.dsn.Dsn(dsn).getOptions().containsKey("stacktrace.app.packages")) {
-			dsn += "&stacktrace.app.packages=" + stacktraceAppPackages.map(( list) -> list.stream().collect(java.util.stream.Collectors.joining(","))).orElse("");
+		if (false) {
+			dsn += "&stacktrace.app.packages=" + this.stacktraceAppPackages.map(( list) -> list.stream().collect(java.util.stream.Collectors.joining(","))).orElse("");
 		}
 		io.sentry.SentryClient sentryClient = io.sentry.SentryClientFactory.sentryClient(dsn, factory);
 		final io.sentry.logback.SentryAppender appender = new io.sentry.logback.SentryAppender();
  • Overview: The problem is related to a NullPointerException that is thrown by the program during the execution of a test case.

  • Reason why the patch has been generated: jKali managed to create a patch because it changes the if condition in which the exception is thrown, and since the test case doesn't check if the property dns of the object SentryAppenderFactory is not null, the patched program passes all test cases.

  • Useful information for the developer: The developer can focus on the property dns of the object SentryAppenderFactory and check if it is initialized correclty or not. Since it is correct, the developer can then check if there is some errors in the test case.

  • Human fix

From 7e2b50b3acc662f84b2a55aa46cfbaaecb8f840f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Olivier=20Ch=C3=A9dru?= <[email protected]>
Date: Fri, 1 Jun 2018 17:40:06 +0200
Subject: [PATCH] Fix test

---
 .../sentry/logging/SentryAppenderFactoryTest.java           | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/dhatim/dropwizard/sentry/logging/SentryAppenderFactoryTest.java b/src/test/java/org/dhatim/dropwizard/sentry/logging/SentryAppenderFactoryTest.java
index 8dee656..7b33490 100644
--- a/src/test/java/org/dhatim/dropwizard/sentry/logging/SentryAppenderFactoryTest.java
+++ b/src/test/java/org/dhatim/dropwizard/sentry/logging/SentryAppenderFactoryTest.java
@@ -42,11 +42,11 @@ public void buildSentryAppenderShouldFailWithNullContext() {
 
     @Test
     public void buildSentryAppenderShouldWorkWithValidConfiguration() {
-        final SentryAppenderFactory factory = new SentryAppenderFactory();
-        final String dsn = "https://user:[email protected]/id";
+        SentryAppenderFactory factory = new SentryAppenderFactory();
+        factory.setDsn("https://user:[email protected]/id");
 
         Appender<ILoggingEvent> appender
-                = factory.build(context, dsn, layoutFactory, levelFilterFactory, asyncAppenderFactory);
+                = factory.build(context, "", layoutFactory, levelFilterFactory, asyncAppenderFactory);
 
         assertThat(appender, instanceOf(AsyncAppender.class));
     }

dta-sherlock-sirh-gestion-paie-384713759-20180528-141604

Branch associated with the failure: repairnator-repairnator-experiments-dta-sherlock-sirh-gestion-paie-384713759-20180528-141604-firstCommit

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
javax.persistence.PersistenceException CotisationServiceJpaTest.java Cotisation.java

Kali patch:

--- /src/main/java/dev/paie/entite/Cotisation.java
+++ /src/main/java/dev/paie/entite/Cotisation.java
@@ -21,7 +21,6 @@
 
 	public Cotisation(java.lang.Integer id, java.lang.String code, java.lang.String libelle, java.math.BigDecimal tauxSalarial, java.math.BigDecimal tauxPatronal) {
 		super();
-		this.id = id;
 		this.code = code;
 		this.libelle = libelle;
 		this.tauxSalarial = tauxSalarial;
  • Overview: The problem is related to a PersistenceException that is thrown while the program executes the test cases.

  • Reason why the patch has been generated: The Kali patch is equal to the human fix, so it's correct that it has been generated.

  • Useful information for the developer: The developer can apply the same fix.

Human fix:

The developer changed also a test case, but the fix of the error is only the deletion of the assignment to the variable id. Since the assignment is no longer necessary, the developers removes also the parameter from the constructor of the class Cotisation, and she adapts the test case.

From dc7cbf5a7f1343b49d849dae078258315a92904a Mon Sep 17 00:00:00 2001
From: Geraud Tourrilhes <[email protected]>
Date: Mon, 28 May 2018 14:19:36 +0200
Subject: [PATCH] suppression id cotisation

---
 src/main/java/dev/paie/entite/Cotisation.java                | 3 +--
 src/test/java/dev/paie/service/CotisationServiceJpaTest.java | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/main/java/dev/paie/entite/Cotisation.java b/src/main/java/dev/paie/entite/Cotisation.java
index 5c675df..df4f35a 100644
--- a/src/main/java/dev/paie/entite/Cotisation.java
+++ b/src/main/java/dev/paie/entite/Cotisation.java
@@ -26,9 +26,8 @@
 	@Column(name = "tauxPatronal")
 	private BigDecimal tauxPatronal;
 
-	public Cotisation(Integer id, String code, String libelle, BigDecimal tauxSalarial, BigDecimal tauxPatronal) {
+	public Cotisation(String code, String libelle, BigDecimal tauxSalarial, BigDecimal tauxPatronal) {
 		super();
-		this.id = id;
 		this.code = code;
 		this.libelle = libelle;
 		this.tauxSalarial = tauxSalarial;
diff --git a/src/test/java/dev/paie/service/CotisationServiceJpaTest.java b/src/test/java/dev/paie/service/CotisationServiceJpaTest.java
index 160e012..cb165a1 100644
--- a/src/test/java/dev/paie/service/CotisationServiceJpaTest.java
+++ b/src/test/java/dev/paie/service/CotisationServiceJpaTest.java
@@ -26,7 +26,7 @@
 	@Test
 	public void test_sauvegarder_lister_mettre_a_jour() {
 
-		cotisation = new Cotisation(new Integer(1), "EP50", "l", new BigDecimal("0.54045"), new BigDecimal("0.1478"));
+		cotisation = new Cotisation("EP50", "l", new BigDecimal("0.54045"), new BigDecimal("0.1478"));
 
 		cotisationService.supprimer();

dta-sherlock-sirh-gestion-paie-384760371-20180528-160928

Branch associated with the failure: repairnator-repairnator-experiments-dta-sherlock-sirh-gestion-paie-384760371-20180528-160928-firstCommit

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
java.lang.NullPointerException AvantageRepositoryTest.java Avantage.java

Kali patch:

--- /src/main/java/dev/paie/entite/Avantage.java
+++ /src/main/java/dev/paie/entite/Avantage.java
@@ -46,7 +46,6 @@
 	}
 
 	public void setId(java.lang.Integer id) {
-		this.id = id;
 	}
 
 	public boolean equals(dev.paie.entite.Avantage av) {
  • Overview: The problem is related to a NullPointerException that is thrown by the program during the execution of a test case. This NullPointerExcption is generated because Hibernate save a new record with a different ID from what the developer expects in the test case.

  • Reason why the patch has been generated: jKali managed to create a patch because it removes the instruction to assign the ID. Since the test case doesn't check if the ID of the new record is not null, jKali is able to create the patch. Adding for example this assertion assertNotNull(avantage.getId());, it allows to avoid the creation of the Kali patch.

  • Useful information for the developer: The developer can understand that there is a problem with the variable id used to assign the primary key to the new records. Indeed, to fix the error, the developer removed the annotation @GeneratedValue(strategy = GenerationType.IDENTITY) associated with the variable id. GenerationType.IDENTITY is associated with auto_increment of MySQL (https://stackoverflow.com/a/20605392/4255576).

Human fix:

From d81b4ef14fe1137c6c087d18b436fffe03c7cd72 Mon Sep 17 00:00:00 2001
From: Gauthier Puertas <[email protected]>
Date: Mon, 28 May 2018 16:11:56 +0200
Subject: =?UTF-8?q?Suppression=20g=C3=A9n=C3=A9ration=20ID=20pour?=
 =?UTF-8?q?=20avantage?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/main/java/dev/paie/entite/Avantage.java | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/main/java/dev/paie/entite/Avantage.java b/src/main/java/dev/paie/entite/Avantage.java
index febeacf..506ed08 100644
--- a/src/main/java/dev/paie/entite/Avantage.java
+++ b/src/main/java/dev/paie/entite/Avantage.java
@@ -4,15 +4,12 @@
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
 import javax.persistence.Id;
 
 @Entity
 public class Avantage {
 
 	@Id
-	@GeneratedValue(strategy = GenerationType.IDENTITY)
 	@Column(name = "id_avantage", unique = true, nullable = false)
 	private Integer id;

nilsreiter-CorefAnnotator-354919174-20180318-063510

Branch associated with the failure: repairnator-repairnator-experiments-nilsreiter-CorefAnnotator-354919174-20180318-063510-firstCommit

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
java.lang.NullPointerException TestCoreferenceModelLoader.java EntityTreeModel.java

Kali patch:

--- /src/main/java/de/unistuttgart/ims/coref/annotator/document/EntityTreeModel.java
+++ /src/main/java/de/unistuttgart/ims/coref/annotator/document/EntityTreeModel.java
@@ -14,7 +14,6 @@
 		super(new de.unistuttgart.ims.coref.annotator.CATreeNode(null, de.unistuttgart.ims.coref.annotator.Annotator.getString("tree.root")));
 		this.coreferenceModel = docMod;
 		this.coreferenceModel.addCoreferenceModelListener(this);
-		this.initialise();
 		this.resort();
 	}

vitorenesduarte-VCD-java-client-373018834-20180430-144835

Branch associated with the failure: repairnator-repairnator-experiments-vitorenesduarte-VCD-java-client-373018834-20180430-144835-firstCommit

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
java.lang.OutOfMemoryError DependencyQueueTest.java DependencyQueue.java

Kali patch:

--- /src/main/java/org/imdea/vcd/queue/DependencyQueue.java
+++ /src/main/java/org/imdea/vcd/queue/DependencyQueue.java
@@ -64,7 +64,6 @@
 		org.imdea.vcd.queue.DependencyQueue.Node<E> it = first;
 		while (it != null) {
 			if (e.before(it.item)) {
-				return it;
 			}
 			it = it.next;
 		} 

vitorenesduarte-VCD-java-client-373043004-20180430-155241

Branch associated with the failure: repairnator-repairnator-experiments-vitorenesduarte-VCD-java-client-373043004-20180430-155241-firstCommit

Information about the failure:

Error type Erroring test case Changed file by AstorJKali
java.lang.OutOfMemoryError DependencyQueueTest.java DependencyQueue.java

Kali patch:

--- /src/main/java/org/imdea/vcd/queue/DependencyQueue.java
+++ /src/main/java/org/imdea/vcd/queue/DependencyQueue.java
@@ -63,7 +63,6 @@
 		org.imdea.vcd.queue.DependencyQueue.Node<E> it = first;
 		while (it != null) {
 			if (e.before(it.item)) {
-				return it;
 			}
 			it = it.next;
 		} 

vlingo-vlingo-actors-415654258-20180813-233512

Branch associated with the failure: repairnator-repairnator-experiments-vlingo-vlingo-actors-415654258-20180813-233512-firstCommit

Information about the failure:

Error type Detail Erroring test case Changed file by AstorJKali
java.lang.Exception Test timed out after 1000 milliseconds ActorStopTest.java ConcurrentQueueMailbox.java

Kali patch:

--- /src/main/java/io/vlingo/actors/plugin/mailbox/concurrentqueue/ConcurrentQueueMailbox.java
+++ /src/main/java/io/vlingo/actors/plugin/mailbox/concurrentqueue/ConcurrentQueueMailbox.java
@@ -12,7 +12,6 @@
 
 	public void close() {
 		queue.clear();
-		dispatcher.close();
 	}
 
 	@java.lang.Override

Hellojungle-rocketmq-421420531-20180828-082343

Branch associated with the failure: repairnator-repairnator-experiments-Hellojungle-rocketmq-421420531-20180828-082343-firstCommit

--- /src/main/java/org/apache/rocketmq/client/log/ClientLogger.java
+++ /src/main/java/org/apache/rocketmq/client/log/ClientLogger.java
@@ -76,7 +76,7 @@
 	}
 
 	public static org.slf4j.Logger getLog() {
-		if (org.apache.rocketmq.client.log.ClientLogger.log == null) {
+		if (true) {
 			org.apache.rocketmq.client.log.ClientLogger.log = org.apache.rocketmq.client.log.ClientLogger.createLogger(org.apache.rocketmq.common.constant.LoggerName.CLIENT_LOGGER_NAME);
 			return org.apache.rocketmq.client.log.ClientLogger.log;
 		} else {

apache-twill-356030973-20180320-212647

Branch associated with the failure: repairnator-repairnator-experiments-apache-twill-356030973-20180320-212647-firstCommit

Human fix: https://github.com/apache/twill/compare/8f70aa4d4924...ee4d13701b21

Information about the failure:

Error type Details Erroring test case Changed file by AstorJKali
java.lang.Exception test timed out after 120000 milliseconds ZKClientTest.java InMemoryZKServer.java

Kali Patch:

--- /src/main/java/org/apache/twill/internal/zookeeper/InMemoryZKServer.java
+++ /src/main/java/org/apache/twill/internal/zookeeper/InMemoryZKServer.java
@@ -67,7 +67,7 @@
 
 	private java.net.InetSocketAddress getAddress(int port) {
 		int socketPort = (port < 0) ? 0 : port;
-		if (java.lang.Boolean.parseBoolean(java.lang.System.getProperties().getProperty("twill.zk.server.localhost", "true"))) {
+		if (false) {
 			return new java.net.InetSocketAddress(java.net.InetAddress.getLoopbackAddress(), socketPort);
 		} else {
 			return new java.net.InetSocketAddress(socketPort);

chtyim-twill-356031025-20180320-212226

Branch associated with the failure: repairnator-repairnator-experiments-chtyim-twill-356031025-20180320-212226-firstCommit

Information about the failure:

Error type Details Erroring test case Changed file by AstorJKali
java.lang.Exception Test timed out after 120000 milliseconds ZKClientTest.java InMemoryZKServer.java
  • Kali patch
--- /src/main/java/org/apache/twill/internal/zookeeper/InMemoryZKServer.java
+++ /src/main/java/org/apache/twill/internal/zookeeper/InMemoryZKServer.java
@@ -67,7 +67,7 @@
 
 	private java.net.InetSocketAddress getAddress(int port) {
 		int socketPort = (port < 0) ? 0 : port;
-		if (java.lang.Boolean.parseBoolean(java.lang.System.getProperties().getProperty("twill.zk.server.localhost", "true"))) {
+		if (false) {
 			return new java.net.InetSocketAddress(java.net.InetAddress.getLoopbackAddress(), socketPort);
 		} else {
 			return new java.net.InetSocketAddress(socketPort);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published