So I have below line of code in my file
List<String> nameList = new ArrayList<String>();
Now each time I run sonar scans it shows an error in above line saying I should use diamond operator instead. Now I understand that from Java7 compiler will automatically detect and supply the type of objects for ArrayList but my question is there a harm if I do it myself while declaring the class ?
Here is the rule link from Sonar website. I really don't understand the example they are supplying with this rule.
Is there any performance, efficiency or any other type of gain in changing the code to what Sonar is suggesting ?