You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: This new rule would flag instances of code that explicitly creates an array when calling a varargs method. This is more heavy to read and could be simplified.
I think this new rule may only be written in pmd 7, because type resolution in pmd 6 does not expose information about the called method.
Code Sample:
List<String> strings = Arrays.asList(newString[] { "a", "b", }); // flagged by the rulestrings = Arrays.asList("a", "b"); // ok
Arrays.asList(someVariable) // ok
Possible Properties:
Should this rule be customizable via properties? No need
The text was updated successfully, but these errors were encountered:
Proposed Rule Name: UnnecessaryVarargsArrayCreation
Proposed Category:
Code StyleBest PracticesDescription: This new rule would flag instances of code that explicitly creates an array when calling a varargs method. This is more heavy to read and could be simplified.
I think this new rule may only be written in pmd 7, because type resolution in pmd 6 does not expose information about the called method.
Code Sample:
Possible Properties:
The text was updated successfully, but these errors were encountered: