|
|
@ -13,14 +13,14 @@
|
|
|
|
<test-code>
|
|
|
|
<test-code>
|
|
|
|
<description>sets-UnsupportedExceptionWithModifyAsListRule-ok.</description>
|
|
|
|
<description>sets-UnsupportedExceptionWithModifyAsListRule-ok.</description>
|
|
|
|
<expected-problems>0</expected-problems>
|
|
|
|
<expected-problems>0</expected-problems>
|
|
|
|
<code-ref id="sets-UnsupportedExceptionWithModifyAsListRule-ok" />
|
|
|
|
<code-ref id="sets-UnsupportedExceptionWithModifyAsListRule-ok"/>
|
|
|
|
</test-code>
|
|
|
|
</test-code>
|
|
|
|
|
|
|
|
|
|
|
|
<code-fragment id="sets-UnsupportedExceptionWithModifyAsListRule-warn"><![CDATA[
|
|
|
|
<code-fragment id="sets-UnsupportedExceptionWithModifyAsListRule-warn"><![CDATA[
|
|
|
|
public class Foo {
|
|
|
|
public class Foo {
|
|
|
|
private void method1() {
|
|
|
|
private void method1() {
|
|
|
|
if(true){
|
|
|
|
if (true) {
|
|
|
|
List<String> list = Arrays.asList("a","b","c");
|
|
|
|
List<String> list = Arrays.asList("a", "b", "c");
|
|
|
|
list.add("d");
|
|
|
|
list.add("d");
|
|
|
|
list.remove("22");
|
|
|
|
list.remove("22");
|
|
|
|
list.clear();
|
|
|
|
list.clear();
|
|
|
@ -31,8 +31,8 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void method2() {
|
|
|
|
private void method2() {
|
|
|
|
if(true){
|
|
|
|
if (true) {
|
|
|
|
List<String> list = Arrays.asList("a","b","c");
|
|
|
|
List<String> list = Arrays.asList("a", "b", "c");
|
|
|
|
list.add("d");
|
|
|
|
list.add("d");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<String> list = new ArrayList<String>();
|
|
|
|
List<String> list = new ArrayList<String>();
|
|
|
@ -46,7 +46,7 @@
|
|
|
|
<description>sets-UnsupportedExceptionWithModifyAsListRule-warn.</description>
|
|
|
|
<description>sets-UnsupportedExceptionWithModifyAsListRule-warn.</description>
|
|
|
|
<expected-problems>4</expected-problems>
|
|
|
|
<expected-problems>4</expected-problems>
|
|
|
|
<expected-linenumbers>5,6,7,17</expected-linenumbers>
|
|
|
|
<expected-linenumbers>5,6,7,17</expected-linenumbers>
|
|
|
|
<code-ref id="sets-UnsupportedExceptionWithModifyAsListRule-warn" />
|
|
|
|
<code-ref id="sets-UnsupportedExceptionWithModifyAsListRule-warn"/>
|
|
|
|
</test-code>
|
|
|
|
</test-code>
|
|
|
|
|
|
|
|
|
|
|
|
</test-data>
|
|
|
|
</test-data>
|