Fix UseObjectForClearerAPI rule that treated String and String[] the same
This commit is contained in:
@ -1639,7 +1639,7 @@ your API.
|
||||
<value>
|
||||
<![CDATA[
|
||||
//MethodDeclaration[@Public = 'true']/MethodDeclarator/FormalParameters[
|
||||
count(FormalParameter/Type/ReferenceType/ClassOrInterfaceType[@Image = 'String']) > 3
|
||||
count(FormalParameter/Type/ReferenceType/ClassOrInterfaceType[@Image = 'String' and @Array = 'false']) > 3
|
||||
]
|
||||
]]>
|
||||
</value>
|
||||
|
@ -86,6 +86,26 @@ public class MyClass {
|
||||
String databaseAdress)
|
||||
{
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</code>
|
||||
</test-code>
|
||||
<test-code>
|
||||
<description>
|
||||
<![CDATA[
|
||||
String[] should not be treated as String
|
||||
]]>
|
||||
</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code>
|
||||
<![CDATA[
|
||||
public class MyClass {
|
||||
public void connectProtected(String username,
|
||||
String[] pssd,
|
||||
String databaseName,
|
||||
String databaseAdress)
|
||||
{
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</code>
|
||||
|
Reference in New Issue
Block a user