Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantCollectionOperation/beforeContainsRemoveAndAnd.java
Bas Leijdekkers e310b0c94c inspection warning text improvements
GitOrigin-RevId: 9aaad61ae52463727c77930af532258ea16dd1da
2020-09-04 10:23:25 +00:00

11 lines
280 B
Java

// "Remove 'contains()' check" "true"
import java.util.List;
class Test {
void test(List<String> list, String key) {
if(key !=/*nullcheck*/ null && !key./*check*/isEmpty() && /*and*/ list.co<caret>ntains(/*key*/key//line comment
)) {
list.remove(key);
}
}
}