not only static constants may be inlined by compiler: IDEA-115878 Constants search should work for final fields

This commit is contained in:
Eugene Zhuravlev
2013-11-03 22:13:28 +01:00
parent cd139bd5fd
commit 59de59f776
6 changed files with 28 additions and 1 deletions
@@ -0,0 +1,12 @@
Cleaning output files:
out/production/IntNonStaticConstantChange/Server.class
End of files
Compiling files:
src/Server.java
End of files
Cleaning output files:
out/production/IntNonStaticConstantChange/Client.class
End of files
Compiling files:
src/Client.java
End of files
@@ -0,0 +1,3 @@
class Server {
final int var = 500;
}
@@ -0,0 +1,5 @@
class Client {
public static void main(String[] args) {
System.out.println(new Server().var);
}
}
@@ -0,0 +1,3 @@
class Server {
final int var = 100;
}
@@ -799,7 +799,7 @@ public class Mappings {
}
private class Differential {
private static final int DESPERATE_MASK = Opcodes.ACC_STATIC | Opcodes.ACC_FINAL;
private static final int DESPERATE_MASK = Opcodes.ACC_FINAL;
final Mappings myDelta;
final Collection<File> myFilesToCompile;
@@ -60,6 +60,10 @@ public class FieldPropertyTest extends IncrementalTestCase {
doTest();
}
public void testIntNonStaticConstantChange() throws Exception {
doTest();
}
public void testLongConstantChange() throws Exception {
doTest();
}