A DESCRIPTION OF THE PROBLEM :
I expect javac -Xlint:-fallthrough to disable fallthrough *and turn on linting*.
javac -Xlint:-fallthrough
does nothing. I must use
javac -Xlint:all,-fallthrough
or
javac -Xlint -Xlint:-fallthrough
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Make a Java file with a switch with fallthrough and another warning that -Xlint should catch. Run
javac -Xlint:-fallthrough Test.java
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The other warning is displayed, lossy-conversion in the example below.
ACTUAL -
Nothing is displayed
---------- BEGIN SOURCE ----------
public class Test {
public static void main(String[] args) {
int x = 0;
x += 3.5;
switch (x) {
case 0: x++;
default: x++;
}
}
}
---------- END SOURCE ----------
I expect javac -Xlint:-fallthrough to disable fallthrough *and turn on linting*.
javac -Xlint:-fallthrough
does nothing. I must use
javac -Xlint:all,-fallthrough
or
javac -Xlint -Xlint:-fallthrough
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Make a Java file with a switch with fallthrough and another warning that -Xlint should catch. Run
javac -Xlint:-fallthrough Test.java
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The other warning is displayed, lossy-conversion in the example below.
ACTUAL -
Nothing is displayed
---------- BEGIN SOURCE ----------
public class Test {
public static void main(String[] args) {
int x = 0;
x += 3.5;
switch (x) {
case 0: x++;
default: x++;
}
}
}
---------- END SOURCE ----------
- csr for
-
JDK-8367018 Improve documentation for how the -Xlint flag works
-
- Provisional
-
- links to
-
Review(master) openjdk/jdk/27129