Property with all accessors deprecated considered as deprecated
This commit is contained in:
@@ -1019,7 +1019,16 @@ public abstract class KotlinBuiltIns {
|
||||
}
|
||||
|
||||
public static boolean isDeprecated(@NotNull DeclarationDescriptor declarationDescriptor) {
|
||||
return containsAnnotation(declarationDescriptor, FQ_NAMES.deprecated);
|
||||
if (containsAnnotation(declarationDescriptor, FQ_NAMES.deprecated)) return true;
|
||||
|
||||
if (declarationDescriptor instanceof PropertyDescriptor) {
|
||||
boolean isVar = ((PropertyDescriptor) declarationDescriptor).isVar();
|
||||
PropertyGetterDescriptor getter = ((PropertyDescriptor) declarationDescriptor).getGetter();
|
||||
PropertySetterDescriptor setter = ((PropertyDescriptor) declarationDescriptor).getSetter();
|
||||
return getter != null && isDeprecated(getter) && (!isVar || setter != null && isDeprecated(setter));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isSuppressAnnotation(@NotNull AnnotationDescriptor annotationDescriptor) {
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
interface JavaClass{
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public int getSomething1();
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public int getSomething2();
|
||||
public void setSomething2(int value);
|
||||
|
||||
public int getSomething3();
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public void setSomething3(int value);
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public int getSomething4();
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public void setSomething4(int value);
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fun foo(javaClass: JavaClass) {
|
||||
javaClass.<caret>
|
||||
}
|
||||
|
||||
// WITH_ORDER
|
||||
// EXIST: { lookupString: "something2", attributes: "bold" }
|
||||
// EXIST: { lookupString: "something3", attributes: "bold" }
|
||||
// EXIST: { lookupString: "something1", attributes: "bold strikeout" }
|
||||
// EXIST: { lookupString: "something4", attributes: "bold strikeout" }
|
||||
+6
@@ -329,6 +329,12 @@ public class MultiFileJvmBasicCompletionTestGenerated extends AbstractMultiFileJ
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SyntheticExtensionDeprecated")
|
||||
public void testSyntheticExtensionDeprecated() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/SyntheticExtensionDeprecated/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SyntheticExtensionForGenericClass")
|
||||
public void testSyntheticExtensionForGenericClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/SyntheticExtensionForGenericClass/");
|
||||
|
||||
Reference in New Issue
Block a user