Use constant

This commit is contained in:
Roman Shevchenko
2012-05-22 19:02:36 +04:00
parent 2e762eea08
commit d85f261204
2 changed files with 6 additions and 5 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package com.intellij.psi.impl.source.javadoc;
import com.intellij.codeInspection.SuppressionUtil;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.project.Project;
import com.intellij.pom.java.LanguageLevel;
@@ -53,7 +54,7 @@ public class JavadocManagerImpl implements JavadocManager {
myInfos.add(new SimpleDocTagInfo("code", PsiElement.class, true, LanguageLevel.JDK_1_5));
//Not a standard tag, but added by IDEA for inspection suppression
myInfos.add(new SimpleDocTagInfo("noinspection", PsiElement.class, false, LanguageLevel.JDK_1_3));
myInfos.add(new SimpleDocTagInfo(SuppressionUtil.SUPPRESS_INSPECTIONS_TAG_NAME, PsiElement.class, false, LanguageLevel.JDK_1_3));
myInfos.add(new ParamDocTagInfo());
myInfos.add(new ReturnDocTagInfo());
@@ -15,6 +15,7 @@
*/
package com.siyeh.ig.maturity;
import com.intellij.codeInspection.SuppressionUtil;
import com.intellij.psi.JavaTokenType;
import com.intellij.psi.PsiAnnotation;
import com.intellij.psi.PsiComment;
@@ -55,9 +56,8 @@ public class SuppressionAnnotationInspection extends BaseInspection {
&& !tokenType.equals(JavaTokenType.C_STYLE_COMMENT)) {
return;
}
@NonNls final String strippedComment =
commentText.substring(2).trim();
if (strippedComment.startsWith("noinspection")) {
@NonNls final String strippedComment = commentText.substring(2).trim();
if (strippedComment.startsWith(SuppressionUtil.SUPPRESS_INSPECTIONS_TAG_NAME)) {
registerError(comment);
}
}