From fec8e2b00fc3fb52a45bc05301dec67160b15050 Mon Sep 17 00:00:00 2001 From: nik Date: Sat, 15 Feb 2020 16:01:29 +0300 Subject: [PATCH] [i18n] move properties used in Java plugin only to from InspectionsBundle to JavaAnalysisBundle This is needed to reduce amount of platform properties which are included into all IDEs (IDEA-209382). GitOrigin-RevId: 545fb9e9284185b93fa0e12598f504428c686e6e --- .../messages/JavaAnalysisBundle.properties | 218 +++++++++++++++- .../src/META-INF/JavaAnalysisPlugin.xml | 58 ++--- .../impl/actions/SuppressAllForClassFix.java | 4 +- .../daemon/impl/actions/SuppressFix.java | 14 +- .../impl/actions/SuppressForClassFix.java | 9 +- .../analysis/PostHighlightingVisitor.java | 4 +- .../codeInspection/AnnotateMethodFix.java | 9 +- .../AnonymousCanBeLambdaInspection.java | 7 +- ...onymousHasLambdaAlternativeInspection.java | 7 +- .../BlockMarkerCommentsInspection.java | 6 +- .../ClassGetClassInspection.java | 7 +- .../DeprecatedIsStillUsedInspection.java | 3 +- .../ExplicitTypeCanBeDiamondInspection.java | 3 +- ...idComparatorMethodReferenceInspection.java | 5 +- .../NumericOverflowInspection.java | 3 +- ...ossibleHeapPollutionVarargsInspection.java | 9 +- .../RedundantLambdaCodeBlockInspection.java | 5 +- .../StringTokenizerDelimiterInspection.java | 5 +- .../SuspiciousArrayMethodCallInspection.java | 5 +- .../UseCompareMethodInspection.java | 5 +- .../VariableTypeCanBeExplicitInspection.java | 5 +- .../canBeFinal/CanBeFinalInspection.java | 11 +- .../JavacQuirksInspectionVisitor.java | 22 +- .../FieldAccessNotGuardedInspection.java | 3 +- .../InstanceGuardedByStaticInspection.java | 5 +- .../NonFinalFieldInImmutableInspection.java | 3 +- .../NonFinalGuardInspection.java | 5 +- .../StaticGuardedByInstanceInspection.java | 5 +- .../UnknownGuardInspection.java | 5 +- .../dataFlow/DataFlowInspectionBase.java | 10 +- .../dataFlow/fix/DeleteSwitchLabelFix.java | 8 +- .../dataFlow/fix/RedundantInstanceofFix.java | 4 +- .../fix/ReplaceWithConstantValueFix.java | 4 +- .../dataFlow/fix/SimplifyToAssignmentFix.java | 4 +- .../fix/SurroundWithRequireNonNullFix.java | 6 +- .../deprecation/DeprecationInspection.java | 10 +- .../DeprecationInspectionBase.java | 8 +- .../DuplicateThrowsInspection.java | 9 +- .../EqualsAndHashcodeBase.java | 6 +- .../InconsistentLanguageLevelInspection.java | 3 +- .../inheritance/ImplicitSubclassInspection.kt | 7 +- .../java19modules/Java9ModuleEntryPoint.java | 4 +- ...oduleExportsPackageToItselfInspection.java | 8 +- ...9RedundantRequiresStatementInspection.java | 7 +- .../JavaModuleNamingInspection.java | 4 +- .../JavaRequiresAutoModuleInspection.java | 8 +- .../localCanBeFinal/LocalCanBeFinal.java | 17 +- .../RedundantTypeArgsInspection.java | 9 +- ...ciousCollectionsMethodCallsInspection.java | 3 +- .../SuspiciousMethodCallUtil.java | 8 +- .../AnnotateOverriddenMethodParameterFix.java | 6 +- .../nullable/ChangeNullableDefaultsFix.java | 4 +- .../nullable/NullableStuffInspectionBase.java | 47 ++-- .../RedundantCastInspection.java | 7 +- .../reference/RefImplicitConstructorImpl.java | 6 +- .../reference/RefJavaElementImpl.java | 9 +- .../SameReturnValueInspection.java | 7 +- .../testOnly/TestOnlyInspection.java | 10 +- ...UnnecessaryModuleDependencyInspection.java | 7 +- .../RedundantThrowsDeclarationInspection.java | 12 +- .../unusedImport/UnusedImportInspection.java | 3 +- .../UnusedLibrariesInspection.java | 9 +- .../AccessCanBeTightenedInspection.java | 3 +- .../visibility/VisibilityInspection.java | 17 +- .../xml/DeprecatedClassUsageInspection.java | 8 +- .../ClassHasNoToStringMethodInspection.java | 18 +- .../FieldNotUsedInToStringInspection.java | 6 +- .../impl/quickfix/RemoveTypeArgumentsFix.java | 4 +- ...onymousCanBeMethodReferenceInspection.java | 3 +- .../ex/HTMLJavaHTMLComposerImpl.java | 2 +- .../java18api/Java8MapForEachInspection.java | 5 +- .../streamMigration/MigrateToStreamFix.java | 3 +- .../Java9ModuleExportsPackageToItselfTest.kt | 7 +- .../propertyBased/JavaIntentionPolicy.java | 4 +- .../messages/AnalysisBundle.properties | 1 + .../messages/InspectionsBundle.properties | 237 ------------------ ...piciousIntegerDivAssignmentInspection.java | 4 +- .../DefaultNotLastCaseInSwitchInspection.java | 4 +- ...tementWithIdenticalBranchesInspection.java | 13 +- .../InfiniteLoopStatementInspection.java | 4 +- .../ig/inheritance/StaticInheritanceFix.java | 4 +- .../SuspiciousGetterSetterInspection.java | 4 +- .../siyeh/ig/junit/JUnitRuleInspection.java | 6 +- .../siyeh/ig/numeric/UnaryPlusInspection.java | 4 +- .../CStyleArrayDeclarationInspection.java | 4 +- ...tantOnWrongSideOfComparisonInspection.java | 4 +- ...bjectsEqualsCanBeSimplifiedInspection.java | 5 +- ...edundantFieldInitializationInspection.java | 4 +- .../UnnecessarySuperQualifierInspection.java | 4 +- .../LambdaCanBeMethodCallInspection.java | 3 +- .../codeInspection/SuppressForMemberFix.java | 6 +- 91 files changed, 579 insertions(+), 536 deletions(-) diff --git a/java/java-analysis-api/resources/messages/JavaAnalysisBundle.properties b/java/java-analysis-api/resources/messages/JavaAnalysisBundle.properties index 7b6b30b1d41b..037c522e35b4 100644 --- a/java/java-analysis-api/resources/messages/JavaAnalysisBundle.properties +++ b/java/java-analysis-api/resources/messages/JavaAnalysisBundle.properties @@ -139,4 +139,220 @@ replace.get.class.with.class.literal=Replace getClass() with .class literal service.provides=Provides service {0}
Click to navigate
service.uses=Uses service {0}
Click to navigate
suppress.for.parameter=Suppress for parameter -suppress.for.statement.with.comment=Suppress for statement with comment \ No newline at end of file +suppress.for.statement.with.comment=Suppress for statement with comment + +0.field.is.always.initialized.not.null=@{0} field is always initialized not-null +access.can.be.0=Access can be {0} +access.to.field.code.ref.code.outside.of.declared.guards.loc=Access to field #ref outside of declared guards #loc +annotate.as.safevarargs=Annotate as @SafeVarargs +annotate.overridden.methods.parameters.family.name=Annotate overridden method parameters +annotate.overridden.methods.parameters=Annotate overridden method parameters as ''@{0}'' +anonymous.ref.loc.can.be.replaced.with.0=Anonymous #ref #loc can be replaced with {0} +anonymous.ref.loc.can.be.replaced.with.lambda=Anonymous #ref #loc can be replaced with lambda +assigning.a.collection.of.nullable.elements=Assigning a collection of nullable elements into a collection of non-null elements +comparision.between.object.and.primitive=Comparision between Object and primitive is illegal and is accepted in java 7 only +custom.exception.class.should.have.a.constructor=Custom exception class should have a constructor with a single message parameter of String type +delimiters.argument.contains.duplicated.characters=Delimiters argument contains duplicated characters +deprecated.class.usage.group.xml=XML +deprecated.member.0.is.still.used=Deprecated member ''{0}'' is still used +detach.library.quickfix.name=Detach library +detach.library.roots.quickfix.name=Detach unused library roots +don.t.report.unused.jars.inside.used.library=Don't report unused jars inside used library +explicit.type.argument.ref.loc.can.be.replaced.with=Explicit type argument #ref #loc can be replaced with <> +exports.to.itself.delete.module.ref.fix=Delete reference to module ''{0}'' +exports.to.itself.delete.statement.fix=Delete directive +html.classes.exposed.with.code.module.info.code.html=Classes exposed with module-info +html.ignore.overrides.of.deprecated.abstract.methods=Ignore overrides of deprecated abstract methods from non-deprecated supers +ignore.casts.in.suspicious.collections.method.calls=Ignore casts in suspicious collections method calls +ignore.exceptions.thrown.by.entry.points.methods=Ignore exceptions thrown by entry points methods +ignore.in.the.same.outermost.class=Ignore in the same outermost class +ignore.inside.deprecated.members=Ignore inside deprecated members +ignore.inside.non.static.imports=Ignore inside non-static imports +ignore.members.of.deprecated.classes=Ignore members of deprecated classes +ignore.operation.which.results.in.negative.value=Ignore '<<' operation which results in negative value +inspection.annotate.method.quickfix.family.name=Annotate method +inspection.annotate.overridden.method.and.self.quickfix.family.name=Annotate overridden methods and self +inspection.annotate.overridden.method.quickfix.family.name=Annotate overridden methods +inspection.c.style.array.declarations.option=Ignore C-style declarations in variables +inspection.can.be.final.accept.quickfix=Make final +inspection.can.be.final.option1=Report methods +inspection.can.be.final.option2=Report fields +inspection.can.be.final.option=Report classes +inspection.can.be.local.parameter.problem.descriptor=Parameter #ref can have final modifier +inspection.can.be.local.variable.problem.descriptor=Variable #ref can have final modifier +inspection.can.be.replaced.with.message=Can be replaced with ''{0}'' +inspection.class.getclass.display.name=Class.getClass() call +inspection.class.getclass.fix.remove.name=Remove 'getClass()' call +inspection.class.getclass.fix.replace.name=Replace with 'Class.class' +inspection.class.getclass.message='getClass()' is called on Class instance +inspection.class.has.no.to.string.method.description=Class ''{0}'' does not override ''toString()'' method +inspection.class.has.no.to.string.method.exclude.classes.reg.exp.option=Exclude classes (reg exp): +inspection.class.has.no.to.string.method.ignore.abstract.classes.option=Ignore abstract classes +inspection.class.has.no.to.string.method.ignore.deprecated.classes.option=Ignore deprecated classes +inspection.class.has.no.to.string.method.ignore.enum.classes.option=Ignore enum classes +inspection.class.has.no.to.string.method.ignore.exception.classes.option=Ignore exception classes +inspection.class.has.no.to.string.method.ignore.inner.classes.option=Ignore inner classes +inspection.class.has.no.to.string.method.ignore.test.classes.option=Ignore test classes +inspection.common.if.parts.disable.highlight.tail.call=Do not highlight common parts, if tail statement is call +inspection.common.if.parts.family.else.if.description='else if' can be merged +inspection.common.if.parts.family.else.if=Merge 'else if' statement +inspection.common.if.parts.family=Extract common parts of 'if' statement +inspection.common.if.parts.settings.highlight.when.tail.call=Highlight when last common statement is call +inspection.compiler.javac.quirks.anno.array.comma.fix=Remove trailing comma +inspection.compiler.javac.quirks.anno.array.comma.problem=Trailing comma in annotation array initializer may cause compilation error in some Javac versions (e.g. JDK 5 and JDK 6). +inspection.compiler.javac.quirks.name=Javac quirks +inspection.compiler.javac.quirks.qualifier.type.args.fix=Remove generic parameter +inspection.compiler.javac.quirks.qualifier.type.args.problem=Generics in qualifier reference may cause compilation error in some Javac versions (e.g. JDK 5 and JDK 6). +inspection.constant.on.wrong.side.of.a.comparison.side.option=Constant should be on this side of a comparison: +inspection.contract.display.name=Contract issues +inspection.data.flow.redundant.instanceof.quickfix=Replace with a null check +inspection.data.flow.simplify.boolean.expression.quickfix=Simplify boolean expression +inspection.data.flow.simplify.to.assignment.quickfix.name=Simplify to normal assignment +inspection.data.flow.turn.off.constant.references.quickfix=Don't report values which are guaranteed to be constant +inspection.data.flow.turn.off.nullable.returning.notnull.quickfix=Don't report nullable methods which always return not-null value +inspection.data.flow.turn.off.true.asserts.quickfix=Don't report always true assertions +inspection.duplicate.throws.display.name=Duplicate throws +inspection.duplicate.throws.ignore.subclassing.option=Ignore exceptions subclassing others +inspection.duplicate.throws.more.general.problem=There is a more general exception, ''{0}'', in the throws list already. +inspection.duplicate.throws.problem=Duplicate throws +inspection.equals.hashcode.only.one.defined.problem.descriptor=Class has {0} defined but does not define {1} +inspection.export.results.can.be.final.description=Declaration can have final modifier +inspection.field.not.used.in.to.string.description2=Field ''{0}'' is not used in ''toString()'' method +inspection.field.not.used.in.to.string.description=Method ''{0}'' is not used in ''toString()'' method +inspection.implicit.subclass.display.forClass=Class ''{0}'' could be implicitly subclassed and must not be final +inspection.implicit.subclass.display.name=Final declaration can't be overridden at runtime +inspection.implicit.subclass.extendable=Make ''{0}'' overridable +inspection.implicit.subclass.make.class.extendable=Make class ''{0}'' {1,choice,0#|1#and method {2} |1 +inspection.requires.auto.module.message='requires' directive for an automatic module +inspection.requires.auto.module.option=Highlight only transitive dependencies +inspection.requires.auto.module.transitive='requires transitive' directive for an automatic module +inspection.requires.auto.module=Dependencies on automatic modules +inspection.same.return.value.display.name=Method returns the same value +inspection.same.return.value.problem.descriptor1=Method and all its derivables always return {0} +inspection.same.return.value.problem.descriptor2=All implementations of this method always return {0} +inspection.same.return.value.problem.descriptor=Method always returns {0} +inspection.surround.requirenonnull.quickfix=Replace with ''Objects.requireNonNull({0})'' +inspection.suspicious.array.method.call.display.name=Suspicious Arrays method calls +inspection.suspicious.array.method.call.problem.arrays=Array types are incompatible: arrays are always different +inspection.suspicious.array.method.call.problem.element=Element type is not compatible with array type +inspection.suspicious.collections.method.calls.display.name=Suspicious collections method calls +inspection.suspicious.collections.method.calls.problem.descriptor1=Suspicious call to ''{0}'' +inspection.suspicious.collections.method.calls.problem.descriptor=''{0}'' may not contain {2} of type ''{1}'' +inspection.suspicious.getter.setter.field.option=Only warn when field matching getter/setter name is present +inspection.suspicious.integer.div.assignment.option=Report suspicious but possibly exact divisions +inspection.test.only.problems.display.name=Test-only class or method call in production code +inspection.test.only.problems.test.only.class.reference=Test-only class is referenced in production code +inspection.test.only.problems.test.only.field.reference=Test-only field is referenced in production code +inspection.test.only.problems.test.only.method.call=Test-only method is called in production code +inspection.unary.plus.unary.binary.option=Only report in confusing binary or unary expression context +inspection.unnecessary.super.qualifier.option=Ignore clarification 'super' qualifier +inspection.use.compare.method.fix.family.name=Replace with single comparison method +inspection.visibility.accept.quickfix=Accept suggested access level +inspection.visibility.compose.suggestion=Can be {0} +inspection.visibility.option.constants=Suggest weaker visibility for constants +inspection.visibility.option.package.private.members=Suggest package-private visibility level for class members +inspection.visibility.package.private.top.level.classes=Suggest package-private visibility level for top-level classes +inspection.visibility.private.inner.members=Suggest private for inner class members when referenced from outer class only +instance.member.guarded.by.static.0.loc=Instance member guarded by static "{0}" #loc +instance.member.guarded.by.static.ref.loc=Instance member guarded by static #ref #loc +junit.rule.classrule.option=Report @ClassRule problems +junit.rule.rule.option=Report @Rule problems +make.0.default.annotation=Make "{0}" default annotation +make.default.the.last.case.family.name=Make 'default' the last case +make.final.and.annotate.as.safevarargs=Make final and annotate as @SafeVarargs +method.reference.mapped.to.comparator=Method reference mapped to Comparator interface does not fulfill the Comparator contract +module.0.with.language.level.1.depends.on.module.2.with.language.level.3=Module {0} with language level {1} depends on module {2} with language level {3} +non.final.field.code.ref.code.in.immutable.class.loc=Non-final field #ref in @Immutable class #loc +non.final.guarded.by.field.0.loc=Non-final @GuardedBy field "{0}" #loc +non.final.guarded.by.field.ref.loc=Non-final @GuardedBy field #ref #loc +non.null.type.argument.is.expected=Non-null type argument is expected +not.annotated.method.is.used.as.an.override.for.a.method.annotated.with.0=Not annotated method is used as an override for a method annotated with {0} +nullable.stuff.problems.overridden.method.parameters.are.not.annotated=Overridden method parameters are not annotated +nullable.stuff.problems.overridden.methods.are.not.annotated=Overridden methods are not annotated +parameter.can.be.null=Parameter can be null +parameter.is.always.not.null=Parameter is always not-null +possible.heap.pollution.from.parameterized.vararg.type.loc=Possible heap pollution from parameterized vararg type #loc +redundant.block.marker=Redundant block marker +remove.block.marker.comments=Remove block marker comments +remove.dependency=Remove dependency +remove.switch.branch.0=Remove switch branch ''{0}'' +remove.switch.label.0=Remove switch label ''{0}'' +remove.switch.label=Remove switch label +replace.0.with=Replace ''''{0}'''' with ''''='''' +replace.anonymous.class.with.lambda.alternative=Replace anonymous class with lambda alternative +replace.operator.assignment.with.assignment=Replace Operator Assignment with Assignment +replace.stringtokenizer.delimiters.parameter.with.unique.symbols=Replace StringTokenizer delimiters parameter with unique symbols +replace.var.with.explicit.type=Replace 'var' with explicit type +replace.with.0=Replace with {0} +replace.with.comparator=Replace with comparator +replace.with.constant.value=Replace with constant value +replace.with.expression.lambda=Replace with expression lambda +replace.with.lambda=Replace with lambda +report.suspicious.but.possibly.correct.method.calls=&Report suspicious but possibly correct method calls +report.when.interface.is.not.annotated.with.functional.interface=Report when interface is not annotated with @FunctionalInterface +searching.for.overriding.methods=Searching for Overriding Methods +statement.lambda.can.be.replaced.with.expression.lambda=Statement lambda can be replaced with expression lambda +static.inheritrance.fix.replace.progress=Replacing usages of {0} +static.member.guarded.by.instance.0.loc=Static member guarded by instance "{0}" #loc +static.member.guarded.by.instance.ref.loc=Static member guarded by instance #ref #loc +suppress.all.for.class=Suppress all inspections for class +suppress.inspection.class=Suppress for class +suppress.inspection.field=Suppress for field +suppress.inspection.member=Suppress for member +suppress.inspection.method=Suppress for method +suppress.inspection.module=Suppress for module declaration +suspected.module.dependency.problem.descriptor=Module ''{0}'' does not depend on module ''{1}''. Though ''{1}'' was not inspected for exported dependencies needed for scope ''{2}'' +unknown.guardedby.reference.0.loc=Unknown @GuardedBy reference "{0}" #loc +unknown.guardedby.reference.ref.loc=Unknown @GuardedBy reference #ref #loc +unnecessary.module.dependency.display.name=Unnecessary module dependency +unnecessary.module.dependency.problem.descriptor=Module ''{0}'' sources do not depend on module ''{1}'' sources +unused.import.display.name=Unused import +unused.import.statement=Unused import statement +unused.library.display.name=Unused library +unused.library.problem.descriptor=Unused library ''{0}'' +unused.library.roots.problem.descriptor=Unused roots {0} from library ''{1}'' +var.can.be.replaced.with.explicit.type='var' can be replaced with explicit type +vararg.method.call.with.50.poly.arguments=Vararg method call with 50+ poly arguments may cause compilation and analysis slowdown +visible.for.testing.makes.little.sense.on.test.only.code=@VisibleForTesting makes little sense on @TestOnly code \ No newline at end of file diff --git a/java/java-analysis-impl/src/META-INF/JavaAnalysisPlugin.xml b/java/java-analysis-impl/src/META-INF/JavaAnalysisPlugin.xml index 062f0c450a42..891ddc6b6fa7 100644 --- a/java/java-analysis-impl/src/META-INF/JavaAnalysisPlugin.xml +++ b/java/java-analysis-impl/src/META-INF/JavaAnalysisPlugin.xml @@ -72,17 +72,17 @@ - - - - @@ -173,41 +173,41 @@ enabledByDefault="true" level="WARNING" implementationClass="com.intellij.codeInspection.deprecation.DeprecationInspection"/> - - - - - - - - @@ -239,12 +239,12 @@ diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressAllForClassFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressAllForClassFix.java index 07f784f4a47f..2dc0643f6431 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressAllForClassFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressAllForClassFix.java @@ -15,10 +15,10 @@ */ package com.intellij.codeInsight.daemon.impl.actions; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.JavaSuppressionUtil; import com.intellij.codeInspection.SuppressionUtil; import com.intellij.codeInspection.SuppressionUtilCore; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; @@ -63,7 +63,7 @@ public class SuppressAllForClassFix extends SuppressFix { @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("suppress.all.for.class"); + return JavaAnalysisBundle.message("suppress.all.for.class"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressFix.java index e6d625cfc541..bd3097cb7015 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressFix.java @@ -17,9 +17,9 @@ package com.intellij.codeInsight.daemon.impl.actions; import com.intellij.codeInsight.daemon.HighlightDisplayKey; import com.intellij.codeInsight.intention.impl.BaseIntentionAction; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.JavaSuppressionUtil; import com.intellij.codeInspection.SuppressionUtilCore; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.lang.java.JavaLanguage; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.command.undo.UndoUtil; @@ -56,7 +56,7 @@ public class SuppressFix extends AbstractBatchSuppressByNoInspectionCommentFix { @NotNull public String getText() { String myText = super.getText(); - return StringUtil.isEmpty(myText) ? InspectionsBundle.message("suppress.inspection.member") : myText; + return StringUtil.isEmpty(myText) ? JavaAnalysisBundle.message("suppress.inspection.member") : myText; } @Override @@ -89,16 +89,16 @@ public class SuppressFix extends AbstractBatchSuppressByNoInspectionCommentFix { return false; } if (container instanceof PsiJavaModule) { - setText(InspectionsBundle.message("suppress.inspection.module")); + setText(JavaAnalysisBundle.message("suppress.inspection.module")); } else if (container instanceof PsiClass) { - setText(InspectionsBundle.message("suppress.inspection.class")); + setText(JavaAnalysisBundle.message("suppress.inspection.class")); } else if (container instanceof PsiMethod) { - setText(InspectionsBundle.message("suppress.inspection.method")); + setText(JavaAnalysisBundle.message("suppress.inspection.method")); } else { - setText(InspectionsBundle.message("suppress.inspection.field")); + setText(JavaAnalysisBundle.message("suppress.inspection.field")); } return true; } @@ -119,7 +119,7 @@ public class SuppressFix extends AbstractBatchSuppressByNoInspectionCommentFix { @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("suppress.inspection.member"); + return JavaAnalysisBundle.message("suppress.inspection.member"); } private boolean doSuppress(@NotNull Project project, PsiJavaDocumentedElement container) { diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressForClassFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressForClassFix.java index c6ed839692da..e98852650586 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressForClassFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressForClassFix.java @@ -16,8 +16,11 @@ package com.intellij.codeInsight.daemon.impl.actions; import com.intellij.codeInsight.daemon.HighlightDisplayKey; -import com.intellij.codeInspection.InspectionsBundle; -import com.intellij.psi.*; +import com.intellij.java.analysis.JavaAnalysisBundle; +import com.intellij.psi.PsiClass; +import com.intellij.psi.PsiDeclarationStatement; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiJavaDocumentedElement; import com.intellij.psi.util.PsiTreeUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -57,6 +60,6 @@ public class SuppressForClassFix extends SuppressFix { @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("suppress.inspection.class"); + return JavaAnalysisBundle.message("suppress.inspection.class"); } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/PostHighlightingVisitor.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/PostHighlightingVisitor.java index 624bac95578e..11a4499e6cb7 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/PostHighlightingVisitor.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/PostHighlightingVisitor.java @@ -10,12 +10,12 @@ import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction; import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.codeInsight.intention.QuickFixFactory; import com.intellij.codeInspection.InspectionProfile; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.SuppressionUtil; import com.intellij.codeInspection.deadCode.UnusedDeclarationInspectionBase; import com.intellij.codeInspection.unusedImport.UnusedImportInspection; import com.intellij.codeInspection.unusedSymbol.UnusedSymbolLocalInspectionBase; import com.intellij.codeInspection.util.SpecialAnnotationsUtilBase; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.lang.Language; import com.intellij.lang.annotation.HighlightSeverity; import com.intellij.openapi.Disposable; @@ -537,7 +537,7 @@ class PostHighlightingVisitor { VirtualFile file = PsiUtilCore.getVirtualFile(myFile); Set imports = file != null ? file.getCopyableUserData(ImportsHighlightUtil.IMPORTS_FROM_TEMPLATE) : null; boolean predefinedImport = imports != null && imports.contains(importStatement.getText()); - String description = !predefinedImport ? InspectionsBundle.message("unused.import.statement") : "Unused import (specified in template)"; + String description = !predefinedImport ? JavaAnalysisBundle.message("unused.import.statement") : "Unused import (specified in template)"; HighlightInfo info = HighlightInfo.newHighlightInfo(JavaHighlightInfoTypes.UNUSED_IMPORT) .range(importStatement) .descriptionAndTooltip(description) diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/AnnotateMethodFix.java b/java/java-analysis-impl/src/com/intellij/codeInspection/AnnotateMethodFix.java index dc859d71133c..a332921e2b0b 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/AnnotateMethodFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/AnnotateMethodFix.java @@ -5,6 +5,7 @@ import com.intellij.codeInsight.AnnotationUtil; import com.intellij.codeInsight.FileModificationService; import com.intellij.codeInsight.intention.AddAnnotationPsiFix; import com.intellij.codeInspection.nullable.NullableStuffInspectionBase; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.command.undo.UndoUtil; import com.intellij.openapi.diagnostic.Logger; @@ -57,11 +58,11 @@ public class AnnotateMethodFix implements LocalQuickFix { public String getFamilyName() { if (annotateSelf()) { if (annotateOverriddenMethods()) { - return InspectionsBundle.message("inspection.annotate.overridden.method.and.self.quickfix.family.name"); + return JavaAnalysisBundle.message("inspection.annotate.overridden.method.and.self.quickfix.family.name"); } - return InspectionsBundle.message("inspection.annotate.method.quickfix.family.name"); + return JavaAnalysisBundle.message("inspection.annotate.method.quickfix.family.name"); } - return InspectionsBundle.message("inspection.annotate.overridden.method.quickfix.family.name"); + return JavaAnalysisBundle.message("inspection.annotate.overridden.method.quickfix.family.name"); } @Override @@ -118,6 +119,6 @@ public class AnnotateMethodFix implements LocalQuickFix { } }); } - }, InspectionsBundle.message("searching.for.overriding.methods"), true, method.getProject()); + }, JavaAnalysisBundle.message("searching.for.overriding.methods"), true, method.getProject()); } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeLambdaInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeLambdaInspection.java index e320e7509e17..75c12a9719d7 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeLambdaInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeLambdaInspection.java @@ -6,6 +6,7 @@ import com.intellij.codeInsight.ChangeContextUtil; import com.intellij.codeInsight.daemon.impl.analysis.HighlightControlFlowUtil; import com.intellij.codeInsight.intention.HighPriorityAction; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; @@ -59,7 +60,7 @@ public class AnonymousCanBeLambdaInspection extends AbstractBaseJavaLocalInspect @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("report.when.interface.is.not.annotated.with.functional.interface"), this, "reportNotAnnotatedInterfaces"); + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("report.when.interface.is.not.annotated.with.functional.interface"), this, "reportNotAnnotatedInterfaces"); } @NotNull @@ -82,7 +83,7 @@ public class AnonymousCanBeLambdaInspection extends AbstractBaseJavaLocalInspect type = ProblemHighlightType.INFORMATION; } } - holder.registerProblem(parent, InspectionsBundle.message("anonymous.ref.loc.can.be.replaced.with.lambda"), + holder.registerProblem(parent, JavaAnalysisBundle.message("anonymous.ref.loc.can.be.replaced.with.lambda"), type, rangeInElement, new ReplaceWithLambdaFix()); } } @@ -380,7 +381,7 @@ public class AnonymousCanBeLambdaInspection extends AbstractBaseJavaLocalInspect @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("replace.with.lambda"); + return JavaAnalysisBundle.message("replace.with.lambda"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousHasLambdaAlternativeInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousHasLambdaAlternativeInspection.java index b915c649edeb..5d813b29315c 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousHasLambdaAlternativeInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousHasLambdaAlternativeInspection.java @@ -1,6 +1,7 @@ // Copyright 2000-2017 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. package com.intellij.codeInspection; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.TextRange; @@ -59,7 +60,7 @@ public class AnonymousHasLambdaAlternativeInspection extends AbstractBaseJavaLoc LOG.assertTrue(lBrace != null); final TextRange rangeInElement = new TextRange(0, lBrace.getStartOffsetInParent() + aClass.getStartOffsetInParent() - 1); holder.registerProblem(aClass.getParent(), - InspectionsBundle.message("anonymous.ref.loc.can.be.replaced.with.0", alternative.myReplacementMessage), + JavaAnalysisBundle.message("anonymous.ref.loc.can.be.replaced.with.0", alternative.myReplacementMessage), ProblemHighlightType.LIKE_UNUSED_SYMBOL, rangeInElement, new ReplaceWithLambdaAlternativeFix(alternative)); } } @@ -89,14 +90,14 @@ public class AnonymousHasLambdaAlternativeInspection extends AbstractBaseJavaLoc @NotNull @Override public String getName() { - return InspectionsBundle.message("replace.with.0", myAlternative.myReplacementMessage); + return JavaAnalysisBundle.message("replace.with.0", myAlternative.myReplacementMessage); } @Nls @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("replace.anonymous.class.with.lambda.alternative"); + return JavaAnalysisBundle.message("replace.anonymous.class.with.lambda.alternative"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/BlockMarkerCommentsInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/BlockMarkerCommentsInspection.java index 14499226f95b..2f6e1ed29bfc 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/BlockMarkerCommentsInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/BlockMarkerCommentsInspection.java @@ -1,6 +1,7 @@ // Copyright 2000-2017 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. package com.intellij.codeInspection; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.lang.Commenter; import com.intellij.lang.LanguageCommenters; import com.intellij.openapi.project.Project; @@ -11,7 +12,6 @@ import com.intellij.patterns.PsiJavaElementPattern; import com.intellij.psi.*; import com.intellij.psi.tree.IElementType; import com.intellij.util.ProcessingContext; -import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; import static com.intellij.patterns.PsiJavaPatterns.or; @@ -77,11 +77,11 @@ public class BlockMarkerCommentsInspection extends AbstractBaseJavaLocalInspecti return; } if (MARKER_PATTERN.accepts(element)) { - holder.registerProblem(element, InspectionsBundle.message("redundant.block.marker"), new LocalQuickFix() { + holder.registerProblem(element, JavaAnalysisBundle.message("redundant.block.marker"), new LocalQuickFix() { @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("remove.block.marker.comments"); + return JavaAnalysisBundle.message("remove.block.marker.comments"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/ClassGetClassInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/ClassGetClassInspection.java index 7a449a72d9da..f81a07c71ea2 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/ClassGetClassInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/ClassGetClassInspection.java @@ -1,6 +1,7 @@ // Copyright 2000-2018 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. package com.intellij.codeInspection; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; @@ -32,7 +33,7 @@ public class ClassGetClassInspection extends AbstractBaseJavaLocalInspectionTool if (!(type instanceof PsiClassType)) return; if (!((PsiClassType)type).rawType().equalsToText(CommonClassNames.JAVA_LANG_CLASS)) return; holder.registerProblem(Objects.requireNonNull(call.getMethodExpression().getReferenceNameElement()), - InspectionsBundle.message("inspection.class.getclass.message"), + JavaAnalysisBundle.message("inspection.class.getclass.message"), new RemoveGetClassCallFix(), new ReplaceWithClassClassFix()); } }; @@ -43,7 +44,7 @@ public class ClassGetClassInspection extends AbstractBaseJavaLocalInspectionTool @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("inspection.class.getclass.fix.remove.name"); + return JavaAnalysisBundle.message("inspection.class.getclass.fix.remove.name"); } @Override @@ -61,7 +62,7 @@ public class ClassGetClassInspection extends AbstractBaseJavaLocalInspectionTool @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("inspection.class.getclass.fix.replace.name"); + return JavaAnalysisBundle.message("inspection.class.getclass.fix.replace.name"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/DeprecatedIsStillUsedInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/DeprecatedIsStillUsedInspection.java index 70ce041aa9c5..872d631df805 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/DeprecatedIsStillUsedInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/DeprecatedIsStillUsedInspection.java @@ -2,6 +2,7 @@ package com.intellij.codeInspection; import com.intellij.codeInspection.deprecation.DeprecationInspectionBase; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.search.PsiSearchHelper; @@ -38,7 +39,7 @@ public class DeprecatedIsStillUsedInspection extends LocalInspectionTool { PsiSearchHelper searchHelper = PsiSearchHelper.getInstance(member.getProject()); String name = member.getName(); if (name != null && hasUsages(member, name, searchHelper, member.getResolveScope())) { - holder.registerProblem(identifier, InspectionsBundle.message("deprecated.member.0.is.still.used", name)); + holder.registerProblem(identifier, JavaAnalysisBundle.message("deprecated.member.0.is.still.used", name)); } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/ExplicitTypeCanBeDiamondInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/ExplicitTypeCanBeDiamondInspection.java index 0e52dc853a5d..4ede00458b9e 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/ExplicitTypeCanBeDiamondInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/ExplicitTypeCanBeDiamondInspection.java @@ -2,6 +2,7 @@ package com.intellij.codeInspection; import com.intellij.codeInsight.intention.HighPriorityAction; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.TextRange; @@ -53,7 +54,7 @@ public class ExplicitTypeCanBeDiamondInspection extends AbstractBaseJavaLocalIns final PsiElement lastChild = parameterList.getLastChild(); final TextRange range = new TextRange(firstChild != null && firstChild.getNode().getElementType() == JavaTokenType.LT ? 1 : 0, parameterList.getTextLength() - (lastChild != null && lastChild.getNode().getElementType() == JavaTokenType.GT ? 1 : 0)); - holder.registerProblem(parameterList, InspectionsBundle.message("explicit.type.argument.ref.loc.can.be.replaced.with"), ProblemHighlightType.LIKE_UNUSED_SYMBOL, range, new ReplaceWithDiamondFix()); + holder.registerProblem(parameterList, JavaAnalysisBundle.message("explicit.type.argument.ref.loc.can.be.replaced.with"), ProblemHighlightType.LIKE_UNUSED_SYMBOL, range, new ReplaceWithDiamondFix()); } } }; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/InvalidComparatorMethodReferenceInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/InvalidComparatorMethodReferenceInspection.java index 5ff7e4d819e8..564719619eaa 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/InvalidComparatorMethodReferenceInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/InvalidComparatorMethodReferenceInspection.java @@ -1,6 +1,7 @@ // Copyright 2000-2017 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. package com.intellij.codeInspection; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.codeStyle.JavaCodeStyleManager; @@ -29,7 +30,7 @@ public class InvalidComparatorMethodReferenceInspection extends AbstractBaseJava holder .registerProblem(expression, - InspectionsBundle + JavaAnalysisBundle .message("method.reference.mapped.to.comparator"), new ReplaceWithComparatorQuickFix(name.equals("min"))); } @@ -70,7 +71,7 @@ public class InvalidComparatorMethodReferenceInspection extends AbstractBaseJava @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("replace.with.comparator"); + return JavaAnalysisBundle.message("replace.with.comparator"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/NumericOverflowInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/NumericOverflowInspection.java index 1fcfd34e052a..fab663da2c48 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/NumericOverflowInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/NumericOverflowInspection.java @@ -3,6 +3,7 @@ package com.intellij.codeInspection; import com.intellij.codeInsight.daemon.JavaErrorBundle; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Key; import com.intellij.psi.*; @@ -27,7 +28,7 @@ public class NumericOverflowInspection extends AbstractBaseJavaLocalInspectionTo @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("ignore.operation.which.results.in.negative.value"), this, + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("ignore.operation.which.results.in.negative.value"), this, "ignoreLeftShiftWithNegativeResult"); } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/PossibleHeapPollutionVarargsInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/PossibleHeapPollutionVarargsInspection.java index d8e486e7d122..2035340eb498 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/PossibleHeapPollutionVarargsInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/PossibleHeapPollutionVarargsInspection.java @@ -5,6 +5,7 @@ import com.intellij.codeInsight.AnnotationUtil; import com.intellij.codeInsight.daemon.impl.analysis.GenericsHighlightUtil; import com.intellij.codeInsight.daemon.impl.analysis.JavaGenericsUtil; import com.intellij.codeInsight.intention.AddAnnotationPsiFix; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.diagnostic.Logger; @@ -58,7 +59,7 @@ public class PossibleHeapPollutionVarargsInspection extends AbstractBaseJavaLoca @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("annotate.as.safevarargs"); + return JavaAnalysisBundle.message("annotate.as.safevarargs"); } @Override @@ -90,7 +91,7 @@ public class PossibleHeapPollutionVarargsInspection extends AbstractBaseJavaLoca @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("make.final.and.annotate.as.safevarargs"); + return JavaAnalysisBundle.message("make.final.and.annotate.as.safevarargs"); } @Nullable @@ -157,7 +158,7 @@ public class PossibleHeapPollutionVarargsInspection extends AbstractBaseJavaLoca final PsiElement nameIdentifier = ((PsiNameIdentifierOwner)aClass).getNameIdentifier(); if (nameIdentifier != null) { final LocalQuickFix quickFix = new AnnotateAsSafeVarargsQuickFix(); - myHolder.registerProblem(nameIdentifier, InspectionsBundle.message("possible.heap.pollution.from.parameterized.vararg.type.loc"), quickFix); + myHolder.registerProblem(nameIdentifier, JavaAnalysisBundle.message("possible.heap.pollution.from.parameterized.vararg.type.loc"), quickFix); } } @@ -197,7 +198,7 @@ public class PossibleHeapPollutionVarargsInspection extends AbstractBaseJavaLoca OverridingMethodsSearch.search(method).findFirst() == null; quickFix = canBeFinal ? new MakeFinalAndAnnotateQuickFix() : null; } - myHolder.registerProblem(nameIdentifier, InspectionsBundle.message("possible.heap.pollution.from.parameterized.vararg.type.loc"), quickFix); + myHolder.registerProblem(nameIdentifier, JavaAnalysisBundle.message("possible.heap.pollution.from.parameterized.vararg.type.loc"), quickFix); } } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/RedundantLambdaCodeBlockInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/RedundantLambdaCodeBlockInspection.java index acaa54cd275e..89adb021c560 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/RedundantLambdaCodeBlockInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/RedundantLambdaCodeBlockInspection.java @@ -2,6 +2,7 @@ package com.intellij.codeInspection; import com.intellij.codeInsight.intention.HighPriorityAction; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.psi.*; @@ -53,7 +54,7 @@ public class RedundantLambdaCodeBlockInspection extends AbstractBaseJavaLocalIns } else { errorElement = body.getFirstChild(); } - holder.registerProblem(errorElement, InspectionsBundle.message("statement.lambda.can.be.replaced.with.expression.lambda"), + holder.registerProblem(errorElement, JavaAnalysisBundle.message("statement.lambda.can.be.replaced.with.expression.lambda"), ProblemHighlightType.LIKE_UNUSED_SYMBOL, new ReplaceWithExprFix()); } } @@ -99,7 +100,7 @@ public class RedundantLambdaCodeBlockInspection extends AbstractBaseJavaLocalIns @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("replace.with.expression.lambda"); + return JavaAnalysisBundle.message("replace.with.expression.lambda"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/StringTokenizerDelimiterInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/StringTokenizerDelimiterInspection.java index 96c681a47f28..39288ef566f0 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/StringTokenizerDelimiterInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/StringTokenizerDelimiterInspection.java @@ -1,6 +1,7 @@ // 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. package com.intellij.codeInspection; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.*; @@ -55,7 +56,7 @@ public class StringTokenizerDelimiterInspection extends AbstractBaseJavaLocalIns final Set chars = new THashSet<>(); for (char c : delimiters.toCharArray()) { if (!chars.add(c)) { - holder.registerProblem(delimiterArgument, InspectionsBundle.message("delimiters.argument.contains.duplicated.characters"), + holder.registerProblem(delimiterArgument, JavaAnalysisBundle.message("delimiters.argument.contains.duplicated.characters"), new ReplaceDelimitersWithUnique(delimiterArgument)); return; } @@ -78,7 +79,7 @@ public class StringTokenizerDelimiterInspection extends AbstractBaseJavaLocalIns @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("replace.stringtokenizer.delimiters.parameter.with.unique.symbols"); + return JavaAnalysisBundle.message("replace.stringtokenizer.delimiters.parameter.with.unique.symbols"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/SuspiciousArrayMethodCallInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/SuspiciousArrayMethodCallInspection.java index 4636de457d40..2202a87d5bcc 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/SuspiciousArrayMethodCallInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/SuspiciousArrayMethodCallInspection.java @@ -1,6 +1,7 @@ // Copyright 2000-2017 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. package com.intellij.codeInspection; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.util.TypeConversionUtil; import com.intellij.util.containers.ContainerUtil; @@ -58,7 +59,7 @@ public class SuspiciousArrayMethodCallInspection extends AbstractBaseJavaLocalIn elementType = TypeConversionUtil.erasure(elementType); arrayElementType = TypeConversionUtil.erasure(arrayElementType); if (!TypeConversionUtil.areTypesConvertible(elementType, arrayElementType)) { - holder.registerProblem(element, InspectionsBundle.message("inspection.suspicious.array.method.call.problem.element")); + holder.registerProblem(element, JavaAnalysisBundle.message("inspection.suspicious.array.method.call.problem.element")); } } @@ -74,7 +75,7 @@ public class SuspiciousArrayMethodCallInspection extends AbstractBaseJavaLocalIn array2ElementType = TypeConversionUtil.erasure(array2ElementType); if (!TypeConversionUtil.areTypesConvertible(array1ElementType, array2ElementType) || !TypeConversionUtil.areTypesConvertible(array2ElementType, array1ElementType)) { - holder.registerProblem(context, InspectionsBundle.message("inspection.suspicious.array.method.call.problem.arrays")); + holder.registerProblem(context, JavaAnalysisBundle.message("inspection.suspicious.array.method.call.problem.arrays")); } } }; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/UseCompareMethodInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/UseCompareMethodInspection.java index 316c1c778575..00af99b37f81 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/UseCompareMethodInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/UseCompareMethodInspection.java @@ -2,6 +2,7 @@ package com.intellij.codeInspection; import com.intellij.codeInsight.PsiEquivalenceUtil; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Pair; import com.intellij.pom.java.LanguageLevel; @@ -62,7 +63,7 @@ public class UseCompareMethodInspection extends AbstractBaseJavaLocalInspectionT } private void register(CompareInfo info, PsiElement nameElement) { - holder.registerProblem(nameElement, InspectionsBundle.message("inspection.can.be.replaced.with.message", info.myClass.getClassName() + ".compare"), + holder.registerProblem(nameElement, JavaAnalysisBundle.message("inspection.can.be.replaced.with.message", info.myClass.getClassName() + ".compare"), new ReplaceWithPrimitiveCompareFix(info.getReplacementText())); } }; @@ -339,7 +340,7 @@ public class UseCompareMethodInspection extends AbstractBaseJavaLocalInspectionT @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("inspection.use.compare.method.fix.family.name"); + return JavaAnalysisBundle.message("inspection.use.compare.method.fix.family.name"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/VariableTypeCanBeExplicitInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/VariableTypeCanBeExplicitInspection.java index 39efdb055ebb..5771255181ed 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/VariableTypeCanBeExplicitInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/VariableTypeCanBeExplicitInspection.java @@ -1,6 +1,7 @@ // Copyright 2000-2018 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. package com.intellij.codeInspection; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.util.PsiTypesUtil; @@ -47,7 +48,7 @@ public class VariableTypeCanBeExplicitInspection extends AbstractBaseJavaLocalIn private void registerTypeElementProblem(PsiTypeElement typeElement) { holder.registerProblem(typeElement, - InspectionsBundle.message("var.can.be.replaced.with.explicit.type"), + JavaAnalysisBundle.message("var.can.be.replaced.with.explicit.type"), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new ReplaceVarWithExplicitTypeFix()); } @@ -70,7 +71,7 @@ public class VariableTypeCanBeExplicitInspection extends AbstractBaseJavaLocalIn @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("replace.var.with.explicit.type"); + return JavaAnalysisBundle.message("replace.var.with.explicit.type"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/canBeFinal/CanBeFinalInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/canBeFinal/CanBeFinalInspection.java index 308976f0fd7d..e0fc8fa6df88 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/canBeFinal/CanBeFinalInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/canBeFinal/CanBeFinalInspection.java @@ -19,6 +19,7 @@ package com.intellij.codeInspection.canBeFinal; import com.intellij.analysis.AnalysisScope; import com.intellij.codeInspection.*; import com.intellij.codeInspection.reference.*; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.psi.*; @@ -56,19 +57,19 @@ public class CanBeFinalInspection extends GlobalJavaBatchInspectionTool { gc.anchor = GridBagConstraints.NORTHWEST; - myReportClassesCheckbox = new JCheckBox(InspectionsBundle.message("inspection.can.be.final.option")); + myReportClassesCheckbox = new JCheckBox(JavaAnalysisBundle.message("inspection.can.be.final.option")); myReportClassesCheckbox.setSelected(REPORT_CLASSES); myReportClassesCheckbox.getModel().addItemListener(e -> REPORT_CLASSES = myReportClassesCheckbox.isSelected()); gc.gridy = 0; add(myReportClassesCheckbox, gc); - myReportMethodsCheckbox = new JCheckBox(InspectionsBundle.message("inspection.can.be.final.option1")); + myReportMethodsCheckbox = new JCheckBox(JavaAnalysisBundle.message("inspection.can.be.final.option1")); myReportMethodsCheckbox.setSelected(REPORT_METHODS); myReportMethodsCheckbox.getModel().addItemListener(e -> REPORT_METHODS = myReportMethodsCheckbox.isSelected()); gc.gridy++; add(myReportMethodsCheckbox, gc); - myReportFieldsCheckbox = new JCheckBox(InspectionsBundle.message("inspection.can.be.final.option2")); + myReportFieldsCheckbox = new JCheckBox(JavaAnalysisBundle.message("inspection.can.be.final.option2")); myReportFieldsCheckbox.setSelected(REPORT_FIELDS); myReportFieldsCheckbox.getModel().addItemListener(e -> REPORT_FIELDS = myReportFieldsCheckbox.isSelected()); @@ -142,7 +143,7 @@ public class CanBeFinalInspection extends GlobalJavaBatchInspectionTool { if (psiIdentifier != null) { - return new ProblemDescriptor[]{manager.createProblemDescriptor(psiIdentifier, InspectionsBundle.message( + return new ProblemDescriptor[]{manager.createProblemDescriptor(psiIdentifier, JavaAnalysisBundle.message( "inspection.export.results.can.be.final.description"), new AcceptSuggested(globalContext.getRefManager()), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false)}; } @@ -264,6 +265,6 @@ public class CanBeFinalInspection extends GlobalJavaBatchInspectionTool { } private static String getQuickFixName() { - return InspectionsBundle.message("inspection.can.be.final.accept.quickfix"); + return JavaAnalysisBundle.message("inspection.can.be.final.accept.quickfix"); } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/compiler/JavacQuirksInspectionVisitor.java b/java/java-analysis-impl/src/com/intellij/codeInspection/compiler/JavacQuirksInspectionVisitor.java index 9c2bc9252d18..ee33219907a8 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/compiler/JavacQuirksInspectionVisitor.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/compiler/JavacQuirksInspectionVisitor.java @@ -7,8 +7,12 @@ import com.intellij.codeInsight.daemon.impl.actions.SuppressByJavaCommentFix; import com.intellij.codeInsight.daemon.impl.analysis.JavaHighlightUtil; import com.intellij.codeInsight.daemon.impl.quickfix.AddTypeArgumentsFix; import com.intellij.codeInsight.intention.QuickFixFactory; -import com.intellij.codeInspection.*; +import com.intellij.codeInspection.LocalQuickFix; +import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.codeInspection.ProblemHighlightType; +import com.intellij.codeInspection.ProblemsHolder; import com.intellij.codeInspection.miscGenerics.RedundantTypeArgsInspection; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.project.Project; import com.intellij.openapi.projectRoots.JavaSdkVersion; @@ -48,8 +52,8 @@ public class JavacQuirksInspectionVisitor extends JavaElementVisitor { if (PsiUtil.isLanguageLevel7OrHigher(initializer)) return; final PsiElement lastElement = PsiTreeUtil.skipWhitespacesAndCommentsBackward(initializer.getLastChild()); if (lastElement != null && PsiUtil.isJavaToken(lastElement, JavaTokenType.COMMA)) { - final String message = InspectionsBundle.message("inspection.compiler.javac.quirks.anno.array.comma.problem"); - final String fixName = InspectionsBundle.message("inspection.compiler.javac.quirks.anno.array.comma.fix"); + final String message = JavaAnalysisBundle.message("inspection.compiler.javac.quirks.anno.array.comma.problem"); + final String fixName = JavaAnalysisBundle.message("inspection.compiler.javac.quirks.anno.array.comma.fix"); myHolder.registerProblem(lastElement, message, QuickFixFactory.getInstance().createDeleteFix(lastElement, fixName)); } } @@ -64,8 +68,8 @@ public class JavacQuirksInspectionVisitor extends JavaElementVisitor { public void visitReferenceParameterList(final PsiReferenceParameterList list) { super.visitReferenceParameterList(list); if (list.getFirstChild() != null && QUALIFIER_REFERENCE.accepts(list)) { - final String message = InspectionsBundle.message("inspection.compiler.javac.quirks.qualifier.type.args.problem"); - final String fixName = InspectionsBundle.message("inspection.compiler.javac.quirks.qualifier.type.args.fix"); + final String message = JavaAnalysisBundle.message("inspection.compiler.javac.quirks.qualifier.type.args.problem"); + final String fixName = JavaAnalysisBundle.message("inspection.compiler.javac.quirks.qualifier.type.args.fix"); myHolder.registerProblem(list, message, QuickFixFactory.getInstance().createDeleteFix(list, fixName)); } } @@ -147,7 +151,7 @@ public class JavacQuirksInspectionVisitor extends JavaElementVisitor { for (int i = method.getParameterList().getParametersCount(); i < args.length; i++) { if (PsiPolyExpressionUtil.isPolyExpression(args[i]) && ++ count > 50) { myHolder.registerProblem(expression.getMethodExpression(), - InspectionsBundle + JavaAnalysisBundle .message("vararg.method.call.with.50.poly.arguments"), new MyAddExplicitTypeArgumentsFix()); break; @@ -171,7 +175,7 @@ public class JavacQuirksInspectionVisitor extends JavaElementVisitor { (TypeConversionUtil.isPrimitiveAndNotNull(ltype) ^ TypeConversionUtil.isPrimitiveAndNotNull(rtype)) && TypeConversionUtil.isBinaryOperatorApplicable(expression.getOperationTokenType(), ltype, rtype, false) && TypeConversionUtil.areTypesConvertible(rtype, ltype)) { - myHolder.registerProblem(expression.getOperationSign(), InspectionsBundle + myHolder.registerProblem(expression.getOperationSign(), JavaAnalysisBundle .message("comparision.between.object.and.primitive"), ProblemHighlightType.GENERIC_ERROR_OR_WARNING); } } @@ -189,14 +193,14 @@ public class JavacQuirksInspectionVisitor extends JavaElementVisitor { @NotNull @Override public String getName() { - return InspectionsBundle.message("replace.0.with", myOperationSign); + return JavaAnalysisBundle.message("replace.0.with", myOperationSign); } @Nls @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("replace.operator.assignment.with.assignment"); + return JavaAnalysisBundle.message("replace.operator.assignment.with.assignment"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/FieldAccessNotGuardedInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/FieldAccessNotGuardedInspection.java index e211c2d78953..dac5b02eb54f 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/FieldAccessNotGuardedInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/FieldAccessNotGuardedInspection.java @@ -5,6 +5,7 @@ import com.intellij.codeInsight.PsiEquivalenceUtil; import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool; import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemsHolder; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.util.InheritanceUtil; import com.intellij.psi.util.PsiTreeUtil; @@ -181,7 +182,7 @@ public class FieldAccessNotGuardedInspection extends AbstractBaseJavaLocalInspec } check = syncStatement; } - myHolder.registerProblem(expression, InspectionsBundle.message("access.to.field.code.ref.code.outside.of.declared.guards.loc")); + myHolder.registerProblem(expression, JavaAnalysisBundle.message("access.to.field.code.ref.code.outside.of.declared.guards.loc")); } private static PsiClass getClassFromThisExpression(PsiThisExpression thisExpression, PsiElement context) { diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/InstanceGuardedByStaticInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/InstanceGuardedByStaticInspection.java index 71d11807fa35..3b844e11496b 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/InstanceGuardedByStaticInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/InstanceGuardedByStaticInspection.java @@ -4,6 +4,7 @@ package com.intellij.codeInspection.concurrencyAnnotations; import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool; import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemsHolder; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.javadoc.PsiDocTag; import com.intellij.psi.util.PsiTreeUtil; @@ -63,7 +64,7 @@ public class InstanceGuardedByStaticInspection extends AbstractBaseJavaLocalInsp if (!guardField.hasModifierProperty(PsiModifier.STATIC)) { return; } - myHolder.registerProblem(psiDocTag, InspectionsBundle.message("instance.member.guarded.by.static.0.loc", guardValue)); + myHolder.registerProblem(psiDocTag, JavaAnalysisBundle.message("instance.member.guarded.by.static.0.loc", guardValue)); } @Override @@ -99,7 +100,7 @@ public class InstanceGuardedByStaticInspection extends AbstractBaseJavaLocalInsp if (!guardField.hasModifierProperty(PsiModifier.STATIC)) { return; } - myHolder.registerProblem(guardRef, InspectionsBundle.message("instance.member.guarded.by.static.ref.loc")); + myHolder.registerProblem(guardRef, JavaAnalysisBundle.message("instance.member.guarded.by.static.ref.loc")); } } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/NonFinalFieldInImmutableInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/NonFinalFieldInImmutableInspection.java index 37875d0c53e3..27b6279a65eb 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/NonFinalFieldInImmutableInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/NonFinalFieldInImmutableInspection.java @@ -4,6 +4,7 @@ package com.intellij.codeInspection.concurrencyAnnotations; import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool; import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemsHolder; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import org.jetbrains.annotations.NotNull; @@ -38,7 +39,7 @@ public class NonFinalFieldInImmutableInspection extends AbstractBaseJavaLocalIns return; } holder.registerProblem(field.getNameIdentifier(), - InspectionsBundle.message("non.final.field.code.ref.code.in.immutable.class.loc")); + JavaAnalysisBundle.message("non.final.field.code.ref.code.in.immutable.class.loc")); } } }; diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/NonFinalGuardInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/NonFinalGuardInspection.java index af2673365368..9cfd60086c5a 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/NonFinalGuardInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/NonFinalGuardInspection.java @@ -4,6 +4,7 @@ package com.intellij.codeInspection.concurrencyAnnotations; import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool; import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemsHolder; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.javadoc.PsiDocTag; import com.intellij.psi.util.PsiTreeUtil; @@ -63,7 +64,7 @@ public class NonFinalGuardInspection extends AbstractBaseJavaLocalInspectionTool if (member == null) { return; } - myHolder.registerProblem(member, InspectionsBundle.message("non.final.guarded.by.field.ref.loc")); + myHolder.registerProblem(member, JavaAnalysisBundle.message("non.final.guarded.by.field.ref.loc")); } @Override @@ -87,7 +88,7 @@ public class NonFinalGuardInspection extends AbstractBaseJavaLocalInspectionTool if (guardField.hasModifierProperty(PsiModifier.FINAL)) { return; } - myHolder.registerProblem(psiDocTag, InspectionsBundle.message("non.final.guarded.by.field.0.loc", guardValue)); + myHolder.registerProblem(psiDocTag, JavaAnalysisBundle.message("non.final.guarded.by.field.0.loc", guardValue)); } } } \ No newline at end of file diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/StaticGuardedByInstanceInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/StaticGuardedByInstanceInspection.java index 95996779bb17..1de999c2d69b 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/StaticGuardedByInstanceInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/StaticGuardedByInstanceInspection.java @@ -4,6 +4,7 @@ package com.intellij.codeInspection.concurrencyAnnotations; import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool; import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemsHolder; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.javadoc.PsiDocTag; import com.intellij.psi.util.PsiTreeUtil; @@ -104,11 +105,11 @@ public class StaticGuardedByInstanceInspection extends AbstractBaseJavaLocalInsp if (guardField.hasModifierProperty(PsiModifier.STATIC)) { return; } - myHolder.registerProblem(psiDocTag, InspectionsBundle.message("static.member.guarded.by.instance.0.loc", guardValue)); + myHolder.registerProblem(psiDocTag, JavaAnalysisBundle.message("static.member.guarded.by.instance.0.loc", guardValue)); } private void registerError(PsiElement element) { - myHolder.registerProblem(element, InspectionsBundle.message("static.member.guarded.by.instance.ref.loc")); + myHolder.registerProblem(element, JavaAnalysisBundle.message("static.member.guarded.by.instance.ref.loc")); } } } \ No newline at end of file diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/UnknownGuardInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/UnknownGuardInspection.java index 90dda3a73bda..e862f102b3e1 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/UnknownGuardInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/concurrencyAnnotations/UnknownGuardInspection.java @@ -4,6 +4,7 @@ package com.intellij.codeInspection.concurrencyAnnotations; import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool; import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemsHolder; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.impl.source.DummyHolder; import com.intellij.psi.javadoc.PsiDocTag; @@ -56,7 +57,7 @@ public class UnknownGuardInspection extends AbstractBaseJavaLocalInspectionTool if (member == null) { return; } - myHolder.registerProblem(member, InspectionsBundle.message("unknown.guardedby.reference.ref.loc")); + myHolder.registerProblem(member, JavaAnalysisBundle.message("unknown.guardedby.reference.ref.loc")); } private static boolean isValidGuardText(@Nullable String guardText, @NotNull PsiElement context) { @@ -160,7 +161,7 @@ public class UnknownGuardInspection extends AbstractBaseJavaLocalInspectionTool if (isValidGuardText(guardValue, psiDocTag)) { return; } - myHolder.registerProblem(psiDocTag, InspectionsBundle.message("unknown.guardedby.reference.0.loc", guardValue)); + myHolder.registerProblem(psiDocTag, JavaAnalysisBundle.message("unknown.guardedby.reference.0.loc", guardValue)); } } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java index ca1ededdf4f2..47bae712fe44 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java @@ -425,12 +425,12 @@ public abstract class DataFlowInspectionBase extends AbstractBaseJavaLocalInspec if (reporter.isOnTheFly()) { if (ref instanceof PsiReferenceExpression) { fixes.add(new SetInspectionOptionFix(this, "REPORT_CONSTANT_REFERENCE_VALUES", - InspectionsBundle.message("inspection.data.flow.turn.off.constant.references.quickfix"), + JavaAnalysisBundle.message("inspection.data.flow.turn.off.constant.references.quickfix"), false)); } if (isAssertion) { fixes.add(new SetInspectionOptionFix(this, "DONT_REPORT_TRUE_ASSERT_STATEMENTS", - InspectionsBundle.message("inspection.data.flow.turn.off.true.asserts.quickfix"), true)); + JavaAnalysisBundle.message("inspection.data.flow.turn.off.true.asserts.quickfix"), true)); } } if (reporter.isOnTheFly()) { @@ -615,7 +615,7 @@ public abstract class DataFlowInspectionBase extends AbstractBaseJavaLocalInspec LocalQuickFix[] fixes = {AddAnnotationPsiFix.createAddNotNullFix(method)}; if (holder.isOnTheFly()) { fixes = ArrayUtil.append(fixes, new SetInspectionOptionFix(this, "REPORT_NULLABLE_METHODS_RETURNING_NOT_NULL", - InspectionsBundle + JavaAnalysisBundle .message( "inspection.data.flow.turn.off.nullable.returning.notnull.quickfix"), false)); @@ -762,7 +762,7 @@ public abstract class DataFlowInspectionBase extends AbstractBaseJavaLocalInspec ContainerUtil.addIfNotNull(fixes, createSimplifyBooleanExpressionFix(psiAnchor, evaluatesToTrue)); if (isAssertion && reporter.isOnTheFly()) { fixes.add(new SetInspectionOptionFix(this, "DONT_REPORT_TRUE_ASSERT_STATEMENTS", - InspectionsBundle.message("inspection.data.flow.turn.off.true.asserts.quickfix"), true)); + JavaAnalysisBundle.message("inspection.data.flow.turn.off.true.asserts.quickfix"), true)); } ContainerUtil.addIfNotNull(fixes, createReplaceWithNullCheckFix(psiAnchor, evaluatesToTrue)); } @@ -1099,7 +1099,7 @@ public abstract class DataFlowInspectionBase extends AbstractBaseJavaLocalInspec @Override public @NotNull String getFamilyName() { - return InspectionsBundle.message("inspection.data.flow.simplify.boolean.expression.quickfix"); + return JavaAnalysisBundle.message("inspection.data.flow.simplify.boolean.expression.quickfix"); } }; } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/DeleteSwitchLabelFix.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/DeleteSwitchLabelFix.java index 55837f1e853d..0a94177df3c1 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/DeleteSwitchLabelFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/DeleteSwitchLabelFix.java @@ -1,9 +1,9 @@ // Copyright 2000-2018 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. package com.intellij.codeInspection.dataFlow.fix; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.impl.PsiImplUtil; @@ -49,15 +49,15 @@ public class DeleteSwitchLabelFix implements LocalQuickFix { @Override public String getName() { return myBranch ? - InspectionsBundle.message("remove.switch.branch.0", myName) : - InspectionsBundle.message("remove.switch.label.0", myName); + JavaAnalysisBundle.message("remove.switch.branch.0", myName) : + JavaAnalysisBundle.message("remove.switch.label.0", myName); } @Nls(capitalization = Nls.Capitalization.Sentence) @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("remove.switch.label"); + return JavaAnalysisBundle.message("remove.switch.label"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/RedundantInstanceofFix.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/RedundantInstanceofFix.java index 71d4456f5262..09acda0ae086 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/RedundantInstanceofFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/RedundantInstanceofFix.java @@ -15,9 +15,9 @@ */ package com.intellij.codeInspection.dataFlow.fix; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.codeStyle.JavaCodeStyleManager; @@ -34,7 +34,7 @@ public class RedundantInstanceofFix implements LocalQuickFix { @Override @NotNull public String getFamilyName() { - return InspectionsBundle.message("inspection.data.flow.redundant.instanceof.quickfix"); + return JavaAnalysisBundle.message("inspection.data.flow.redundant.instanceof.quickfix"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/ReplaceWithConstantValueFix.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/ReplaceWithConstantValueFix.java index 01936a956594..8e9731b23b8d 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/ReplaceWithConstantValueFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/ReplaceWithConstantValueFix.java @@ -16,9 +16,9 @@ package com.intellij.codeInspection.dataFlow.fix; import com.intellij.codeInspection.CommonQuickFixBundle; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.refactoring.extractMethod.ExtractMethodUtil; @@ -45,7 +45,7 @@ public class ReplaceWithConstantValueFix implements LocalQuickFix { @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("replace.with.constant.value"); + return JavaAnalysisBundle.message("replace.with.constant.value"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/SimplifyToAssignmentFix.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/SimplifyToAssignmentFix.java index b1115a97d3fb..6d4ffdd65798 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/SimplifyToAssignmentFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/SimplifyToAssignmentFix.java @@ -15,9 +15,9 @@ */ package com.intellij.codeInspection.dataFlow.fix; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; @@ -30,7 +30,7 @@ public class SimplifyToAssignmentFix implements LocalQuickFix { @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("inspection.data.flow.simplify.to.assignment.quickfix.name"); + return JavaAnalysisBundle.message("inspection.data.flow.simplify.to.assignment.quickfix.name"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/SurroundWithRequireNonNullFix.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/SurroundWithRequireNonNullFix.java index 460bf941806e..cc33bb953167 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/SurroundWithRequireNonNullFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/fix/SurroundWithRequireNonNullFix.java @@ -15,9 +15,9 @@ */ package com.intellij.codeInspection.dataFlow.fix; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.JavaPsiFacade; import com.intellij.psi.PsiExpression; @@ -41,14 +41,14 @@ public class SurroundWithRequireNonNullFix implements LocalQuickFix { @NotNull @Override public String getName() { - return InspectionsBundle.message("inspection.surround.requirenonnull.quickfix", myText); + return JavaAnalysisBundle.message("inspection.surround.requirenonnull.quickfix", myText); } @Nls @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("inspection.surround.requirenonnull.quickfix", ""); + return JavaAnalysisBundle.message("inspection.surround.requirenonnull.quickfix", ""); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/deprecation/DeprecationInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/deprecation/DeprecationInspection.java index ca7e870f0026..cb1d04a153dd 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/deprecation/DeprecationInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/deprecation/DeprecationInspection.java @@ -2,10 +2,10 @@ package com.intellij.codeInspection.deprecation; import com.intellij.codeInspection.DeprecationUtil; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemsHolder; import com.intellij.codeInspection.apiUsage.ApiUsageUastVisitor; import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.util.registry.Registry; import com.intellij.psi.PsiElementVisitor; import org.jetbrains.annotations.NotNull; @@ -57,10 +57,10 @@ public class DeprecationInspection extends DeprecationInspectionBase { @Override public JComponent createOptionsPanel() { final MultipleCheckboxOptionsPanel panel = new MultipleCheckboxOptionsPanel(this); - panel.addCheckbox(InspectionsBundle.message("ignore.inside.deprecated.members"), "IGNORE_INSIDE_DEPRECATED"); - panel.addCheckbox(InspectionsBundle.message("ignore.inside.non.static.imports"), "IGNORE_IMPORT_STATEMENTS"); - panel.addCheckbox(InspectionsBundle.message("html.ignore.overrides.of.deprecated.abstract.methods"), "IGNORE_ABSTRACT_DEPRECATED_OVERRIDES"); - panel.addCheckbox(InspectionsBundle.message("ignore.members.of.deprecated.classes"), IGNORE_METHODS_OF_DEPRECATED_NAME); + panel.addCheckbox(JavaAnalysisBundle.message("ignore.inside.deprecated.members"), "IGNORE_INSIDE_DEPRECATED"); + panel.addCheckbox(JavaAnalysisBundle.message("ignore.inside.non.static.imports"), "IGNORE_IMPORT_STATEMENTS"); + panel.addCheckbox(JavaAnalysisBundle.message("html.ignore.overrides.of.deprecated.abstract.methods"), "IGNORE_ABSTRACT_DEPRECATED_OVERRIDES"); + panel.addCheckbox(JavaAnalysisBundle.message("ignore.members.of.deprecated.classes"), IGNORE_METHODS_OF_DEPRECATED_NAME); addSameOutermostClassCheckBox(panel); return panel; } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/deprecation/DeprecationInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/deprecation/DeprecationInspectionBase.java index e1c0768bdd9e..43466d21f5ce 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/deprecation/DeprecationInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/deprecation/DeprecationInspectionBase.java @@ -4,8 +4,12 @@ package com.intellij.codeInspection.deprecation; import com.intellij.codeInsight.AnnotationUtil; import com.intellij.codeInsight.daemon.JavaErrorBundle; import com.intellij.codeInsight.daemon.impl.analysis.HighlightMessageUtil; -import com.intellij.codeInspection.*; +import com.intellij.codeInspection.LocalInspectionTool; +import com.intellij.codeInspection.LocalQuickFix; +import com.intellij.codeInspection.ProblemHighlightType; +import com.intellij.codeInspection.ProblemsHolder; import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.util.TextRange; import com.intellij.psi.*; @@ -147,7 +151,7 @@ public abstract class DeprecationInspectionBase extends LocalInspectionTool { } static void addSameOutermostClassCheckBox(MultipleCheckboxOptionsPanel panel) { - panel.addCheckbox(InspectionsBundle.message("ignore.in.the.same.outermost.class"), "IGNORE_IN_SAME_OUTERMOST_CLASS"); + panel.addCheckbox(JavaAnalysisBundle.message("ignore.in.the.same.outermost.class"), "IGNORE_IN_SAME_OUTERMOST_CLASS"); } protected static String getDescription(@NotNull String description, boolean forRemoval, ProblemHighlightType highlightType) { diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/duplicateThrows/DuplicateThrowsInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/duplicateThrows/DuplicateThrowsInspection.java index 38ed23861cf1..107bedf9acbf 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/duplicateThrows/DuplicateThrowsInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/duplicateThrows/DuplicateThrowsInspection.java @@ -4,6 +4,7 @@ package com.intellij.codeInspection.duplicateThrows; import com.intellij.codeInsight.daemon.impl.quickfix.MethodThrowsFix; import com.intellij.codeInspection.*; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.javadoc.PsiDocComment; import com.intellij.psi.javadoc.PsiDocTag; @@ -34,7 +35,7 @@ public class DuplicateThrowsInspection extends AbstractBaseJavaLocalInspectionTo @Override public JComponent createOptionsPanel() { return new SingleCheckboxOptionsPanel( - InspectionsBundle.message("inspection.duplicate.throws.ignore.subclassing.option"), this, "ignoreSubclassing"); + JavaAnalysisBundle.message("inspection.duplicate.throws.ignore.subclassing.option"), this, "ignoreSubclassing"); } @Override @@ -53,14 +54,14 @@ public class DuplicateThrowsInspection extends AbstractBaseJavaLocalInspectionTo String problem = null; PsiJavaCodeReferenceElement ref = refs[i]; if (type.equals(otherType)) { - problem = InspectionsBundle.message("inspection.duplicate.throws.problem"); + problem = JavaAnalysisBundle.message("inspection.duplicate.throws.problem"); } else if (!ignoreSubclassing) { if (otherType.isAssignableFrom(type)) { - problem = InspectionsBundle.message("inspection.duplicate.throws.more.general.problem", otherType.getCanonicalText()); + problem = JavaAnalysisBundle.message("inspection.duplicate.throws.more.general.problem", otherType.getCanonicalText()); } else if (type.isAssignableFrom(otherType)) { - problem = InspectionsBundle.message("inspection.duplicate.throws.more.general.problem", type.getCanonicalText()); + problem = JavaAnalysisBundle.message("inspection.duplicate.throws.more.general.problem", type.getCanonicalText()); ref = refs[j]; type = otherType; } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/equalsAndHashcode/EqualsAndHashcodeBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/equalsAndHashcode/EqualsAndHashcodeBase.java index 8c2f8be4f864..b21c8b7457b7 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/equalsAndHashcode/EqualsAndHashcodeBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/equalsAndHashcode/EqualsAndHashcodeBase.java @@ -2,9 +2,9 @@ package com.intellij.codeInspection.equalsAndHashcode; import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemsHolder; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ProjectRootManager; @@ -61,8 +61,8 @@ public class EqualsAndHashcodeBase extends AbstractBaseJavaLocalInspectionTool { PsiIdentifier identifier = aClass.getNameIdentifier(); holder.registerProblem(identifier != null ? identifier : aClass, hasEquals[0] - ? InspectionsBundle.message("inspection.equals.hashcode.only.one.defined.problem.descriptor", "equals()", "hashCode()") - : InspectionsBundle.message("inspection.equals.hashcode.only.one.defined.problem.descriptor","hashCode()", "equals()"), + ? JavaAnalysisBundle.message("inspection.equals.hashcode.only.one.defined.problem.descriptor", "equals()", "hashCode()") + : JavaAnalysisBundle.message("inspection.equals.hashcode.only.one.defined.problem.descriptor","hashCode()", "equals()"), buildFixes(isOnTheFly, hasEquals[0])); } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/inconsistentLanguageLevel/InconsistentLanguageLevelInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/inconsistentLanguageLevel/InconsistentLanguageLevelInspection.java index 61e7cb52eba9..06ba88546c7b 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/inconsistentLanguageLevel/InconsistentLanguageLevelInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/inconsistentLanguageLevel/InconsistentLanguageLevelInspection.java @@ -22,6 +22,7 @@ import com.intellij.codeInspection.*; import com.intellij.codeInspection.reference.RefEntity; import com.intellij.codeInspection.reference.RefModule; import com.intellij.codeInspection.unnecessaryModuleDependency.UnnecessaryModuleDependencyInspection; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.module.EffectiveLanguageLevelUtil; import com.intellij.openapi.module.Module; import com.intellij.openapi.roots.ModuleOrderEntry; @@ -61,7 +62,7 @@ public class InconsistentLanguageLevelInspection extends GlobalInspectionTool { LanguageLevel dependantLanguageLevel = EffectiveLanguageLevelUtil.getEffectiveLanguageLevel(dependantModule); if (languageLevel.compareTo(dependantLanguageLevel) < 0) { final CommonProblemDescriptor problemDescriptor = manager.createProblemDescriptor( - InspectionsBundle + JavaAnalysisBundle .message("module.0.with.language.level.1.depends.on.module.2.with.language.level.3", module.getName(), languageLevel, dependantModule.getName(), dependantLanguageLevel), module, diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/inheritance/ImplicitSubclassInspection.kt b/java/java-analysis-impl/src/com/intellij/codeInspection/inheritance/ImplicitSubclassInspection.kt index 4cd7a535b76f..b63f5ec05873 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/inheritance/ImplicitSubclassInspection.kt +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/inheritance/ImplicitSubclassInspection.kt @@ -19,6 +19,7 @@ import com.intellij.CommonBundle import com.intellij.codeInsight.daemon.QuickFixBundle import com.intellij.codeInsight.intention.IntentionAction import com.intellij.codeInspection.* +import com.intellij.java.analysis.JavaAnalysisBundle import com.intellij.lang.jvm.JvmClass import com.intellij.lang.jvm.JvmModifier import com.intellij.lang.jvm.JvmModifiersOwner @@ -83,7 +84,7 @@ class ImplicitSubclassInspection : LocalInspectionTool() { if ((methodsToOverride.isNotEmpty() || classReasonToBeSubclassed != null)) { problemTargets(aClass, classHighlightableModifiersSet).forEach { problems.add(manager.createProblemDescriptor( - it, classReasonToBeSubclassed ?: InspectionsBundle.message("inspection.implicit.subclass.display.forClass", psiClass.name), + it, classReasonToBeSubclassed ?: JavaAnalysisBundle.message("inspection.implicit.subclass.display.forClass", psiClass.name), isOnTheFly, createFixesIfApplicable(aClass, psiClass.name ?: "class", methodsToAttachToClassFix ?: emptyList()), ProblemHighlightType.GENERIC_ERROR_OR_WARNING) @@ -192,7 +193,7 @@ class ImplicitSubclassInspection : LocalInspectionTool() { is UClass -> if (actionsToPerform.size <= MAX_MESSAGES_TO_COMBINE) actionsToPerform.joinToString { it.text } - else InspectionsBundle.message("inspection.implicit.subclass.make.class.extendable", + else JavaAnalysisBundle.message("inspection.implicit.subclass.make.class.extendable", hintTargetName, siblings.size, siblingsDescription()) @@ -200,7 +201,7 @@ class ImplicitSubclassInspection : LocalInspectionTool() { if (actionsToPerform.size <= MAX_MESSAGES_TO_COMBINE) actionsToPerform.joinToString { it.text } else - InspectionsBundle.message("inspection.implicit.subclass.extendable", hintTargetName) + JavaAnalysisBundle.message("inspection.implicit.subclass.extendable", hintTargetName) } private fun siblingsDescription() = diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/Java9ModuleEntryPoint.java b/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/Java9ModuleEntryPoint.java index b22415392f2a..69c8e158a7fb 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/Java9ModuleEntryPoint.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/Java9ModuleEntryPoint.java @@ -2,9 +2,9 @@ package com.intellij.codeInspection.java19modules; import com.intellij.codeInsight.daemon.impl.analysis.JavaModuleGraphUtil; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.reference.*; import com.intellij.codeInspection.visibility.EntryPointWithVisibilityLevel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.util.InvalidDataException; import com.intellij.openapi.util.WriteExternalException; import com.intellij.psi.*; @@ -39,7 +39,7 @@ public class Java9ModuleEntryPoint extends EntryPointWithVisibilityLevel { @NotNull @Override public String getDisplayName() { - return InspectionsBundle.message("html.classes.exposed.with.code.module.info.code.html"); + return JavaAnalysisBundle.message("html.classes.exposed.with.code.module.info.code.html"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/Java9ModuleExportsPackageToItselfInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/Java9ModuleExportsPackageToItselfInspection.java index 081f2aa8d773..2bf79019d5b7 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/Java9ModuleExportsPackageToItselfInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/Java9ModuleExportsPackageToItselfInspection.java @@ -3,8 +3,8 @@ package com.intellij.codeInspection.java19modules; import com.intellij.codeInsight.intention.QuickFixFactory; import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemsHolder; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.PsiUtil; @@ -39,13 +39,13 @@ public class Java9ModuleExportsPackageToItselfInspection extends AbstractBaseJav List references = ContainerUtil.newArrayList(statement.getModuleReferences()); for (PsiJavaModuleReferenceElement referenceElement : references) { if (moduleName.equals(referenceElement.getReferenceText())) { - String message = InspectionsBundle.message("inspection.module.exports.package.to.itself"); + String message = JavaAnalysisBundle.message("inspection.module.exports.package.to.itself"); if (references.size() == 1) { - String fixText = InspectionsBundle.message("exports.to.itself.delete.statement.fix"); + String fixText = JavaAnalysisBundle.message("exports.to.itself.delete.statement.fix"); myHolder.registerProblem(referenceElement, message, QuickFixFactory.getInstance().createDeleteFix(statement, fixText)); } else { - String fixText = InspectionsBundle.message("exports.to.itself.delete.module.ref.fix", moduleName); + String fixText = JavaAnalysisBundle.message("exports.to.itself.delete.module.ref.fix", moduleName); myHolder.registerProblem(referenceElement, message, QuickFixFactory.getInstance().createDeleteFix(referenceElement, fixText)); } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/Java9RedundantRequiresStatementInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/Java9RedundantRequiresStatementInspection.java index b87bc7030276..7fb0d8fd9826 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/Java9RedundantRequiresStatementInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/Java9RedundantRequiresStatementInspection.java @@ -6,6 +6,7 @@ import com.intellij.codeInsight.FileModificationService; import com.intellij.codeInsight.daemon.impl.analysis.JavaModuleGraphUtil; import com.intellij.codeInspection.*; import com.intellij.codeInspection.reference.*; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Key; @@ -56,7 +57,7 @@ public class Java9RedundantRequiresStatementInspection extends GlobalJavaBatchIn if (requiresStatement != null && !isSuppressedFor(requiresStatement)) { CommonProblemDescriptor descriptor = manager.createProblemDescriptor( requiresStatement, - InspectionsBundle.message("inspection.redundant.requires.statement.description", requiredModuleName), + JavaAnalysisBundle.message("inspection.redundant.requires.statement.description", requiredModuleName), new DeleteRedundantRequiresStatementFix(requiredModuleName, moduleImportedPackages), ProblemHighlightType.LIKE_UNUSED_SYMBOL, false); descriptors.add(descriptor); @@ -108,14 +109,14 @@ public class Java9RedundantRequiresStatementInspection extends GlobalJavaBatchIn @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("inspection.redundant.requires.statement.fix.family"); + return JavaAnalysisBundle.message("inspection.redundant.requires.statement.fix.family"); } @Nls @NotNull @Override public String getName() { - return InspectionsBundle.message("inspection.redundant.requires.statement.fix.name", myRequiredModuleName); + return JavaAnalysisBundle.message("inspection.redundant.requires.statement.fix.name", myRequiredModuleName); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/JavaModuleNamingInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/JavaModuleNamingInspection.java index 84c44609714d..7e24972fd1e8 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/JavaModuleNamingInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/JavaModuleNamingInspection.java @@ -3,8 +3,8 @@ package com.intellij.codeInspection.java19modules; import com.intellij.codeInsight.intention.QuickFixFactory; import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemsHolder; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.*; @@ -27,7 +27,7 @@ public class JavaModuleNamingInspection extends AbstractBaseJavaLocalInspectionT psiTraverser().children(name).filter(PsiIdentifier.class).forEach(id -> { String text = id.getText(); if (text.length() > 0 && Character.isDigit(text.charAt(text.length() - 1))) { - String message = InspectionsBundle.message("inspection.java.module.naming.terminal.digits", text); + String message = JavaAnalysisBundle.message("inspection.java.module.naming.terminal.digits", text); if (newName.isNull()) { newName.set(StringUtil.join(psiTraverser().children(name).filter(PsiIdentifier.class).map(i -> trimDigits(i.getText())), ".")); } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/JavaRequiresAutoModuleInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/JavaRequiresAutoModuleInspection.java index 1cd9656b54c4..591a1f9ad372 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/JavaRequiresAutoModuleInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/java19modules/JavaRequiresAutoModuleInspection.java @@ -2,9 +2,9 @@ package com.intellij.codeInspection.java19modules; import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemsHolder; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.impl.light.LightJavaModule; import com.intellij.psi.util.PsiUtil; @@ -19,7 +19,7 @@ public class JavaRequiresAutoModuleInspection extends AbstractBaseJavaLocalInspe @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("inspection.requires.auto.module.option"), this, "TRANSITIVE_ONLY"); + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("inspection.requires.auto.module.option"), this, "TRANSITIVE_ONLY"); } @NotNull @@ -34,10 +34,10 @@ public class JavaRequiresAutoModuleInspection extends AbstractBaseJavaLocalInspe PsiJavaModule target = statement.resolve(); if (target instanceof LightJavaModule) { if (!TRANSITIVE_ONLY) { - holder.registerProblem(refElement, InspectionsBundle.message("inspection.requires.auto.module.message")); + holder.registerProblem(refElement, JavaAnalysisBundle.message("inspection.requires.auto.module.message")); } else if (statement.hasModifierProperty(PsiModifier.TRANSITIVE)) { - holder.registerProblem(refElement, InspectionsBundle.message("inspection.requires.auto.module.transitive")); + holder.registerProblem(refElement, JavaAnalysisBundle.message("inspection.requires.auto.module.transitive")); } } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/localCanBeFinal/LocalCanBeFinal.java b/java/java-analysis-impl/src/com/intellij/codeInspection/localCanBeFinal/LocalCanBeFinal.java index 11ca66f30ce7..f911c68bef34 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/localCanBeFinal/LocalCanBeFinal.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/localCanBeFinal/LocalCanBeFinal.java @@ -3,6 +3,7 @@ package com.intellij.codeInspection.localCanBeFinal; import com.intellij.codeInspection.*; import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.WriteExternalException; import com.intellij.psi.*; @@ -262,12 +263,12 @@ public class LocalCanBeFinal extends AbstractBaseJavaLocalInspectionTool impleme PsiElement problemElement = nameIdentifier != null ? nameIdentifier : variable; if (variable instanceof PsiParameter && !(((PsiParameter)variable).getDeclarationScope() instanceof PsiForeachStatement)) { problems.add(manager.createProblemDescriptor(problemElement, - InspectionsBundle.message("inspection.can.be.local.parameter.problem.descriptor"), + JavaAnalysisBundle.message("inspection.can.be.local.parameter.problem.descriptor"), myQuickFix, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, onTheFly)); } else { problems.add(manager.createProblemDescriptor(problemElement, - InspectionsBundle.message("inspection.can.be.local.variable.problem.descriptor"), + JavaAnalysisBundle.message("inspection.can.be.local.variable.problem.descriptor"), myQuickFix, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, onTheFly)); } } @@ -313,7 +314,7 @@ public class LocalCanBeFinal extends AbstractBaseJavaLocalInspectionTool impleme @Override @NotNull public String getFamilyName() { - return InspectionsBundle.message("inspection.can.be.final.accept.quickfix"); + return JavaAnalysisBundle.message("inspection.can.be.final.accept.quickfix"); } @Override @@ -330,11 +331,11 @@ public class LocalCanBeFinal extends AbstractBaseJavaLocalInspectionTool impleme @Override public JComponent createOptionsPanel() { final MultipleCheckboxOptionsPanel panel = new MultipleCheckboxOptionsPanel(this); - panel.addCheckbox(InspectionsBundle.message("inspection.local.can.be.final.option"), "REPORT_VARIABLES"); - panel.addCheckbox(InspectionsBundle.message("inspection.local.can.be.final.option1"), "REPORT_PARAMETERS"); - panel.addCheckbox(InspectionsBundle.message("inspection.local.can.be.final.option2"), "REPORT_CATCH_PARAMETERS"); - panel.addCheckbox(InspectionsBundle.message("inspection.local.can.be.final.option3"), "REPORT_FOREACH_PARAMETERS"); - panel.addCheckbox(InspectionsBundle.message("inspection.local.can.be.final.option4"), "REPORT_IMPLICIT_FINALS"); + panel.addCheckbox(JavaAnalysisBundle.message("inspection.local.can.be.final.option"), "REPORT_VARIABLES"); + panel.addCheckbox(JavaAnalysisBundle.message("inspection.local.can.be.final.option1"), "REPORT_PARAMETERS"); + panel.addCheckbox(JavaAnalysisBundle.message("inspection.local.can.be.final.option2"), "REPORT_CATCH_PARAMETERS"); + panel.addCheckbox(JavaAnalysisBundle.message("inspection.local.can.be.final.option3"), "REPORT_FOREACH_PARAMETERS"); + panel.addCheckbox(JavaAnalysisBundle.message("inspection.local.can.be.final.option4"), "REPORT_IMPLICIT_FINALS"); return panel; } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/RedundantTypeArgsInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/RedundantTypeArgsInspection.java index d2cbbe763410..f43e70601d77 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/RedundantTypeArgsInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/RedundantTypeArgsInspection.java @@ -16,6 +16,7 @@ package com.intellij.codeInspection.miscGenerics; import com.intellij.codeInspection.*; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.psi.*; @@ -115,7 +116,7 @@ public class RedundantTypeArgsInspection extends GenericsInspectionToolBase { : "inspection.redundant.type.problem.descriptor"; final ProblemDescriptor descriptor = inspectionManager.createProblemDescriptor(expression.getTypeArgumentList(), - InspectionsBundle.message(key), + JavaAnalysisBundle.message(key), ourQuickFixAction, ProblemHighlightType.LIKE_UNUSED_SYMBOL, isOnTheFly); problems.add(descriptor); @@ -142,7 +143,7 @@ public class RedundantTypeArgsInspection extends GenericsInspectionToolBase { LOG.assertTrue(referenceElement != null, qualifierTypeElement); final PsiReferenceParameterList parameterList = referenceElement.getParameterList(); LOG.assertTrue(parameterList != null); - final ProblemDescriptor descriptor = inspectionManager.createProblemDescriptor(parameterList, InspectionsBundle + final ProblemDescriptor descriptor = inspectionManager.createProblemDescriptor(parameterList, JavaAnalysisBundle .message("inspection.redundant.type.problem.descriptor"), ourQuickFixAction, ProblemHighlightType.LIKE_UNUSED_SYMBOL, isOnTheFly); problems.add(descriptor); } @@ -163,7 +164,7 @@ public class RedundantTypeArgsInspection extends GenericsInspectionToolBase { : "inspection.redundant.type.problem.descriptor"; final ProblemDescriptor descriptor = inspectionManager.createProblemDescriptor(parameterList, - InspectionsBundle.message(key), + JavaAnalysisBundle.message(key), new MyQuickFixAction(), ProblemHighlightType.LIKE_UNUSED_SYMBOL, isOnTheFly); problems.add(descriptor); } @@ -175,7 +176,7 @@ public class RedundantTypeArgsInspection extends GenericsInspectionToolBase { @Override @NotNull public String getFamilyName() { - return InspectionsBundle.message("inspection.redundant.type.remove.quickfix"); + return JavaAnalysisBundle.message("inspection.redundant.type.remove.quickfix"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/SuspiciousCollectionsMethodCallsInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/SuspiciousCollectionsMethodCallsInspection.java index 8727cd96bab2..8b51afc0c464 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/SuspiciousCollectionsMethodCallsInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/SuspiciousCollectionsMethodCallsInspection.java @@ -7,6 +7,7 @@ import com.intellij.codeInspection.ProblemsHolder; import com.intellij.codeInspection.dataFlow.CommonDataflow; import com.intellij.codeInspection.dataFlow.TypeConstraint; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.util.MethodSignature; import com.intellij.psi.util.PsiUtil; @@ -32,7 +33,7 @@ public class SuspiciousCollectionsMethodCallsInspection extends AbstractBaseJava @Override @Nullable public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("report.suspicious.but.possibly.correct.method.calls"), this, "REPORT_CONVERTIBLE_METHOD_CALLS"); + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("report.suspicious.but.possibly.correct.method.calls"), this, "REPORT_CONVERTIBLE_METHOD_CALLS"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/SuspiciousMethodCallUtil.java b/java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/SuspiciousMethodCallUtil.java index 7babbcb206cb..afc822594500 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/SuspiciousMethodCallUtil.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/SuspiciousMethodCallUtil.java @@ -2,7 +2,7 @@ package com.intellij.codeInspection.miscGenerics; import com.intellij.codeInsight.daemon.impl.analysis.JavaGenericsUtil; -import com.intellij.codeInspection.InspectionsBundle; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.util.NullableLazyValue; import com.intellij.psi.*; import com.intellij.psi.impl.source.resolve.graphInference.PsiPolyExpressionUtil; @@ -288,7 +288,7 @@ public class SuspiciousMethodCallUtil { if (qualifierItemType.isConvertibleFrom(itemType) && !reportConvertibleMethodCalls) { return null; } - return InspectionsBundle.message("inspection.suspicious.collections.method.calls.problem.descriptor", + return JavaAnalysisBundle.message("inspection.suspicious.collections.method.calls.problem.descriptor", PsiFormatUtil.formatType(qualifierType, 0, PsiSubstitutor.EMPTY), PsiFormatUtil.formatType(itemType, 0, PsiSubstitutor.EMPTY), "objects"); @@ -305,7 +305,7 @@ public class SuspiciousMethodCallUtil { if (!typeParamMapping.isAssignableFrom(argType)) { if (typeParamMapping.isConvertibleFrom(argType)) { if (reportConvertibleMethodCalls) { - message = InspectionsBundle.message("inspection.suspicious.collections.method.calls.problem.descriptor1", + message = JavaAnalysisBundle.message("inspection.suspicious.collections.method.calls.problem.descriptor1", PsiFormatUtil.formatMethod(calleeMethod, substitutor, PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_CONTAINING_CLASS, @@ -315,7 +315,7 @@ public class SuspiciousMethodCallUtil { else { PsiType qualifierType = qualifier.getType(); if (qualifierType != null) { - message = InspectionsBundle.message("inspection.suspicious.collections.method.calls.problem.descriptor", + message = JavaAnalysisBundle.message("inspection.suspicious.collections.method.calls.problem.descriptor", PsiFormatUtil.formatType(qualifierType, 0, PsiSubstitutor.EMPTY), PsiFormatUtil.formatType(argType, 0, PsiSubstitutor.EMPTY), getPreciseObjectTitle(patternClass, patternMethod.typeParameterIdx)); diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/AnnotateOverriddenMethodParameterFix.java b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/AnnotateOverriddenMethodParameterFix.java index 2bb7c796d106..a99c1a624c66 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/AnnotateOverriddenMethodParameterFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/AnnotateOverriddenMethodParameterFix.java @@ -19,9 +19,9 @@ import com.intellij.codeInsight.AnnotationUtil; import com.intellij.codeInsight.FileModificationService; import com.intellij.codeInsight.intention.AddAnnotationPsiFix; import com.intellij.codeInspection.AnnotateMethodFix; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.util.ClassUtil; @@ -49,7 +49,7 @@ public class AnnotateOverriddenMethodParameterFix implements LocalQuickFix { @Override @NotNull public String getName() { - return InspectionsBundle.message("annotate.overridden.methods.parameters", ClassUtil.extractClassName(myAnnotation)); + return JavaAnalysisBundle.message("annotate.overridden.methods.parameters", ClassUtil.extractClassName(myAnnotation)); } @Override @@ -109,6 +109,6 @@ public class AnnotateOverriddenMethodParameterFix implements LocalQuickFix { @Override @NotNull public String getFamilyName() { - return InspectionsBundle.message("annotate.overridden.methods.parameters.family.name"); + return JavaAnalysisBundle.message("annotate.overridden.methods.parameters.family.name"); } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/ChangeNullableDefaultsFix.java b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/ChangeNullableDefaultsFix.java index 39edaf9eb62c..bf37366a8ca6 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/ChangeNullableDefaultsFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/ChangeNullableDefaultsFix.java @@ -16,9 +16,9 @@ package com.intellij.codeInspection.nullable; import com.intellij.codeInsight.NullableNotNullManager; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiAnnotation; import org.jetbrains.annotations.NotNull; @@ -44,7 +44,7 @@ class ChangeNullableDefaultsFix implements LocalQuickFix { @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("make.0.default.annotation", myNotNullName != null ? myNotNullName : myNullableName); + return JavaAnalysisBundle.message("make.0.default.annotation", myNotNullName != null ? myNotNullName : myNullableName); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java index c061e52252f0..e6243305f66a 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/nullable/NullableStuffInspectionBase.java @@ -7,6 +7,7 @@ import com.intellij.codeInsight.intention.AddAnnotationPsiFix; import com.intellij.codeInspection.*; import com.intellij.codeInspection.dataFlow.DfaPsiUtil; import com.intellij.codeInspection.dataFlow.instructions.MethodCallInstruction; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.GeneratedSourcesFilter; @@ -157,7 +158,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection PsiClass psiClass = PsiUtil.resolveClassInClassTypeOnly(((PsiClassObjectAccessExpression)value).getOperand().getType()); if (psiClass != null && !hasStringConstructor(psiClass)) { holder.registerProblem(value, - InspectionsBundle.message( + JavaAnalysisBundle.message( "custom.exception.class.should.have.a.constructor"), ProblemHighlightType.GENERIC_ERROR_OR_WARNING); @@ -204,7 +205,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection if (DfaPsiUtil.getTypeNullability(JavaPsiFacade.getElementFactory(element.getProject()).createType(typeParameters[i])) == Nullability.NOT_NULL && DfaPsiUtil.getTypeNullability(typeArguments[i].getType()) != Nullability.NOT_NULL) { holder.registerProblem(typeArguments[i], - InspectionsBundle.message("non.null.type.argument.is.expected"), + JavaAnalysisBundle.message("non.null.type.argument.is.expected"), ProblemHighlightType.GENERIC_ERROR_OR_WARNING); } } @@ -279,7 +280,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection @Nullable PsiType assignedType) { if (isNullableNotNullCollectionConflict(expectedType, assignedType, new HashSet<>())) { holder.registerProblem(errorElement, - InspectionsBundle + JavaAnalysisBundle .message("assigning.a.collection.of.nullable.elements"), ProblemHighlightType.GENERIC_ERROR_OR_WARNING); @@ -386,13 +387,13 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection assert refName != null; if (isNullableOverridingNotNull(check(targetMethod, holder, expression.getType()), superMethod)) { holder.registerProblem(refName, - InspectionsBundle.message("inspection.nullable.problems.Nullable.method.overrides.NotNull", + JavaAnalysisBundle.message("inspection.nullable.problems.Nullable.method.overrides.NotNull", getPresentableAnnoName(targetMethod), getPresentableAnnoName(superMethod)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING); } else if (isNonAnnotatedOverridingNotNull(targetMethod, superMethod)) { holder.registerProblem(refName, - InspectionsBundle.message("not.annotated.method.is.used.as.an.override.for.a.method.annotated.with.0", + JavaAnalysisBundle.message("not.annotated.method.is.used.as.an.override.for.a.method.annotated.with.0", getPresentableAnnoName(superMethod)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, createFixForNonAnnotatedOverridesNotNull(targetMethod, superMethod)); @@ -441,14 +442,14 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection AnnotateMethodFix getterAnnoFix = new AnnotateMethodFix(anno, ArrayUtilRt.toStringArray(annoToRemove)); if (REPORT_NOT_ANNOTATED_GETTER) { if (!manager.hasNullability(getter) && !TypeConversionUtil.isPrimitiveAndNotNull(getter.getReturnType())) { - holder.registerProblem(nameIdentifier, InspectionsBundle + holder.registerProblem(nameIdentifier, JavaAnalysisBundle .message("inspection.nullable.problems.annotated.field.getter.not.annotated", getPresentableAnnoName(field)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, getterAnnoFix); } } if (annotated.isDeclaredNotNull && isNullableNotInferred(getter, false) || annotated.isDeclaredNullable && isNotNullNotInferred(getter, false, false)) { - holder.registerProblem(nameIdentifier, InspectionsBundle.message( + holder.registerProblem(nameIdentifier, JavaAnalysisBundle.message( "inspection.nullable.problems.annotated.field.getter.conflict", getPresentableAnnoName(field), getPresentableAnnoName(getter)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, getterAnnoFix); } @@ -467,7 +468,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection final PsiIdentifier parameterName = parameter.getNameIdentifier(); assertValidElement(setter, parameter, parameterName); holder.registerProblem(parameterName, - InspectionsBundle.message("inspection.nullable.problems.annotated.field.setter.parameter.not.annotated", + JavaAnalysisBundle.message("inspection.nullable.problems.annotated.field.setter.parameter.not.annotated", getPresentableAnnoName(field)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, addAnnoFix); @@ -476,7 +477,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection if (annotated.isDeclaredNotNull && isNullableNotInferred(parameter, false)) { final PsiIdentifier parameterName = parameter.getNameIdentifier(); assertValidElement(setter, parameter, parameterName); - holder.registerProblem(parameterName, InspectionsBundle.message( + holder.registerProblem(parameterName, JavaAnalysisBundle.message( "inspection.nullable.problems.annotated.field.setter.parameter.conflict", getPresentableAnnoName(field), getPresentableAnnoName(parameter)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, @@ -518,7 +519,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection if (nameIdentifier != null && nameIdentifier.isPhysical()) { holder.registerProblem( nameIdentifier, - InspectionsBundle.message("inspection.nullable.problems.annotated.field.constructor.parameter.not.annotated", getPresentableAnnoName(field)), + JavaAnalysisBundle.message("inspection.nullable.problems.annotated.field.constructor.parameter.not.annotated", getPresentableAnnoName(field)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, createAddAnnotationFix(anno, annoToRemove, parameter)); continue; } @@ -542,7 +543,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection PsiIdentifier nameIdentifier = field.getNameIdentifier(); if (nameIdentifier.isPhysical()) { holder.registerProblem(nameIdentifier, - InspectionsBundle.message("0.field.is.always.initialized.not.null", getPresentableAnnoName(field)), + JavaAnalysisBundle.message("0.field.is.always.initialized.not.null", getPresentableAnnoName(field)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, AddAnnotationPsiFix.createAddNotNullFix(field)); } } @@ -612,11 +613,11 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection private static void checkLoopParameterNullability(ProblemsHolder holder, @Nullable PsiAnnotation notNull, @Nullable PsiAnnotation nullable, Nullability expectedNullability) { if (notNull != null && expectedNullability == Nullability.NULLABLE) { - holder.registerProblem(notNull, InspectionsBundle.message("parameter.can.be.null"), + holder.registerProblem(notNull, JavaAnalysisBundle.message("parameter.can.be.null"), new RemoveAnnotationQuickFix(notNull, null)); } else if (nullable != null && expectedNullability == Nullability.NOT_NULL) { - holder.registerProblem(nullable, InspectionsBundle.message("parameter.is.always.not.null"), + holder.registerProblem(nullable, JavaAnalysisBundle.message("parameter.is.always.not.null"), new RemoveAnnotationQuickFix(nullable, null)); } } @@ -624,7 +625,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection private static void reportPrimitiveType(ProblemsHolder holder, PsiAnnotation annotation, @Nullable PsiModifierListOwner listOwner) { holder.registerProblem(!annotation.isPhysical() && listOwner != null ? listOwner.getNavigationElement() : annotation, - InspectionsBundle.message("inspection.nullable.problems.primitive.type.annotation"), + JavaAnalysisBundle.message("inspection.nullable.problems.primitive.type.annotation"), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new RemoveAnnotationQuickFix(annotation, listOwner) { @Override protected boolean shouldRemoveInheritors() { @@ -666,7 +667,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection if (isNullableOverridingNotNull(annotated, superMethod)) { PsiAnnotation annotation = AnnotationUtil.findAnnotation(method, getNullityManager(method).getNullables(), true); holder.registerProblem(annotation != null ? annotation : method.getNameIdentifier(), - InspectionsBundle.message("inspection.nullable.problems.Nullable.method.overrides.NotNull", + JavaAnalysisBundle.message("inspection.nullable.problems.Nullable.method.overrides.NotNull", getPresentableAnnoName(method), getPresentableAnnoName(superMethod)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING); break; @@ -674,7 +675,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection if (isNonAnnotatedOverridingNotNull(method, superMethod)) { holder.registerProblem(method.getNameIdentifier(), - InspectionsBundle + JavaAnalysisBundle .message("inspection.nullable.problems.method.overrides.NotNull", getPresentableAnnoName(superMethod)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, createFixForNonAnnotatedOverridesNotNull(method, superMethod)); @@ -735,7 +736,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection if (nullableSuper != null) { PsiAnnotation annotation = AnnotationUtil.findAnnotation(parameter, nullableManager.getNotNulls(), true); holder.registerProblem(annotation != null ? annotation : parameter.getNameIdentifier(), - InspectionsBundle.message("inspection.nullable.problems.NotNull.parameter.overrides.Nullable", + JavaAnalysisBundle.message("inspection.nullable.problems.NotNull.parameter.overrides.Nullable", getPresentableAnnoName(parameter), getPresentableAnnoName(nullableSuper)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING); @@ -746,7 +747,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection ? AddAnnotationPsiFix.createAddNotNullFix(parameter) : createChangeDefaultNotNullFix(nullableManager, notNullSuper); holder.registerProblem(parameter.getNameIdentifier(), - InspectionsBundle.message("inspection.nullable.problems.parameter.overrides.NotNull", getPresentableAnnoName(notNullSuper)), + JavaAnalysisBundle.message("inspection.nullable.problems.parameter.overrides.NotNull", getPresentableAnnoName(notNullSuper)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, fix); } @@ -757,7 +758,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection boolean physical = PsiTreeUtil.isAncestor(parameter, notNullAnnotation, true); final LocalQuickFix fix = physical ? new RemoveAnnotationQuickFix(notNullAnnotation, parameter) : null; holder.registerProblem(physical ? notNullAnnotation : parameter.getNameIdentifier(), - InspectionsBundle.message("inspection.nullable.problems.NotNull.parameter.overrides.not.annotated", getPresentableAnnoName(parameter)), + JavaAnalysisBundle.message("inspection.nullable.problems.NotNull.parameter.overrides.not.annotated", getPresentableAnnoName(parameter)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, fix); } @@ -814,7 +815,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection if (elementToHighlight == null || !JavaNullMethodArgumentUtil.hasNullArgument(method, parameterIdx)) return; holder.registerProblem(elementToHighlight, - InspectionsBundle.message("inspection.nullable.problems.NotNull.parameter.receives.null.literal", + JavaAnalysisBundle.message("inspection.nullable.problems.NotNull.parameter.receives.null.literal", getPresentableAnnoName(parameter)), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, createNavigateToNullParameterUsagesFix(parameter)); @@ -866,7 +867,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection psiElement = identifier; if (psiElement == null) continue; } - holder.registerProblem(psiElement, InspectionsBundle.message("nullable.stuff.problems.overridden.methods.are.not.annotated"), + holder.registerProblem(psiElement, JavaAnalysisBundle.message("nullable.stuff.problems.overridden.methods.are.not.annotated"), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, fix); methodQuickFixSuggested = true; @@ -891,7 +892,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection ? new AnnotateOverriddenMethodParameterFix(defaultNotNull, nullableManager.getDefaultNullable()) : createChangeDefaultNotNullFix(nullableManager, parameters[i]); holder.registerProblem(psiElement, - InspectionsBundle.message("nullable.stuff.problems.overridden.method.parameters.are.not.annotated"), + JavaAnalysisBundle.message("nullable.stuff.problems.overridden.method.parameters.are.not.annotated"), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, fix); parameterQuickFixSuggested[i] = true; @@ -954,7 +955,7 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection private static void reportNullableNotNullConflict(final ProblemsHolder holder, final PsiModifierListOwner listOwner, final PsiAnnotation declaredNullable, final PsiAnnotation declaredNotNull) { - final String bothNullableNotNullMessage = InspectionsBundle.message("inspection.nullable.problems.Nullable.NotNull.conflict", + final String bothNullableNotNullMessage = JavaAnalysisBundle.message("inspection.nullable.problems.Nullable.NotNull.conflict", getPresentableAnnoName(declaredNullable), getPresentableAnnoName(declaredNotNull)); holder.registerProblem(declaredNotNull.isPhysical() ? declaredNotNull : listOwner.getNavigationElement(), diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/redundantCast/RedundantCastInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/redundantCast/RedundantCastInspection.java index c26c779e577a..c376fada2824 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/redundantCast/RedundantCastInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/redundantCast/RedundantCastInspection.java @@ -5,6 +5,7 @@ import com.intellij.codeInspection.*; import com.intellij.codeInspection.miscGenerics.GenericsInspectionToolBase; import com.intellij.codeInspection.miscGenerics.SuspiciousMethodCallUtil; import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.WriteExternalException; import com.intellij.psi.*; @@ -61,7 +62,7 @@ public class RedundantCastInspection extends GenericsInspectionToolBase { @Override public JComponent createOptionsPanel() { final MultipleCheckboxOptionsPanel optionsPanel = new MultipleCheckboxOptionsPanel(this); - optionsPanel.addCheckbox(InspectionsBundle.message("ignore.casts.in.suspicious.collections.method.calls"), "IGNORE_SUSPICIOUS_METHOD_CALLS"); + optionsPanel.addCheckbox(JavaAnalysisBundle.message("ignore.casts.in.suspicious.collections.method.calls"), "IGNORE_SUSPICIOUS_METHOD_CALLS"); return optionsPanel; } @@ -82,7 +83,7 @@ public class RedundantCastInspection extends GenericsInspectionToolBase { } } - String message = InspectionsBundle.message("inspection.redundant.cast.problem.descriptor", + String message = JavaAnalysisBundle.message("inspection.redundant.cast.problem.descriptor", "" + PsiExpressionTrimRenderer.render(operand) + "", "#ref #loc"); return manager.createProblemDescriptor(castType, message, myQuickFixAction, ProblemHighlightType.LIKE_UNUSED_SYMBOL, onTheFly); } @@ -92,7 +93,7 @@ public class RedundantCastInspection extends GenericsInspectionToolBase { @Override @NotNull public String getFamilyName() { - return InspectionsBundle.message("inspection.redundant.cast.remove.quickfix"); + return JavaAnalysisBundle.message("inspection.redundant.cast.remove.quickfix"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefImplicitConstructorImpl.java b/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefImplicitConstructorImpl.java index 30217bf819c1..22e3f9a92451 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefImplicitConstructorImpl.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefImplicitConstructorImpl.java @@ -16,7 +16,7 @@ package com.intellij.codeInspection.reference; -import com.intellij.codeInspection.InspectionsBundle; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.application.ReadAction; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; @@ -29,7 +29,7 @@ import java.util.Objects; public class RefImplicitConstructorImpl extends RefMethodImpl implements RefImplicitConstructor { RefImplicitConstructorImpl(@NotNull RefClass ownerClass) { - super(InspectionsBundle.message("inspection.reference.implicit.constructor.name", ownerClass.getName()), ownerClass); + super(JavaAnalysisBundle.message("inspection.reference.implicit.constructor.name", ownerClass.getName()), ownerClass); } @Override @@ -45,7 +45,7 @@ public class RefImplicitConstructorImpl extends RefMethodImpl implements RefImpl @NotNull @Override public String getName() { - return InspectionsBundle.message("inspection.reference.implicit.constructor.name", getOwnerClass().getName()); + return JavaAnalysisBundle.message("inspection.reference.implicit.constructor.name", getOwnerClass().getName()); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefJavaElementImpl.java b/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefJavaElementImpl.java index 16752b20eba8..636d5fcd5048 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefJavaElementImpl.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefJavaElementImpl.java @@ -2,7 +2,8 @@ package com.intellij.codeInspection.reference; -import com.intellij.codeInspection.InspectionsBundle; +import com.intellij.analysis.AnalysisBundle; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.util.Iconable; import com.intellij.psi.*; import com.intellij.util.IconUtil; @@ -79,7 +80,7 @@ public abstract class RefJavaElementImpl extends RefElementImpl implements RefJa if (psiBaseClass == null) { return "anonymous class"; } else { - return InspectionsBundle.message("inspection.reference.anonymous.name", psiBaseClass.getName()); + return JavaAnalysisBundle.message("inspection.reference.anonymous.name", psiBaseClass.getName()); } } @@ -90,14 +91,14 @@ public abstract class RefJavaElementImpl extends RefElementImpl implements RefJa } if (element instanceof PsiMethod && element instanceof SyntheticElement ) { - return InspectionsBundle.message("inspection.reference.jsp.holder.method.anonymous.name"); + return JavaAnalysisBundle.message("inspection.reference.jsp.holder.method.anonymous.name"); } String name = null; if (element instanceof PsiNamedElement) { name = ((PsiNamedElement)element).getName(); } - return name == null ? InspectionsBundle.message("inspection.reference.anonymous") : name; + return name == null ? AnalysisBundle.message("inspection.reference.anonymous") : name; } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java index 9c031036b039..e22cfc05176b 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java @@ -4,6 +4,7 @@ package com.intellij.codeInspection.sameReturnValue; import com.intellij.analysis.AnalysisScope; import com.intellij.codeInspection.*; import com.intellij.codeInspection.reference.*; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -24,11 +25,11 @@ public class SameReturnValueInspection extends GlobalJavaBatchInspectionTool { if (returnValue != null) { final String message; if (refMethod.getDerivedMethods().isEmpty()) { - message = InspectionsBundle.message("inspection.same.return.value.problem.descriptor", "" + returnValue + ""); + message = JavaAnalysisBundle.message("inspection.same.return.value.problem.descriptor", "" + returnValue + ""); } else if (refMethod.hasBody()) { - message = InspectionsBundle.message("inspection.same.return.value.problem.descriptor1", "" + returnValue + ""); + message = JavaAnalysisBundle.message("inspection.same.return.value.problem.descriptor1", "" + returnValue + ""); } else { - message = InspectionsBundle.message("inspection.same.return.value.problem.descriptor2", "" + returnValue + ""); + message = JavaAnalysisBundle.message("inspection.same.return.value.problem.descriptor2", "" + returnValue + ""); } final UDeclaration decl = refMethod.getUastElement(); diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/testOnly/TestOnlyInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/testOnly/TestOnlyInspection.java index 5f83dd1bfbd2..07e892ea38bb 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/testOnly/TestOnlyInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/testOnly/TestOnlyInspection.java @@ -3,7 +3,11 @@ package com.intellij.codeInspection.testOnly; import com.intellij.codeInsight.AnnotationUtil; import com.intellij.codeInsight.TestFrameworks; -import com.intellij.codeInspection.*; +import com.intellij.codeInspection.AbstractBaseJavaLocalInspectionTool; +import com.intellij.codeInspection.ProblemHighlightType; +import com.intellij.codeInspection.ProblemsHolder; +import com.intellij.codeInspection.RemoveAnnotationQuickFix; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.lang.java.JavaLanguage; import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.openapi.vfs.VirtualFile; @@ -91,7 +95,7 @@ public class TestOnlyInspection extends AbstractBaseJavaLocalInspectionTool { if (toHighlight == null) { toHighlight = element; } - h.registerProblem(toHighlight, InspectionsBundle.message("visible.for.testing.makes.little.sense.on.test.only.code"), new RemoveAnnotationQuickFix(vft, (PsiModifierListOwner)element)); + h.registerProblem(toHighlight, JavaAnalysisBundle.message("visible.for.testing.makes.little.sense.on.test.only.code"), new RemoveAnnotationQuickFix(vft, (PsiModifierListOwner)element)); } } super.visitElement(element); @@ -202,7 +206,7 @@ public class TestOnlyInspection extends AbstractBaseJavaLocalInspectionTool { } private static void reportProblem(PsiElement e, PsiMember target, ProblemsHolder h) { - String message = InspectionsBundle.message(target instanceof PsiClass + String message = JavaAnalysisBundle.message(target instanceof PsiClass ? "inspection.test.only.problems.test.only.class.reference" : target instanceof PsiField ? "inspection.test.only.problems.test.only.field.reference" : "inspection.test.only.problems.test.only.method.call"); diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/unnecessaryModuleDependency/UnnecessaryModuleDependencyInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/unnecessaryModuleDependency/UnnecessaryModuleDependencyInspection.java index 8855fcb0baad..4c2ba80ce96b 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/unnecessaryModuleDependency/UnnecessaryModuleDependencyInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/unnecessaryModuleDependency/UnnecessaryModuleDependencyInspection.java @@ -6,6 +6,7 @@ import com.intellij.codeInspection.reference.RefEntity; import com.intellij.codeInspection.reference.RefGraphAnnotator; import com.intellij.codeInspection.reference.RefManager; import com.intellij.codeInspection.reference.RefModule; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.*; @@ -114,11 +115,11 @@ public class UnnecessaryModuleDependencyInspection extends GlobalInspectionTool String dependencyName = dependency.getName(); String moduleName = module.getName(); if (scope.containsModule(dependency)) { //external references are rejected -> annotator doesn't provide any information on them -> false positives - final String allContainsMessage = InspectionsBundle.message("unnecessary.module.dependency.problem.descriptor", moduleName, dependencyName); + final String allContainsMessage = JavaAnalysisBundle.message("unnecessary.module.dependency.problem.descriptor", moduleName, dependencyName); return manager.createProblemDescriptor(allContainsMessage, module, new RemoveModuleDependencyFix(dependencyName)); } else { - String message = InspectionsBundle.message("suspected.module.dependency.problem.descriptor", moduleName, dependencyName, scope.getDisplayName()); + String message = JavaAnalysisBundle.message("suspected.module.dependency.problem.descriptor", moduleName, dependencyName, scope.getDisplayName()); return manager.createProblemDescriptor(message, module); } } @@ -134,7 +135,7 @@ public class UnnecessaryModuleDependencyInspection extends GlobalInspectionTool @Override @NotNull public String getFamilyName() { - return InspectionsBundle.message("remove.dependency"); + return JavaAnalysisBundle.message("remove.dependency"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/unneededThrows/RedundantThrowsDeclarationInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/unneededThrows/RedundantThrowsDeclarationInspection.java index 2962932acd89..174641dc2286 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/unneededThrows/RedundantThrowsDeclarationInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/unneededThrows/RedundantThrowsDeclarationInspection.java @@ -8,6 +8,7 @@ import com.intellij.codeInsight.daemon.impl.quickfix.MethodThrowsFix; import com.intellij.codeInspection.*; import com.intellij.codeInspection.reference.*; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.lang.jvm.JvmModifier; import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.diagnostic.Logger; @@ -21,7 +22,6 @@ import com.intellij.util.IncorrectOperationException; import com.intellij.util.ObjectUtils; import com.intellij.util.Query; import com.intellij.util.containers.ContainerUtil; -import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -39,7 +39,7 @@ public class RedundantThrowsDeclarationInspection extends GlobalJavaBatchInspect @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("ignore.exceptions.thrown.by.entry.points.methods"), this, "IGNORE_ENTRY_POINTS"); + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("ignore.exceptions.thrown.by.entry.points.methods"), this, "IGNORE_ENTRY_POINTS"); } @Override @@ -84,17 +84,17 @@ public class RedundantThrowsDeclarationInspection extends GlobalJavaBatchInspect RefClass ownerClass = refMethod.getOwnerClass(); if (refMethod.isAbstract() || ownerClass != null && ownerClass.isInterface()) { - problems.add(manager.createProblemDescriptor(throwsRef, InspectionsBundle.message( + problems.add(manager.createProblemDescriptor(throwsRef, JavaAnalysisBundle.message( "inspection.redundant.throws.problem.descriptor", "#ref"), new MyQuickFix(processor, throwsClassName), ProblemHighlightType.LIKE_UNUSED_SYMBOL, false)); } else if (!refMethod.getDerivedMethods().isEmpty()) { - problems.add(manager.createProblemDescriptor(throwsRef, InspectionsBundle.message( + problems.add(manager.createProblemDescriptor(throwsRef, JavaAnalysisBundle.message( "inspection.redundant.throws.problem.descriptor1", "#ref"), new MyQuickFix(processor, throwsClassName), ProblemHighlightType.LIKE_UNUSED_SYMBOL, false)); } else { - problems.add(manager.createProblemDescriptor(throwsRef, InspectionsBundle.message( + problems.add(manager.createProblemDescriptor(throwsRef, JavaAnalysisBundle.message( "inspection.redundant.throws.problem.descriptor2", "#ref"), new MyQuickFix(processor, throwsClassName), ProblemHighlightType.LIKE_UNUSED_SYMBOL, false)); } @@ -171,7 +171,7 @@ public class RedundantThrowsDeclarationInspection extends GlobalJavaBatchInspect @Override @NotNull public String getFamilyName() { - return InspectionsBundle.message("inspection.redundant.throws.remove.quickfix"); + return JavaAnalysisBundle.message("inspection.redundant.throws.remove.quickfix"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/unusedImport/UnusedImportInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/unusedImport/UnusedImportInspection.java index 1a18a228b502..5f037e0c6833 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/unusedImport/UnusedImportInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/unusedImport/UnusedImportInspection.java @@ -16,6 +16,7 @@ package com.intellij.codeInspection.unusedImport; import com.intellij.codeInspection.*; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.util.FileTypeUtils; import com.intellij.psi.util.PsiTreeUtil; @@ -62,6 +63,6 @@ public class UnusedImportInspection extends GlobalSimpleInspectionTool { } public static String getDisplayNameText() { - return InspectionsBundle.message("unused.import.display.name"); + return JavaAnalysisBundle.message("unused.import.display.name"); } } \ No newline at end of file diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/unusedLibraries/UnusedLibrariesInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/unusedLibraries/UnusedLibrariesInspection.java index 3362fa029099..7b28731b1e8e 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/unusedLibraries/UnusedLibrariesInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/unusedLibraries/UnusedLibrariesInspection.java @@ -22,6 +22,7 @@ import com.intellij.codeInspection.reference.RefGraphAnnotator; import com.intellij.codeInspection.reference.RefManager; import com.intellij.codeInspection.reference.RefModule; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.module.Module; @@ -62,7 +63,7 @@ public class UnusedLibrariesInspection extends GlobalInspectionTool { @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("don.t.report.unused.jars.inside.used.library"), this, "IGNORE_LIBRARY_PARTS"); + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("don.t.report.unused.jars.inside.used.library"), this, "IGNORE_LIBRARY_PARTS"); } @Nullable @@ -123,13 +124,13 @@ public class UnusedLibrariesInspection extends GlobalInspectionTool { final Set files = ContainerUtil.set(((LibraryOrderEntry)entry).getRootFiles(OrderRootType.CLASSES)); boolean allRootsUnused = usedRoots == null || !files.removeAll(usedRoots); if (allRootsUnused) { - String message = InspectionsBundle.message("unused.library.problem.descriptor", entry.getPresentableName()); + String message = JavaAnalysisBundle.message("unused.library.problem.descriptor", entry.getPresentableName()); result.add(manager.createProblemDescriptor(message, module, new RemoveUnusedLibrary(entry.getPresentableName(), null))); } else if (!files.isEmpty() && !IGNORE_LIBRARY_PARTS) { final String unusedLibraryRoots = StringUtil.join(files, file -> file.getPresentableName(), ","); String message = - InspectionsBundle.message("unused.library.roots.problem.descriptor", unusedLibraryRoots, entry.getPresentableName()); + JavaAnalysisBundle.message("unused.library.roots.problem.descriptor", unusedLibraryRoots, entry.getPresentableName()); CommonProblemDescriptor descriptor = ((LibraryOrderEntry)entry).isModuleLevel() ? manager.createProblemDescriptor(message, module, new RemoveUnusedLibrary(entry.getPresentableName(), files)) @@ -258,7 +259,7 @@ public class UnusedLibrariesInspection extends GlobalInspectionTool { @Override @NotNull public String getFamilyName() { - return myFiles == null ? InspectionsBundle.message("detach.library.quickfix.name") : InspectionsBundle.message("detach.library.roots.quickfix.name"); + return myFiles == null ? JavaAnalysisBundle.message("detach.library.quickfix.name") : JavaAnalysisBundle.message("detach.library.roots.quickfix.name"); } @Override diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/visibility/AccessCanBeTightenedInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/visibility/AccessCanBeTightenedInspection.java index a8be70f8c4fd..ef6f3cbd34f4 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/visibility/AccessCanBeTightenedInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/visibility/AccessCanBeTightenedInspection.java @@ -7,6 +7,7 @@ import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemsHolder; import com.intellij.codeInspection.deadCode.UnusedDeclarationInspectionBase; import com.intellij.codeInspection.inheritance.ImplicitSubclassProvider; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.module.Module; import com.intellij.openapi.progress.EmptyProgressIndicator; import com.intellij.openapi.project.Project; @@ -125,7 +126,7 @@ class AccessCanBeTightenedInspection extends AbstractBaseJavaLocalInspectionTool if (toHighlight != null) { String suggestedModifier = PsiUtil.getAccessModifier(suggestedLevel); myHolder.registerProblem(toHighlight, - InspectionsBundle.message("access.can.be.0", VisibilityUtil.toPresentableText(suggestedModifier)), new ChangeModifierFix(suggestedModifier)); + JavaAnalysisBundle.message("access.can.be.0", VisibilityUtil.toPresentableText(suggestedModifier)), new ChangeModifierFix(suggestedModifier)); } } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/visibility/VisibilityInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/visibility/VisibilityInspection.java index 4be4136b8e91..e999ca09881d 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/visibility/VisibilityInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/visibility/VisibilityInspection.java @@ -8,6 +8,7 @@ import com.intellij.codeInspection.*; import com.intellij.codeInspection.ex.EntryPointsManager; import com.intellij.codeInspection.ex.EntryPointsManagerBase; import com.intellij.codeInspection.reference.*; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.diagnostic.Logger; @@ -61,7 +62,7 @@ public final class VisibilityInspection extends GlobalJavaBatchInspectionTool { gc.weighty = 0; gc.anchor = GridBagConstraints.NORTHWEST; - myPackageLocalForMembersCheckbox = new JCheckBox(InspectionsBundle.message("inspection.visibility.option.package.private.members")); + myPackageLocalForMembersCheckbox = new JCheckBox(JavaAnalysisBundle.message("inspection.visibility.option.package.private.members")); myPackageLocalForMembersCheckbox.setSelected(SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS); myPackageLocalForMembersCheckbox.getModel().addItemListener( e -> SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS = myPackageLocalForMembersCheckbox.isSelected()); @@ -69,7 +70,7 @@ public final class VisibilityInspection extends GlobalJavaBatchInspectionTool { gc.gridy = 0; add(myPackageLocalForMembersCheckbox, gc); - myPackageLocalForTopClassesCheckbox = new JCheckBox(InspectionsBundle.message( + myPackageLocalForTopClassesCheckbox = new JCheckBox(JavaAnalysisBundle.message( "inspection.visibility.package.private.top.level.classes")); myPackageLocalForTopClassesCheckbox.setSelected(SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES); myPackageLocalForTopClassesCheckbox.getModel().addItemListener( @@ -78,14 +79,14 @@ public final class VisibilityInspection extends GlobalJavaBatchInspectionTool { gc.gridy++; add(myPackageLocalForTopClassesCheckbox, gc); - myPrivateForInnersCheckbox = new JCheckBox(InspectionsBundle.message("inspection.visibility.private.inner.members")); + myPrivateForInnersCheckbox = new JCheckBox(JavaAnalysisBundle.message("inspection.visibility.private.inner.members")); myPrivateForInnersCheckbox.setSelected(SUGGEST_PRIVATE_FOR_INNERS); myPrivateForInnersCheckbox.getModel().addItemListener(e -> SUGGEST_PRIVATE_FOR_INNERS = myPrivateForInnersCheckbox.isSelected()); gc.gridy++; add(myPrivateForInnersCheckbox, gc); - mySuggestForConstantsCheckbox = new JCheckBox(InspectionsBundle.message("inspection.visibility.option.constants")); + mySuggestForConstantsCheckbox = new JCheckBox(JavaAnalysisBundle.message("inspection.visibility.option.constants")); mySuggestForConstantsCheckbox.setSelected(SUGGEST_FOR_CONSTANTS); mySuggestForConstantsCheckbox.getModel().addItemListener( e -> SUGGEST_FOR_CONSTANTS = mySuggestForConstantsCheckbox.isSelected()); @@ -651,7 +652,7 @@ public final class VisibilityInspection extends GlobalJavaBatchInspectionTool { @Override @NotNull public String getFamilyName() { - return InspectionsBundle.message("inspection.visibility.accept.quickfix"); + return JavaAnalysisBundle.message("inspection.visibility.accept.quickfix"); } @Override @@ -689,14 +690,14 @@ public final class VisibilityInspection extends GlobalJavaBatchInspectionTool { } private static String getCanBePrivate() { - return InspectionsBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PRIVATE)); + return JavaAnalysisBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PRIVATE)); } private static String getCanBePackageLocal() { - return InspectionsBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PACKAGE_LOCAL)); + return JavaAnalysisBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PACKAGE_LOCAL)); } private static String getCanBeProtected() { - return InspectionsBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PROTECTED)); + return JavaAnalysisBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PROTECTED)); } } diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/xml/DeprecatedClassUsageInspection.java b/java/java-analysis-impl/src/com/intellij/codeInspection/xml/DeprecatedClassUsageInspection.java index ddb228f92711..a50cfaa21256 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/xml/DeprecatedClassUsageInspection.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/xml/DeprecatedClassUsageInspection.java @@ -1,8 +1,12 @@ // Copyright 2000-2018 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. package com.intellij.codeInspection.xml; -import com.intellij.codeInspection.*; +import com.intellij.codeInspection.LocalInspectionToolSession; +import com.intellij.codeInspection.ProblemHighlightType; +import com.intellij.codeInspection.ProblemsHolder; +import com.intellij.codeInspection.XmlSuppressableInspectionTool; import com.intellij.codeInspection.deprecation.DeprecationInspectionBase; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.xml.XmlAttributeValue; import com.intellij.psi.xml.XmlTag; @@ -56,7 +60,7 @@ public class DeprecatedClassUsageInspection extends XmlSuppressableInspectionToo @NotNull @Override public String getGroupDisplayName() { - return InspectionsBundle.message("deprecated.class.usage.group.xml"); + return JavaAnalysisBundle.message("deprecated.class.usage.group.xml"); } @NotNull diff --git a/java/java-analysis-impl/src/org/jetbrains/java/generate/inspection/ClassHasNoToStringMethodInspection.java b/java/java-analysis-impl/src/org/jetbrains/java/generate/inspection/ClassHasNoToStringMethodInspection.java index 535c2b792056..2e6ab1891e83 100644 --- a/java/java-analysis-impl/src/org/jetbrains/java/generate/inspection/ClassHasNoToStringMethodInspection.java +++ b/java/java-analysis-impl/src/org/jetbrains/java/generate/inspection/ClassHasNoToStringMethodInspection.java @@ -16,11 +16,11 @@ package org.jetbrains.java.generate.inspection; import com.intellij.codeInsight.TestFrameworks; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemHighlightType; import com.intellij.codeInspection.ProblemsHolder; import com.intellij.codeInspection.ui.RegExFormatter; import com.intellij.codeInspection.ui.RegExInputVerifier; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.util.InheritanceUtil; import com.intellij.ui.DocumentAdapter; @@ -153,7 +153,7 @@ public class ClassHasNoToStringMethodInspection extends AbstractToStringInspecti } } holder.registerProblem(nameIdentifier, - InspectionsBundle.message("inspection.class.has.no.to.string.method.description", clazz.getName()), + JavaAnalysisBundle.message("inspection.class.has.no.to.string.method.description", clazz.getName()), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, createFixes(holder)); } }; @@ -174,7 +174,7 @@ public class ClassHasNoToStringMethodInspection extends AbstractToStringInspecti constraints.weightx = 0.0; constraints.anchor = GridBagConstraints.WEST; constraints.fill = GridBagConstraints.NONE; - panel.add(new JLabel(InspectionsBundle.message("inspection.class.has.no.to.string.method.exclude.classes.reg.exp.option")), constraints); + panel.add(new JLabel(JavaAnalysisBundle.message("inspection.class.has.no.to.string.method.exclude.classes.reg.exp.option")), constraints); final JFormattedTextField excludeClassNamesField = new JFormattedTextField(new RegExFormatter()); excludeClassNamesField.setValue(excludeClassNamesPattern); @@ -203,7 +203,7 @@ public class ClassHasNoToStringMethodInspection extends AbstractToStringInspecti panel.add(excludeClassNamesField, constraints); final CheckBox excludeExceptionCheckBox = new CheckBox( - InspectionsBundle.message("inspection.class.has.no.to.string.method.ignore.exception.classes.option"), this, "excludeException"); + JavaAnalysisBundle.message("inspection.class.has.no.to.string.method.ignore.exception.classes.option"), this, "excludeException"); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; @@ -211,27 +211,27 @@ public class ClassHasNoToStringMethodInspection extends AbstractToStringInspecti panel.add(excludeExceptionCheckBox, constraints); final CheckBox excludeDeprecatedCheckBox = new CheckBox( - InspectionsBundle.message("inspection.class.has.no.to.string.method.ignore.deprecated.classes.option"), this, "excludeDeprecated"); + JavaAnalysisBundle.message("inspection.class.has.no.to.string.method.ignore.deprecated.classes.option"), this, "excludeDeprecated"); constraints.gridy = 2; panel.add(excludeDeprecatedCheckBox, constraints); final CheckBox excludeEnumCheckBox = new CheckBox( - InspectionsBundle.message("inspection.class.has.no.to.string.method.ignore.enum.classes.option"), this, "excludeEnum"); + JavaAnalysisBundle.message("inspection.class.has.no.to.string.method.ignore.enum.classes.option"), this, "excludeEnum"); constraints.gridy = 3; panel.add(excludeEnumCheckBox, constraints); final CheckBox excludeAbstractCheckBox = new CheckBox( - InspectionsBundle.message("inspection.class.has.no.to.string.method.ignore.abstract.classes.option"), this, "excludeAbstract"); + JavaAnalysisBundle.message("inspection.class.has.no.to.string.method.ignore.abstract.classes.option"), this, "excludeAbstract"); constraints.gridy = 4; panel.add(excludeAbstractCheckBox, constraints); final CheckBox excludeInTestCodeCheckBox = new CheckBox( - InspectionsBundle.message("inspection.class.has.no.to.string.method.ignore.test.classes.option"), this, "excludeTestCode"); + JavaAnalysisBundle.message("inspection.class.has.no.to.string.method.ignore.test.classes.option"), this, "excludeTestCode"); constraints.gridy = 5; panel.add(excludeInTestCodeCheckBox, constraints); final CheckBox excludeInnerClasses = new CheckBox( - InspectionsBundle.message("inspection.class.has.no.to.string.method.ignore.inner.classes.option"), this, "excludeInnerClasses"); + JavaAnalysisBundle.message("inspection.class.has.no.to.string.method.ignore.inner.classes.option"), this, "excludeInnerClasses"); constraints.gridy = 6; constraints.weighty = 1.0; panel.add(excludeInnerClasses, constraints); diff --git a/java/java-analysis-impl/src/org/jetbrains/java/generate/inspection/FieldNotUsedInToStringInspection.java b/java/java-analysis-impl/src/org/jetbrains/java/generate/inspection/FieldNotUsedInToStringInspection.java index daba31a5a20b..c3809625dc75 100644 --- a/java/java-analysis-impl/src/org/jetbrains/java/generate/inspection/FieldNotUsedInToStringInspection.java +++ b/java/java-analysis-impl/src/org/jetbrains/java/generate/inspection/FieldNotUsedInToStringInspection.java @@ -15,9 +15,9 @@ */ package org.jetbrains.java.generate.inspection; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemHighlightType; import com.intellij.codeInspection.ProblemsHolder; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.*; import com.intellij.psi.util.PropertyUtilBase; import gnu.trove.THashSet; @@ -95,14 +95,14 @@ public class FieldNotUsedInToStringInspection extends AbstractToStringInspection for (PsiField field : visitor.getUnusedFields()) { final String fieldName = field.getName(); myHolder.registerProblem(field.getNameIdentifier(), - InspectionsBundle.message("inspection.field.not.used.in.to.string.description2", fieldName), + JavaAnalysisBundle.message("inspection.field.not.used.in.to.string.description2", fieldName), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, createFixes(myHolder)); } for (PsiMethod unusedMethod : visitor.getUnusedMethods()) { final PsiIdentifier identifier = unusedMethod.getNameIdentifier(); final PsiElement target = identifier == null ? unusedMethod : identifier; myHolder.registerProblem(target, - InspectionsBundle.message("inspection.field.not.used.in.to.string.description", unusedMethod.getName()), + JavaAnalysisBundle.message("inspection.field.not.used.in.to.string.description", unusedMethod.getName()), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, createFixes(myHolder)); } } diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RemoveTypeArgumentsFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RemoveTypeArgumentsFix.java index f5bf4f6e5726..4fadc09c84fd 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RemoveTypeArgumentsFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RemoveTypeArgumentsFix.java @@ -16,8 +16,8 @@ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.intention.HighPriorityAction; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.LocalQuickFixAndIntentionActionOnPsiElement; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; @@ -35,7 +35,7 @@ public class RemoveTypeArgumentsFix extends LocalQuickFixAndIntentionActionOnPsi @NotNull @Override public String getText() { - return InspectionsBundle.message("inspection.redundant.type.remove.quickfix"); + return JavaAnalysisBundle.message("inspection.redundant.type.remove.quickfix"); } @NotNull diff --git a/java/java-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java b/java/java-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java index e1c7ce5533ac..1a1edc8ccf9c 100644 --- a/java/java-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java @@ -3,6 +3,7 @@ package com.intellij.codeInspection; import com.intellij.codeInspection.LambdaCanBeMethodReferenceInspection.MethodReferenceCandidate; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.TextRange; @@ -45,7 +46,7 @@ public class AnonymousCanBeMethodReferenceInspection extends AbstractBaseJavaLoc @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("report.when.interface.is.not.annotated.with.functional.interface"), this, "reportNotAnnotatedInterfaces"); + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("report.when.interface.is.not.annotated.with.functional.interface"), this, "reportNotAnnotatedInterfaces"); } @NotNull diff --git a/java/java-impl/src/com/intellij/codeInspection/ex/HTMLJavaHTMLComposerImpl.java b/java/java-impl/src/com/intellij/codeInspection/ex/HTMLJavaHTMLComposerImpl.java index 42cd77dae364..826f2836f722 100644 --- a/java/java-impl/src/com/intellij/codeInspection/ex/HTMLJavaHTMLComposerImpl.java +++ b/java/java-impl/src/com/intellij/codeInspection/ex/HTMLJavaHTMLComposerImpl.java @@ -296,7 +296,7 @@ public class HTMLJavaHTMLComposerImpl extends HTMLJavaHTMLComposer { buf.append(">"); if (refElement instanceof RefClass && ((RefClass)refElement).isAnonymous()) { - buf.append(InspectionsBundle.message("inspection.reference.anonymous")); + buf.append(AnalysisBundle.message("inspection.reference.anonymous")); } else if (refElement instanceof RefJavaElement && ((RefJavaElement)refElement).isSyntheticJSP()) { buf.append(XmlStringUtil.escapeString(refElement.getName())); diff --git a/java/java-impl/src/com/intellij/codeInspection/java18api/Java8MapForEachInspection.java b/java/java-impl/src/com/intellij/codeInspection/java18api/Java8MapForEachInspection.java index 3d7d7205faad..91a1bbfa3a12 100644 --- a/java/java-impl/src/com/intellij/codeInspection/java18api/Java8MapForEachInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/java18api/Java8MapForEachInspection.java @@ -4,6 +4,7 @@ package com.intellij.codeInspection.java18api; import com.intellij.codeInspection.*; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; import com.intellij.codeInspection.util.LambdaGenerationUtil; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.TextRange; import com.intellij.pom.java.JavaFeature; @@ -63,7 +64,7 @@ public class Java8MapForEachInspection extends AbstractBaseJavaLocalInspectionTo PsiParameter entry = lambdaParameters[0]; if (!allUsagesAllowed(entry)) return; PsiElement nameElement = Objects.requireNonNull(call.getMethodExpression().getReferenceNameElement()); - holder.registerProblem(nameElement, InspectionsBundle.message("inspection.can.be.replaced.with.message", "Map.forEach()"), + holder.registerProblem(nameElement, JavaAnalysisBundle.message("inspection.can.be.replaced.with.message", "Map.forEach()"), new ReplaceWithMapForEachFix()); } @@ -99,7 +100,7 @@ public class Java8MapForEachInspection extends AbstractBaseJavaLocalInspectionTo toHighlight = firstChild; range = new TextRange(0, firstChild.getTextLength()); } - holder.registerProblem(toHighlight, InspectionsBundle.message("inspection.can.be.replaced.with.message", "Map.forEach()"), + holder.registerProblem(toHighlight, JavaAnalysisBundle.message("inspection.can.be.replaced.with.message", "Map.forEach()"), type, range, new ReplaceWithMapForEachFix()); } } diff --git a/java/java-impl/src/com/intellij/codeInspection/streamMigration/MigrateToStreamFix.java b/java/java-impl/src/com/intellij/codeInspection/streamMigration/MigrateToStreamFix.java index 2d6242523f08..deae68ab121e 100644 --- a/java/java-impl/src/com/intellij/codeInspection/streamMigration/MigrateToStreamFix.java +++ b/java/java-impl/src/com/intellij/codeInspection/streamMigration/MigrateToStreamFix.java @@ -17,6 +17,7 @@ package com.intellij.codeInspection.streamMigration; import com.intellij.codeInspection.*; import com.intellij.codeInspection.streamMigration.StreamApiMigrationInspection.StreamSource; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.codeStyle.JavaCodeStyleManager; @@ -41,7 +42,7 @@ class MigrateToStreamFix implements LocalQuickFix { @NotNull @Override public String getName() { - return InspectionsBundle.message("replace.with.0", myMigration.getReplacement()); + return JavaAnalysisBundle.message("replace.with.0", myMigration.getReplacement()); } @NotNull diff --git a/java/java-tests/testSrc/com/intellij/java/codeInspection/Java9ModuleExportsPackageToItselfTest.kt b/java/java-tests/testSrc/com/intellij/java/codeInspection/Java9ModuleExportsPackageToItselfTest.kt index dfbdc2e0da89..4ccc608635bb 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInspection/Java9ModuleExportsPackageToItselfTest.kt +++ b/java/java-tests/testSrc/com/intellij/java/codeInspection/Java9ModuleExportsPackageToItselfTest.kt @@ -17,6 +17,7 @@ package com.intellij.java.codeInspection import com.intellij.codeInspection.InspectionsBundle import com.intellij.codeInspection.java19modules.Java9ModuleExportsPackageToItselfInspection +import com.intellij.java.analysis.JavaAnalysisBundle import com.intellij.java.testFramework.fixtures.LightJava9ModulesCodeInsightFixtureTestCase import com.intellij.java.testFramework.fixtures.MultiModuleJava9ProjectDescriptor import org.intellij.lang.annotations.Language @@ -25,9 +26,9 @@ import org.intellij.lang.annotations.Language * @author Pavel.Dolgov */ class Java9ModuleExportsPackageToItselfTest : LightJava9ModulesCodeInsightFixtureTestCase() { - private val message = InspectionsBundle.message("inspection.module.exports.package.to.itself") - private val fix1 = InspectionsBundle.message("exports.to.itself.delete.statement.fix") - private val fix2 = InspectionsBundle.message("exports.to.itself.delete.module.ref.fix", "M") + private val message = JavaAnalysisBundle.message("inspection.module.exports.package.to.itself") + private val fix1 = JavaAnalysisBundle.message("exports.to.itself.delete.statement.fix") + private val fix2 = JavaAnalysisBundle.message("exports.to.itself.delete.module.ref.fix", "M") override fun setUp() { super.setUp() diff --git a/java/java-tests/testSrc/com/intellij/java/propertyBased/JavaIntentionPolicy.java b/java/java-tests/testSrc/com/intellij/java/propertyBased/JavaIntentionPolicy.java index 74448e3a0baa..36353fe4eada 100644 --- a/java/java-tests/testSrc/com/intellij/java/propertyBased/JavaIntentionPolicy.java +++ b/java/java-tests/testSrc/com/intellij/java/propertyBased/JavaIntentionPolicy.java @@ -3,7 +3,7 @@ package com.intellij.java.propertyBased; import com.intellij.codeInsight.daemon.impl.HighlightInfo; import com.intellij.codeInsight.intention.IntentionAction; -import com.intellij.codeInspection.InspectionsBundle; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.editor.Editor; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; @@ -104,7 +104,7 @@ class JavaCommentingStrategy extends JavaIntentionPolicy { intentionText.matches("Simplify '.*' to .*") || intentionText.matches("Move '.*' to Javadoc ''@throws'' tag") || intentionText.matches("Remove '.*' from '.*' throws list") || - intentionText.matches(InspectionsBundle.message("inspection.redundant.type.remove.quickfix")) || + intentionText.matches(JavaAnalysisBundle.message("inspection.redundant.type.remove.quickfix")) || intentionText.matches("Remove .+ suppression"); return !isCommentChangingAction; } diff --git a/platform/analysis-api/resources/messages/AnalysisBundle.properties b/platform/analysis-api/resources/messages/AnalysisBundle.properties index c8c95faa7805..3a3436a06405 100644 --- a/platform/analysis-api/resources/messages/AnalysisBundle.properties +++ b/platform/analysis-api/resources/messages/AnalysisBundle.properties @@ -36,6 +36,7 @@ inspection.processing.job.descriptor1=Processing external usages of inspection.processing.job.descriptor2=Analyzing code in inspection.progress.title=Inspecting Code... inspection.redirect.template=Injected element has problem: {0} (in {3}). +inspection.reference.anonymous=anonymous inspection.reference.invalid=element no longer exists jar.modification.not.supported.error=Cannot modify archive file {0} local.scopes.node.text=Local Scopes diff --git a/platform/analysis-api/resources/messages/InspectionsBundle.properties b/platform/analysis-api/resources/messages/InspectionsBundle.properties index 7e55199e5c42..bc0915ab03fa 100644 --- a/platform/analysis-api/resources/messages/InspectionsBundle.properties +++ b/platform/analysis-api/resources/messages/InspectionsBundle.properties @@ -19,30 +19,16 @@ inspection.disabled.title=Inspection disabled inspection.problem.synopsis=Problem synopsis #export results view -inspection.export.results.can.be.final.description=Declaration can have final modifier - inspection.export.results.package=package inspection.export.results.constructor=constructor inspection.export.results.method=method inspection.export.results.field=field #can be final inspection.can.be.final.display.name=Declaration can have final modifier -inspection.can.be.final.accept.quickfix=Make final -inspection.can.be.final.option=Report classes -inspection.can.be.final.option1=Report methods -inspection.can.be.final.option2=Report fields - #dataflow inspection.data.flow.display.name=Constant conditions \\& exceptions -inspection.contract.display.name=Contract issues inspection.data.flow.nullable.quickfix.option=Suggest @Nullable annotation for methods/fields/parameters where nullable values are used inspection.data.flow.true.asserts.option=Don't report assertions with condition statically proven to be always true -inspection.data.flow.turn.off.true.asserts.quickfix=Don't report always true assertions -inspection.data.flow.turn.off.constant.references.quickfix=Don't report values which are guaranteed to be constant -inspection.data.flow.turn.off.nullable.returning.notnull.quickfix=Don't report nullable methods which always return not-null value -inspection.data.flow.redundant.instanceof.quickfix=Replace with a null check -inspection.data.flow.simplify.boolean.expression.quickfix=Simplify boolean expression -inspection.data.flow.simplify.to.assignment.quickfix.name=Simplify to normal assignment inspection.data.flow.filter.notnull.quickfix=Insert 'filter(Objects::nonNull)' step inspection.data.flow.use.computeifpresent.quickfix=Replace 'compute' with 'computeIfPresent' configure.annotations.option=Configure Annotations @@ -62,16 +48,8 @@ inspection.empty.method.problem.descriptor4=All implementations of this method a #redundant cast inspection.redundant.cast.display.name=Redundant type cast -inspection.redundant.cast.remove.quickfix=Remove redundant cast(s) -inspection.redundant.cast.problem.descriptor=Casting {0} to {1} is redundant - #redundant throws inspection.redundant.throws.display.name=Redundant 'throws' clause -inspection.redundant.throws.remove.quickfix=Remove unnecessary 'throws' declarations -inspection.redundant.throws.problem.descriptor=The declared exception {0} is never thrown in method implementations -inspection.redundant.throws.problem.descriptor1=The declared exception {0} is never thrown in this method, nor in its derivables -inspection.redundant.throws.problem.descriptor2=The declared exception {0} is never thrown - inspection.equals.hashcode.display.name='equals()' and 'hashCode()' not paired inspection.equals.hashcode.only.one.defined.problem.descriptor=Class has {0} defined but does not define {1} inspection.equals.hashcode.generate.equals.quickfix=Generate 'equals()' @@ -83,15 +61,6 @@ inspection.1.7.problem.descriptor=Usage of generified after 1.6 API which would inspection.1.8.problem.descriptor=Default {0, choice, 0#|1#method is|2# methods are} not overridden. It would cause compilation problems with JDK {1} inspection.1.8.problem.single.descriptor=Default method ''{0}'' is not overridden. It would cause compilation problems with JDK {1} -inspection.local.can.be.final.display.name=Local variable or parameter can be final -inspection.local.can.be.final.option=Report local variables -inspection.local.can.be.final.option1=Report method parameters -inspection.local.can.be.final.option2=Report catch parameters -inspection.local.can.be.final.option3=Report foreach parameters -inspection.local.can.be.final.option4=Report variables which are implicit final -inspection.can.be.local.parameter.problem.descriptor=Parameter #ref can have final modifier -inspection.can.be.local.variable.problem.descriptor=Variable #ref can have final modifier - inspection.return.separated.from.computation.name='return' separated from the result computation inspection.return.separated.from.computation.descriptor=Return separated from computation of value of ''{0}'' inspection.return.separated.from.computation.quickfix=Move ''return'' closer to computation of the value of ''{0}'' @@ -111,35 +80,8 @@ inspection.nullable.problems.notnull.overrides.option=Report @NotNull ¶meter inspection.nullable.problems.notnull.parameters.with.null.literal.option=Report @NotNull parameters with null-literal argument usages #problem descriptor messages -inspection.nullable.problems.Nullable.NotNull.conflict=Cannot annotate with both @{0} and @{1} -inspection.nullable.problems.Nullable.method.overrides.NotNull=Method annotated with @{0} must not override @{1} method -inspection.nullable.problems.method.overrides.NotNull=Not annotated method overrides method annotated with @{0} -inspection.nullable.problems.annotated.field.getter.not.annotated=Getter for @{0} field might be annotated @{0} itself -inspection.nullable.problems.annotated.field.getter.conflict=Getter for @{0} field is annotated @{1} -inspection.nullable.problems.annotated.field.setter.parameter.not.annotated=Setter parameter for @{0} field might be annotated @{0} itself -inspection.nullable.problems.annotated.field.setter.parameter.conflict=Setter parameter for @{0} field is annotated @{1} -inspection.nullable.problems.annotated.field.constructor.parameter.not.annotated=Constructor parameter for @{0} field might be annotated @{0} itself -inspection.nullable.problems.NotNull.parameter.overrides.Nullable=Parameter annotated @{0} must not override @{1} parameter -inspection.nullable.problems.NotNull.parameter.overrides.not.annotated=Parameter annotated @{0} should not override non-annotated parameter -inspection.nullable.problems.parameter.overrides.NotNull=Not annotated parameter overrides @{0} parameter -inspection.nullable.problems.primitive.type.annotation=Primitive type members cannot be annotated -inspection.nullable.problems.NotNull.parameter.receives.null.literal=Parameter annotated @{0} should not receive ''null'' as an argument - -inspection.test.only.problems.display.name=Test-only class or method call in production code -inspection.test.only.problems.test.only.method.call=Test-only method is called in production code -inspection.test.only.problems.test.only.class.reference=Test-only class is referenced in production code -inspection.test.only.problems.test.only.field.reference=Test-only field is referenced in production code - inspection.visibility.display.name=Declaration access can be weaker -inspection.visibility.option.constants=Suggest weaker visibility for constants -inspection.visibility.option.package.private.members=Suggest package-private visibility level for class members -inspection.visibility.package.private.top.level.classes=Suggest package-private visibility level for top-level classes -inspection.visibility.private.inner.members=Suggest private for inner class members when referenced from outer class only - #can be private|package-private|protected|public -inspection.visibility.compose.suggestion=Can be {0} - -inspection.visibility.accept.quickfix=Accept suggested access level inspection.field.can.be.local.display.name=Field can be local inspection.field.can.be.local.problem.descriptor=Field can be converted to a local variable inspection.parameter.can.be.local.display.name=Parameter can be local @@ -153,11 +95,6 @@ inspection.unused.return.value.display.name=Method can be void inspection.unused.return.value.problem.descriptor=Return value of the method is never used inspection.unused.return.value.make.void.quickfix=Make method 'void' -inspection.same.return.value.display.name=Method returns the same value -inspection.same.return.value.problem.descriptor=Method always returns {0} -inspection.same.return.value.problem.descriptor1=Method and all its derivables always return {0} -inspection.same.return.value.problem.descriptor2=All implementations of this method always return {0} - inspection.dependency.violator.problem.descriptor=Dependency rule ''{0}.'' is violated inspection.same.parameter.display.name=Actual method parameter is the same constant @@ -178,33 +115,15 @@ inspection.unused.parameter.composer=Parameter #ref is not used in inspection.unused.parameter.composer1=Parameter #ref is not used in either this method or any of its derived methods inspection.unused.parameter.display.name=Unused method parameters inspection.unused.parameter.delete.quickfix=Delete unused parameter(s) -inspection.redundant.type.display.name=Redundant type arguments -inspection.redundant.type.remove.quickfix=Remove type arguments -inspection.redundant.type.problem.descriptor=Explicit type arguments can be inferred -inspection.redundant.type.no.generics.problem.descriptor=Type arguments are redundant for the non-generic method call -inspection.redundant.type.no.generics.method.reference.problem.descriptor=Type arguments are redundant for the non-generic method reference - inspection.redundant.array.creation.display.name=Redundant array creation inspection.redundant.array.creation.quickfix=Remove explicit array creation inspection.redundant.array.creation.for.varargs.call.descriptor=Redundant array creation for calling varargs method -inspection.suspicious.collections.method.calls.display.name=Suspicious collections method calls -inspection.suspicious.collections.method.calls.problem.descriptor=''{0}'' may not contain {2} of type ''{1}'' -inspection.suspicious.collections.method.calls.problem.descriptor1=Suspicious call to ''{0}'' - -inspection.suspicious.array.method.call.display.name=Suspicious Arrays method calls -inspection.suspicious.array.method.call.problem.element=Element type is not compatible with array type -inspection.suspicious.array.method.call.problem.arrays=Array types are incompatible: arrays are always different - inspection.raw.variable.type.can.be.generic.name=Raw type can be generic inspection.raw.variable.type.can.be.generic.quickfix=Change type of {0} to {1} inspection.raw.variable.type.can.be.generic.family.quickfix=Add generic parameters to the type inspection.reference.default.package= -inspection.reference.implicit.constructor.name=implicit constructor of {0} -inspection.reference.anonymous.name=anonymous ({0}) -inspection.reference.jsp.holder.method.anonymous.name=<% page content %> -inspection.reference.anonymous=anonymous inspection.export.save.button=Save inspection.export.dialog.title=Export inspection.export.options.panel.title=Options @@ -213,18 +132,12 @@ inspection.export.title=Code Inspection results inspection.export.generating.html.for=Generating HTML:{0} inspection.export.error.writing.to=Error writing to {0}: {1} -inspection.common.if.parts.family=Extract common parts of 'if' statement -inspection.common.if.parts.family.else.if=Merge 'else if' statement -inspection.common.if.parts.family.else.if.description='else if' can be merged inspection.common.if.parts.message.variables.only=Extract variables from ''if''{0} inspection.common.if.parts.message.with.variables.extract=Extract common part with variables from ''if''{0} inspection.common.if.parts.message.without.variables.extract=Extract common part from ''if''{0} inspection.common.if.parts.message.whole.branch=Extract common part removing branch{0} inspection.common.if.parts.message.complete.duplicate=Collapse ''if'' statement{0} inspection.common.if.parts.message.complete.duplicate.side.effect=Collapse 'if' statement and extract side effect -inspection.common.if.parts.disable.highlight.tail.call=Do not highlight common parts, if tail statement is call -inspection.common.if.parts.settings.highlight.when.tail.call=Highlight when last common statement is call - inspection.common.if.parts.description.variables.only=Variables can be extracted from ''if''{0} inspection.common.if.parts.description.with.variables.extract=Common parts with variables can be extracted from ''if''{0} inspection.common.if.parts.description.without.variables.extract=Common part can be extracted from ''if''{0} @@ -311,8 +224,6 @@ inspection.replace.ternary.quickfix=Replace with ''{0} != null ?:'' inspection.replace.methodref.ternary.quickfix=Replace with null-checking lambda inspection.surround.if.family=Surround with if inspection.dependency.configure.button.text=Configure dependency rules -inspection.surround.requirenonnull.quickfix=Replace with ''Objects.requireNonNull({0})'' - inspection.javadoc.label.text=Additional Javadoc Tags: inspection.javadoc.dialog.title=Edit Additional Javadoc Tags inspection.javadoc.html.not.required.label.text=Additional Not Required Html Attributes: @@ -449,17 +360,7 @@ inspection.duplicates.message.in.this.file=(in this file) inspection.duplicates.message.more=... ({0} more) inspection.duplicates.message=Duplicate string literal found in
{0} -inspection.compiler.javac.quirks.name=Javac quirks -inspection.compiler.javac.quirks.anno.array.comma.problem=Trailing comma in annotation array initializer may cause compilation error in some Javac versions (e.g. JDK 5 and JDK 6). -inspection.compiler.javac.quirks.anno.array.comma.fix=Remove trailing comma -inspection.compiler.javac.quirks.qualifier.type.args.problem=Generics in qualifier reference may cause compilation error in some Javac versions (e.g. JDK 5 and JDK 6). -inspection.compiler.javac.quirks.qualifier.type.args.fix=Remove generic parameter - inspection.redundant.requires.statement.name=Redundant 'requires' directive in module-info -inspection.redundant.requires.statement.description=Redundant directive ''requires {0}'' -inspection.redundant.requires.statement.fix.family=Delete redundant 'requires' directive -inspection.redundant.requires.statement.fix.name=Delete directive ''requires {0}'' - inspection.forward.compatibility.name=Forward compatibility inspection.root.node.title=Inspections @@ -470,7 +371,6 @@ inspection.tools.action.show.global.inspections.description=Hide Global Inspecti # hardcoded inspection tools deprecated.symbol=Deprecated symbol unused.import=Unused import (editor light) -unused.import.statement=Unused import statement unused.symbol=Unused symbol redundant.throws.declaration=Redundant throws declaration access.static.via.instance=Access static member via instance reference @@ -479,13 +379,9 @@ illegal.package.dependencies=Illegal package dependencies unchecked.warning=Unchecked warning # suppression stuff -suppress.all.for.class=Suppress all inspections for class suppress.inspection.family=Suppress inspection suppress.inspection.statement=Suppress for statement -suppress.inspection.module=Suppress for module declaration suppress.inspection.class=Suppress for class -suppress.inspection.field=Suppress for field -suppress.inspection.method=Suppress for method suppress.inspection.member=Suppress for member edit.dependency.rules.family=Edit dependency rules edit.dependency.rules.text=Edit dependency rule \"{0} \" @@ -583,10 +479,7 @@ profile.mapping.scope.column.title=scope boolean.method.is.always.inverted.display.name=Boolean method is always inverted boolean.method.is.always.inverted.problem.descriptor=Boolean method #ref is always inverted inspection.results.title=Results By Editor Settings -unnecessary.module.dependency.display.name=Unnecessary module dependency -unnecessary.module.dependency.problem.descriptor=Module ''{0}'' sources do not depend on module ''{1}'' sources unnecessary.module.dependency.exported.problem.descriptor1=Module ''{0}'' does not depend on ''{1}''. Though ''{0}'' depends on ''{2}'' through exported dependencies of ''{1}'' -suspected.module.dependency.problem.descriptor=Module ''{0}'' does not depend on module ''{1}''. Though ''{1}'' was not inspected for exported dependencies needed for scope ''{2}'' run.with.editor.settings.dialog.option=Run with &editor settings inspection.new.profile.text=New Profile Name profile.save.as.project.checkbox.title=Save as project profile @@ -627,10 +520,6 @@ special.annotations.annotations.list=Additional Special Annotations inspection.filter.resolved.action.text=Filter resolved items inspection.filter.show.diff.action.text=Show diff -inspection.duplicate.throws.display.name=Duplicate throws -inspection.duplicate.throws.problem=Duplicate throws -inspection.duplicate.throws.more.general.problem=There is a more general exception, ''{0}'', in the throws list already. -inspection.duplicate.throws.ignore.subclassing.option=Ignore exceptions subclassing others inspection.filter.show.diff.only.action.text=Show diff only inspection.new.profile.ide.to.project.warning.message=Do you want to save selected IDE profile as project profile? inspection.new.profile.ide.to.project.warning.title=Unable to set up IDE profile for scope @@ -677,17 +566,9 @@ inspections.view.options.title=Inspection {0} options xml.suppressable.for.tag.title=Suppress for tag xml.suppressable.for.file.title=Suppress for file xml.suppressable.all.for.file.title=Suppress all for file -nullable.stuff.problems.overridden.methods.are.not.annotated=Overridden methods are not annotated -nullable.stuff.problems.overridden.method.parameters.are.not.annotated=Overridden method parameters are not annotated -annotate.overridden.methods.parameters=Annotate overridden method parameters as ''@{0}'' -annotate.overridden.methods.parameters.family.name=Annotate overridden method parameters offline.inspections.library.was.not.resolved=Please configure library ''{0}'' which is used in module ''{1}'' offline.inspections.library.urls.were.not.resolved=Roots {0} of the library ''{1}'' from module ''{2}'' were not resolved offline.inspections.no.source.roots=No source roots detected for module ''{0}'' -report.suspicious.but.possibly.correct.method.calls=&Report suspicious but possibly correct method calls -unused.library.display.name=Unused library -unused.library.problem.descriptor=Unused library ''{0}'' -unused.library.roots.problem.descriptor=Unused roots {0} from library ''{1}'' unused.library.backward.analysis.job.description=Perform backward analysis inspection.duplicates.option.report.propertykey.expressions=&Ignore @PropertyKey expressions inspection.same.parameter.fix.name=Inline value ''{1}'' for parameter ''{0}'' @@ -702,8 +583,6 @@ inconsistent.line.separators=Inconsistent line separators inspection.unused.symbol.public.method.parameters=Check parameters in &Non-private methods introduce.constant.across.the.project=Introduce constant across the project inspection.application.chosen.profile.log.message=Inspecting with profile ''{0}'' -detach.library.quickfix.name=Detach library -detach.library.roots.quickfix.name=Detach unused library roots inspection.javadoc.problem.pointing.to.itself=Javadoc pointing to itself inspection.illegal.character=Illegal character @@ -727,10 +606,6 @@ long.line.display.name=Line is longer than allowed by code style inspection.default.annotation.param=Default annotation parameter value preparing.for.apply.fix=Preparing to Apply Fix... -inspection.annotate.method.quickfix.family.name=Annotate method -inspection.annotate.overridden.method.quickfix.family.name=Annotate overridden methods -inspection.annotate.overridden.method.and.self.quickfix.family.name=Annotate overridden methods and self - inspection.tool.window.dialog.title=Inspection Tool Window inspection.tool.window.dialog.no.options=Inspection ''{0}'' has no configurable options inspection.tool.window.inspection.dialog.title=Inspection ''{0}'' options @@ -748,22 +623,10 @@ inspection.explicit.argument.can.be.lambda.fix.name=Use ''{0}'' method with func inspection.lambda.to.method.call.fix.family.name=Replace lambda expression with method call inspection.lambda.to.method.call.fix.name=Replace lambda expression with ''{0}'' -inspection.module.exports.package.to.itself=Module exports/opens package to itself -exports.to.itself.delete.statement.fix=Delete directive -exports.to.itself.delete.module.ref.fix=Delete reference to module ''{0}'' - -inspection.requires.auto.module=Dependencies on automatic modules -inspection.requires.auto.module.message='requires' directive for an automatic module -inspection.requires.auto.module.transitive='requires transitive' directive for an automatic module -inspection.requires.auto.module.option=Highlight only transitive dependencies - naming.convention.problem.descriptor.short={0} name #ref is too short ({1} \\< {2}) #loc naming.convention.problem.descriptor.long={0} name #ref is too long ({1} \\> {2}) #loc naming.convention.problem.descriptor.regex.mismatch={0} name #ref doesn''t match regex ''{1}'' #loc -inspection.java.module.naming=Java module naming conventions -inspection.java.module.naming.terminal.digits=Module name component ''{0}'' should avoid terminal digits - inspection.replace.with.bulk.message=Iteration can be replaced with bulk ''{0}'' call inspection.replace.with.bulk.fix.name=Replace iteration with bulk ''{0}'' call inspection.replace.with.bulk.fix.family.name=Replace with bulk method call @@ -855,12 +718,7 @@ inspection.reflect.handle.invocation.primitive.argument.null=Argument of type '' inspection.reflect.handle.invocation.result.void=Return type is 'void' inspection.reflect.handle.invocation.result.null=Returned value is always 'null' -inspection.implicit.subclass.display.forClass=Class ''{0}'' could be implicitly subclassed and must not be final inspection.implicit.subclass.display.forMethod=Method ''{0}'' should be overridable -inspection.implicit.subclass.make.class.extendable=Make class ''{0}'' {1,choice,0#|1#and method {2} |1#ref #loc inspection.duplicate.expressions.complexity.threshold=Expression complexity threshold @@ -1030,9 +880,6 @@ inspection.collection.used.as.vararg.message=Iterable is passed as vararg: proba inspection.manual.min.max.calculation.description=Can be replaced with ''Math.{0}'' call inspection.manual.min.max.calculation.disable.for.non.integral=Disable for float and double -inspection.use.compare.method.fix.family.name=Replace with single comparison method - -inspection.can.be.replaced.with.message=Can be replaced with ''{0}'' inspection.null.value.for.optional.option.comparisons=Report comparison of Optional with null action.DumbAware.SingleInspectionProfilePanel.text.reset.to.empty=Reset to Empty @@ -1045,70 +892,8 @@ inspection.redundant.record.constructor.canonical.message=Redundant canonical co inspection.redundant.record.constructor.can.be.compact.message=Canonical constructor can be converted to compact form inspection.redundant.record.constructor.fix.family.name=Convert canonical constructor to compact form action.presentation.ScopesChooser.text=In All Scopes -non.final.guarded.by.field.0.loc=Non-final @GuardedBy field "{0}" #loc -non.final.guarded.by.field.ref.loc=Non-final @GuardedBy field #ref #loc -access.can.be.0=Access can be {0} -don.t.report.unused.jars.inside.used.library=Don't report unused jars inside used library -non.final.field.code.ref.code.in.immutable.class.loc=Non-final field #ref in @Immutable class #loc -deprecated.class.usage.group.xml=XML -replace.with.comparator=Replace with comparator -method.reference.mapped.to.comparator=Method reference mapped to Comparator interface does not fulfill the Comparator contract -static.member.guarded.by.instance.ref.loc=Static member guarded by instance #ref #loc -static.member.guarded.by.instance.0.loc=Static member guarded by instance "{0}" #loc -deprecated.member.0.is.still.used=Deprecated member ''{0}'' is still used -access.to.field.code.ref.code.outside.of.declared.guards.loc=Access to field #ref outside of declared guards #loc -replace.stringtokenizer.delimiters.parameter.with.unique.symbols=Replace StringTokenizer delimiters parameter with unique symbols -delimiters.argument.contains.duplicated.characters=Delimiters argument contains duplicated characters -make.0.default.annotation=Make "{0}" default annotation -remove.block.marker.comments=Remove block marker comments -redundant.block.marker=Redundant block marker -parameter.is.always.not.null=Parameter is always not-null -parameter.can.be.null=Parameter can be null -0.field.is.always.initialized.not.null=@{0} field is always initialized not-null -not.annotated.method.is.used.as.an.override.for.a.method.annotated.with.0=Not annotated method is used as an override for a method annotated with {0} -assigning.a.collection.of.nullable.elements=Assigning a collection of nullable elements into a collection of non-null elements -non.null.type.argument.is.expected=Non-null type argument is expected -custom.exception.class.should.have.a.constructor=Custom exception class should have a constructor with a single message parameter of String type -html.classes.exposed.with.code.module.info.code.html=Classes exposed with module-info -ignore.operation.which.results.in.negative.value=Ignore '<<' operation which results in negative value -visible.for.testing.makes.little.sense.on.test.only.code=@VisibleForTesting makes little sense on @TestOnly code -ignore.in.the.same.outermost.class=Ignore in the same outermost class -replace.anonymous.class.with.lambda.alternative=Replace anonymous class with lambda alternative replace.with.0=Replace with {0} -anonymous.ref.loc.can.be.replaced.with.0=Anonymous #ref #loc can be replaced with {0} replace.with=Replace with <> -explicit.type.argument.ref.loc.can.be.replaced.with=Explicit type argument #ref #loc can be replaced with <> -replace.with.constant.value=Replace with constant value -possible.heap.pollution.from.parameterized.vararg.type.loc=Possible heap pollution from parameterized vararg type #loc -make.final.and.annotate.as.safevarargs=Make final and annotate as @SafeVarargs -annotate.as.safevarargs=Annotate as @SafeVarargs -ignore.members.of.deprecated.classes=Ignore members of deprecated classes -html.ignore.overrides.of.deprecated.abstract.methods=Ignore overrides of deprecated abstract methods from non-deprecated supers -ignore.inside.non.static.imports=Ignore inside non-static imports -ignore.inside.deprecated.members=Ignore inside deprecated members -module.0.with.language.level.1.depends.on.module.2.with.language.level.3=Module {0} with language level {1} depends on module {2} with language level {3} -ignore.casts.in.suspicious.collections.method.calls=Ignore casts in suspicious collections method calls -replace.with.lambda=Replace with lambda -anonymous.ref.loc.can.be.replaced.with.lambda=Anonymous #ref #loc can be replaced with lambda -report.when.interface.is.not.annotated.with.functional.interface=Report when interface is not annotated with @FunctionalInterface -instance.member.guarded.by.static.ref.loc=Instance member guarded by static #ref #loc -instance.member.guarded.by.static.0.loc=Instance member guarded by static "{0}" #loc -replace.var.with.explicit.type=Replace 'var' with explicit type -var.can.be.replaced.with.explicit.type='var' can be replaced with explicit type -replace.operator.assignment.with.assignment=Replace Operator Assignment with Assignment -replace.0.with=Replace ''''{0}'''' with ''''='''' -comparision.between.object.and.primitive=Comparision between Object and primitive is illegal and is accepted in java 7 only -vararg.method.call.with.50.poly.arguments=Vararg method call with 50+ poly arguments may cause compilation and analysis slowdown -replace.with.expression.lambda=Replace with expression lambda -statement.lambda.can.be.replaced.with.expression.lambda=Statement lambda can be replaced with expression lambda -unknown.guardedby.reference.0.loc=Unknown @GuardedBy reference "{0}" #loc -unknown.guardedby.reference.ref.loc=Unknown @GuardedBy reference #ref #loc -ignore.exceptions.thrown.by.entry.points.methods=Ignore exceptions thrown by entry points methods -remove.dependency=Remove dependency -searching.for.overriding.methods=Searching for Overriding Methods -remove.switch.label=Remove switch label -remove.switch.label.0=Remove switch label ''{0}'' -remove.switch.branch.0=Remove switch branch ''{0}'' replace.with.java.stream.api.pipeline=Replace with Java Stream API pipeline pseudo.functional.style.code=Pseudo functional style code remove.not.null.annotation=Remove not-null annotation @@ -1211,28 +996,6 @@ inspection.suspicious.names.ignore.methods.title=Ignore methods nullable.notnull.configuration.dialog.title=Nullable/NotNull Configuration nullable.notnull.annotations.panel.title={0} annotations nullable.notnull.annotations.runtime.instrumentation.tooltip=Add runtime assertions for notnull-annotated methods and parameters -inspection.field.not.used.in.to.string.description=Method ''{0}'' is not used in ''toString()'' method -inspection.field.not.used.in.to.string.description2=Field ''{0}'' is not used in ''toString()'' method -inspection.class.has.no.to.string.method.description=Class ''{0}'' does not override ''toString()'' method -inspection.class.has.no.to.string.method.ignore.inner.classes.option=Ignore inner classes -inspection.class.has.no.to.string.method.ignore.test.classes.option=Ignore test classes -inspection.class.has.no.to.string.method.ignore.abstract.classes.option=Ignore abstract classes -inspection.class.has.no.to.string.method.ignore.enum.classes.option=Ignore enum classes -inspection.class.has.no.to.string.method.ignore.deprecated.classes.option=Ignore deprecated classes -inspection.class.has.no.to.string.method.ignore.exception.classes.option=Ignore exception classes -inspection.class.has.no.to.string.method.exclude.classes.reg.exp.option=Exclude classes (reg exp): -make.default.the.last.case.family.name=Make 'default' the last case -inspection.suspicious.integer.div.assignment.option=Report suspicious but possibly exact divisions -junit.rule.classrule.option=Report @ClassRule problems -junit.rule.rule.option=Report @Rule problems -inspection.constant.on.wrong.side.of.a.comparison.side.option=Constant should be on this side of a comparison: -static.inheritrance.fix.replace.progress=Replacing usages of {0} -inspection.suspicious.getter.setter.field.option=Only warn when field matching getter/setter name is present -inspection.c.style.array.declarations.option=Ignore C-style declarations in variables -inspection.unary.plus.unary.binary.option=Only report in confusing binary or unary expression context -inspection.infinite.loop.option=Ignore when placed in Thread.run -inspection.redundant.field.initialization.option=Only warn on initialization to null -inspection.unnecessary.super.qualifier.option=Ignore clarification 'super' qualifier new.line.0=New line ({0}) edit.property.value=Edit property value annotate.capitalization.type=Annotate capitalization type diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/SuspiciousIntegerDivAssignmentInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/SuspiciousIntegerDivAssignmentInspection.java index cfbe0db7715c..82ef86a5352a 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/SuspiciousIntegerDivAssignmentInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/SuspiciousIntegerDivAssignmentInspection.java @@ -1,11 +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. package com.siyeh.ig.bugs; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemDescriptor; import com.intellij.codeInspection.dataFlow.CommonDataflow; import com.intellij.codeInspection.dataFlow.rangeSet.LongRangeSet; import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.tree.IElementType; @@ -40,7 +40,7 @@ public class SuspiciousIntegerDivAssignmentInspection extends BaseInspection { @Override public JComponent createOptionsPanel() { MultipleCheckboxOptionsPanel panel = new MultipleCheckboxOptionsPanel(this); - panel.addCheckbox(InspectionsBundle.message("inspection.suspicious.integer.div.assignment.option"), "myReportPossiblyExactDivision"); + panel.addCheckbox(JavaAnalysisBundle.message("inspection.suspicious.integer.div.assignment.option"), "myReportPossiblyExactDivision"); return panel; } diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/DefaultNotLastCaseInSwitchInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/DefaultNotLastCaseInSwitchInspection.java index 05a260139e51..bc0e651c0ea4 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/DefaultNotLastCaseInSwitchInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/DefaultNotLastCaseInSwitchInspection.java @@ -15,8 +15,8 @@ */ package com.siyeh.ig.controlflow; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; @@ -76,7 +76,7 @@ public class DefaultNotLastCaseInSwitchInspection extends BaseInspection { @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("make.default.the.last.case.family.name"); + return JavaAnalysisBundle.message("make.default.the.last.case.family.name"); } }; } diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspection.java index b37d22e4105c..c7f7655224a3 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspection.java @@ -18,6 +18,7 @@ package com.siyeh.ig.controlflow; import com.intellij.codeInsight.BlockUtils; import com.intellij.codeInspection.*; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.codeStyle.JavaCodeStyleManager; @@ -49,7 +50,7 @@ public class IfStatementWithIdenticalBranchesInspection extends AbstractBaseJava @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("inspection.common.if.parts.settings.highlight.when.tail.call"), this, "myHighlightWhenLastStatementIsCall"); + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("inspection.common.if.parts.settings.highlight.when.tail.call"), this, "myHighlightWhenLastStatementIsCall"); } @NotNull @@ -77,7 +78,7 @@ public class IfStatementWithIdenticalBranchesInspection extends AbstractBaseJava new SetInspectionOptionFix( IfStatementWithIdenticalBranchesInspection.this, "myHighlightWhenLastStatementIsCall", - InspectionsBundle.message("inspection.common.if.parts.disable.highlight.tail.call"), + JavaAnalysisBundle.message("inspection.common.if.parts.disable.highlight.tail.call"), false ), result.myFix @@ -125,14 +126,14 @@ public class IfStatementWithIdenticalBranchesInspection extends AbstractBaseJava @NotNull @Override public String getName() { - return InspectionsBundle.message("inspection.common.if.parts.family.else.if"); + return JavaAnalysisBundle.message("inspection.common.if.parts.family.else.if"); } @Nls @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("inspection.common.if.parts.family.else.if"); + return JavaAnalysisBundle.message("inspection.common.if.parts.family.else.if"); } @Override @@ -222,7 +223,7 @@ public class IfStatementWithIdenticalBranchesInspection extends AbstractBaseJava @NotNull @Override public String getFamilyName() { - return InspectionsBundle.message("inspection.common.if.parts.family"); + return JavaAnalysisBundle.message("inspection.common.if.parts.family"); } @Nls @@ -1153,7 +1154,7 @@ public class IfStatementWithIdenticalBranchesInspection extends AbstractBaseJava boolean highlightWhenLastStatementIsCall) { ElseIf elseIf = from(ifStatement, thenBranch); if (elseIf == null) return null; - String message = InspectionsBundle.message("inspection.common.if.parts.family.else.if.description"); + String message = JavaAnalysisBundle.message("inspection.common.if.parts.family.else.if.description"); return new IfInspectionResult(ifStatement.getFirstChild(), false, new MergeElseIfsFix(), message); } } diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/InfiniteLoopStatementInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/InfiniteLoopStatementInspection.java index 46d9cdbd40a3..e53828f55287 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/InfiniteLoopStatementInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/InfiniteLoopStatementInspection.java @@ -15,8 +15,8 @@ */ package com.siyeh.ig.controlflow; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.lang.jvm.JvmModifier; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; @@ -39,7 +39,7 @@ public class InfiniteLoopStatementInspection extends BaseInspection { @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("inspection.infinite.loop.option"), this, "myIgnoreInThreadTopLevel"); + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("inspection.infinite.loop.option"), this, "myIgnoreInThreadTopLevel"); } @Override diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/StaticInheritanceFix.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/StaticInheritanceFix.java index 0b54140052fd..7f415ad3faaa 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/StaticInheritanceFix.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/StaticInheritanceFix.java @@ -17,8 +17,8 @@ package com.siyeh.ig.inheritance; import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.codeInsight.intention.QuickFixFactory; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.progress.ProgressIndicator; @@ -75,7 +75,7 @@ class StaticInheritanceFix extends InspectionGadgetsFix { final PsiFile file = implementingClass.getContainingFile(); ProgressManager.getInstance().run(new Task.Modal(project, - InspectionsBundle.message("static.inheritrance.fix.replace.progress", iface.getName()), false) { + JavaAnalysisBundle.message("static.inheritrance.fix.replace.progress", iface.getName()), false) { @Override public void run(@NotNull ProgressIndicator indicator) { diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/javabeans/SuspiciousGetterSetterInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/javabeans/SuspiciousGetterSetterInspection.java index 61e0421f4c5c..3d692bb384cf 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/javabeans/SuspiciousGetterSetterInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/javabeans/SuspiciousGetterSetterInspection.java @@ -15,8 +15,8 @@ */ package com.siyeh.ig.javabeans; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiField; import com.intellij.psi.PsiMethod; @@ -50,7 +50,7 @@ public class SuspiciousGetterSetterInspection extends BaseInspection { @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("inspection.suspicious.getter.setter.field.option"), this, "onlyWarnWhenFieldPresent"); + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("inspection.suspicious.getter.setter.field.option"), this, "onlyWarnWhenFieldPresent"); } @Override diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/JUnitRuleInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/JUnitRuleInspection.java index 7f6f898036b6..44a27c2aeffd 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/JUnitRuleInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/JUnitRuleInspection.java @@ -2,8 +2,8 @@ package com.siyeh.ig.junit; import com.intellij.codeInsight.AnnotationUtil; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiField; import com.intellij.psi.PsiModifier; @@ -29,8 +29,8 @@ public class JUnitRuleInspection extends BaseInspection { @Override public JComponent createOptionsPanel() { final MultipleCheckboxOptionsPanel panel = new MultipleCheckboxOptionsPanel(this); - panel.addCheckbox(InspectionsBundle.message("junit.rule.rule.option"), "REPORT_RULE_PROBLEMS"); - panel.addCheckbox(InspectionsBundle.message("junit.rule.classrule.option"), "REPORT_CLASS_RULE_PROBLEMS"); + panel.addCheckbox(JavaAnalysisBundle.message("junit.rule.rule.option"), "REPORT_RULE_PROBLEMS"); + panel.addCheckbox(JavaAnalysisBundle.message("junit.rule.classrule.option"), "REPORT_CLASS_RULE_PROBLEMS"); return panel; } diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/UnaryPlusInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/UnaryPlusInspection.java index 6ee227ff4f20..69e925f09f67 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/UnaryPlusInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/UnaryPlusInspection.java @@ -15,10 +15,10 @@ */ package com.siyeh.ig.numeric; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemDescriptor; import com.intellij.codeInspection.ProblemHighlightType; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.WriteExternalException; import com.intellij.psi.*; @@ -51,7 +51,7 @@ public class UnaryPlusInspection extends BaseInspection { @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("inspection.unary.plus.unary.binary.option"), this, + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("inspection.unary.plus.unary.binary.option"), this, "onlyReportInsideBinaryExpression"); } diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/CStyleArrayDeclarationInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/CStyleArrayDeclarationInspection.java index ee2c12e5ef70..cd2e313f3707 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/CStyleArrayDeclarationInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/CStyleArrayDeclarationInspection.java @@ -16,8 +16,8 @@ package com.siyeh.ig.style; import com.intellij.codeInspection.CleanupLocalInspectionTool; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.psi.*; import com.intellij.psi.tree.IElementType; @@ -53,7 +53,7 @@ public class CStyleArrayDeclarationInspection extends BaseInspection implements @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("inspection.c.style.array.declarations.option"), this, "ignoreVariables"); + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("inspection.c.style.array.declarations.option"), this, "ignoreVariables"); } @Override diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ConstantOnWrongSideOfComparisonInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ConstantOnWrongSideOfComparisonInspection.java index cdb2f07b0063..9d10d00efb5b 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ConstantOnWrongSideOfComparisonInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ConstantOnWrongSideOfComparisonInspection.java @@ -1,8 +1,8 @@ // 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. package com.siyeh.ig.style; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.ComboBox; import com.intellij.psi.PsiBinaryExpression; @@ -49,7 +49,7 @@ public class ConstantOnWrongSideOfComparisonInspection extends BaseInspection { myConstantShouldGoLeft = (e.getItem() == left); } }); - final JLabel label = new JLabel(InspectionsBundle.message("inspection.constant.on.wrong.side.of.a.comparison.side.option")); + final JLabel label = new JLabel(JavaAnalysisBundle.message("inspection.constant.on.wrong.side.of.a.comparison.side.option")); final JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEADING)); panel.add(label); panel.add(comboBox); diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ObjectsEqualsCanBeSimplifiedInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ObjectsEqualsCanBeSimplifiedInspection.java index 33cd8182711f..0bbbaad82526 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ObjectsEqualsCanBeSimplifiedInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ObjectsEqualsCanBeSimplifiedInspection.java @@ -4,6 +4,7 @@ package com.siyeh.ig.style; import com.intellij.codeInsight.Nullability; import com.intellij.codeInspection.*; import com.intellij.codeInspection.dataFlow.NullabilityUtil; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; @@ -52,7 +53,7 @@ public class ObjectsEqualsCanBeSimplifiedInspection extends AbstractBaseJavaLoca return; } } - holder.registerProblem(nameElement, InspectionsBundle.message("inspection.can.be.replaced.with.message", "equals()"), + holder.registerProblem(nameElement, JavaAnalysisBundle.message("inspection.can.be.replaced.with.message", "equals()"), new ReplaceWithEqualsFix(false)); } } @@ -61,7 +62,7 @@ public class ObjectsEqualsCanBeSimplifiedInspection extends AbstractBaseJavaLoca PsiType type1 = arg1.getType(); PsiType type2 = arg2.getType(); if (type1 instanceof PsiPrimitiveType && type1.equals(type2) && !TypeConversionUtil.isFloatOrDoubleType(type1)) { - holder.registerProblem(nameElement, InspectionsBundle.message("inspection.can.be.replaced.with.message", "=="), + holder.registerProblem(nameElement, JavaAnalysisBundle.message("inspection.can.be.replaced.with.message", "=="), new ReplaceWithEqualsFix(true)); return true; } diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/RedundantFieldInitializationInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/RedundantFieldInitializationInspection.java index d3808f6b7c59..39d69e126676 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/RedundantFieldInitializationInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/RedundantFieldInitializationInspection.java @@ -16,10 +16,10 @@ package com.siyeh.ig.style; import com.intellij.codeInspection.CleanupLocalInspectionTool; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemDescriptor; import com.intellij.codeInspection.ProblemHighlightType; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; @@ -49,7 +49,7 @@ public class RedundantFieldInitializationInspection extends BaseInspection imple @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("inspection.redundant.field.initialization.option"), this, "onlyWarnOnNull"); + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("inspection.redundant.field.initialization.option"), this, "onlyWarnOnNull"); } @Override diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessarySuperQualifierInspection.java b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessarySuperQualifierInspection.java index 7203614a5df6..6247ea6607b4 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessarySuperQualifierInspection.java +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessarySuperQualifierInspection.java @@ -16,10 +16,10 @@ package com.siyeh.ig.style; import com.intellij.codeInspection.CleanupLocalInspectionTool; -import com.intellij.codeInspection.InspectionsBundle; import com.intellij.codeInspection.ProblemDescriptor; import com.intellij.codeInspection.ProblemHighlightType; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; @@ -48,7 +48,7 @@ public class UnnecessarySuperQualifierInspection extends BaseInspection implemen @Nullable @Override public JComponent createOptionsPanel() { - return new SingleCheckboxOptionsPanel(InspectionsBundle.message("inspection.unnecessary.super.qualifier.option"), this, "ignoreClarification"); + return new SingleCheckboxOptionsPanel(JavaAnalysisBundle.message("inspection.unnecessary.super.qualifier.option"), this, "ignoreClarification"); } @Override diff --git a/plugins/InspectionGadgets/src/com/intellij/codeInspection/LambdaCanBeMethodCallInspection.java b/plugins/InspectionGadgets/src/com/intellij/codeInspection/LambdaCanBeMethodCallInspection.java index 8a6207162ce1..1fac20a7b9ba 100644 --- a/plugins/InspectionGadgets/src/com/intellij/codeInspection/LambdaCanBeMethodCallInspection.java +++ b/plugins/InspectionGadgets/src/com/intellij/codeInspection/LambdaCanBeMethodCallInspection.java @@ -1,6 +1,7 @@ // Copyright 2000-2018 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. package com.intellij.codeInspection; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.codeStyle.CodeStyleManager; @@ -119,7 +120,7 @@ public class LambdaCanBeMethodCallInspection extends AbstractBaseJavaLocalInspec } private void registerProblem(PsiLambdaExpression lambda, String displayReplacement, String replacement) { - holder.registerProblem(lambda, InspectionsBundle.message("inspection.can.be.replaced.with.message", displayReplacement), + holder.registerProblem(lambda, JavaAnalysisBundle.message("inspection.can.be.replaced.with.message", displayReplacement), new ReplaceWithFunctionCallFix(replacement, displayReplacement)); } }; diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/SuppressForMemberFix.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/SuppressForMemberFix.java index 562b7cc68ef7..b20a9d0c59c0 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/SuppressForMemberFix.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/SuppressForMemberFix.java @@ -5,7 +5,7 @@ package org.jetbrains.plugins.groovy.codeInspection; import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer; import com.intellij.codeInsight.daemon.impl.actions.AbstractBatchSuppressByNoInspectionCommentFix; import com.intellij.codeInspection.BatchSuppressManager; -import com.intellij.codeInspection.InspectionsBundle; +import com.intellij.java.analysis.JavaAnalysisBundle; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; @@ -28,7 +28,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.types.GrTypeParameter; * @author peter */ public class SuppressForMemberFix extends AbstractBatchSuppressByNoInspectionCommentFix { - private @PropertyKey(resourceBundle = "messages.InspectionsBundle") String myKey; + private @PropertyKey(resourceBundle = "messages.JavaAnalysisBundle") String myKey = "suppress.inspection.member"; private final boolean myForClass; public SuppressForMemberFix(String toolId, boolean forClass) { @@ -72,7 +72,7 @@ public class SuppressForMemberFix extends AbstractBatchSuppressByNoInspectionCom @Override @NotNull public String getText() { - return myKey != null ? InspectionsBundle.message(myKey) : "Suppress for member"; + return JavaAnalysisBundle.message(myKey); }