Mapping of JavaDoc deprecated to Kotlin Deprecated + a pair of tests
This commit is contained in:
+5
@@ -59,4 +59,9 @@ public abstract class JavaClassifierImpl<Psi extends PsiClass> extends JavaEleme
|
||||
public JavaAnnotation findAnnotation(@NotNull FqName fqName) {
|
||||
return JavaElementUtil.findAnnotation(this, fqName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeprecatedInJavaDoc() {
|
||||
return getPsi().isDeprecated();
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.load.java.structure.impl;
|
||||
|
||||
import com.intellij.psi.PsiAnnotationOwner;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiDocCommentOwner;
|
||||
import com.intellij.psi.PsiMember;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -90,4 +91,10 @@ public abstract class JavaMemberImpl<Psi extends PsiMember> extends JavaElementI
|
||||
public JavaAnnotation findAnnotation(@NotNull FqName fqName) {
|
||||
return JavaElementUtil.findAnnotation(this, fqName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeprecatedInJavaDoc() {
|
||||
PsiMember psi = getPsi();
|
||||
return psi instanceof PsiDocCommentOwner && ((PsiDocCommentOwner) psi).isDeprecated();
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -97,6 +97,10 @@ public abstract class JavaTypeImpl<Psi extends PsiType> implements JavaType, Jav
|
||||
return JavaElementUtil.findAnnotation(this, fqName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeprecatedInJavaDoc() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
+5
@@ -76,6 +76,11 @@ public class JavaValueParameterImpl extends JavaElementImpl<PsiParameter>
|
||||
return JavaElementUtil.findAnnotation(this, fqName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeprecatedInJavaDoc() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Name getName() {
|
||||
|
||||
Reference in New Issue
Block a user