[java] MethodReturnsInternalArray - add test case (#3630)
This commit is contained in:
@ -454,6 +454,28 @@ public interface Outer {
|
||||
String [] arr;
|
||||
String [] getArr() {return arr;}
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>[java] MethodReturnsInternalArray doesn't consider anonymous classes #3630</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<expected-linenumbers>7</expected-linenumbers>
|
||||
<code><![CDATA[
|
||||
public class Outer {
|
||||
private static final String[] names = new String[] {"a", "b"};
|
||||
public static Provider getProvider() {
|
||||
return new Provider() {
|
||||
@Override
|
||||
public String[] getNames() {
|
||||
return names;
|
||||
}
|
||||
};
|
||||
}
|
||||
public interface Provider {
|
||||
String[] getNames();
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
Reference in New Issue
Block a user