Idea 138: Avoid using auto-generated parameters names in Kotlin
This commit is contained in:
+7
-1
@@ -17,6 +17,7 @@
|
|||||||
package org.jetbrains.jet.lang.resolve.java.structure.impl;
|
package org.jetbrains.jet.lang.resolve.java.structure.impl;
|
||||||
|
|
||||||
import com.intellij.psi.PsiParameter;
|
import com.intellij.psi.PsiParameter;
|
||||||
|
import com.intellij.psi.impl.compiled.ClsParameterImpl;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.resolve.java.structure.JavaAnnotation;
|
import org.jetbrains.jet.lang.resolve.java.structure.JavaAnnotation;
|
||||||
@@ -47,7 +48,12 @@ public class JavaValueParameterImpl extends JavaElementImpl<PsiParameter> implem
|
|||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public Name getName() {
|
public Name getName() {
|
||||||
String name = getPsi().getName();
|
PsiParameter psi = getPsi();
|
||||||
|
if (psi instanceof ClsParameterImpl && ((ClsParameterImpl) psi).isAutoGeneratedName()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String name = psi.getName();
|
||||||
return name == null ? null : Name.identifier(name);
|
return name == null ? null : Name.identifier(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user