As I installed Sonarlint plugin in my eclipse IDE, i got the above (Heading) Major Issue in Sonar Report.
The Code is:
public class Demo
{
public static final Map<String, String> CARD_TYPES;
static
{
CARD_TYPES = new HashMap<String, String>()
{
{ //Move the contents of this initializer to a standard constructor or to field* initializers
put("visa", "001");
put("diner", "002");
}
};
}
//..code goes here
}
The Query is: what exactly should be done in above Static Block, to Resolve the above issue ?