java/design/UseVargs - update changelog, extend test case
This commit is contained in:
@ -1766,9 +1766,13 @@ having to deal with the creation of an array.
|
||||
<priority>4</priority>
|
||||
<properties>
|
||||
<property name="xpath">
|
||||
<value><![CDATA[
|
||||
//FormalParameters/FormalParameter[position()=last() and @Array='true' and @Varargs='false' and not (./Type/ReferenceType/PrimitiveType[@Image='byte']) and not (./Type/PrimitiveType[@Image='byte'])]
|
||||
]]></value>
|
||||
<value><![CDATA[
|
||||
//FormalParameters/FormalParameter
|
||||
[position()=last()]
|
||||
[@Array='true']
|
||||
[@Varargs='false']
|
||||
[not (./Type/ReferenceType[@Array='true'][PrimitiveType[@Image='byte']] or ./Type/ReferenceType[@Array='true'][ClassOrInterfaceType[@Image='Byte']])]
|
||||
]]></value>
|
||||
</property>
|
||||
</properties>
|
||||
<example><![CDATA[
|
||||
|
@ -63,7 +63,7 @@ public class Foo implements InvocationHandler {
|
||||
|
||||
<test-code>
|
||||
<description><![CDATA[
|
||||
method, do not varargs, allow byte[] as not vargars
|
||||
method, do not varargs, allow byte[] as not varargs
|
||||
]]></description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
@ -72,5 +72,15 @@ public class Foo {
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description><![CDATA[
|
||||
method, do not varargs, allow Byte[] as not varargs
|
||||
]]></description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
public void bar(File file, Byte[] data) { }
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
</test-data>
|
||||
|
Reference in New Issue
Block a user