mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
compile-time constant field change affects static import usages (IDEA-245262)
GitOrigin-RevId: 9d472bdad672217f92a17766165ef51e4eea4947
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8cd79f9f80
commit
3c2608408e
+12
@@ -0,0 +1,12 @@
|
||||
Cleaning output files:
|
||||
out/production/StaticImportConstantFieldChanged/package1/A.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/package1/A.java
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/StaticImportConstantFieldChanged/package1/B.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/package1/B.java
|
||||
End of files
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package package1;
|
||||
|
||||
public class A {
|
||||
public static final int FIELD = 100;
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package package1;
|
||||
|
||||
public class A {
|
||||
public static final int FIELD = 200;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package package1;
|
||||
|
||||
import static package1.A.FIELD;
|
||||
|
||||
public class B {
|
||||
void foo() {
|
||||
String msg = "Value " + FIELD;
|
||||
}
|
||||
}
|
||||
@@ -1699,11 +1699,12 @@ public class Mappings {
|
||||
|
||||
if (harmful || valueChanged || becameLessAccessible) {
|
||||
if (myProcessConstantsIncrementally) {
|
||||
debug("Potentially inlined field changed it's access or value => affecting field usages");
|
||||
debug("Potentially inlined field changed its access or value => affecting field usages and static member import usages");
|
||||
myFuture.affectFieldUsages(field, propagated.get(), field.createUsage(myContext, it.name), state.myAffectedUsages, state.myDependants);
|
||||
myFuture.affectStaticMemberImportUsages(field.name, it.name, propagated.get(), state.myAffectedUsages, state.myDependants);
|
||||
}
|
||||
else {
|
||||
debug("Potentially inlined field changed it's access or value => a switch to non-incremental mode requested");
|
||||
debug("Potentially inlined field changed its access or value => a switch to non-incremental mode requested");
|
||||
if (!incrementalDecision(it.name, field, myAffectedFiles, myFilesToCompile, myFilter)) {
|
||||
debug("End of Differentiate, returning false");
|
||||
return false;
|
||||
|
||||
@@ -41,6 +41,11 @@ public class ImportTest extends IncrementalTestCase {
|
||||
doTestBuild(1).assertFailed();
|
||||
}
|
||||
|
||||
public void testStaticImportConstantFieldChanged() {
|
||||
setupInitialProject();
|
||||
doTestBuild(1).assertSuccessful();
|
||||
}
|
||||
|
||||
public void testUnusedStaticImportFieldBecameNonstatic() {
|
||||
setupInitialProject();
|
||||
setupModules();
|
||||
|
||||
Reference in New Issue
Block a user