Bytecode analysis: purity inference improvement (also fixes IDEA-172989):

1. Lambda/method reference creation is pure
2. String concatenation is pure
3. Constructor which only modifies own fields (calls setters, etc.) is pure
4. Exception creation is pure
5. A few hardcoded native methods
This commit is contained in:
Tagir Valeev
2017-05-18 10:52:53 +07:00
parent af20bc97d0
commit c41245708f
50 changed files with 4164 additions and 139 deletions
@@ -25,6 +25,16 @@
<val name="pure" val="true"/>
</annotation>
</item>
<item name='javax.swing.AbstractButton int checkHorizontalKey(int, java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='javax.swing.AbstractButton int checkVerticalKey(int, java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='javax.swing.AbstractButton int getDisplayedMnemonicIndex()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
@@ -311,6 +321,16 @@
<item name='javax.swing.JFrame java.lang.String paramString()'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='javax.swing.JLabel int checkHorizontalKey(int, java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='javax.swing.JLabel int checkVerticalKey(int, java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='javax.swing.JLabel int getDisplayedMnemonic()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
@@ -570,6 +590,11 @@
<item name='javax.swing.JTable void writeObject(java.io.ObjectOutputStream) 0'>
<annotation name='org.jetbrains.annotations.NotNull'/>
</item>
<item name='javax.swing.SwingUtilities SwingUtilities()'>
<annotation name='org.jetbrains.annotations.Contract'>
<val name="pure" val="true"/>
</annotation>
</item>
<item name='javax.swing.SwingUtilities boolean isDescendingFrom(java.awt.Component, java.awt.Component)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;null,_-&gt;true&quot;"/>