diff --git a/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavadocHighlightUtil.java b/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavadocHighlightUtil.java index 72e9a0b15005..c9b052d98089 100644 --- a/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavadocHighlightUtil.java +++ b/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavadocHighlightUtil.java @@ -275,6 +275,9 @@ public class JavadocHighlightUtil { PsiReference reference = value.getReference(); if (reference != null) { String paramName = reference.getCanonicalText(); + if(((PsiDocParamRef)value).isTypeParamRef()){ + paramName = "<" + paramName + ">"; + } documentedParamNames = set(documentedParamNames); if (documentedParamNames.contains(paramName)) { holder.problem(tag.getNameElement(), InspectionsBundle.message("inspection.javadoc.problem.duplicate.param", paramName), null); diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/javaDoc/DuplicateParam.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/javaDoc/DuplicateParam0.java similarity index 100% rename from java/java-tests/testData/codeInsight/daemonCodeAnalyzer/javaDoc/DuplicateParam.java rename to java/java-tests/testData/codeInsight/daemonCodeAnalyzer/javaDoc/DuplicateParam0.java diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/javaDoc/DuplicateParam1.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/javaDoc/DuplicateParam1.java new file mode 100644 index 000000000000..db840a250872 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/javaDoc/DuplicateParam1.java @@ -0,0 +1,10 @@ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +class Test { + /** + * Test. Don't report type param 'X' as duplicate of param 'X'. + * + * @param X my string + * @param my type + */ + X getValue(String X) {return null;} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/javaDoc/DuplicateParam2.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/javaDoc/DuplicateParam2.java new file mode 100644 index 000000000000..676d6898dd2c --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/javaDoc/DuplicateParam2.java @@ -0,0 +1,11 @@ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +class Test { + /** + * Test. + * + * @param X my string + * @param my type + * @param another type + */ + X getValue(String X) {return null;} +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/JavadocHighlightingTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/JavadocHighlightingTest.java index be0d091661ff..b1feb2843222 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/JavadocHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/JavadocHighlightingTest.java @@ -103,7 +103,9 @@ public class JavadocHighlightingTest extends LightDaemonAnalyzerTestCase { public void testBadReference() { doTest(); } public void testMissingReturnDescription() { doTest(); } public void testDoubleParenthesesInCode() { doTest(); } - public void testDuplicateParam() { doTest(); } + public void testDuplicateParam0() { doTest(); } + public void testDuplicateParam1() { doTest(); } + public void testDuplicateParam2() { doTest(); } public void testDuplicateReturn() { doTest(); } public void testDuplicateDeprecated() { myInspection.IGNORE_DEPRECATED = false; doTest(); } public void testDuplicateSerial() { doTest(); }