PurityAnalysis: StringBuffer.toString is also hardcoded (used for string concatenation in older java versions)

This commit is contained in:
Tagir Valeev
2017-05-24 10:41:01 +07:00
parent 0b08c056a8
commit 871ef095bb
12 changed files with 133 additions and 1 deletions

View File

@@ -558,6 +558,7 @@ final class HardCodedPurity {
new Method("java/lang/Throwable", "toString", "()Ljava/lang/String;"),
// Declared in final class StringBuilder
new Method("java/lang/StringBuilder", "toString", "()Ljava/lang/String;"),
new Method("java/lang/StringBuffer", "toString", "()Ljava/lang/String;"),
// Native
new Method("java/lang/Object", "getClass", "()Ljava/lang/Class;"),
new Method("java/lang/Class", "getComponentType", "()Ljava/lang/Class;"),

View File

@@ -318,6 +318,11 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.io.FileNotFoundException FileNotFoundException(java.lang.String, java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.io.FileNotFoundException FileNotFoundException(java.lang.String, java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>

View File

@@ -156,6 +156,11 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.lang.ArrayIndexOutOfBoundsException ArrayIndexOutOfBoundsException(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.lang.ArrayIndexOutOfBoundsException ArrayIndexOutOfBoundsException(java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
@@ -1499,6 +1504,9 @@
</annotation>
</item>
<item name='java.lang.NumberFormatException java.lang.NumberFormatException forInputString(java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.lang.NumberFormatException java.lang.NumberFormatException forInputString(java.lang.String) 0'>
@@ -1712,6 +1720,11 @@
<item name='java.lang.String String(java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.lang.String String(java.lang.StringBuffer)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.lang.String String(java.lang.StringBuffer) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
@@ -2033,6 +2046,9 @@
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.lang.StringBuffer java.lang.String toString()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.lang.StringBuffer java.lang.StringBuffer append(boolean)'>

View File

@@ -25,9 +25,19 @@
<item name='java.net.DatagramPacket DatagramPacket(byte[], int, int) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.net.DatagramPacket DatagramPacket(byte[], int, int, java.net.InetAddress, int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.net.DatagramPacket DatagramPacket(byte[], int, int, java.net.InetAddress, int) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.net.DatagramPacket DatagramPacket(byte[], int, java.net.InetAddress, int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.net.DatagramPacket DatagramPacket(byte[], int, java.net.InetAddress, int) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>

View File

@@ -100,6 +100,9 @@
</annotation>
</item>
<item name='java.security.Provider java.lang.String toString()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.security.Provider java.lang.String[] getTypeAndAlgorithm(java.lang.String)'>

View File

@@ -723,6 +723,11 @@
<item name='java.util.Arrays void fill(short[], short) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.util.Arrays void rangeCheck(int, int, int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='java.util.Arrays void sort(T[], int, int, java.util.Comparator&lt;? super T&gt;) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
@@ -1569,6 +1574,9 @@
</annotation>
</item>
<item name='java.util.Collections.CopiesList java.lang.Object[] toArray()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='java.util.Collections.CopiesList java.util.List&lt;E&gt; subList(int, int)'>

View File

@@ -305,6 +305,11 @@
<item name='org.apache.commons.collections.map.AbstractLinkedMap org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry entryBefore(org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.collections.map.AbstractLinkedMap org.apache.commons.collections.map.AbstractLinkedMap.LinkEntry getEntry(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.collections.map.AbstractLinkedMap void addEntry(org.apache.commons.collections.map.AbstractHashedMap.HashEntry, int) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>

View File

@@ -1695,11 +1695,21 @@
<item name='org.apache.commons.lang.CharUtils char toChar(java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.CharUtils int toIntValue(char)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.CharUtils int toIntValue(char, int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.CharUtils int toIntValue(java.lang.Character)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.CharUtils int toIntValue(java.lang.Character) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
@@ -2038,6 +2048,11 @@
<item name='org.apache.commons.lang.IllegalClassException java.lang.String safeGetClassName(java.lang.Class) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='org.apache.commons.lang.IncompleteArgumentException IncompleteArgumentException(java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.IncompleteArgumentException IncompleteArgumentException(java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
@@ -2056,6 +2071,21 @@
<item name='org.apache.commons.lang.IncompleteArgumentException java.lang.String safeArrayToString(java.lang.Object[]) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='org.apache.commons.lang.IntHashMap IntHashMap()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.IntHashMap IntHashMap(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.IntHashMap IntHashMap(int, float)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.IntHashMap boolean contains(java.lang.Object) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
@@ -2124,6 +2154,11 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.NotImplementedException NotImplementedException(java.lang.Class)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.NotImplementedException NotImplementedException(java.lang.Class) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
@@ -2156,6 +2191,11 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.NullArgumentException NullArgumentException(java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.NullArgumentException NullArgumentException(java.lang.String) 0'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
@@ -3375,6 +3415,9 @@
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.StringUtils java.lang.String padding(int, char)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.StringUtils java.lang.String prechomp(java.lang.String, java.lang.String)'>
@@ -3504,7 +3547,8 @@
</item>
<item name='org.apache.commons.lang.StringUtils java.lang.String reverse(java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;!null-&gt;!null;null-&gt;null&quot;"/>
<val name="value" val="&quot;!null-&gt;!null;null-&gt;null&quot;"/>
<val name="pure" val="true"/>
</annotation>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
@@ -4034,18 +4078,38 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void isTrue(boolean, java.lang.String, double)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void isTrue(boolean, java.lang.String, double) 1'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='org.apache.commons.lang.Validate void isTrue(boolean, java.lang.String, java.lang.Object)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void isTrue(boolean, java.lang.String, java.lang.Object) 1'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='org.apache.commons.lang.Validate void isTrue(boolean, java.lang.String, java.lang.Object) 2'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='org.apache.commons.lang.Validate void isTrue(boolean, java.lang.String, long)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.Validate void isTrue(boolean, java.lang.String, long) 1'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='org.apache.commons.lang.Validate void noNullElements(java.lang.Object[])'>
<annotation name='org.jetbrains.annotations.Contract'>
<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>

View File

@@ -276,6 +276,11 @@
<item name='org.apache.commons.lang.time.DateUtils long getFragmentInSeconds(java.util.Date, int) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.time.DateUtils long getMillisPerUnit(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='org.apache.commons.lang.time.DateUtils void modify(java.util.Calendar, int, boolean) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
@@ -407,6 +412,9 @@
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.time.FastDateFormat java.lang.String toString()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.time.FastDateFormat java.lang.StringBuffer applyRules(java.util.Calendar, java.lang.StringBuffer)'>
@@ -484,6 +492,9 @@
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='org.apache.commons.lang.time.FastDateFormat.Pair java.lang.String toString()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.commons.lang.time.FastDateFormat.StringLiteral StringLiteral(java.lang.String)'>

View File

@@ -30,6 +30,9 @@
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.velocity.convert.WebMacro java.lang.String makeSubstRE(int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.velocity.convert.WebMacro void convert(java.lang.String) 0'>

View File

@@ -48,6 +48,9 @@
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='org.apache.velocity.runtime.log.Log java.lang.String formatFileString(java.lang.String, int, int)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.velocity.runtime.log.Log java.lang.String formatFileString(java.lang.String, int, int) 0'>

View File

@@ -250,6 +250,9 @@
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='org.apache.velocity.runtime.visitor.NodeViewMode java.lang.String indentString()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
</root>