【发布时间】:2013-05-20 09:22:01
【问题描述】:
Sonar 正在给我信息:
恶意代码漏洞 - 字段应该被包保护 静态数组
FORMATS.
为什么这段代码被认为是恶意的?我有一个公共类来存储所有常量。
public class Constants
{
/*
all the public static final constants of primitive datatypes for which
there is no sonar warning.
*/
public static final String[] FORMATS = new String[] {
"yyyy-MM-dd HH:mm:ss.S z",
"yyyy-MM-dd HH:mm:ss.S"
}
【问题讨论】: