SonarQube 5.5 (with the sonar-java-plugin-3.13.1.jar
plugin) reports an issue on this code:
public class TimeA {
public static final SimpleDateFormat DATE_FORMATTER;
static {
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
df.setTimeZone(TimeZone.getTimeZone("GMT"));
DATE_FORMATTER=df;
}
}
The error message is Make "DATE_FORMATTER" an instance variable.
How can I avoid this SonarQube issue?