SmartBear / soapui

SoapUI is a free and open source cross-platform functional testing solution for APIs and web services.
http://www.soapui.org
Other
1.56k stars 607 forks source link

Fix sonar issue S2293 The diamond operator ('<>') should be used #804

Open jlerbsc opened 6 months ago

jlerbsc commented 6 months ago

https://rules.sonarsource.com/java/RSPEC-2293/

"Prior to Java 7, the type argument had to be provided explicitly for every occurrence where generics were used. This often caused redundancy, as the type argument would have to be provided both when a field is declared and initialized.

Java 7 introduced the diamond operator (<>) to reduce the code’s verbosity in some situations. The type argument between the angular brackets should be omitted if the compiler can infer it."

This code fix was made automatically by our Indepth solution. You can use it free of charge to correct other sonar issues.

https://www.indepth.fr

jlerbsc commented 6 months ago

We have also noticed that Indepth can also quickly correct the 105 violations of the rule "Collection.isEmpty() should be used to test for emptiness" as well as a large number of violations of the rule "'throws' declarations should not be superfluous". Now it's your turn.