diff --git a/java/java-impl/src/com/intellij/codeInspection/defaultFileTemplateUsage/FileHeaderChecker.java b/java/java-impl/src/com/intellij/codeInspection/defaultFileTemplateUsage/FileHeaderChecker.java index 7c468e3c18fc..56c9251fa0c4 100644 --- a/java/java-impl/src/com/intellij/codeInspection/defaultFileTemplateUsage/FileHeaderChecker.java +++ b/java/java-impl/src/com/intellij/codeInspection/defaultFileTemplateUsage/FileHeaderChecker.java @@ -77,7 +77,7 @@ public class FileHeaderChecker { if (element == null) return null; LocalQuickFix[] quickFix = createQuickFix(element, matcher, offsetToProperty); final String description = InspectionsBundle.message("default.file.template.description"); - return manager.createProblemDescriptor(element, description, quickFix, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, onTheFly); + return manager.createProblemDescriptor(element, description, onTheFly, quickFix, ProblemHighlightType.GENERIC_ERROR_OR_WARNING); } return null; } diff --git a/java/java-impl/src/com/intellij/codeInspection/dependencyViolation/DependencyInspection.java b/java/java-impl/src/com/intellij/codeInspection/dependencyViolation/DependencyInspection.java index 53071de6f600..7c2496db3f9d 100644 --- a/java/java-impl/src/com/intellij/codeInspection/dependencyViolation/DependencyInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/dependencyViolation/DependencyInspection.java @@ -100,8 +100,7 @@ public class DependencyInspection extends BaseLocalInspectionTool { for (DependencyRule dependencyRule : rule) { StringBuffer message = new StringBuffer(); message.append(MessageFormat.format(InspectionsBundle.message("inspection.dependency.violator.problem.descriptor"), dependencyRule.getDisplayText())); - problems.add(manager.createProblemDescriptor(place, message.toString(), new LocalQuickFix[]{new EditDependencyRulesAction(dependencyRule)}, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, - isOnTheFly)); + problems.add(manager.createProblemDescriptor(place, message.toString(), isOnTheFly, new LocalQuickFix[]{new EditDependencyRulesAction(dependencyRule)}, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } } } diff --git a/java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java b/java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java index 791adeb27e50..f6856f608435 100644 --- a/java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java @@ -146,9 +146,9 @@ public class EmptyMethodInspection extends GlobalJavaInspectionTool { } }); - final ProblemDescriptor descriptor = manager.createProblemDescriptor(refMethod.getElement().getNavigationElement(), message, + final ProblemDescriptor descriptor = manager.createProblemDescriptor(refMethod.getElement().getNavigationElement(), message, false, fixes.toArray(new LocalQuickFix[fixes.size()]), - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false); + ProblemHighlightType.GENERIC_ERROR_OR_WARNING); return new ProblemDescriptor[]{descriptor}; } diff --git a/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspection.java b/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspection.java index 69a60f1fc0d1..59fe65ab71fb 100644 --- a/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspection.java @@ -271,8 +271,7 @@ public class JavaDocLocalInspection extends BaseLocalInspectionTool { private static ProblemDescriptor createDescriptor(@NotNull PsiElement element, String template, InspectionManager manager, boolean onTheFly) { - return manager.createProblemDescriptor(element, template, (LocalQuickFix [])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, - onTheFly); + return manager.createProblemDescriptor(element, template, onTheFly, (LocalQuickFix [])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING); } private static ProblemDescriptor createDescriptor(@NotNull PsiElement element, String template, @NotNull LocalQuickFix fix, diff --git a/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocReferenceInspection.java b/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocReferenceInspection.java index 032c4f1f253d..982910c89a00 100644 --- a/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocReferenceInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocReferenceInspection.java @@ -45,7 +45,7 @@ public class JavaDocReferenceInspection extends BaseLocalInspectionTool { private static ProblemDescriptor createDescriptor(@NotNull PsiElement element, String template, InspectionManager manager, boolean onTheFly) { - return manager.createProblemDescriptor(element, template, (LocalQuickFix [])null, ProblemHighlightType.LIKE_UNKNOWN_SYMBOL, onTheFly); + return manager.createProblemDescriptor(element, template, onTheFly, (LocalQuickFix [])null, ProblemHighlightType.LIKE_UNKNOWN_SYMBOL); } @Nullable diff --git a/java/java-impl/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java b/java/java-impl/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java index 999543d1f860..db40b99a0cba 100644 --- a/java/java-impl/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java @@ -47,8 +47,7 @@ public class SameReturnValueInspection extends GlobalJavaInspectionTool { message = InspectionsBundle.message("inspection.same.return.value.problem.descriptor2", "" + returnValue + ""); } - return new ProblemDescriptor[] {manager.createProblemDescriptor(refMethod.getElement().getNavigationElement(), message, (LocalQuickFix [])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, - false)}; + return new ProblemDescriptor[] {manager.createProblemDescriptor(refMethod.getElement().getNavigationElement(), message, false, (LocalQuickFix [])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)}; } } diff --git a/java/java-impl/src/com/intellij/codeInspection/wrongPackageStatement/WrongPackageStatementInspection.java b/java/java-impl/src/com/intellij/codeInspection/wrongPackageStatement/WrongPackageStatementInspection.java index 50ae74ec551c..04365a22fbf6 100644 --- a/java/java-impl/src/com/intellij/codeInspection/wrongPackageStatement/WrongPackageStatementInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/wrongPackageStatement/WrongPackageStatementInspection.java @@ -75,8 +75,7 @@ public class WrongPackageStatementInspection extends BaseJavaLocalInspectionTool String description = JavaErrorMessages.message("package.name.file.path.mismatch", packageReference.getText(), dirPackage.getQualifiedName()); - return new ProblemDescriptor[]{manager.createProblemDescriptor(packageStatement, description, availableFixes.toArray(new LocalQuickFix[availableFixes.size()]), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, - isOnTheFly)}; + return new ProblemDescriptor[]{manager.createProblemDescriptor(packageStatement, description, isOnTheFly, availableFixes.toArray(new LocalQuickFix[availableFixes.size()]), ProblemHighlightType.GENERIC_ERROR_OR_WARNING)}; } } diff --git a/platform/lang-api/src/com/intellij/codeInspection/InspectionManager.java b/platform/lang-api/src/com/intellij/codeInspection/InspectionManager.java index 83a3993f8dd3..660371445e6a 100644 --- a/platform/lang-api/src/com/intellij/codeInspection/InspectionManager.java +++ b/platform/lang-api/src/com/intellij/codeInspection/InspectionManager.java @@ -43,8 +43,7 @@ public abstract class InspectionManager { LocalQuickFix fix, ProblemHighlightType highlightType, boolean onTheFly); @NotNull public abstract ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, @NotNull String descriptionTemplate, - LocalQuickFix[] fixes, ProblemHighlightType highlightType, - boolean onTheFly); + boolean onTheFly, LocalQuickFix[] fixes, ProblemHighlightType highlightType); @NotNull public abstract ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, @NotNull String descriptionTemplate, LocalQuickFix[] fixes, ProblemHighlightType highlightType, @@ -72,4 +71,49 @@ public abstract class InspectionManager { @NotNull final String descriptionTemplate, final boolean showTooltip, final ProblemHighlightType highlightType, boolean onTheFly, final LocalQuickFix... fixes); + + + @Deprecated + /** + * Factory method for ProblemDescriptor. Should be called from LocalInspectionTool.checkXXX() methods. + * @param psiElement problem is reported against + * @param descriptionTemplate problem message. Use #ref for a link to problem piece of code and #loc for location in source code. + * @param fix should be null if no fix is provided. + */ + @NotNull public abstract ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, @NotNull String descriptionTemplate, LocalQuickFix fix, ProblemHighlightType highlightType); + + @Deprecated + @NotNull public abstract ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, @NotNull String descriptionTemplate, LocalQuickFix[] fixes, ProblemHighlightType highlightType); + + @Deprecated + @NotNull public abstract ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, @NotNull String descriptionTemplate, LocalQuickFix[] fixes, ProblemHighlightType highlightType, boolean isAfterEndOfLine); + + @Deprecated + @NotNull public abstract ProblemDescriptor createProblemDescriptor(@NotNull PsiElement startElement, + @NotNull PsiElement endElement, + @NotNull String descriptionTemplate, + ProblemHighlightType highlightType, + LocalQuickFix... fixes + ); + + + @Deprecated + public abstract ProblemDescriptor createProblemDescriptor(@NotNull final PsiElement psiElement, + final TextRange rangeInElement, + @NotNull final String descriptionTemplate, + final ProblemHighlightType highlightType, + final LocalQuickFix... fixes); + + @Deprecated + public abstract ProblemDescriptor createProblemDescriptor(@NotNull final PsiElement psiElement, + @NotNull final String descriptionTemplate, + final ProblemHighlightType highlightType, + @Nullable final HintAction hintAction, + final LocalQuickFix... fixes); + + @Deprecated + public abstract ProblemDescriptor createProblemDescriptor(@NotNull final PsiElement psiElement, + @NotNull final String descriptionTemplate, + final boolean showTooltip, + final ProblemHighlightType highlightType, final LocalQuickFix... fixes); } diff --git a/platform/lang-api/src/com/intellij/codeInspection/ProblemsHolder.java b/platform/lang-api/src/com/intellij/codeInspection/ProblemsHolder.java index 710466cd8912..30d46f0e7788 100644 --- a/platform/lang-api/src/com/intellij/codeInspection/ProblemsHolder.java +++ b/platform/lang-api/src/com/intellij/codeInspection/ProblemsHolder.java @@ -54,7 +54,7 @@ public class ProblemsHolder { String descriptionTemplate, ProblemHighlightType highlightType, LocalQuickFix... fixes) { - registerProblem(myManager.createProblemDescriptor(psiElement, descriptionTemplate, fixes, highlightType, myOnTheFly)); + registerProblem(myManager.createProblemDescriptor(psiElement, descriptionTemplate, myOnTheFly, fixes, highlightType)); } public void registerProblem(ProblemDescriptor problemDescriptor) { diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionManagerEx.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionManagerEx.java index bff59cc2ab2c..6ef4b050cc03 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionManagerEx.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionManagerEx.java @@ -106,8 +106,9 @@ public class InspectionManagerEx extends InspectionManager { @NotNull public ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, @NotNull String descriptionTemplate, + boolean onTheFly, LocalQuickFix[] fixes, - ProblemHighlightType highlightType, boolean onTheFly) { + ProblemHighlightType highlightType) { return createProblemDescriptor(psiElement, descriptionTemplate, fixes, highlightType, onTheFly, false); } @@ -212,4 +213,73 @@ public class InspectionManagerEx extends InspectionManager { } return false; } + + @Deprecated + @NotNull + public ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, + @NotNull String descriptionTemplate, + LocalQuickFix fix, + ProblemHighlightType highlightType) { + LocalQuickFix[] quickFixes = fix != null ? new LocalQuickFix[]{fix} : null; + return createProblemDescriptor(psiElement, descriptionTemplate, quickFixes, highlightType); + } + + @Deprecated + @NotNull + public ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, + @NotNull String descriptionTemplate, + LocalQuickFix[] fixes, + ProblemHighlightType highlightType) { + return createProblemDescriptor(psiElement, descriptionTemplate, fixes, highlightType, false); + } + + @Deprecated + @NotNull + public ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, + @NotNull String descriptionTemplate, + LocalQuickFix[] fixes, + ProblemHighlightType highlightType, + boolean isAfterEndOfLine) { + return new ProblemDescriptorImpl(psiElement, psiElement, descriptionTemplate, fixes, highlightType, isAfterEndOfLine, null, true); + } + + @Deprecated + @NotNull + public ProblemDescriptor createProblemDescriptor(@NotNull PsiElement startElement, + @NotNull PsiElement endElement, + @NotNull String descriptionTemplate, + ProblemHighlightType highlightType, + LocalQuickFix... fixes) { + return new ProblemDescriptorImpl(startElement, endElement, descriptionTemplate, fixes, highlightType, false, null, true); + } + + @Deprecated + public ProblemDescriptor createProblemDescriptor(@NotNull final PsiElement psiElement, + final TextRange rangeInElement, + @NotNull final String descriptionTemplate, + final ProblemHighlightType highlightType, + final LocalQuickFix... fixes) { + return new ProblemDescriptorImpl(psiElement, psiElement, descriptionTemplate, fixes, highlightType, false, rangeInElement, true); + } + + @Deprecated + public ProblemDescriptor createProblemDescriptor(@NotNull final PsiElement psiElement, + @NotNull final String descriptionTemplate, + final ProblemHighlightType highlightType, + @Nullable final HintAction hintAction, + final LocalQuickFix... fixes) { + + return new ProblemDescriptorImpl(psiElement, psiElement, descriptionTemplate, fixes, highlightType, false, null, hintAction, true); + } + + @Deprecated + @Override + public ProblemDescriptor createProblemDescriptor(@NotNull PsiElement psiElement, + @NotNull String descriptionTemplate, + boolean showTooltip, + ProblemHighlightType highlightType, + LocalQuickFix... fixes) { + return new ProblemDescriptorImpl(psiElement, psiElement, descriptionTemplate, fixes, highlightType, false, null, showTooltip, null, + true); + } } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/offlineViewer/OfflineProblemDescriptorNode.java b/platform/lang-impl/src/com/intellij/codeInspection/offlineViewer/OfflineProblemDescriptorNode.java index 9d354c2f43e2..a7c1b6bf903e 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/offlineViewer/OfflineProblemDescriptorNode.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/offlineViewer/OfflineProblemDescriptorNode.java @@ -111,8 +111,8 @@ public class OfflineProblemDescriptorNode extends ProblemDescriptionNode { ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false); final LocalQuickFix[] quickFixes = getFixes(descriptor, hints); if (quickFixes != null) { - descriptor = inspectionManager.createProblemDescriptor(psiElement, offlineProblemDescriptor.getDescription(), quickFixes, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false); + descriptor = inspectionManager.createProblemDescriptor(psiElement, offlineProblemDescriptor.getDescription(), false, quickFixes, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING); } setUserObject(descriptor); return descriptor; diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/global/BooleanFieldAlwaysNegatedInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/global/BooleanFieldAlwaysNegatedInspection.java index 0c32f4cfe09b..45964c5d9938 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/global/BooleanFieldAlwaysNegatedInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/global/BooleanFieldAlwaysNegatedInspection.java @@ -63,8 +63,8 @@ public class BooleanFieldAlwaysNegatedInspection extends BaseGlobalInspection { return null; } return new ProblemDescriptor[]{manager.createProblemDescriptor(refField.getElement(), InspectionGadgetsBundle.message( - "boolean.field.always.negated.problem.descriptor"), (LocalQuickFix []) null, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false)}; + "boolean.field.always.negated.problem.descriptor"), false, (LocalQuickFix []) null, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING)}; } protected boolean queryExternalUsagesRequests(final RefManager manager, final GlobalJavaInspectionContext context, diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/global/MethodReturnAlwaysConstantInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/global/MethodReturnAlwaysConstantInspection.java index 3623b63f648c..351e7446501c 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/global/MethodReturnAlwaysConstantInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/global/MethodReturnAlwaysConstantInspection.java @@ -83,9 +83,8 @@ public class MethodReturnAlwaysConstantInspection extends BaseGlobalInspection { } out.add(manager.createProblemDescriptor(identifier, InspectionGadgetsBundle.message( - "method.return.always.constant.problem.descriptor"), - (LocalQuickFix[]) null, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false)); + "method.return.always.constant.problem.descriptor"), false, (LocalQuickFix[]) null, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); siblingRefMethod.putUserData(ALWAYS_CONSTANT, Boolean.valueOf(true)); } diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/global/MethodReturnAlwaysIgnoredInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/global/MethodReturnAlwaysIgnoredInspection.java index f0b0832d85f5..172f58e4afbb 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/global/MethodReturnAlwaysIgnoredInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/global/MethodReturnAlwaysIgnoredInspection.java @@ -74,9 +74,8 @@ public class MethodReturnAlwaysIgnoredInspection extends BaseGlobalInspection { } final ProblemDescriptor descriptor = manager.createProblemDescriptor(method, - InspectionGadgetsBundle.message("method.return.always.ignored.problem.descriptor"), - (LocalQuickFix []) null, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false); + InspectionGadgetsBundle.message("method.return.always.ignored.problem.descriptor"), false, (LocalQuickFix []) null, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING); if (originalProblemDescriptors == null) { return new ProblemDescriptor[]{descriptor}; } else { diff --git a/plugins/ant/src/com/intellij/lang/ant/validation/AntDuplicateImportedTargetsInspection.java b/plugins/ant/src/com/intellij/lang/ant/validation/AntDuplicateImportedTargetsInspection.java index cda679bdd702..5349624fae94 100644 --- a/plugins/ant/src/com/intellij/lang/ant/validation/AntDuplicateImportedTargetsInspection.java +++ b/plugins/ant/src/com/intellij/lang/ant/validation/AntDuplicateImportedTargetsInspection.java @@ -70,8 +70,7 @@ public class AntDuplicateImportedTargetsInspection extends AntInspection { final String duplicatedMessage = AntBundle.message("target.is.duplicated.in.imported.file", name, target.getAntFile().getName()); problems - .add(manager.createProblemDescriptor(t, duplicatedMessage, LocalQuickFix.EMPTY_ARRAY, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, - isOnTheFly)); + .add(manager.createProblemDescriptor(t, duplicatedMessage, isOnTheFly, LocalQuickFix.EMPTY_ARRAY, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } } final int prolemCount = problems.size(); diff --git a/plugins/ant/src/com/intellij/lang/ant/validation/AntDuplicateTargetsInspection.java b/plugins/ant/src/com/intellij/lang/ant/validation/AntDuplicateTargetsInspection.java index 46e98c26294b..62386d4f8774 100644 --- a/plugins/ant/src/com/intellij/lang/ant/validation/AntDuplicateTargetsInspection.java +++ b/plugins/ant/src/com/intellij/lang/ant/validation/AntDuplicateTargetsInspection.java @@ -64,11 +64,9 @@ public class AntDuplicateTargetsInspection extends AntInspection { if (t != null) { final String duplicatedMessage = AntBundle.message("target.is.duplicated", name); problems.add( - manager.createProblemDescriptor(target, duplicatedMessage, LocalQuickFix.EMPTY_ARRAY, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, - isOnTheFly)); + manager.createProblemDescriptor(target, duplicatedMessage, isOnTheFly, LocalQuickFix.EMPTY_ARRAY, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); problems - .add(manager.createProblemDescriptor(t, duplicatedMessage, LocalQuickFix.EMPTY_ARRAY, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, - isOnTheFly)); + .add(manager.createProblemDescriptor(t, duplicatedMessage, isOnTheFly, LocalQuickFix.EMPTY_ARRAY, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } name2Target.put(name, target); } diff --git a/plugins/ant/src/com/intellij/lang/ant/validation/AntMissingPropertiesFileInspection.java b/plugins/ant/src/com/intellij/lang/ant/validation/AntMissingPropertiesFileInspection.java index f569dcf893c8..10f360813664 100644 --- a/plugins/ant/src/com/intellij/lang/ant/validation/AntMissingPropertiesFileInspection.java +++ b/plugins/ant/src/com/intellij/lang/ant/validation/AntMissingPropertiesFileInspection.java @@ -76,8 +76,8 @@ public class AntMissingPropertiesFileInspection extends AntInspection { if (AntFileImpl.PROPERTY.equals(prop.getSourceElement().getName())) { final String filename = prop.getFileName(); if (filename != null && prop.getPropertiesFile() == null) { - problems.add(manager.createProblemDescriptor(prop, AntBundle.message("file.doesnt.exist", filename), LocalQuickFix.EMPTY_ARRAY, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, isOnTheFly)); + problems.add(manager.createProblemDescriptor(prop, AntBundle.message("file.doesnt.exist", filename), isOnTheFly, LocalQuickFix.EMPTY_ARRAY, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } } } diff --git a/plugins/devkit/src/inspections/DescriptionNotFoundInspection.java b/plugins/devkit/src/inspections/DescriptionNotFoundInspection.java index f7372cedb5d5..f72017c26dd7 100644 --- a/plugins/devkit/src/inspections/DescriptionNotFoundInspection.java +++ b/plugins/devkit/src/inspections/DescriptionNotFoundInspection.java @@ -77,9 +77,8 @@ public class DescriptionNotFoundInspection extends DevKitInspectionBase{ final PsiElement problem = getProblemElement(aClass, method); final ProblemDescriptor problemDescriptor = manager .createProblemDescriptor(problem == null ? nameIdentifier : problem, - "Inspection does not have a description", - new LocalQuickFix[]{new CreateHtmlDescriptionFix(filename, module)}, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, isOnTheFly); + "Inspection does not have a description", isOnTheFly, new LocalQuickFix[]{new CreateHtmlDescriptionFix(filename, module)}, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING); return new ProblemDescriptor[]{problemDescriptor}; } diff --git a/plugins/devkit/src/inspections/RegistrationProblemsInspection.java b/plugins/devkit/src/inspections/RegistrationProblemsInspection.java index ffeb28c9f93e..c6e79a0493a0 100644 --- a/plugins/devkit/src/inspections/RegistrationProblemsInspection.java +++ b/plugins/devkit/src/inspections/RegistrationProblemsInspection.java @@ -140,9 +140,8 @@ public class RegistrationProblemsInspection extends DevKitInspectionBase { compClass.isInterface() ? DevKitBundle.message("keyword.implement") : DevKitBundle.message("keyword.extend"), - compClass.getQualifiedName()), - ImplementOrExtendFix.createFix(compClass, checkedClass, isOnTheFly), - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, isOnTheFly)); + compClass.getQualifiedName()), isOnTheFly, ImplementOrExtendFix.createFix(compClass, checkedClass, isOnTheFly), + ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } } if (ActionType.ACTION.isOfType(checkedClass)) { @@ -155,8 +154,7 @@ public class RegistrationProblemsInspection extends DevKitInspectionBase { } if (isAbstract(checkedClass)) { problems = addProblem(problems, manager.createProblemDescriptor(nameIdentifier, - DevKitBundle.message("inspections.registration.problems.abstract"), LocalQuickFix.EMPTY_ARRAY, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, - isOnTheFly)); + DevKitBundle.message("inspections.registration.problems.abstract"), isOnTheFly, LocalQuickFix.EMPTY_ARRAY, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } return problems != null ? problems.toArray(new ProblemDescriptor[problems.size()]) : null; } @@ -359,7 +357,7 @@ public class RegistrationProblemsInspection extends DevKitInspectionBase { private void addProblem(PsiElement element, String problem, ProblemHighlightType type, boolean onTheFly, LocalQuickFix... fixes) { if (myList == null) myList = new SmartList(); - myList.add(myManager.createProblemDescriptor(element, problem, fixes, type, onTheFly)); + myList.add(myManager.createProblemDescriptor(element, problem, onTheFly, fixes, type)); } @Nullable diff --git a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/I18nInspection.java b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/I18nInspection.java index 2e6cff0b8c1a..370da4b9a527 100644 --- a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/I18nInspection.java +++ b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/I18nInspection.java @@ -437,8 +437,7 @@ public class I18nInspection extends BaseLocalInspectionTool { final ProblemDescriptor problem = myManager .createProblemDescriptor(expression, - description, - fixes.toArray(new LocalQuickFix[fixes.size()]), ProblemHighlightType.GENERIC_ERROR_OR_WARNING, myOnTheFly); + description, myOnTheFly, fixes.toArray(new LocalQuickFix[fixes.size()]), ProblemHighlightType.GENERIC_ERROR_OR_WARNING); myProblems.add(problem); } } diff --git a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/InconsistentResourceBundleInspection.java b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/InconsistentResourceBundleInspection.java index 9a64abdf57ce..0e2a3fb74098 100644 --- a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/InconsistentResourceBundleInspection.java +++ b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/InconsistentResourceBundleInspection.java @@ -197,9 +197,8 @@ public class InconsistentResourceBundleInspection extends DescriptorProviderInsp Property property = file.findPropertyByKey(inconsistentKey); assert property != null; String message = InspectionsBundle.message("inconsistent.bundle.property.error", inconsistentKey, parent.getName()); - ProblemDescriptor descriptor = manager.createProblemDescriptor(property, message, - LocalQuickFix.EMPTY_ARRAY, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false); + ProblemDescriptor descriptor = manager.createProblemDescriptor(property, message, false, LocalQuickFix.EMPTY_ARRAY, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING); addProblemElement(getRefManager().getReference(file), descriptor); } } @@ -234,9 +233,8 @@ public class InconsistentResourceBundleInspection extends DescriptorProviderInsp } assert untranslatedProperty != null; String message = InspectionsBundle.message("inconsistent.bundle.untranslated.property.error", untranslatedKey, file.getName()); - ProblemDescriptor descriptor = manager.createProblemDescriptor(untranslatedProperty, message, - LocalQuickFix.EMPTY_ARRAY, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false); + ProblemDescriptor descriptor = manager.createProblemDescriptor(untranslatedProperty, message, false, LocalQuickFix.EMPTY_ARRAY, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING); addProblemElement(getRefManager().getReference(untranslatedFile), descriptor); } } diff --git a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/InvalidPropertyKeyInspection.java b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/InvalidPropertyKeyInspection.java index 0894e454a498..d4cb8baeafe4 100644 --- a/plugins/java-i18n/src/com/intellij/codeInspection/i18n/InvalidPropertyKeyInspection.java +++ b/plugins/java-i18n/src/com/intellij/codeInspection/i18n/InvalidPropertyKeyInspection.java @@ -197,8 +197,8 @@ public class InvalidPropertyKeyInspection extends BaseJavaLocalInspectionTool { && !hasArrayTypeAt(i+1, methodCall)) { myProblems.add(myManager.createProblemDescriptor(methodCall, CodeInsightBundle.message("property.has.more.parameters.than.passed", key, paramsCount, args.length-i-1), - new LocalQuickFix[0], - ProblemHighlightType.GENERIC_ERROR, onTheFly)); + onTheFly, new LocalQuickFix[0], + ProblemHighlightType.GENERIC_ERROR)); } break; } diff --git a/plugins/java-i18n/src/com/intellij/lang/properties/UnusedMessageFormatParameterInspection.java b/plugins/java-i18n/src/com/intellij/lang/properties/UnusedMessageFormatParameterInspection.java index 87d0208c5961..b0c3058b106b 100644 --- a/plugins/java-i18n/src/com/intellij/lang/properties/UnusedMessageFormatParameterInspection.java +++ b/plugins/java-i18n/src/com/intellij/lang/properties/UnusedMessageFormatParameterInspection.java @@ -93,9 +93,7 @@ public class UnusedMessageFormatParameterInspection extends BaseLocalInspectionT ASTNode[] nodes = property.getNode().getChildren(null); PsiElement valElement = nodes.length < 3 ? property : nodes[2].getPsi(); problemDescriptors.add(manager.createProblemDescriptor(valElement, PropertiesBundle.message( - "unused.message.format.parameter.problem.descriptor", integer.toString(), Integer.toString(i)), - (LocalQuickFix[])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, - isOnTheFly)); + "unused.message.format.parameter.problem.descriptor", integer.toString(), Integer.toString(i)), isOnTheFly, (LocalQuickFix[])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); break; } } diff --git a/plugins/properties/src/com/intellij/codeInspection/duplicatePropertyInspection/DuplicatePropertyInspection.java b/plugins/properties/src/com/intellij/codeInspection/duplicatePropertyInspection/DuplicatePropertyInspection.java index 2e4cdadf8357..130bf3821dae 100644 --- a/plugins/properties/src/com/intellij/codeInspection/duplicatePropertyInspection/DuplicatePropertyInspection.java +++ b/plugins/properties/src/com/intellij/codeInspection/duplicatePropertyInspection/DuplicatePropertyInspection.java @@ -262,9 +262,7 @@ public class DuplicatePropertyInspection extends DescriptorProviderInspection { } } if (duplicatesCount > 1) { - problemDescriptors.add(manager.createProblemDescriptor(psiFile, message.toString(), - (LocalQuickFix[])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, - false)); + problemDescriptors.add(manager.createProblemDescriptor(psiFile, message.toString(), false, (LocalQuickFix[])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } } @@ -305,9 +303,7 @@ public class DuplicatePropertyInspection extends DescriptorProviderInspection { } } if (duplicatesCount > 1 && CHECK_DUPLICATE_KEYS) { - problemDescriptors.add(manager.createProblemDescriptor(psiFile, message.toString(), - (LocalQuickFix[])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, - false)); + problemDescriptors.add(manager.createProblemDescriptor(psiFile, message.toString(), false, (LocalQuickFix[])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } } @@ -344,9 +340,7 @@ public class DuplicatePropertyInspection extends DescriptorProviderInspection { surroundWithHref(message, property.getFirstChild(), false); } } - problemDescriptors.add(manager.createProblemDescriptor(psiFile, message.toString(), - (LocalQuickFix[])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, - false)); + problemDescriptors.add(manager.createProblemDescriptor(psiFile, message.toString(), false, (LocalQuickFix[])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } } } diff --git a/plugins/testng/src/com/theoryinpractice/testng/inspection/UndeclaredTestInspection.java b/plugins/testng/src/com/theoryinpractice/testng/inspection/UndeclaredTestInspection.java index 974f4dd07a3f..2f3e406806de 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/inspection/UndeclaredTestInspection.java +++ b/plugins/testng/src/com/theoryinpractice/testng/inspection/UndeclaredTestInspection.java @@ -101,9 +101,9 @@ public class UndeclaredTestInspection extends BaseJavaLocalInspectionTool { final PsiIdentifier nameIdentifier = aClass.getNameIdentifier(); LOG.assertTrue(nameIdentifier != null); return new ProblemDescriptor[]{manager.createProblemDescriptor(nameIdentifier, "Undeclared test \'" + aClass.getName() + "\'", - new LocalQuickFix[]{new RegisterClassFix(aClass), + isOnTheFly, new LocalQuickFix[]{new RegisterClassFix(aClass), new CreateTestngFix()}, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, isOnTheFly)}; + ProblemHighlightType.GENERIC_ERROR_OR_WARNING)}; } return null; } diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/CheckNodeTest.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/CheckNodeTest.java index 4b2d51168a0c..ad1b372e5c3b 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/CheckNodeTest.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/CheckNodeTest.java @@ -120,8 +120,7 @@ public class CheckNodeTest extends XPathInspection { } final LocalQuickFix[] fixes = contextProvider.getQuickFixFactory().createUnknownNodeTestFixes(nodeTest); - addProblem(myManager.createProblemDescriptor(nodeTest, "Unknown " + type + " name " + name + "", - fixes, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, myOnTheFly)); + addProblem(myManager.createProblemDescriptor(nodeTest, "Unknown " + type + " name " + name + "", myOnTheFly, fixes, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } private static boolean matches(@Nullable PrefixedName prefixedName, QName element, NamespaceContext namespaceContext, XmlElement context) { diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/HardwiredNamespacePrefix.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/HardwiredNamespacePrefix.java index 733d1f8feb3b..248d277a2fac 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/HardwiredNamespacePrefix.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/HardwiredNamespacePrefix.java @@ -46,13 +46,15 @@ public class HardwiredNamespacePrefix extends XPathInspection { if (isNameComparison(lop, rop)) { assert rop != null; - final ProblemDescriptor p = manager.createProblemDescriptor(rop, "Hardwired namespace prefix", LocalQuickFix.EMPTY_ARRAY, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, isOnTheFly); + final ProblemDescriptor p = manager.createProblemDescriptor(rop, "Hardwired namespace prefix", isOnTheFly, + LocalQuickFix.EMPTY_ARRAY, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING); addProblem(p); } else if (isNameComparison(rop, lop)) { assert lop != null; - final ProblemDescriptor p = manager.createProblemDescriptor(lop, "Hardwired namespace prefix", LocalQuickFix.EMPTY_ARRAY, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, isOnTheFly); + final ProblemDescriptor p = manager.createProblemDescriptor(lop, "Hardwired namespace prefix", isOnTheFly, + LocalQuickFix.EMPTY_ARRAY, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING); addProblem(p); } else if (isNameFunctionCall(lop)) { // TODO diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/ImplicitTypeConversion.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/ImplicitTypeConversion.java index 3a513a26859b..efebfc6933af 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/ImplicitTypeConversion.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/ImplicitTypeConversion.java @@ -143,8 +143,8 @@ public class ImplicitTypeConversion extends XPathInspection { } addProblem(myManager.createProblemDescriptor(expression, - "Expression should be of type '" + type.getName() + "'", fixes, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, myOnTheFly)); + "Expression should be of type '" + type.getName() + "'", myOnTheFly, fixes, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } } diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/RedundantTypeConversion.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/RedundantTypeConversion.java index 2fc31056e767..16f677673f26 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/RedundantTypeConversion.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/validation/inspections/RedundantTypeConversion.java @@ -77,8 +77,8 @@ public class RedundantTypeConversion extends XPathInspection { LocalQuickFix[] fixes = fixFactory.createRedundantTypeConversionFixes(expression); addProblem(myManager.createProblemDescriptor(expression, - "Redundant conversion to type '" + convertedType.getName() + "'", fixes, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, myOnTheFly)); + "Redundant conversion to type '" + convertedType.getName() + "'", myOnTheFly, fixes, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } else if (CHECK_ANY) { final XPathType expectedType = ExpectedTypeUtil.getExpectedType(expression); if (expectedType == XPathType.ANY) { @@ -86,8 +86,8 @@ public class RedundantTypeConversion extends XPathInspection { LocalQuickFix[] fixes = fixFactory.createRedundantTypeConversionFixes(expression); addProblem(myManager.createProblemDescriptor(expression, - "Redundant conversion to type '" + expectedType.getName() + "'", fixes, - ProblemHighlightType.GENERIC_ERROR_OR_WARNING, myOnTheFly)); + "Redundant conversion to type '" + expectedType.getName() + "'", myOnTheFly, fixes, + ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } } }