diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/java15api/Java15APIUsageInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/java15api/Java15APIUsageInspectionBase.java index 80df2bb0004c..ce22eee0149c 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/java15api/Java15APIUsageInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/java15api/Java15APIUsageInspectionBase.java @@ -97,7 +97,7 @@ public class Java15APIUsageInspectionBase extends BaseJavaBatchLocalInspectionTo ourDefaultMethods.add("java.util.Iterator#remove()"); } - protected LanguageLevel myEffectiveLanguageLevel; + LanguageLevel myEffectiveLanguageLevel; @Nullable private static Set getForbiddenApi(@NotNull LanguageLevel languageLevel) { @@ -119,14 +119,8 @@ public class Java15APIUsageInspectionBase extends BaseJavaBatchLocalInspectionTo return; } - try { - BufferedReader reader = new BufferedReader(new InputStreamReader(resource.openStream(), CharsetToolkit.UTF8_CHARSET)); - try { - set.addAll(FileUtil.loadLines(reader)); - } - finally { - reader.close(); - } + try (BufferedReader reader = new BufferedReader(new InputStreamReader(resource.openStream(), CharsetToolkit.UTF8_CHARSET))) { + set.addAll(FileUtil.loadLines(reader)); } catch (IOException ignored) { } } @@ -367,7 +361,7 @@ public class Java15APIUsageInspectionBase extends BaseJavaBatchLocalInspectionTo private static String getJdkName(LanguageLevel languageLevel) { final String presentableText = languageLevel.getPresentableText(); - return presentableText.substring(0, presentableText.indexOf(" ")); + return presentableText.substring(0, presentableText.indexOf(' ')); } public static boolean isForbiddenApiUsage(@NotNull PsiMember member, @NotNull LanguageLevel languageLevel) { diff --git a/platform/usageView/src/com/intellij/usages/rules/UsageFilteringRuleProvider.java b/platform/usageView/src/com/intellij/usages/rules/UsageFilteringRuleProvider.java index f9d7295ddbd7..07cc31fd0ca9 100644 --- a/platform/usageView/src/com/intellij/usages/rules/UsageFilteringRuleProvider.java +++ b/platform/usageView/src/com/intellij/usages/rules/UsageFilteringRuleProvider.java @@ -31,5 +31,5 @@ public interface UsageFilteringRuleProvider { @NotNull AnAction[] createFilteringActions(@NotNull UsageView view); - Topic RULES_CHANGED = new Topic<>("usave view rules changed", Runnable.class); + Topic RULES_CHANGED = new Topic<>("usage view rules changed", Runnable.class); } diff --git a/plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/unsorted/AlphaUnsortedPropertiesFileInspection.java b/plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/unsorted/AlphaUnsortedPropertiesFileInspection.java index 0ed86dfac63f..a52477db4574 100644 --- a/plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/unsorted/AlphaUnsortedPropertiesFileInspection.java +++ b/plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/unsorted/AlphaUnsortedPropertiesFileInspection.java @@ -30,17 +30,18 @@ import com.intellij.openapi.util.Comparing; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.PsiFile; import com.intellij.psi.util.PsiTreeUtil; -import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; /** * @author Dmitry Batkovich */ public class AlphaUnsortedPropertiesFileInspection extends LocalInspectionTool { - private final static Logger LOG = Logger.getInstance(AlphaUnsortedPropertiesFileInspection.class); - private final static String MESSAGE_TEMPLATE_WHOLE_RESOURCE_BUNDLE = "Property keys of resource bundle '%s' aren't alphabetically sorted"; + private static final Logger LOG = Logger.getInstance(AlphaUnsortedPropertiesFileInspection.class); + private static final String MESSAGE_TEMPLATE_WHOLE_RESOURCE_BUNDLE = "Property keys of resource bundle '%s' aren't alphabetically sorted"; @NotNull @Override @@ -73,8 +74,8 @@ public class AlphaUnsortedPropertiesFileInspection extends LocalInspectionTool { }; } - private static boolean isResourceBundleAlphaSortedExceptOneFile(final @NotNull ResourceBundle resourceBundle, - final @NotNull PropertiesFile exceptedFile) { + private static boolean isResourceBundleAlphaSortedExceptOneFile(@NotNull final ResourceBundle resourceBundle, + @NotNull final PropertiesFile exceptedFile) { for (PropertiesFile file : resourceBundle.getPropertiesFiles()) { if (!(file instanceof PropertiesFileImpl)) { return true;