mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RedundantUnmodifiableInspection created: IDEA-202309
GitOrigin-RevId: d5a5e1f45ba0f6e0af786ca588caaa192cd4b554
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a89e02f7f0
commit
6fbd744430
+35
@@ -0,0 +1,35 @@
|
||||
// "Fix all 'Redundant usage of unmodifiable collection factories' problems in file" "true"
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
getEmptyList();
|
||||
|
||||
getEmptyList();
|
||||
getEmptySet();
|
||||
getEmptyMap();
|
||||
|
||||
getEmptySet();
|
||||
getEmptyMap();
|
||||
|
||||
getEmptySet();
|
||||
getEmptyMap();
|
||||
}
|
||||
|
||||
static List getEmptyList() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
static Set getEmptySet() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
static Map getEmptyMap() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// "Fix all 'Redundant usage of unmodifiable collection factories' problems in file" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
List list = new ArrayList();
|
||||
list = Collections.emptyList();
|
||||
|
||||
Set set = new HashSet();
|
||||
set = Collections.emptySet();
|
||||
|
||||
Map map = new HashMap();
|
||||
map = Collections.emptyMap();
|
||||
|
||||
list;
|
||||
|
||||
list;
|
||||
set;
|
||||
map;
|
||||
|
||||
set;
|
||||
map;
|
||||
|
||||
set;
|
||||
map;
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Fix all 'Redundant usage of unmodifiable collection factories' problems in file" "true"
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Collections.EMPTY_LIST;
|
||||
|
||||
Collections.EMPTY_LIST;
|
||||
Collections.EMPTY_SET;
|
||||
Collections.EMPTY_MAP;
|
||||
|
||||
Collections.EMPTY_SET;
|
||||
Collections.EMPTY_MAP;
|
||||
|
||||
Collections.EMPTY_SET;
|
||||
Collections.EMPTY_MAP;
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Fix all 'Redundant usage of unmodifiable collection factories' problems in file" "true"
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Collections.emptyList();
|
||||
|
||||
Collections.emptyList();
|
||||
Collections.emptySet();
|
||||
Collections.emptyMap();
|
||||
|
||||
Collections.emptySet();
|
||||
Collections.emptyMap();
|
||||
|
||||
Collections.emptySet();
|
||||
Collections.emptyMap();
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
// "Fix all 'Redundant usage of unmodifiable collection factories' problems in file" "true"
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
/*empty*/
|
||||
/*empty too*/
|
||||
/*blah blah blah*/
|
||||
Collections.emptyList();
|
||||
|
||||
/*empty*/
|
||||
/*empty too*/
|
||||
/*blah blah blah*/
|
||||
Collections.emptyList();
|
||||
/*empty*/
|
||||
/*empty too*/
|
||||
/*blah blah blah*/
|
||||
Collections.emptySet();
|
||||
/*empty*/
|
||||
/*empty too*/
|
||||
/*blah blah blah*/
|
||||
Collections.emptyMap();
|
||||
|
||||
/*empty*/
|
||||
/*empty too*/
|
||||
/*blah blah blah*/
|
||||
Collections.emptySet();
|
||||
/*empty*/
|
||||
/*empty too*/
|
||||
/*blah blah blah*/
|
||||
Collections.emptyMap();
|
||||
|
||||
/*empty*/
|
||||
/*empty too*/
|
||||
/*blah blah blah*/
|
||||
Collections.emptySet();
|
||||
/*empty*/
|
||||
/*empty too*/
|
||||
/*blah blah blah*/
|
||||
Collections.emptyMap();
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Fix all 'Redundant usage of unmodifiable collection factories' problems in file" "true"
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
((Collections.emptyList()));
|
||||
|
||||
((Collections.emptyList()));
|
||||
((Collections.emptySet()));
|
||||
((Collections.emptyMap()));
|
||||
|
||||
((Collections.emptySet()));
|
||||
((Collections.emptyMap()));
|
||||
|
||||
((Collections.emptySet()));
|
||||
((Collections.emptyMap()));
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
// "Fix all 'Redundant usage of unmodifiable collection factories' problems in file" "true"
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Collections.unmodifiableCollecti<caret>on(getEmptyList());
|
||||
|
||||
Collections.unmodifiableList(getEmptyList());
|
||||
Collections.unmodifiableSet(getEmptySet());
|
||||
Collections.unmodifiableMap(getEmptyMap());
|
||||
|
||||
Collections.unmodifiableSortedSet(getEmptySet());
|
||||
Collections.unmodifiableSortedMap(getEmptyMap());
|
||||
|
||||
Collections.unmodifiableNavigableSet(getEmptySet());
|
||||
Collections.unmodifiableNavigableMap(getEmptyMap());
|
||||
}
|
||||
|
||||
static List getEmptyList() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
static Set getEmptySet() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
static Map getEmptyMap() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// "Fix all 'Redundant usage of unmodifiable collection factories' problems in file" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
List list = new ArrayList();
|
||||
list = Collections.emptyList();
|
||||
|
||||
Set set = new HashSet();
|
||||
set = Collections.emptySet();
|
||||
|
||||
Map map = new HashMap();
|
||||
map = Collections.emptyMap();
|
||||
|
||||
Collections.unmodifiableCollecti<caret>on(list);
|
||||
|
||||
Collections.unmodifiableList(list);
|
||||
Collections.unmodifiableSet(set);
|
||||
Collections.unmodifiableMap(map);
|
||||
|
||||
Collections.unmodifiableSortedSet(set);
|
||||
Collections.unmodifiableSortedMap(map);
|
||||
|
||||
Collections.unmodifiableNavigableSet(set);
|
||||
Collections.unmodifiableNavigableMap(map);
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Fix all 'Redundant usage of unmodifiable collection factories' problems in file" "true"
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Collections.unmodifiableCollecti<caret>on(Collections.EMPTY_LIST);
|
||||
|
||||
Collections.unmodifiableList(Collections.EMPTY_LIST);
|
||||
Collections.unmodifiableSet(Collections.EMPTY_SET);
|
||||
Collections.unmodifiableMap(Collections.EMPTY_MAP);
|
||||
|
||||
Collections.unmodifiableSortedSet(Collections.EMPTY_SET);
|
||||
Collections.unmodifiableSortedMap(Collections.EMPTY_MAP);
|
||||
|
||||
Collections.unmodifiableNavigableSet(Collections.EMPTY_SET);
|
||||
Collections.unmodifiableNavigableMap(Collections.EMPTY_MAP);
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Fix all 'Redundant usage of unmodifiable collection factories' problems in file" "true"
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Collections.unmodifiableCollecti<caret>on(Collections.emptyList());
|
||||
|
||||
Collections.unmodifiableList(Collections.emptyList());
|
||||
Collections.unmodifiableSet(Collections.emptySet());
|
||||
Collections.unmodifiableMap(Collections.emptyMap());
|
||||
|
||||
Collections.unmodifiableSortedSet(Collections.emptySet());
|
||||
Collections.unmodifiableSortedMap(Collections.emptyMap());
|
||||
|
||||
Collections.unmodifiableNavigableSet(Collections.emptySet());
|
||||
Collections.unmodifiableNavigableMap(Collections.emptyMap());
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Fix all 'Redundant usage of unmodifiable collection factories' problems in file" "true"
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Collections/*empty*/./*empty too*/unmodifiableCollecti<caret>on/*blah blah blah*/(Collections.emptyList());
|
||||
|
||||
Collections/*empty*/./*empty too*/unmodifiableList/*blah blah blah*/(Collections.emptyList());
|
||||
Collections/*empty*/./*empty too*/unmodifiableSet/*blah blah blah*/(Collections.emptySet());
|
||||
Collections/*empty*/./*empty too*/unmodifiableMap/*blah blah blah*/(Collections.emptyMap());
|
||||
|
||||
Collections/*empty*/./*empty too*/unmodifiableSortedSet/*blah blah blah*/(Collections.emptySet());
|
||||
Collections/*empty*/./*empty too*/unmodifiableSortedMap/*blah blah blah*/(Collections.emptyMap());
|
||||
|
||||
Collections/*empty*/./*empty too*/unmodifiableNavigableSet/*blah blah blah*/(Collections.emptySet());
|
||||
Collections/*empty*/./*empty too*/unmodifiableNavigableMap/*blah blah blah*/(Collections.emptyMap());
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Fix all 'Redundant usage of unmodifiable collection factories' problems in file" "true"
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Collections.unmodifiableCollecti<caret>on(((Collections.emptyList())));
|
||||
|
||||
Collections.unmodifiableList(((Collections.emptyList())));
|
||||
Collections.unmodifiableSet(((Collections.emptySet())));
|
||||
Collections.unmodifiableMap(((Collections.emptyMap())));
|
||||
|
||||
Collections.unmodifiableSortedSet(((Collections.emptySet())));
|
||||
Collections.unmodifiableSortedMap(((Collections.emptyMap())));
|
||||
|
||||
Collections.unmodifiableNavigableSet(((Collections.emptySet())));
|
||||
Collections.unmodifiableNavigableMap(((Collections.emptyMap())));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user