Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void bothMethodCalls() {
System.out.println("arrays are not equal!");
}
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -163,7 +163,7 @@ public void objectArray() {
System.out.println("arrays are not equal!");
}
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -232,7 +232,7 @@ public void secondArray() {
System.out.println("Objects are not equal!");
}
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -285,7 +285,7 @@ public void secondArray() {
System.out.println("arrays are not equal!");
}
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void varargsHashCodeOnMoreThanOneArg() {
// Arrays.deepHashCode(multidimensionalStringArray))
hashCode = Objects.hashCode(obj1, obj2, multidimensionalStringArray);
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -148,7 +148,7 @@ public void varagsHashCodeOnObjectOrStringArray() {
hashCode = Objects.hashCode(objArray);
hashCode = Objects.hashCode((Object[]) stringArray);
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -195,7 +195,7 @@ public void varagsHashCodeOnObjectOrStringArray() {
hashCode = Objects.hash(objArray);
hashCode = Objects.hash((Object[]) stringArray);
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void arrayOfArrays() {
// BUG: Diagnostic contains: Arrays.deepToString(a)
System.out.println(a);
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -130,7 +130,7 @@ public void objectEquals() {
System.out.println("string is not empty!");
}
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -307,7 +307,7 @@ public void stringVariableAddsArrayAndAssigns() {
// BUG: Diagnostic contains: += Arrays.toString(a)
b += a;
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -335,7 +335,7 @@ public void concatenateCompoundAssign_int() {
String b = " a string ";
b += a;
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -366,7 +366,7 @@ public void stringLiteralRightOperandIsArray() {
// BUG: Diagnostic contains: + Arrays.toString(a)
String b = "a string" + a;
}
}\
}
""")
.doTest();
}
Expand All @@ -393,7 +393,7 @@ public void notArray_refactored() {
String b = " a string";
String c = a + b;
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void assertTrue() {
public void assertFalseFromCondition() {
assert 0 == 1;
}
}\
}
""")
.doTest();
}
Expand All @@ -71,7 +71,7 @@ public void assertFalse() {
// BUG: Diagnostic contains: throw new AssertionError()
assert false;
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public ListenableFuture<Object> apply(String input) throws Exception {
interface MyNonAsyncFunction<I, O> {
ListenableFuture<O> apply(@Nullable I input) throws Exception;
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public int compare(File lhs, File rhs) {
return (int) (rhs.lastModified() - lhs.lastModified());
}
};
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -232,7 +232,7 @@ public char compare(byte n1, byte n2) {
return (char) (n1 - n2);
}
};
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void useNestedBuilder() {
new Builder();
}
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -501,7 +501,7 @@ ImmutableList.Builder returnRaw() {
void classLiteral() {
System.out.println(ImmutableList.Builder.class);
}
}\
}
""")
.doTest(TestMode.AST_MATCH);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void foo() {
// BUG: Diagnostic contains: (long) c >>> 32
result += c >>> 32;
}
}\
}
""")
.doTest();
}
Expand All @@ -105,7 +105,7 @@ public void foo() {
result += x >>> 3;
result += (long) (x & 0xff) >> 40;
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static final Class<?> methodHandlesDefineClass(byte[] bytes)
// BUG: Diagnostic contains: BanClassLoader
return MethodHandles.lookup().defineClass(bytes);
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -114,7 +114,7 @@ public final Class<?> overrideClassLoader() throws ClassNotFoundException {
private class NotClassLoader {
protected void loadClass() {}
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private Object subclassesJavaNamingcontext() throws NamingException {
// BUG: Diagnostic contains: BanJNDI
return c.lookup("hello");
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void array_precededByNotAValidMethod_isFlagged() {
// BUG: Diagnostic contains: ByteBuffer.array()
buff.array();
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -249,7 +249,7 @@ void array_inLambdaExpression_precededByByteBufferAllocate_isNotFlagged() {
return null;
};
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void method() {
// BUG: Diagnostic contains: Mockito cannot mock
FinalClass local = Mockito.mock(FinalClass.class);
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -102,7 +102,7 @@ static class NonFinalClass {}
public void method() {
NonFinalClass local = Mockito.mock(NonFinalClass.class);
}
}\
}
""")
.doTest();
}
Expand All @@ -125,7 +125,7 @@ static final class FinalClass {}
public void method() {
FinalClass local = Mockito.mock(FinalClass.class);
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Foo otherFoo() {
return this;
}
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -191,7 +191,7 @@ Foo otherFoo() {
return this;
}
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static class MultipleQueuedErrors {
enum Location {
TEST_TARGET
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -233,7 +233,7 @@ static class Varargs2 {
this("something");
}
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public static void ignoresCheck() {
check();
}
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -356,7 +356,7 @@ public void testMethodReference(boolean predicate) {
callSupplier(this::mustCheck);
callSupplier(predicate ? this::mustCheck : this::nothingToCheck);
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ int localMethod() {
}
}
}
}\
}
""")
.setArgs("--release", "11")
.doTest();
Expand All @@ -137,7 +137,7 @@ public class ClassCanBeStaticPositiveCase1 {
class Inner1 {
int innerVar;
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -168,7 +168,7 @@ int localMethod(int outerVar2) {
return outerVar2;
}
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void test(FooBar<Integer> foo) {
class FooBar<T> extends HashSet<String> {}

class Foo<T> extends HashSet<T> {}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -142,7 +142,7 @@ Integer[] toArray(Integer[] someArray) {
return new Integer[10];
}
}
}\
}
""")
.doTest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void accept(Builder<Object> objectBuilder, Object o) {
(left, right) -> left.addAll(right.build()),
ImmutableList.Builder::build);
}
}\
}
""")
.doTest();
}
Expand Down Expand Up @@ -127,7 +127,7 @@ public void accept(Builder<Object> objectBuilder, Object o) {
(left, right) -> left.addAll(right.build()),
ImmutableList.Builder::build);
}
}\
}
""")
.doTest();
}
Expand Down
Loading
Loading