We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Affects PMD Version: 7.0.0
Rule: ArrayIsStoredDirectly
Description:
The original array could be modified, even though we use it in an enum constant.
Code Sample demonstrating the issue:
import java.util.Arrays; public class ArrayIsStoredDirectlyTest { public void testEnum() { System.out.println(Test.A); System.out.println(Test.B); System.out.println(Test.C); strings[1] = "modified"; System.out.println(Test.C); } public static String[] strings = new String[]{"a", "b"}; public enum Test { A("a"), B("b".toUpperCase()), C(strings); private final String[] a; Test(String ... args) { a = args; // <---- violation expected here } @Override public String toString() { return super.toString() + ":" + Arrays.toString(a); } } }
Expected outcome:
PMD should report a violation at line ..., but doesn't. This is a false-negative.
References:
Related to #1413
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Affects PMD Version: 7.0.0
Rule: ArrayIsStoredDirectly
Description:
The original array could be modified, even though we use it in an enum constant.
Code Sample demonstrating the issue:
Expected outcome:
PMD should report a violation at line ..., but doesn't. This is a false-negative.
References:
Related to #1413
The text was updated successfully, but these errors were encountered: