-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ff9ef7
commit 581db54
Showing
3 changed files
with
125 additions
and
0 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
68 changes: 68 additions & 0 deletions
68
...ntrib/src/test/resources/tech/picnic/errorprone/bugpatterns/MethodTemplatesTestInput.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,68 @@ | ||
package tech.picnic.errorprone.bugpatterns; | ||
|
||
import java.util.stream.Collectors; | ||
|
||
final class MethodTemplateTest implements RefasterTemplateTestCase { | ||
String testObjectReturn() { | ||
String var = "Hello!"; | ||
return var; | ||
} | ||
|
||
byte testByteReturn() { | ||
byte var = Byte.MAX_VALUE; | ||
return var; | ||
} | ||
|
||
char testCharacterReturn() { | ||
char var = Character.MAX_VALUE; | ||
return var; | ||
} | ||
|
||
short testShortReturn() { | ||
short var = Short.MAX_VALUE; | ||
return var; | ||
} | ||
|
||
int testIntegerReturn() { | ||
int var = Integer.MAX_VALUE; | ||
return var; | ||
} | ||
|
||
long testLongReturn() { | ||
long var = 349827359L; | ||
return var; | ||
} | ||
|
||
float testFloatReturn() { | ||
float var = 4324.347284F; | ||
return var; | ||
} | ||
|
||
double testDoubleReturn() { | ||
double var = 3492.34284D; | ||
return var; | ||
} | ||
|
||
boolean testBooleanReturn() { | ||
boolean var = true; | ||
return var; | ||
} | ||
|
||
String testStuffAboveDoesntMatter() { | ||
System.out.println("Hi"); | ||
String var = "Hello!"; | ||
return var; | ||
} | ||
|
||
String testStuffBelowDoesMatter() { | ||
String var = "Hello!"; | ||
System.out.println("Hi"); | ||
return var; | ||
} | ||
|
||
String testChainedReturn() { | ||
String var = | ||
Stream.of("I", "like", "error-prone", ":-)").collect(Collectors.joining(" ", "", "!")); | ||
return var; | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...trib/src/test/resources/tech/picnic/errorprone/bugpatterns/MethodTemplatesTestOutput.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,56 @@ | ||
package tech.picnic.errorprone.bugpatterns; | ||
|
||
import java.util.stream.Collectors; | ||
|
||
final class MethodTemplateTest implements RefasterTemplateTestCase { | ||
String testObjectReturn() { | ||
return "Hello!"; | ||
} | ||
|
||
byte testByteReturn() { | ||
return Byte.MAX_VALUE; | ||
} | ||
|
||
char testCharacterReturn() { | ||
return Character.MAX_VALUE; | ||
} | ||
|
||
short testShortReturn() { | ||
return Short.MAX_VALUE; | ||
} | ||
|
||
int testIntegerReturn() { | ||
return Integer.MAX_VALUE; | ||
} | ||
|
||
long testLongReturn() { | ||
return 349827359L; | ||
} | ||
|
||
float testFloatReturn() { | ||
return 4324.347284F; | ||
} | ||
|
||
double testDoubleReturn() { | ||
return 3492.34284D; | ||
} | ||
|
||
boolean testBooleanReturn() { | ||
return true; | ||
} | ||
|
||
String testStuffAboveDoesntMatter() { | ||
System.out.println("Hi"); | ||
return "Hello!"; | ||
} | ||
|
||
String testStuffBelowDoesMatter() { | ||
String var = "Hello!"; | ||
System.out.println("Hi"); | ||
return var; | ||
} | ||
|
||
String testChainedReturn() { | ||
return Stream.of("I", "like", "error-prone", ":-)").collect(Collectors.joining(" ", "", "!")); | ||
} | ||
} |