mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-inspection] IDEA-378175 Inspection "'collect(toList())' can be replaced with 'toList()'" disappears on some newer JDKs
- more external annotations GitOrigin-RevId: 349bb9e942e5f1278ba8531d3d79f507cf6eef39
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b7d9354609
commit
07ca813ff6
+15
@@ -244,4 +244,19 @@ class MissingIteratorRemoveAnalysis {
|
||||
list = new ArrayList<>();
|
||||
list.add("foo");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class UnmodifiableListTest {
|
||||
private final List<String> myList = Stream.of("foo", "barA").collect(Collectors.toList());
|
||||
|
||||
private final List<String> myList2 = Stream.of("foo", "barB").<warning descr="'collect(toList())' can be replaced with 'toList()'">collect(Collectors.toList())</warning>;
|
||||
|
||||
void add() {
|
||||
myList.add("foo");
|
||||
}
|
||||
|
||||
List<String> get(boolean b) {
|
||||
return Collections.unmodifiableList(b ? myList : myList2);
|
||||
}
|
||||
}
|
||||
@@ -2193,6 +2193,9 @@
|
||||
<item name="java.util.Collections java.util.Collection<T> unmodifiableCollection(java.util.Collection<? extends T>)">
|
||||
<annotation name="org.jetbrains.annotations.NotNull"/>
|
||||
<annotation name="org.jetbrains.annotations.UnmodifiableView"/>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name="java.util.Collections java.util.Collection<T> unmodifiableCollection(java.util.Collection<? extends T>) 0">
|
||||
<annotation name="org.jetbrains.annotations.NotNull"/>
|
||||
@@ -2304,6 +2307,9 @@
|
||||
<item name="java.util.Collections java.util.List<T> unmodifiableList(java.util.List<? extends T>)">
|
||||
<annotation name="org.jetbrains.annotations.NotNull"/>
|
||||
<annotation name="org.jetbrains.annotations.UnmodifiableView"/>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name="java.util.Collections java.util.List<T> unmodifiableList(java.util.List<? extends T>) 0">
|
||||
<annotation name="org.jetbrains.annotations.NotNull"/>
|
||||
@@ -2364,6 +2370,9 @@
|
||||
<item name="java.util.Collections java.util.Map<K,V> unmodifiableMap(java.util.Map<? extends K,? extends V>)">
|
||||
<annotation name="org.jetbrains.annotations.NotNull"/>
|
||||
<annotation name="org.jetbrains.annotations.UnmodifiableView"/>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name="java.util.Collections java.util.Map<K,V> unmodifiableMap(java.util.Map<? extends K,? extends V>) 0">
|
||||
<annotation name="org.jetbrains.annotations.NotNull"/>
|
||||
@@ -2496,6 +2505,9 @@
|
||||
<item name="java.util.Collections java.util.Set<T> unmodifiableSet(java.util.Set<? extends T>)">
|
||||
<annotation name="org.jetbrains.annotations.NotNull"/>
|
||||
<annotation name="org.jetbrains.annotations.UnmodifiableView"/>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name="java.util.Collections java.util.Set<T> unmodifiableSet(java.util.Set<? extends T>) 0">
|
||||
<annotation name="org.jetbrains.annotations.NotNull"/>
|
||||
@@ -2541,6 +2553,9 @@
|
||||
<item name="java.util.Collections java.util.SortedMap<K,V> unmodifiableSortedMap(java.util.SortedMap<K,? extends V>)">
|
||||
<annotation name="org.jetbrains.annotations.NotNull"/>
|
||||
<annotation name="org.jetbrains.annotations.UnmodifiableView"/>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name="java.util.Collections java.util.SortedMap<K,V> unmodifiableSortedMap(java.util.SortedMap<K,? extends V>) 0">
|
||||
<annotation name="org.jetbrains.annotations.NotNull"/>
|
||||
@@ -2586,6 +2601,9 @@
|
||||
<item name="java.util.Collections java.util.SortedSet<T> unmodifiableSortedSet(java.util.SortedSet<T>)">
|
||||
<annotation name="org.jetbrains.annotations.NotNull"/>
|
||||
<annotation name="org.jetbrains.annotations.UnmodifiableView"/>
|
||||
<annotation name='org.jetbrains.annotations.Contract'>
|
||||
<val name="pure" val="true"/>
|
||||
</annotation>
|
||||
</item>
|
||||
<item name="java.util.Collections java.util.SortedSet<T> unmodifiableSortedSet(java.util.SortedSet<T>) 0">
|
||||
<annotation name="org.jetbrains.annotations.NotNull"/>
|
||||
|
||||
Reference in New Issue
Block a user