Repeated annotation @Deprecated after J2K for method with annotation and javadoc #KT-19351 Fixed (#1251)

This commit is contained in:
Toshiaki Kameyama
2017-08-24 00:05:04 +09:00
committed by Dmitry Jemerov
parent 91f50c99e7
commit 46a1c8ca12
5 changed files with 35 additions and 0 deletions
@@ -66,6 +66,7 @@ class AnnotationConverter(private val converter: Converter) {
if (owner is PsiDocCommentOwner) {
val deprecatedAnnotation = convertDeprecatedJavadocTag(owner, target)
if (deprecatedAnnotation != null) {
convertedAnnotations = convertedAnnotations.filter { it.name.name != deprecatedAnnotation.name.name }
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);
}
@TestMetadata("deprecatedDocTagWithAnnotation.java")
public void testDeprecatedDocTagWithAnnotation() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("j2k/testData/fileOrElement/docComments/deprecatedDocTagWithAnnotation.java");
doTest(fileName);
}
@TestMetadata("docCommentWithParamTag.java")
public void testDocCommentWithParamTag() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("j2k/testData/fileOrElement/docComments/docCommentWithParamTag.java");
@@ -1790,6 +1790,12 @@ public class JavaToKotlinConverterSingleFileTestGenerated extends AbstractJavaTo
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")
public void testDocCommentWithParamTag() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("j2k/testData/fileOrElement/docComments/docCommentWithParamTag.java");