ADDITIONAL SYSTEM INFORMATION :
Linux x64
OpenJDK 8 u282 b08 for x64
A DESCRIPTION OF THE PROBLEM :
javac launched with -Werror -Xlint -Xdoclint:all/package raises a false warning "no comment" on a variable declared in a static initialization block.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create the following class
/**
* Class to demo a Xdoclint bug.
*/
public class Foo {
static {
int i = 0;
}
}
2. run javac as follows
javac -Werror -Xlint -Xdoclint:all/package Foo.java
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compilation succeeds.
ACTUAL -
Foo.java:6: warning: no comment
int i = 0;
^
error: warnings found and -Werror specified
1 error
1 warning
---------- BEGIN SOURCE ----------
/**
* Class to demo a Xdoclint bug.
*/
public class Foo {
static {
int i = 0;
}
}
---------- END SOURCE ----------
FREQUENCY : always
Linux x64
OpenJDK 8 u282 b08 for x64
A DESCRIPTION OF THE PROBLEM :
javac launched with -Werror -Xlint -Xdoclint:all/package raises a false warning "no comment" on a variable declared in a static initialization block.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create the following class
/**
* Class to demo a Xdoclint bug.
*/
public class Foo {
static {
int i = 0;
}
}
2. run javac as follows
javac -Werror -Xlint -Xdoclint:all/package Foo.java
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compilation succeeds.
ACTUAL -
Foo.java:6: warning: no comment
int i = 0;
^
error: warnings found and -Werror specified
1 error
1 warning
---------- BEGIN SOURCE ----------
/**
* Class to demo a Xdoclint bug.
*/
public class Foo {
static {
int i = 0;
}
}
---------- END SOURCE ----------
FREQUENCY : always
- duplicates
-
JDK-8194069 doclint throws missing comment warnings on lines which can't even have javadoc
- Resolved
- relates to
-
JDK-8265253 javac -Xdoclint:all gives "no comment" warning for code that can't be commented
- Resolved