Repeated annotation @Deprecated after J2K for method with annotation and javadoc #KT-19351 Fixed (#1251)
This commit is contained in:
committed by
Dmitry Jemerov
parent
91f50c99e7
commit
46a1c8ca12
@@ -66,6 +66,7 @@ class AnnotationConverter(private val converter: Converter) {
|
|||||||
if (owner is PsiDocCommentOwner) {
|
if (owner is PsiDocCommentOwner) {
|
||||||
val deprecatedAnnotation = convertDeprecatedJavadocTag(owner, target)
|
val deprecatedAnnotation = convertDeprecatedJavadocTag(owner, target)
|
||||||
if (deprecatedAnnotation != null) {
|
if (deprecatedAnnotation != null) {
|
||||||
|
convertedAnnotations = convertedAnnotations.filter { it.name.name != deprecatedAnnotation.name.name }
|
||||||
convertedAnnotations += deprecatedAnnotation
|
convertedAnnotations += deprecatedAnnotation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* This is a deprecated class.
|
||||||
|
* @deprecated This class is deprecated
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
class TestDeprecated {
|
||||||
|
/**
|
||||||
|
* @deprecated This method is deprecated
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public void deprecatedMethod() {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* This is a deprecated class.
|
||||||
|
*/
|
||||||
|
@Deprecated("This class is deprecated")
|
||||||
|
internal class TestDeprecated {
|
||||||
|
|
||||||
|
@Deprecated("This method is deprecated")
|
||||||
|
fun deprecatedMethod() {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1790,6 +1790,12 @@ public class JavaToKotlinConverterForWebDemoTestGenerated extends AbstractJavaTo
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("deprecatedDocTagWithAnnotation.java")
|
||||||
|
public void testDeprecatedDocTagWithAnnotation() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("j2k/testData/fileOrElement/docComments/deprecatedDocTagWithAnnotation.java");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("docCommentWithParamTag.java")
|
@TestMetadata("docCommentWithParamTag.java")
|
||||||
public void testDocCommentWithParamTag() throws Exception {
|
public void testDocCommentWithParamTag() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("j2k/testData/fileOrElement/docComments/docCommentWithParamTag.java");
|
String fileName = KotlinTestUtils.navigationMetadata("j2k/testData/fileOrElement/docComments/docCommentWithParamTag.java");
|
||||||
|
|||||||
@@ -1790,6 +1790,12 @@ public class JavaToKotlinConverterSingleFileTestGenerated extends AbstractJavaTo
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("deprecatedDocTagWithAnnotation.java")
|
||||||
|
public void testDeprecatedDocTagWithAnnotation() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("j2k/testData/fileOrElement/docComments/deprecatedDocTagWithAnnotation.java");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("docCommentWithParamTag.java")
|
@TestMetadata("docCommentWithParamTag.java")
|
||||||
public void testDocCommentWithParamTag() throws Exception {
|
public void testDocCommentWithParamTag() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("j2k/testData/fileOrElement/docComments/docCommentWithParamTag.java");
|
String fileName = KotlinTestUtils.navigationMetadata("j2k/testData/fileOrElement/docComments/docCommentWithParamTag.java");
|
||||||
|
|||||||
Reference in New Issue
Block a user