mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
IDEA-236574 False-positive warning appears when inheritDoc is used in @throws tag
GitOrigin-RevId: 0214fca1f2111eb90cef9d4ecda31aeafe68895b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
59743cd1d6
commit
2beb7c007b
@@ -74,19 +74,19 @@ public class JavaDocLocalInspection extends LocalInspectionTool {
|
||||
return new OptionsPanel();
|
||||
}
|
||||
|
||||
protected LocalQuickFix createAddJavadocFix(@NotNull PsiElement nameIdentifier, boolean isOnTheFly) {
|
||||
private static LocalQuickFix createAddJavadocFix(@NotNull PsiElement nameIdentifier, boolean isOnTheFly) {
|
||||
return isOnTheFly ? new AddJavadocFix(nameIdentifier) : null;
|
||||
}
|
||||
|
||||
protected LocalQuickFix createAddMissingTagFix(@NotNull String tag, @NotNull String value, boolean isOnTheFly) {
|
||||
private static LocalQuickFix createAddMissingTagFix(@NotNull String tag, @NotNull String value) {
|
||||
return new AddMissingTagFix(tag, value);
|
||||
}
|
||||
|
||||
protected LocalQuickFix createAddMissingParamTagFix(@NotNull String name, boolean isOnTheFly) {
|
||||
private static LocalQuickFix createAddMissingParamTagFix(@NotNull String name) {
|
||||
return new AddMissingParamTagFix(name);
|
||||
}
|
||||
|
||||
protected LocalQuickFix createRegisterTagFix(@NotNull String tag, boolean isOnTheFly) {
|
||||
protected LocalQuickFix createRegisterTagFix(@NotNull String tag) {
|
||||
return new AddUnknownTagToCustoms(this, tag);
|
||||
}
|
||||
|
||||
@@ -832,17 +832,17 @@ public class JavaDocLocalInspection extends LocalInspectionTool {
|
||||
|
||||
@Override
|
||||
public LocalQuickFix addMissingTagFix(@NotNull String tag, @NotNull String value) {
|
||||
return createAddMissingTagFix(tag, value, myOnTheFly);
|
||||
return createAddMissingTagFix(tag, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalQuickFix addMissingParamTagFix(@NotNull String name) {
|
||||
return createAddMissingParamTagFix(name, myOnTheFly);
|
||||
return createAddMissingParamTagFix(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalQuickFix registerTagFix(@NotNull String tag) {
|
||||
return createRegisterTagFix(tag, myOnTheFly);
|
||||
return createRegisterTagFix(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -439,6 +439,10 @@ public class JavadocHighlightUtil {
|
||||
|
||||
static void checkEmptyMethodTagsDescription(PsiDocTag @NotNull [] tags, @NotNull ProblemHolder holder) {
|
||||
for (PsiDocTag tag : tags) {
|
||||
if (ContainerUtil
|
||||
.exists(tag.getChildren(), e -> e instanceof PsiInlineDocTag && ((PsiInlineDocTag)e).getName().equals("inheritDoc"))) {
|
||||
continue;
|
||||
}
|
||||
if ("return".equals(tag.getName())) {
|
||||
if (emptyTag(tag)) {
|
||||
String tagText = "<code>@return</code>";
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
interface Base {
|
||||
/**
|
||||
* @throws java.lang.RuntimeException if something wrong happens
|
||||
*/
|
||||
void test();
|
||||
}
|
||||
|
||||
class Test implements Base {
|
||||
/**
|
||||
* @throws java.lang.RuntimeException {@inheritDoc}
|
||||
* <warning descr="'throws' tag description is missing">@throws</warning> java.lang.Error
|
||||
*/
|
||||
public void test() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -119,6 +119,7 @@ public class JavadocHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIgnoreDuplicateThrows() { myInspection.setIgnoreDuplicatedThrows(true); doTest(); }
|
||||
public void testIgnoreAccessors() { myInspection.setIgnoreSimpleAccessors(true); doTest(); }
|
||||
public void testAuthoredMethod() { doTest(); }
|
||||
public void testThrowsInheritDoc() { doTest(); }
|
||||
|
||||
public void testIssueLinksInJavaDoc() {
|
||||
IssueNavigationConfiguration navigationConfiguration = IssueNavigationConfiguration.getInstance(getProject());
|
||||
|
||||
Reference in New Issue
Block a user