EA-47695 - IAE: StringUtil.getShortName

This commit is contained in:
Alexey Kudravtsev
2013-07-17 13:54:44 +04:00
parent c4d295896c
commit 0bc7b1e69b
2 changed files with 25 additions and 0 deletions
@@ -24,6 +24,7 @@ public class DummyEntryPointsEP extends InspectionEP {
public DummyEntryPointsEP() {
presentation = DummyEntryPointsPresentation.class.getName();
displayName = InspectionsBundle.message("inspection.dead.code.entry.points.display.name");
implementationClass = "";
shortName = "";
}
@@ -27,6 +27,7 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ArrayUtil;
import com.intellij.util.xmlb.annotations.Attribute;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -52,6 +53,9 @@ public class InspectionEP extends LanguageExtensionPoint implements InspectionPr
@NotNull
public String getShortName() {
if (implementationClass == null) {
throw new IllegalArgumentException(toString());
}
return shortName == null ? InspectionProfileEntry.getShortName(StringUtil.getShortName(implementationClass)) : shortName;
}
@@ -166,4 +170,24 @@ public class InspectionEP extends LanguageExtensionPoint implements InspectionPr
@Attribute("presentation")
public String presentation;
@NonNls
@Override
public String toString() {
return "InspectionEP{" +
"shortName='" + shortName + '\'' +
", key='" + key + '\'' +
", bundle='" + bundle + '\'' +
", displayName='" + displayName + '\'' +
", groupKey='" + groupKey + '\'' +
", groupBundle='" + groupBundle + '\'' +
", groupDisplayName='" + groupDisplayName + '\'' +
", groupPath='" + groupPath + '\'' +
", enabledByDefault=" + enabledByDefault +
", applyToDialects=" + applyToDialects +
", level='" + level + '\'' +
", hasStaticDescription=" + hasStaticDescription +
", presentation='" + presentation + '\'' +
'}';
}
}