This code gives a false positive for a DLS error.
import java.text.Format;
import java.text.MessageFormat;
import java.util.Date;
public final class X
{
public static void main(String[] args)
{
final String copyrightFmt = "Copyright (C)
{0,date,yyyy}, Avaya Inc.";
final Format copyrightFormatter = new
MessageFormat(copyrightFmt);
System.err.println(copyrightFormatter.format(new
Date()));
}
}
I get this error when I shouldn't get any.
EXP: DLS: Dead store to local variable in method X.main
(String[])
...
At X.java:[line 10]
Logged In: NO
This is with 0.8.5
Logged In: YES
user_id=66596
Thanks for the report. Yes this is a known problem with final
variables. Unfortunately the byte code generated makes it
difficult to detect live final variable stores, and the final
attribute isn't a class file attribute. This is why the detector
is disabled, by default.
When i use it, i mentally ignore any reports on final variables.