File tree 2 files changed +39
-0
lines changed
main/java/com/github/codestickers
test/java/com/github/codestickers
2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .github .codestickers ;
2
+
3
+ import java .lang .annotation .*;
4
+
5
+ /**
6
+ * Annotation to show that some logic
7
+ * is just for the compiler to run without complaining
8
+ */
9
+
10
+ @ Retention (RetentionPolicy .CLASS )
11
+ @ Target ({ElementType .TYPE ,
12
+ ElementType .FIELD ,
13
+ ElementType .METHOD ,
14
+ ElementType .CONSTRUCTOR ,
15
+ ElementType .LOCAL_VARIABLE ,
16
+ ElementType .ANNOTATION_TYPE ,
17
+ ElementType .PACKAGE ,
18
+ ElementType .TYPE_PARAMETER ,
19
+ ElementType .TYPE_USE })
20
+ @ Documented
21
+ public @interface KeepTheCompilerHappy {
22
+ String value () default "" ;
23
+ }
24
+
Original file line number Diff line number Diff line change
1
+ package com .github .codestickers ;
2
+
3
+ public class KeepTheCompilerHappyTest {
4
+
5
+ @ KeepTheCompilerHappy ("Needs to return something when testing" )
6
+ public static String usesIsTestVariableForWhateverReason (boolean isTest ) {
7
+ if (isTest ) {
8
+ return "test" ;
9
+ } else {
10
+ return "important data" ;
11
+ }
12
+ }
13
+ }
14
+
15
+
You can’t perform that action at this time.
0 commit comments