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
Copy file name to clipboardExpand all lines: pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConfusingArgumentToVarargsMethodRule.java
Copy file name to clipboardExpand all lines: pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ConfusingArgumentToVarargsMethod.xml
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -106,4 +106,40 @@
106
106
]]></code>
107
107
</test-code>
108
108
109
+
110
+
<test-code>
111
+
<description>#5070 Types of args are unresolved</description>
112
+
<expected-problems>1</expected-problems>
113
+
<expected-linenumbers>7</expected-linenumbers>
114
+
<code><![CDATA[
115
+
public class Foo {
116
+
static {
117
+
// if we don't know the type of ARRAY we should not report a violation
118
+
foo(Somewhere.ARRAY);
119
+
// here we know the type is Unknown[] even if Unknown is unresolved,
120
+
// we know it's not Object[] so we report
121
+
foo(UNKNOWN);
122
+
}
123
+
static Unknown[] UNKNOWN;
124
+
static void foo(Object... args) {}
125
+
}
126
+
]]></code>
127
+
</test-code>
128
+
129
+
130
+
<test-code>
131
+
<description>#5070 Types of args is array of unknown</description>
0 commit comments