Details
-
Enhancement
-
Resolution: Unresolved
-
P5
-
5.0
-
x86
-
windows_xp
Description
A DESCRIPTION OF THE REQUEST :
The @SuppressWarning annotation allows the developer to suppress warnings of a particular category
This enhancement requests that sun add an additional command qualified to the javac command, to allow the compiler to emit more detailed messaged which would otherwise be suppressed
JUSTIFICATION :
When a developer writes some code and suppresses warning witth the @SuppressWarning annotation then the details of the warnign are not produced.
For code review purposes it would be useful to disable this suppression for the the reviewees can see the warning, and assess the risk, and perhaps change the code (or some other library) so as to eliminate the warning, and therefore the need for the suppression
Also if a method is marked with @SuppressWarnings("unchecked") to cater for some API limitation. If then subsiquently the code is modified to add some additional feature (which through some coding error) has some other unchecked warning, then the warning will not be masked.
As the annotation refers to the method, not the line then there s no easy was to detect this
If a facility like this enhancement was implemented then the QA of the code could comple the code with this suppression disabled and the detect that the cont of suppressed warnings has changed, and investigate further
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
javac -XdisableSuppressedWarnings -Xlint ....
Warning ..... [unchecked] ...
or
javac -XsuppressedWarningsAsNotes -Xlint ....
Note ... [unchecked] ....
ACTUAL -
javac -Xlint ....
Note: ... uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
(when lint was actually specified
CUSTOMER SUBMITTED WORKAROUND :
checkout code
delete all @suppress warnings
compile
checkout code
make changes
checkin code
and repeat ...
The @SuppressWarning annotation allows the developer to suppress warnings of a particular category
This enhancement requests that sun add an additional command qualified to the javac command, to allow the compiler to emit more detailed messaged which would otherwise be suppressed
JUSTIFICATION :
When a developer writes some code and suppresses warning witth the @SuppressWarning annotation then the details of the warnign are not produced.
For code review purposes it would be useful to disable this suppression for the the reviewees can see the warning, and assess the risk, and perhaps change the code (or some other library) so as to eliminate the warning, and therefore the need for the suppression
Also if a method is marked with @SuppressWarnings("unchecked") to cater for some API limitation. If then subsiquently the code is modified to add some additional feature (which through some coding error) has some other unchecked warning, then the warning will not be masked.
As the annotation refers to the method, not the line then there s no easy was to detect this
If a facility like this enhancement was implemented then the QA of the code could comple the code with this suppression disabled and the detect that the cont of suppressed warnings has changed, and investigate further
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
javac -XdisableSuppressedWarnings -Xlint ....
Warning ..... [unchecked] ...
or
javac -XsuppressedWarningsAsNotes -Xlint ....
Note ... [unchecked] ....
ACTUAL -
javac -Xlint ....
Note: ... uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
(when lint was actually specified
CUSTOMER SUBMITTED WORKAROUND :
checkout code
delete all @suppress warnings
compile
checkout code
make changes
checkin code
and repeat ...