Find Usages: Fix NPE on constructor with missing name
#EA-69907 Fixed
This commit is contained in:
@@ -66,9 +66,9 @@ public abstract class JetConstructor<T : JetConstructor<T>> : JetDeclarationStub
|
|||||||
|
|
||||||
override fun getTypeParameters() = emptyList<JetTypeParameter>()
|
override fun getTypeParameters() = emptyList<JetTypeParameter>()
|
||||||
|
|
||||||
override fun getName(): String = getContainingClassOrObject().getName()!!
|
override fun getName(): String? = getContainingClassOrObject().getName()
|
||||||
|
|
||||||
override fun getNameAsSafeName() = Name.identifier(getName())
|
override fun getNameAsSafeName() = JetPsiUtil.safeName(getName())
|
||||||
|
|
||||||
override fun getFqName() = null
|
override fun getFqName() = null
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetPrimaryConstructor
|
||||||
|
// OPTIONS: usages
|
||||||
|
class <caret>() {
|
||||||
|
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -756,6 +756,12 @@ public class JetFindUsagesTestGenerated extends AbstractJetFindUsagesTest {
|
|||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/findUsages/kotlin/findPrimaryConstructorUsages"), Pattern.compile("^(.+)\\.0\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/findUsages/kotlin/findPrimaryConstructorUsages"), Pattern.compile("^(.+)\\.0\\.kt$"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("missingName.0.kt")
|
||||||
|
public void testMissingName() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/findUsages/kotlin/findPrimaryConstructorUsages/missingName.0.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("primaryConstructorByRef.0.kt")
|
@TestMetadata("primaryConstructorByRef.0.kt")
|
||||||
public void testPrimaryConstructorByRef() throws Exception {
|
public void testPrimaryConstructorByRef() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/findUsages/kotlin/findPrimaryConstructorUsages/primaryConstructorByRef.0.kt");
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/findUsages/kotlin/findPrimaryConstructorUsages/primaryConstructorByRef.0.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user