[java-inference] Failure contract inference improved

GitOrigin-RevId: 687b4c909c1d2ae67d519ec71899d52fa3e29434
This commit is contained in:
Tagir Valeev
2021-03-11 11:40:45 +07:00
committed by intellij-monorepo-bot
parent 23e19832d4
commit b4c69a9cec
31 changed files with 387 additions and 111 deletions

View File

@@ -493,6 +493,7 @@
</item>
<item name='java.io.InputStream void reset()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -1017,11 +1018,13 @@
</item>
<item name='java.io.Reader void mark(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.io.Reader void reset()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>

View File

@@ -3820,9 +3820,6 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.lang.System void checkKey(java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.lang.System void setProperties(java.util.Properties) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
@@ -3847,6 +3844,7 @@
</item>
<item name='java.lang.Thread java.lang.Object clone()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -3873,6 +3871,11 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.lang.Thread void destroy()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.lang.Thread void setDefaultUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>

View File

@@ -803,6 +803,11 @@
<item name='java.lang.invoke.MethodHandle java.lang.invoke.MethodHandle rebind()'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.lang.invoke.MethodHandle java.lang.invoke.MethodHandle reinvokerTarget()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.lang.invoke.MethodHandle java.lang.invoke.MethodHandle setVarargs(java.lang.invoke.MemberName)'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>

View File

@@ -1116,6 +1116,16 @@
<item name='java.net.URLConnection int readBytes(int[], int, java.io.InputStream) 2'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.net.URLConnection java.io.InputStream getInputStream()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.net.URLConnection java.io.OutputStream getOutputStream()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.net.URLConnection java.lang.String getContentEncoding()'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>

View File

@@ -61,16 +61,19 @@
</item>
<item name='java.sql.Date int getHours()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.sql.Date int getMinutes()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.sql.Date int getSeconds()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -85,16 +88,19 @@
</item>
<item name='java.sql.Date void setHours(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.sql.Date void setMinutes(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.sql.Date void setSeconds(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -215,21 +221,25 @@
</item>
<item name='java.sql.Time int getDate()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.sql.Time int getDay()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.sql.Time int getMonth()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.sql.Time int getYear()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -250,11 +260,13 @@
</item>
<item name='java.sql.Time void setDate(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.sql.Time void setMonth(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -265,6 +277,7 @@
</item>
<item name='java.sql.Time void setYear(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>

View File

@@ -47,6 +47,7 @@
</item>
<item name='java.util.AbstractList E remove(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -1464,11 +1465,13 @@
</item>
<item name='java.util.Calendar int getWeekYear()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.util.Calendar int getWeeksInWeekYear()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -1555,6 +1558,7 @@
</item>
<item name='java.util.Calendar void setWeekDate(int, int, int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_,_,_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -2403,6 +2407,7 @@
</item>
<item name='java.util.Collections.EmptyEnumeration E nextElement()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -2421,6 +2426,7 @@
</item>
<item name='java.util.Collections.EmptyIterator E next()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -2439,11 +2445,13 @@
</item>
<item name='java.util.Collections.EmptyIterator void remove()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.util.Collections.EmptyList E get(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -2520,6 +2528,7 @@
</item>
<item name='java.util.Collections.EmptyListIterator E previous()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -3062,11 +3071,13 @@
</item>
<item name='java.util.Collections.UnmodifiableCollection void clear()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.util.Collections.UnmodifiableList E remove(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -3159,6 +3170,7 @@
</item>
<item name='java.util.Collections.UnmodifiableMap void clear()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -5225,6 +5237,16 @@
<val name="mutates" val="&quot;this&quot;"/>
</annotation>
</item>
<item name='java.util.TreeMap.SubMap K firstKey()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.TreeMap.SubMap K lastKey()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.TreeMap.SubMap SubMap()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
@@ -5236,15 +5258,40 @@
</annotation>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.util.TreeMap.SubMap java.util.Comparator&lt;? super K&gt; comparator()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.TreeMap.SubMap java.util.Set&lt;java.util.Map.Entry&lt;K,V&gt;&gt; entrySet()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.TreeMap.SubMap java.util.SortedMap&lt;K,V&gt; headMap(K)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.TreeMap.SubMap java.util.SortedMap&lt;K,V&gt; headMap(K) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='java.util.TreeMap.SubMap java.util.SortedMap&lt;K,V&gt; subMap(K, K)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_,_-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.TreeMap.SubMap java.util.SortedMap&lt;K,V&gt; subMap(K, K) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='java.util.TreeMap.SubMap java.util.SortedMap&lt;K,V&gt; subMap(K, K) 1'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='java.util.TreeMap.SubMap java.util.SortedMap&lt;K,V&gt; tailMap(K)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.TreeMap.SubMap java.util.SortedMap&lt;K,V&gt; tailMap(K) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>

View File

@@ -1,7 +1,47 @@
<root>
<item name='java.util.concurrent.TimeUnit long convert(long, java.util.concurrent.TimeUnit)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_,_-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.concurrent.TimeUnit long convert(long, java.util.concurrent.TimeUnit) 1'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='java.util.concurrent.TimeUnit long toDays(long)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.concurrent.TimeUnit long toHours(long)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.concurrent.TimeUnit long toMicros(long)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.concurrent.TimeUnit long toMillis(long)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.concurrent.TimeUnit long toMinutes(long)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.concurrent.TimeUnit long toNanos(long)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.concurrent.TimeUnit long toSeconds(long)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_-&gt;fail&quot;"/>
</annotation>
</item>
<item name='java.util.concurrent.TimeUnit long x(long, long, long)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>

View File

@@ -10,6 +10,7 @@
</item>
<item name='java.util.concurrent.locks.AbstractQueuedSynchronizer boolean isHeldExclusively()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -35,16 +36,19 @@
</item>
<item name='java.util.concurrent.locks.AbstractQueuedSynchronizer boolean tryAcquire(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.util.concurrent.locks.AbstractQueuedSynchronizer boolean tryRelease(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.util.concurrent.locks.AbstractQueuedSynchronizer boolean tryReleaseShared(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -53,6 +57,7 @@
</item>
<item name='java.util.concurrent.locks.AbstractQueuedSynchronizer int tryAcquireShared(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -295,6 +300,7 @@
</item>
<item name='java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock java.util.concurrent.locks.Condition newCondition()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>

View File

@@ -1191,11 +1191,13 @@
</item>
<item name='org.apache.commons.collections.CursorableLinkedList.Cursor int nextIndex()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.CursorableLinkedList.Cursor int previousIndex()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -1599,39 +1601,24 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.DoubleOrderedMap void checkKey(java.lang.Object) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.DoubleOrderedMap void checkKeyAndValue(java.lang.Object, java.lang.Object)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_,null-&gt;fail;null,_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.DoubleOrderedMap void checkKeyAndValue(java.lang.Object, java.lang.Object) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.DoubleOrderedMap void checkKeyAndValue(java.lang.Object, java.lang.Object) 1'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.DoubleOrderedMap void checkNonNullComparable(java.lang.Object, int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null,_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.DoubleOrderedMap void checkNonNullComparable(java.lang.Object, int) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.DoubleOrderedMap void checkValue(java.lang.Object)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.DoubleOrderedMap void checkValue(java.lang.Object) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.DoubleOrderedMap void copyColor(org.apache.commons.collections.DoubleOrderedMap.Node, org.apache.commons.collections.DoubleOrderedMap.Node, int) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>

View File

@@ -502,39 +502,24 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkKey(java.lang.Object) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkKeyAndValue(java.lang.Object, java.lang.Object)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_,null-&gt;fail;null,_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkKeyAndValue(java.lang.Object, java.lang.Object) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkKeyAndValue(java.lang.Object, java.lang.Object) 1'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkNonNullComparable(java.lang.Object, int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null,_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkNonNullComparable(java.lang.Object, int) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkValue(java.lang.Object)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void checkValue(java.lang.Object) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.bidimap.TreeBidiMap void copyColor(org.apache.commons.collections.bidimap.TreeBidiMap.Node, org.apache.commons.collections.bidimap.TreeBidiMap.Node, int) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>

View File

@@ -436,27 +436,18 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.functors.FunctorUtils void validate(org.apache.commons.collections.Closure[]) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.functors.FunctorUtils void validate(org.apache.commons.collections.Predicate[])'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.functors.FunctorUtils void validate(org.apache.commons.collections.Predicate[]) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.functors.FunctorUtils void validate(org.apache.commons.collections.Transformer[])'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.functors.FunctorUtils void validate(org.apache.commons.collections.Transformer[]) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.functors.IdentityPredicate IdentityPredicate(java.lang.Object)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>

View File

@@ -26,21 +26,25 @@
</item>
<item name='org.apache.commons.collections.iterators.AbstractEmptyIterator java.lang.Object getKey()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.iterators.AbstractEmptyIterator java.lang.Object getValue()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.iterators.AbstractEmptyIterator java.lang.Object next()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.iterators.AbstractEmptyIterator java.lang.Object previous()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -64,6 +68,7 @@
</item>
<item name='org.apache.commons.collections.iterators.AbstractEmptyIterator void remove()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -163,6 +168,7 @@
</item>
<item name='org.apache.commons.collections.iterators.ArrayIterator void remove()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -415,6 +421,7 @@
</item>
<item name='org.apache.commons.collections.iterators.FilterListIterator void remove()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -538,6 +545,7 @@
</item>
<item name='org.apache.commons.collections.iterators.ListIteratorWrapper void remove()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -620,6 +628,7 @@
</item>
<item name='org.apache.commons.collections.iterators.ObjectArrayIterator void remove()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>

View File

@@ -390,6 +390,7 @@
</item>
<item name='org.apache.commons.collections.list.FixedSizeList java.lang.Object remove(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -432,6 +433,7 @@
</item>
<item name='org.apache.commons.collections.list.FixedSizeList void clear()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -454,6 +456,7 @@
</item>
<item name='org.apache.commons.collections.list.FixedSizeList.FixedSizeListIterator void remove()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>

View File

@@ -909,6 +909,7 @@
</item>
<item name='org.apache.commons.collections.map.FixedSizeMap void clear()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -978,6 +979,7 @@
</item>
<item name='org.apache.commons.collections.map.FixedSizeSortedMap void clear()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -1418,11 +1420,13 @@
</item>
<item name='org.apache.commons.collections.map.LinkedMap.LinkedMapList java.lang.Object remove(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.map.LinkedMap.LinkedMapList void clear()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -1774,9 +1778,6 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.map.MultiKeyMap void checkKey(java.lang.Object) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.map.MultiKeyMap void putAll(java.util.Map) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
@@ -2106,6 +2107,7 @@
</item>
<item name='org.apache.commons.collections.map.SingletonMap void clear()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -2135,6 +2137,7 @@
</item>
<item name='org.apache.commons.collections.map.SingletonMap.SingletonMapIterator void remove()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -2166,6 +2169,7 @@
</item>
<item name='org.apache.commons.collections.map.SingletonMap.SingletonValues void clear()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>

View File

@@ -4445,72 +4445,52 @@
</item>
<item name='org.apache.commons.lang.Validate void noNullElements(java.lang.Object[])'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void noNullElements(java.lang.Object[]) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.Validate void noNullElements(java.lang.Object[], java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null,_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void noNullElements(java.lang.Object[], java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.Validate void noNullElements(java.util.Collection)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void noNullElements(java.util.Collection) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.Validate void noNullElements(java.util.Collection, java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null,_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void noNullElements(java.util.Collection, java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.Object[])'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.Object[]) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.Object[], java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null,_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.Object[], java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.String, java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null,_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void notEmpty(java.lang.String, java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.Validate void notEmpty(java.util.Collection) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
@@ -4529,18 +4509,12 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void notNull(java.lang.Object) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.Validate void notNull(java.lang.Object, java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;null,_-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void notNull(java.lang.Object, java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.WordUtils WordUtils()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>

View File

@@ -1169,6 +1169,7 @@
</item>
<item name='org.apache.commons.lang.text.StrTokenizer void remove()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>

View File

@@ -349,6 +349,7 @@
</item>
<item name='org.apache.commons.lang.time.DateUtils.DateIterator void remove()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>

View File

@@ -535,6 +535,7 @@
</item>
<item name='org.apache.velocity.runtime.directive.Scope void stop()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -571,6 +572,11 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.velocity.runtime.directive.Stop boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_,_,_-&gt;fail&quot;"/>
</annotation>
</item>
<item name='org.apache.velocity.runtime.directive.Stop boolean render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node) 1'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>

View File

@@ -203,6 +203,7 @@
</item>
<item name='org.apache.velocity.runtime.log.RuntimeLoggerLog boolean getShowStackTraces()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>
@@ -233,6 +234,7 @@
</item>
<item name='org.apache.velocity.runtime.log.RuntimeLoggerLog org.apache.velocity.runtime.log.LogChute getLogChute()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>

View File

@@ -9,6 +9,7 @@
</item>
<item name='org.apache.velocity.util.ArrayIterator void remove()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="value" val="&quot;-&gt;fail&quot;"/>
<val name="pure" val="true"/>
</annotation>
</item>

View File

@@ -13,6 +13,25 @@ import java.nio.file.Files;
*/
@SuppressWarnings({"unused", "IOResourceOpenedButNotSafelyClosed"})
public class Test01 {
@ExpectContract("true,_->fail")
static void checkNegate(boolean val, String s1) {
check(!val, s1, null);
}
@ExpectContract("false,_->fail")
static void check1(boolean val, String s1) {
check(val, s1, null);
}
@ExpectContract("false,_,_->fail")
static void check(boolean val, String s1, String s2) {
if (!val) {
throw new RuntimeException(createMessage(s1, s2));
}
}
native static String createMessage(String s1, String s2);
@ExpectNotNull
@ExpectContract(pure = true)
public static MySupplier methodReference(@ExpectNotNull String s) {