mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
Differentiate between type parameters and parameters (IDEA-226683)
PR#1243 GitOrigin-RevId: a91176d9f95e2803da7c1973c58ce4ee492fb703
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f4ad3b5771
commit
909433482c
@@ -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);
|
||||
|
||||
@@ -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 <X> my type
|
||||
*/
|
||||
<X> X getValue(String X) {return null;}
|
||||
}
|
||||
@@ -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 <X> my type
|
||||
* <warning descr="Duplicate @param tag for parameter '<X>'">@param</warning> <X> another type
|
||||
*/
|
||||
<X> X getValue(String X) {return null;}
|
||||
}
|
||||
@@ -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(); }
|
||||
|
||||
Reference in New Issue
Block a user