[AA FIR] KT-58503 Use resolvedStatus to access visibility and modality of a class
Compiler plugins (AllOpen, for example) can modify the status of a declaration, including visibility and modality. If we observe them without enforcing STATUS resolve, we risk to see incorrect information, which in turn can lead to false negatives/positives in inspections/intentions. Add test for light classes. See KT-58503 description for the explanation how the initial problem was influencing Spring inspections from intellij repository. ^KT-58503 Fixed
This commit is contained in:
+16
@@ -559,4 +559,20 @@ public class SymbolLightClassesByFqNameForLibraryTestGenerated extends AbstractS
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/asJava/lightClasses/lightClassByFqName/script"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class WithTestCompilerPluginEnabled {
|
||||
@Test
|
||||
public void testAllFilesPresentInWithTestCompilerPluginEnabled() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("allOpen.kt")
|
||||
public void testAllOpen() throws Exception {
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled/allOpen.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -559,4 +559,20 @@ public class SymbolLightClassesEqualityByFqNameForLibraryTestGenerated extends A
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/asJava/lightClasses/lightClassByFqName/script"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class WithTestCompilerPluginEnabled {
|
||||
@Test
|
||||
public void testAllFilesPresentInWithTestCompilerPluginEnabled() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("allOpen.kt")
|
||||
public void testAllOpen() throws Exception {
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled/allOpen.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -559,4 +559,20 @@ public class SymbolLightClassesParentingByFqNameForLibraryTestGenerated extends
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/asJava/lightClasses/lightClassByFqName/script"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class WithTestCompilerPluginEnabled {
|
||||
@Test
|
||||
public void testAllFilesPresentInWithTestCompilerPluginEnabled() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("allOpen.kt")
|
||||
public void testAllOpen() throws Exception {
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled/allOpen.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -701,4 +701,20 @@ public class SymbolLightClassesByFqNameForSourceTestGenerated extends AbstractSy
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/asJava/lightClasses/lightClassByFqName/script"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class WithTestCompilerPluginEnabled {
|
||||
@Test
|
||||
public void testAllFilesPresentInWithTestCompilerPluginEnabled() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("allOpen.kt")
|
||||
public void testAllOpen() throws Exception {
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled/allOpen.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -701,4 +701,20 @@ public class SymbolLightClassesEqualityByFqNameForSourceTestGenerated extends Ab
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/asJava/lightClasses/lightClassByFqName/script"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class WithTestCompilerPluginEnabled {
|
||||
@Test
|
||||
public void testAllFilesPresentInWithTestCompilerPluginEnabled() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("allOpen.kt")
|
||||
public void testAllOpen() throws Exception {
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled/allOpen.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -701,4 +701,20 @@ public class SymbolLightClassesParentingByFqNameForSourceTestGenerated extends A
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/asJava/lightClasses/lightClassByFqName/script"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class WithTestCompilerPluginEnabled {
|
||||
@Test
|
||||
public void testAllFilesPresentInWithTestCompilerPluginEnabled() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("allOpen.kt")
|
||||
public void testAllOpen() throws Exception {
|
||||
runTest("compiler/testData/asJava/lightClasses/lightClassByFqName/withTestCompilerPluginEnabled/allOpen.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user