Skip to content

Commit

Permalink
fixed false positives of NPEfix on repogit4test data
Browse files Browse the repository at this point in the history
  • Loading branch information
niloofartrg committed Jul 16, 2019
1 parent db52712 commit 471d01d
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 178 deletions.
168 changes: 0 additions & 168 deletions all_instances_found.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@
public class NPEfix extends AbstractRepairTool {

private static final String[] patternFileNames = {
"replacement.xml",
"replacement3.xml",
"replacement2.xml",
"replacement3.xml"
"replacement.xml",
"replacement4.xml",
"replacement5.xml",
"replacement6.xml",
"replacement7.xml",
"replacement8.xml",
"replacement9.xml",
"replacement11.xml"
};

/**
Expand Down
5 changes: 3 additions & 2 deletions src/main/resources/repairability/NPEfix/replacement.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<pattern name="replacement">
<entity id="1" type="*" />
<pattern name="replacement1">
<entity id="1" type="Assignment" />
<action entityId="1" type="INS"/>

</pattern>


7 changes: 7 additions & 0 deletions src/main/resources/repairability/NPEfix/replacement11.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<pattern name="replacement11">
<entity id="1" type="Literal"/>
<action entityId="1" type="UPD"/>

</pattern>


5 changes: 3 additions & 2 deletions src/main/resources/repairability/NPEfix/replacement2.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<pattern name="replacement">
<entity id="1" type="*"/>
<pattern name="replacement2">
<entity id="1" type="Assignment"/>
<action entityId="1" type="UPD"/>

</pattern>


2 changes: 1 addition & 1 deletion src/main/resources/repairability/NPEfix/replacement3.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<pattern name="replacement">
<pattern name="replacement3">
<entity id="1" type="Return" role="Statement"/>
<action entityId="1" type="INS"/>

Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/repairability/NPEfix/replacement4.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<pattern name="replacement4">
<entity id="1" type="Assignment" />
<action entityId="1" type="MOV"/>

</pattern>


7 changes: 7 additions & 0 deletions src/main/resources/repairability/NPEfix/replacement5.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<pattern name="replacement5">
<entity id="1" type="VariableRead" />
<action entityId="1" type="UPD"/>

</pattern>


10 changes: 10 additions & 0 deletions src/main/resources/repairability/NPEfix/replacement6.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<pattern name="replacement6">
<entity id="1" type="FieldRead"/>
<action entityId="1" type="INS"/>

<entity id="2" type="*"/>
<action entityId="2" type="DEL"/>

</pattern>


10 changes: 10 additions & 0 deletions src/main/resources/repairability/NPEfix/replacement7.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<pattern name="replacement7">
<entity id="1" type="FieldRead"/>
<action entityId="1" type="MOV"/>

<entity id="2" type="*"/>
<action entityId="2" type="DEL"/>

</pattern>


10 changes: 10 additions & 0 deletions src/main/resources/repairability/NPEfix/replacement8.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<pattern name="replacement8">
<entity id="1" type="Invocation"/>
<action entityId="1" type="INS"/>

<entity id="2" type="*"/>
<action entityId="2" type="DEL"/>

</pattern>


10 changes: 10 additions & 0 deletions src/main/resources/repairability/NPEfix/replacement9.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<pattern name="replacement9">
<entity id="1" type="VariableRead"/>
<action entityId="1" type="INS"/>

<entity id="2" type="*"/>
<action entityId="2" type="DEL"/>

</pattern>


Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void testRepairabilityInterface() throws Exception {
public void testRepairabilityAll() throws Exception {

FinalResult result = TestUtills.runRepairability("ALL", "/repairability_test_files/mixed/");
TestUtills.numberOfInstances(result, 2, 5);
TestUtills.numberOfInstances(result, 2, 3);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class NPEfixTest {
@Test
public void NPEfixTest() throws Exception {
FinalResult result = TestUtills.runRepairability("NPEfix", "/repairability_test_files/NPEfix/");
TestUtills.numberOfInstances(result, 18, 18);
TestUtills.numberOfInstances(result, 18, 16);
}

// @Test
Expand Down

0 comments on commit 471d01d

Please sign in to comment.