-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from LoiNguyenCS/delete-comments
removing comments from input codes
- Loading branch information
Showing
11 changed files
with
65 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/test/java/org/checkerframework/specimin/RemovingCommentsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.checkerframework.specimin; | ||
|
||
import java.io.IOException; | ||
import org.junit.Test; | ||
|
||
/** This test checks that if Specimin will remove comments from the input code */ | ||
public class RemovingCommentsTest { | ||
@Test | ||
public void runTest() throws IOException { | ||
SpeciminTestExecutor.runTestWithoutJarPaths( | ||
"removingcomments", | ||
new String[] {"com/example/Simple.java"}, | ||
new String[] {"com.example.Simple#test()"}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/test/resources/innerclass/expected/com/example/Maternal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
package com.example; | ||
|
||
public class Maternal { | ||
|
||
public String maternalLastName = null; | ||
} |
6 changes: 4 additions & 2 deletions
6
src/test/resources/innerclass/expected/com/example/OuterFamily.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
package com.example; | ||
|
||
class OuterFamily extends Maternal { | ||
|
||
class InnerFamily extends Paternal { | ||
|
||
public String getLastName() { | ||
return paternalLastName; | ||
} | ||
} | ||
// point A | ||
|
||
public String getLastName() { | ||
return maternalLastName; | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
src/test/resources/innerclass/expected/com/example/Paternal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
package com.example; | ||
|
||
public class Paternal { | ||
|
||
public String paternalLastName = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
package an.old.library; | ||
|
||
public class Book { | ||
|
||
public Book(int parameter0) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/resources/onefilesimple/expected/com/example/Simple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package com.example; | ||
|
||
class Simple { | ||
// Target method. | ||
|
||
void bar() { | ||
Object obj = new Object(); | ||
obj = baz(obj); | ||
|
13 changes: 13 additions & 0 deletions
13
src/test/resources/removingcomments/expected/com/example/Simple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.example; | ||
|
||
class Simple { | ||
|
||
static int returnTen() { | ||
throw new Error(); | ||
} | ||
|
||
static void test() { | ||
int y = returnTen(); | ||
Simple s = new Simple(); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/test/resources/removingcomments/input/com/example/Simple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.example; | ||
|
||
class Simple { | ||
static int returnFive() { | ||
return 5; | ||
} | ||
static int returnTen() { | ||
return returnFive() * 2; | ||
} | ||
|
||
/** | ||
* This method is used to test if the comments (including Javadoc) are all removed by Specimin | ||
*/ | ||
static void test() { | ||
// the comment here should be removed | ||
int y = returnTen(); | ||
Simple s = new Simple(); | ||
} | ||
} |