java: Inline expectation should have space before $

This commit is contained in:
Owen Mansel-Chan
2026-03-04 12:09:06 +00:00
parent ddebdad9e1
commit f41c30e335
11 changed files with 301 additions and 301 deletions

View File

@@ -1,12 +1,12 @@
@ThreadSafe
public class Escaping {
int x; //$ Alert
public int y = 0; //$ Alert
int x; // $ Alert
public int y = 0; // $ Alert
private int z = 3;
final int w = 0;
public final int u = 4;
private final long a = 5;
protected long b = 0; //$ Alert
protected long b = 0; // $ Alert
protected final long c = 0L;
volatile long d = 3;
protected volatile long e = 3L;
@@ -14,4 +14,4 @@ public class Escaping {
public void methodLocal() {
int i;
}
}
}

View File

@@ -2,19 +2,19 @@
public class SafePublication {
int x;
int y = 0;
int z = 3; //$ Alert
int w; //$ Alert
int u; //$ Alert
int z = 3; // $ Alert
int w; // $ Alert
int u; // $ Alert
long a;
long b = 0;
long c = 0L;
long d = 3; //$ Alert
long e = 3L; //$ Alert
long d = 3; // $ Alert
long e = 3L; // $ Alert
int[] arr = new int[3]; //$ Alert
int[] arr = new int[3]; // $ Alert
float f = 0.0f;
double dd = 00.0d;
char cc = 'a'; //$ Alert
char cc = 'a'; // $ Alert
char ok = '\u0000';
public SafePublication(int a) {
@@ -26,4 +26,4 @@ public class SafePublication {
public void methodLocal() {
int i;
}
}
}

View File

@@ -8,10 +8,10 @@ public class Test3Super extends Test2 { // We might want an alert here for the
}
public void y() {
super.x = 0; //$ MISSING: Alert
super.x = 0; // $ MISSING: Alert
}
public void yLst() {
super.lst.add("Hello!"); //$ MISSING: Alert
super.lst.add("Hello!"); // $ MISSING: Alert
}
}