Merge remote-tracking branch 'origin/master'
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Wed, 28 Sep 2016 17:39:21 +0000 (19:39 +0200)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Wed, 28 Sep 2016 17:39:21 +0000 (19:39 +0200)
410 files changed:
community-tests/src/tests/testGroups.properties
images/src/org/intellij/images/editor/impl/ImageEditorUI.java
java/debugger/impl/src/com/intellij/debugger/actions/JavaSmartStepIntoHandler.java
java/debugger/impl/src/com/intellij/debugger/jdi/LocalVariablesUtil.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/ClasspathPanelImpl.java
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/JavaModuleGraphBuilder.java [deleted file]
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/JavaModuleGraphUtil.java [new file with mode: 0644]
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/ModuleHighlightUtil.java
java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeLambdaInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/AnonymousCanBeMethodReferenceInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/ExplicitTypeCanBeDiamondInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/LambdaCanBeMethodReferenceInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/PossibleHeapPollutionVarargsInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/RedundantLambdaCodeBlockInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/RemoveAnnotationQuickFix.java
java/java-analysis-impl/src/com/intellij/codeInspection/canBeFinal/CanBeFinalInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ContractInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java
java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DataFlowInspectionBase.java
java/java-analysis-impl/src/com/intellij/codeInspection/localCanBeFinal/LocalCanBeFinal.java
java/java-analysis-impl/src/com/intellij/codeInspection/miscGenerics/RedundantTypeArgsInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/nullable/ChangeNullableDefaultsFix.java
java/java-analysis-impl/src/com/intellij/codeInspection/redundantCast/RedundantCastInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/unnecessaryModuleDependency/UnnecessaryModuleDependencyInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/unneededThrows/RedundantThrows.java
java/java-analysis-impl/src/com/intellij/codeInspection/unusedLibraries/UnusedLibrariesInspection.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/ParameterNameHintsManager.java
java/java-impl/src/com/intellij/codeInspection/DefaultAnnotationParamInspection.java
java/java-impl/src/com/intellij/codeInspection/RemoveInitializerFix.java
java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedParametersInspection.java
java/java-impl/src/com/intellij/codeInspection/defaultFileTemplateUsage/DefaultFileTemplateUsageInspection.java
java/java-impl/src/com/intellij/codeInspection/defaultFileTemplateUsage/ReplaceWithFileTemplateFix.java
java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java
java/java-impl/src/com/intellij/codeInspection/equalsAndHashcode/EqualsAndHashcode.java
java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocReferenceInspection.java
java/java-impl/src/com/intellij/codeInspection/magicConstant/MagicConstantInspection.java
java/java-impl/src/com/intellij/codeInspection/miscGenerics/RedundantArrayForVarargsCallInspection.java
java/java-impl/src/com/intellij/codeInspection/sillyAssignment/SillyAssignmentInspection.java
java/java-impl/src/com/intellij/codeInspection/unusedReturnValue/UnusedReturnValue.java
java/java-impl/src/com/intellij/codeInspection/varScopeCanBeNarrowed/BaseConvertToLocalQuickFix.java
java/java-psi-api/src/com/intellij/psi/LambdaUtil.java
java/java-tests/testData/inspection/dataFlow/contractCheck/CheckConstructorContracts.java [new file with mode: 0644]
java/java-tests/testData/inspection/dataFlow/fixture/ContractConstructor.java [new file with mode: 0644]
java/java-tests/testData/inspection/dataFlow/fixture/GenericParameterNullity.java
java/java-tests/testSrc/com/intellij/codeInsight/daemon/inlays/InlayParameterHintsTest.kt
java/java-tests/testSrc/com/intellij/codeInspection/ContractCheckTest.java
java/java-tests/testSrc/com/intellij/codeInspection/DataFlowInspectionTest.java
java/mockJDK-1.7/jre/lib/annotations.jar
java/testFramework/src/com/siyeh/ig/LightInspectionTestCase.java
jps/jps-builders/src/org/jetbrains/jps/cmdline/BuildSession.java
json/src/com/intellij/json/codeinsight/JsonStandardComplianceInspection.java
platform/analysis-api/src/com/intellij/codeInspection/QuickFix.java
platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java
platform/lang-impl/src/com/intellij/codeInsight/template/TemplateEditingListener.java
platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java
platform/lang-impl/src/com/intellij/codeInspection/LossyEncodingInspection.java
platform/lang-impl/src/com/intellij/codeInspection/ProblematicWhitespaceInspection.java
platform/lang-impl/src/com/intellij/formatting/AbstractBlockWrapper.java
platform/lang-impl/src/com/intellij/webcore/packaging/ManagePackagesDialog.form
platform/lang-impl/src/com/intellij/webcore/packaging/ManagePackagesDialog.java
platform/platform-api/src/com/intellij/openapi/actionSystem/MouseShortcut.java
platform/platform-api/src/com/intellij/openapi/ui/JBPopupMenu.java
platform/platform-api/src/com/intellij/openapi/wm/ToolWindowFactory.java
platform/platform-api/src/com/intellij/ui/PortField.java
platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java
platform/platform-impl/src/com/intellij/execution/impl/AsyncFilterRunner.java
platform/platform-impl/src/com/intellij/openapi/application/impl/LaterInvocator.java
platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorMarkupModelImpl.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java
platform/platform-impl/src/com/intellij/remote/ext/CredentialsLanguageContribution.java
platform/platform-impl/src/com/intellij/ui/SlideComponent.java
platform/platform-impl/src/com/intellij/ui/mac/MacPathChooserDialog.java
platform/platform-impl/src/com/intellij/util/ui/SwingHelper.java
platform/platform-impl/src/com/intellij/util/ui/table/JBListTable.java
platform/platform-impl/src/com/intellij/util/ui/table/MouseSuppressor.java [deleted file]
platform/platform-tests/testSrc/com/intellij/openapi/application/impl/LaterInvocatorTest.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertor.java
platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java
platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java
platform/testRunner/src/com/intellij/execution/testframework/CompositePrintable.java
platform/testRunner/src/com/intellij/execution/testframework/actions/TestDiffRequestProcessor.java
platform/util/src/com/intellij/util/ui/MouseEventAdapter.java
platform/util/src/com/intellij/util/ui/MouseEventHandler.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesViewContentManager.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesViewToolWindowFactory.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/RemoveBreakpointGutterIconAction.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointUtil.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/META-INF/InspectionGadgets.xml
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/abstraction/OverlyStrongTypeCastInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/assignment/AssignmentUsedAsConditionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bitwise/PointlessBitwiseExpressionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/ClassNewInstanceInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/EmptyInitializerInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/InnerClassReferencedViaSubclassInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/MathRandomCastToIntInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/NewStringBufferWithCharArgumentInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/NonShortCircuitBooleanInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/StaticCallOnSubclassInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/bugs/StaticFieldReferenceOnSubclassInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/classlayout/ClassInitializerInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/classlayout/ClassMayBeInterfaceInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/classlayout/UtilityClassCanBeEnumInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/cloneable/CloneDeclaresCloneNotSupportedInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/cloneable/CloneableImplementsCloneInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/BooleanExpressionMayBeConditionalInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/ConfusingElseInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/ConstantConditionalExpressionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/ConstantIfStatementInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/DoubleNegationInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/FallthruInSwitchStatementInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/ForLoopReplaceableByWhileInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/IfMayBeConditionalInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/IfStatementWithIdenticalBranchesInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/LoopWithImplicitTerminationConditionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/NegatedConditionalExpressionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/NegatedConditionalInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/NegatedEqualityExpressionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/NegatedIfElseInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/PointlessBooleanExpressionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/SimplifiableBooleanExpressionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/SimplifiableConditionalExpressionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/TrivialIfInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/UnnecessaryConditionalExpressionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/UnnecessaryLabelOnBreakStatementInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/UnnecessaryLabelOnContinueStatementInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/EmptyCatchBlockInspectionBase.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/EmptyFinallyBlockInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/errorhandling/NullThrownInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/finalization/FinalizeNotProtectedInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/fixes/AddSerialVersionUIDFix.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/fixes/AddThisQualifierFix.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/fixes/ConvertToVarargsMethodFix.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/fixes/DeleteImportFix.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/fixes/EqualityToEqualsFix.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/fixes/ExtractParameterAsLocalVariableFix.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/fixes/MakeInitializerExplicitFix.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/fixes/NormalizeDeclarationFix.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/imports/StaticImportInspectionBase.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/AbstractMethodOverridesAbstractMethodInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/MissingOverrideAnnotationInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/RedundantMethodOverrideInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/inheritance/TypeParameterExtendsFinalClassInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/initialization/DoubleBraceInitializationInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/j2me/MultiplyOrDivideByPowerOfTwoInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/j2me/SimplifiableIfStatementInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/j2me/SingleCharacterStartsWithInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/javabeans/ClassWithoutConstructorInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/javadoc/DanglingJavadocInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/javadoc/HtmlTagCanBeJavadocTagInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/javadoc/MissingDeprecatedAnnotationInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/javadoc/UnnecessaryInheritDocInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/jdk/AutoBoxingInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/jdk/AutoUnboxingInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/jdk/ForeachStatementInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/jdk/VarargParameterInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/AssertEqualsCalledOnArrayInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/AssertEqualsMayBeAssertSameInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/MisorderedAssertEqualsArgumentsInspectionBase.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/MultipleExceptionsDeclaredOnTestMethodInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/SimplifiableJUnitAssertionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/UseOfObsoleteAssertInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/logging/LogStatementGuardedByLogConditionInspectionBase.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/logging/StringConcatenationArgumentToLogCallInspectionBase.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/memory/InnerClassMayBeStaticInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/BigDecimalLegacyMethodInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/EqualsReplaceableByObjectsCallInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/IfCanBeSwitchInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/IndexOfReplaceableByContainsInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/StringBufferReplaceableByStringBuilderInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/TryFinallyCanBeTryWithResourcesInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/TryWithIdenticalCatchesInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/UnnecessaryBoxingInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/migration/UnnecessaryUnboxingInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/BigDecimalEqualsInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/CharUsedInArithmeticContextInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/ComparisonToNaNInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/ConfusingFloatingPointLiteralInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/ConstantMathCallInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/ConvertOctalLiteralToDecimalFix.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/LongLiteralsEndingWithLowercaseLInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/NonReproducibleMathCallInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/PointlessArithmeticExpressionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/RemoveLeadingZeroFix.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/UnaryPlusInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/UnnecessaryExplicitNumericCastInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/numeric/UnnecessaryUnaryMinusInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/BooleanConstructorInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/BoxingBoxedValueInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/ConstantStringInternInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/InstantiatingObjectToGetClassObjectInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/KeySetIterationMayUseEntrySetInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/LengthOneStringInIndexOfInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/LengthOneStringsInConcatenationInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/ManualArrayCopyInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/ManualArrayToCollectionCopyInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/RandomDoubleForRandomIntegerInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/RedundantStringFormatCallInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/StringBufferToStringInConcatenationInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/StringConcatenationInsideStringBufferAppendInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/StringToStringInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/SubstringZeroInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/performance/TailRecursionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/redundancy/UnusedLabelInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/resources/AutoCloseableResourceInspectionBase.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/serialization/NonSerializableWithSerialVersionUIDFieldInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/serialization/SerialVersionUIDNotStaticFinalInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/serialization/TransientFieldInNonSerializableClassInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/CStyleArrayDeclarationInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/CallToStringConcatCanBeReplacedByOperatorInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ConstantOnLHSOfComparisonInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ConstantOnRHSOfComparisonInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/EqualsCalledOnEnumConstantInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ExtendsObjectInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ImplicitCallToSuperInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/ListIndexOfReplaceableByContainsInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/LiteralAsArgToStringEqualsInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/MissortedModifiersInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/RedundantFieldInitializationInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/RedundantImplementsInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/SimplifiableAnnotationInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/SizeReplaceableByIsEmptyInspectionBase.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/TypeParameterExtendsObjectInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnclearBinaryExpressionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessarilyQualifiedInnerClassAccessInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessarilyQualifiedStaticUsageInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessarilyQualifiedStaticallyImportedElementInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessaryBlockStatementInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessaryConstructorInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessaryParenthesesInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessaryQualifierForThisInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessarySemicolonInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessarySuperConstructorInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessarySuperQualifierInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/UnnecessaryThisInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/threading/ConditionSignalInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/threading/MethodMayBeSynchronizedInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/threading/ObjectNotifyInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/threading/SynchronizedMethodInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/threading/ThreadRunInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/visibility/AmbiguousFieldAccessInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/visibility/AmbiguousMethodCallInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/visibility/LocalVariableHidingMemberVariableInspectionBase.java
plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/StaticMethodOnlyUsedInOneClassInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/asserttoif/AssertionCanBeIfInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/asserttoif/IfCanBeAssertionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/classlayout/ProtectedMemberInFinalClassInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/classlayout/PublicConstructorInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/classlayout/UtilityClassWithoutPrivateConstructorInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/dataflow/ReuseOfLocalVariableInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/errorhandling/TooBroadCatchInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/errorhandling/UnnecessaryInitCauseInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/exceptions/MultiCatchCanBeSplitInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/exceptions/TryStatementWithMultipleResourcesInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/fixes/ExtractMethodFix.java
plugins/InspectionGadgets/src/com/siyeh/ig/fixes/InlineVariableFix.java
plugins/InspectionGadgets/src/com/siyeh/ig/fixes/IntroduceConstantFix.java
plugins/InspectionGadgets/src/com/siyeh/ig/fixes/MoveClassFix.java
plugins/InspectionGadgets/src/com/siyeh/ig/fixes/ReplaceInheritanceWithDelegationFix.java
plugins/InspectionGadgets/src/com/siyeh/ig/fixes/SuppressForTestsScopeFix.java
plugins/InspectionGadgets/src/com/siyeh/ig/initialization/NonThreadSafeLazyInitializationInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/javadoc/MissingPackageInfoInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/javadoc/PackageDotHtmlMayBePackageInfoInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/migration/EnumerationCanBeIterationInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/migration/ForCanBeForeachInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/migration/WhileCanBeForeachInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/naming/MethodNameSameAsClassNameInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/DynamicRegexReplaceableByCompiledPatternInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/ToArrayCallWithZeroLengthArrayArgumentInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/serialization/ExternalizableWithoutPublicNoArgConstructorInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/DiamondCanBeReplacedWithExplicitTypeArgumentsInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/LambdaBodyCanBeCodeBlockInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/LambdaCanBeReplacedWithAnonymousInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/MethodRefCanBeReplacedWithLambdaInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/UnqualifiedInnerClassAccessInspection.java
plugins/InspectionGadgets/src/inspectionDescriptions/EqualsReplaceableByObjectsCall.html
plugins/InspectionGadgets/src/inspectionDescriptions/LocalVariableHidingMemberVariable.html
plugins/InspectionGadgets/test/com/siyeh/igtest/visibility/local_variable_hiding_member_variable/LocalVariableHidingMemberVariable.java
plugins/InspectionGadgets/test/com/siyeh/igtest/visibility/local_variable_hiding_member_variable/LocalVariableHidingMemberVariable2.java [new file with mode: 0644]
plugins/InspectionGadgets/testsrc/com/siyeh/ig/visibility/LocalVariableHidingMemberVariableInspectionTest.java
plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/pattern/PatternValidator.java
plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/util/AnnotateFix.java
plugins/devkit/src/inspections/PluginXmlDomInspection.java
plugins/devkit/src/inspections/quickfix/AddWithTagFix.java
plugins/devkit/src/inspections/quickfix/CreateConstructorFix.java
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/style/GrUnnecessarySemicolonInspection.java
plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GroovyCompilerTest.groovy
plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCheckinEnvironment.java
plugins/java-i18n/src/com/intellij/codeInspection/duplicateStringLiteral/DuplicateStringLiteralInspection.java
plugins/java-i18n/src/com/intellij/codeInspection/i18n/I18nInspection.java
plugins/java-i18n/src/com/intellij/codeInspection/i18n/I18nizeQuickFix.java
plugins/junit/test/com/intellij/execution/junit/JUnitTreeByDescriptionHierarchyTest.java
plugins/junit_rt/src/com/intellij/junit4/JUnit4TestListener.java
plugins/maven/maven3-server-impl/src/org/jetbrains/idea/maven/server/Maven3ServerEmbedderImpl.java
plugins/properties/properties-psi-impl/src/com/intellij/codeInspection/TrailingSpacesInPropertyInspection.java
plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/RemovePropertyLocalFix.java
plugins/testng/src/com/theoryinpractice/testng/inspection/ConvertOldAnnotationInspection.java
plugins/testng/src/com/theoryinpractice/testng/inspection/JUnitConvertTool.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/quickfix/DownloadResourceFix.java
python/ipnb/src/org/jetbrains/plugins/ipnb/editor/actions/IpnbAddCellAboveAction.java
python/ipnb/src/org/jetbrains/plugins/ipnb/editor/actions/IpnbAddCellBelowAction.java
python/ipnb/src/org/jetbrains/plugins/ipnb/editor/actions/IpnbRunCellBaseAction.java
python/ipnb/src/org/jetbrains/plugins/ipnb/editor/panels/IpnbFilePanel.java
python/ipnb/src/org/jetbrains/plugins/ipnb/format/cells/IpnbCodeCell.java
python/ipnb/src/org/jetbrains/plugins/ipnb/format/cells/IpnbEditableCell.java
python/ipnb/testData/emptyFile.ipynb [new file with mode: 0644]
python/ipnb/testSrc/CellOperationTest.java [new file with mode: 0644]
python/ipnb/testSrc/IpnbTestCase.java [new file with mode: 0644]
python/ipnb/testSrc/JsonParserTest.java
python/openapi/src/com/jetbrains/python/packaging/PyExecutionException.java
python/openapi/src/com/jetbrains/python/templateLanguages/ConfigureTemplateDirectoriesAction.java
python/psi-api/src/com/jetbrains/python/PyNames.java
python/src/com/jetbrains/python/codeInsight/intentions/ConvertFormatOperatorToMethodIntention.java
python/src/com/jetbrains/python/inspections/PyMethodParametersInspection.java
python/src/com/jetbrains/python/inspections/PyPackageRequirementsInspection.java
python/src/com/jetbrains/python/inspections/PyPep8NamingInspection.java
python/src/com/jetbrains/python/inspections/PyUnusedLocalInspectionVisitor.java
python/src/com/jetbrains/python/inspections/quickfix/AddCallSuperQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/AddEncodingQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/AddGlobalQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/AugmentedAssignmentQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/ChainedComparisonsQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/ComparisonWithNoneQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/CompatibilityPrintCallQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/ConvertDocstringQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/DictCreationQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/ListCreationQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/MoveFromFutureImportQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyAddExceptionSuperClassQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyAddImportFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyAddPropertyForFieldQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyAddSpecifierToFormatQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyChangeBaseClassQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyChangeSignatureQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyConvertToNewStyleQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyCreatePropertyQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyDefaultArgumentQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyMakeFunctionFromMethodQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyMakeMethodStaticQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyMoveAttributeToInitQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyMoveExceptQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyRemoveArgumentQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyRemoveAssignmentQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyRemoveCallQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyRemoveDictKeyQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyRemoveParameterQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyRemoveStatementQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyRemoveUnderscoresInNumericLiteralsQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyRenameArgumentQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyReplaceTupleWithListQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyUpdatePropertySignatureQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/PyWrapInExceptionQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/RedundantParenthesesQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/RemoveArgumentEqualDefaultQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/RemoveDecoratorQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/RemoveTrailingLQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/RemoveTrailingSemicolonQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/RemoveUnnecessaryBackslashQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/ReplaceBackquoteExpressionQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/ReplaceExceptPartQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/ReplaceFunctionWithSetLiteralQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/ReplaceListComprehensionsQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/ReplaceNotEqOperatorQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/ReplaceOctalNumericLiteralQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/ReplaceRaiseStatementQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/StatementEffectFunctionCallQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/StatementEffectIntroduceVariableQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/TransformClassicClassQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/UnresolvedRefAddFutureImportQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/UnresolvedRefCreateFunctionQuickFix.java
python/src/com/jetbrains/python/packaging/PyPackageService.java
python/testData/inspections/PyMethodParametersInspectionInitSubclass/test.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/bytes.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/bytes_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/callWithNoneReturnType.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/callWithNoneReturnType_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/concatenated_after.py
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/dictCallReference.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/dictCallReference_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/dictReference.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/dictReference_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/dictSubclass.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/dictSubclass_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/escaped_after.py
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/multi_after.py
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/repr.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/repr_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/set.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/setCall.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/setCall_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/set_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/simple_after.py
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/starPrecision.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/starWidth.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/starWidthPrecision.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/tupleReference.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/tupleReference_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertFormatOperatorToMethodIntentionTest/unicode_after.py
python/testSrc/com/jetbrains/python/PythonInspectionsTest.java
python/testSrc/com/jetbrains/python/intentions/PyConvertFormatOperatorToMethodIntentionTest.java
xml/impl/src/com/intellij/xml/util/AddDtdDeclarationFix.java
xml/relaxng/src/org/intellij/plugins/relaxNG/inspections/UnusedDefineInspection.java
xml/xml-analysis-impl/src/com/intellij/codeInspection/htmlInspections/SwitchToHtml5Action.java
xml/xml-analysis-impl/src/com/intellij/codeInspection/htmlInspections/XmlWrongRootElementInspection.java
xml/xml-analysis-impl/src/com/intellij/xml/util/CheckEmptyTagInspection.java
xml/xml-analysis-impl/src/com/intellij/xml/util/CollapseTagIntention.java
xml/xml-analysis-impl/src/com/intellij/xml/util/XmlDeclareIdInCommentAction.java

index 324442c8ebed663198367b4950e7925a0b7c94d4..2f171eb35ee3a1ea9b3d86598788ee1bac9db263 100644 (file)
@@ -86,6 +86,7 @@ com.android.tools.idea.editors.AndroidGeneratedSourcesFilterTest
 com.android.tools.idea.editors.theme.ThemeEditorStyleTest
 com.android.tools.idea.editors.theme.ThemeEditorUtilsTest
 com.android.tools.idea.editors.theme.ConfiguredThemeEditorStyleTest
+com.android.tools.idea.editors.theme.ResolutionUtilsTest
 com.android.tools.idea.editors.theme.qualifiers.QualifierUtilsTest
 com.android.tools.idea.gradle.IdeaAndroidProjectTest
 com.android.tools.idea.gradle.project.AndroidGradleProjectImportingTest
@@ -127,6 +128,7 @@ com.android.tools.idea.wizard.AsyncValidatorTest
 org.jetbrains.jps.android.AndroidBuilderTest
 com.android.tools.idea.gradle.service.notification.hyperlink.CustomNotificationListenerTest
 com.android.repository.impl.installer.BasicInstallerTest
+org.jetbrains.android.AndroidLintTest
 
 [GRADLE_INTEGRATION_TESTS]
 org.jetbrains.plugins.gradle.importing.*
index 62948cb6227993ca730a7c2ef7a082cdad1498eb..0e5e290be79939c9b539b10219a244e0e9a061c9 100644 (file)
@@ -330,9 +330,11 @@ final class ImageEditorUI extends JPanel implements DataProvider, CopyProvider,
       EditorOptions editorOptions = options.getEditorOptions();
       ZoomOptions zoomOptions = editorOptions.getZoomOptions();
       if (zoomOptions.isWheelZooming() && e.isControlDown()) {
-        if (e.getWheelRotation() < 0) {
+        int rotation = e.getWheelRotation();
+        if (rotation < 0) {
           zoomModel.zoomOut();
-        } else {
+        }
+        else if (rotation > 0) {
           zoomModel.zoomIn();
         }
         e.consume();
index 0d46f2fba155cfb74bf2e6830a95d4e3cae265a5..f504c0f67655eb560f697cdb58c594126e401858 100644 (file)
@@ -52,8 +52,9 @@ import org.jetbrains.org.objectweb.asm.MethodVisitor;
 import org.jetbrains.org.objectweb.asm.Opcodes;
 
 import java.util.Collections;
+import java.util.Deque;
+import java.util.LinkedList;
 import java.util.List;
-import java.util.Stack;
 
 /**
  * User: Alexander Podkhalyuzin
@@ -144,14 +145,14 @@ public class JavaSmartStepIntoHandler extends JvmSmartStepIntoHandler {
       final Ref<TextRange> textRange = new Ref<>(lineRange);
 
       final PsiElementVisitor methodCollector = new JavaRecursiveElementVisitor() {
-        final Stack<PsiMethod> myContextStack = new Stack<>();
-        final Stack<String> myParamNameStack = new Stack<>();
+        final Deque<PsiMethod> myContextStack = new LinkedList<>();
+        final Deque<String> myParamNameStack =  new LinkedList<>();
         private int myNextLambdaExpressionOrdinal = 0;
         private boolean myInsideLambda = false;
 
         @Nullable
         private String getCurrentParamName() {
-          return myParamNameStack.isEmpty() ? null : myParamNameStack.peek();
+          return myParamNameStack.peekFirst();
         }
 
         @Override
@@ -257,7 +258,7 @@ public class JavaSmartStepIntoHandler extends JvmSmartStepIntoHandler {
         }
 
         public void visitExpressionList(PsiExpressionList expressionList) {
-          final PsiMethod psiMethod = myContextStack.isEmpty()? null : myContextStack.peek();
+          PsiMethod psiMethod = myContextStack.peekFirst();
           if (psiMethod != null) {
             final String methodName = psiMethod.getName();
             final PsiExpression[] expressions = expressionList.getExpressions();
index 2880847a8adfe15ff9c7b83c49d2753d81c3e3d1..dfb00467a1cf8c360acfce7fab4c43eb183ed0fa 100644 (file)
@@ -360,15 +360,13 @@ public class LocalVariablesUtil {
     private final MultiMap<Integer, String> myNames;
     private int myCurrentSlotIndex;
     private final PsiElement myElement;
-    private final Stack<Integer> myIndexStack;
+    private final Deque<Integer> myIndexStack = new LinkedList<>();
     private boolean myReached = false;
 
     public LocalVariableNameFinder(int startSlot, MultiMap<Integer, String> names, PsiElement element) {
       myNames = names;
       myCurrentSlotIndex = startSlot;
       myElement = element;
-      myIndexStack = new Stack<>();
-
     }
 
     private boolean shouldVisit(PsiElement scope) {
index 711e1d1bc4ebd8a64cfe448db4b56aa8545b6d45..6846057228a3e8634a9c588254bf5fd696d449b7 100644 (file)
@@ -65,6 +65,7 @@ import com.intellij.ui.table.JBTable;
 import com.intellij.util.EventDispatcher;
 import com.intellij.util.IconUtil;
 import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.ui.JBUI;
 import com.intellij.util.ui.TextTransferable;
 import gnu.trove.TIntArrayList;
 import org.jetbrains.annotations.NotNull;
@@ -196,6 +197,7 @@ public class ClasspathPanelImpl extends JPanel implements ClasspathPanel {
     };
     setFixedColumnWidth(ClasspathTableModel.EXPORT_COLUMN, ClasspathTableModel.EXPORT_COLUMN_NAME);
     setFixedColumnWidth(ClasspathTableModel.SCOPE_COLUMN, DependencyScope.COMPILE.toString() + "     ");  // leave space for combobox border
+    myEntryTable.getTableHeader().getColumnModel().getColumn(ClasspathTableModel.ITEM_COLUMN).setPreferredWidth(10000); // consume all available space
 
     myEntryTable.registerKeyboardAction(
       new ActionListener() {
@@ -323,10 +325,9 @@ public class ClasspathPanelImpl extends JPanel implements ClasspathPanel {
   private void setFixedColumnWidth(final int columnIndex, String sampleText) {
     final TableColumn column = myEntryTable.getTableHeader().getColumnModel().getColumn(columnIndex);
     final FontMetrics fontMetrics = myEntryTable.getFontMetrics(myEntryTable.getFont());
-    final int width = fontMetrics.stringWidth(" " + sampleText + " ") + 4;
+    final int width = fontMetrics.stringWidth(" " + sampleText + " ") + JBUI.scale(4);
     column.setPreferredWidth(width);
-    column.setMaxWidth(width);
-
+    column.setMinWidth(width);
     column.setResizable(false);
   }
 
diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/JavaModuleGraphBuilder.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/JavaModuleGraphBuilder.java
deleted file mode 100644 (file)
index 3a1441b..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 2000-2016 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.intellij.codeInsight.daemon.impl.analysis;
-
-import com.intellij.openapi.application.ReadAction;
-import com.intellij.openapi.module.Module;
-import com.intellij.openapi.module.ModuleManager;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.psi.*;
-import com.intellij.psi.search.FilenameIndex;
-import com.intellij.psi.util.CachedValueProvider.Result;
-import com.intellij.psi.util.CachedValuesManager;
-import com.intellij.util.containers.ContainerUtil;
-import com.intellij.util.containers.MultiMap;
-import com.intellij.util.graph.DFSTBuilder;
-import com.intellij.util.graph.Graph;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import static com.intellij.psi.PsiJavaModule.MODULE_INFO_FILE;
-import static com.intellij.psi.SyntaxTraverser.psiTraverser;
-import static com.intellij.psi.util.PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT;
-
-public class JavaModuleGraphBuilder {
-  private JavaModuleGraphBuilder() { }
-
-  @Nullable
-  public static Graph<PsiJavaModule> getOrBuild(@NotNull Project project) {
-    return CachedValuesManager.getManager(project).getCachedValue(project, () -> {
-      Graph<PsiJavaModule> graph = ReadAction.compute(() -> build(project));
-      return Result.create(graph, OUT_OF_CODE_BLOCK_MODIFICATION_COUNT);
-    });
-  }
-
-  @Nullable
-  public static Collection<PsiJavaModule> findCycle(@NotNull Graph<PsiJavaModule> graph, @NotNull PsiJavaModule module) {
-    return ((JavaModuleGraph)graph).myCycles.stream().filter(set -> set.contains(module)).findFirst().orElse(null);
-  }
-
-  // Discovers relationships between Java modules in the project.
-  // Library/JDK modules are excluded - in assumption there can't be any lib -> src dependencies.
-  private static Graph<PsiJavaModule> build(Project project) {
-    Set<PsiJavaModule> projectModules = ContainerUtil.newHashSet();
-    for (Module module : ModuleManager.getInstance(project).getModules()) {
-      Collection<VirtualFile> files = FilenameIndex.getVirtualFilesByName(project, MODULE_INFO_FILE, module.getModuleScope(false));
-      if (files.size() > 1) return null;  // aborts the process when there are incorrect modules in the project
-      VirtualFile vFile = ContainerUtil.getFirstItem(files);
-      if (vFile != null) {
-        PsiFile psiFile = PsiManager.getInstance(project).findFile(vFile);
-        if (psiFile instanceof PsiJavaFile) {
-          PsiJavaModule moduleDeclaration = ((PsiJavaFile)psiFile).getModuleDeclaration();
-          if (moduleDeclaration != null) {
-            projectModules.add(moduleDeclaration);
-          }
-        }
-      }
-    }
-
-    MultiMap<PsiJavaModule, PsiJavaModule> relations = MultiMap.create();
-    for (PsiJavaModule moduleDeclaration : projectModules) {
-      for (PsiRequiresStatement statement : psiTraverser().children(moduleDeclaration).filter(PsiRequiresStatement.class)) {
-        PsiJavaModule dependency = resolveDependency(statement);
-        if (dependency != null && projectModules.contains(dependency)) {
-          relations.putValue(moduleDeclaration, dependency);
-        }
-      }
-    }
-    return new JavaModuleGraph(relations);
-  }
-
-  private static PsiJavaModule resolveDependency(PsiRequiresStatement statement) {
-    PsiJavaModuleReferenceElement refElement = statement.getReferenceElement();
-    if (refElement != null) {
-      PsiPolyVariantReference ref = refElement.getReference();
-      if (ref != null) {
-        ResolveResult[] results = ref.multiResolve(true);
-        if (results.length == 1) {
-          PsiElement target = results[0].getElement();
-          if (target instanceof PsiJavaModule) {
-            return (PsiJavaModule)target;
-          }
-        }
-      }
-    }
-
-    return null;
-  }
-
-  private static class JavaModuleGraph implements Graph<PsiJavaModule> {
-    private final MultiMap<PsiJavaModule, PsiJavaModule> myMap;
-    private final List<Set<PsiJavaModule>> myCycles;
-
-    public JavaModuleGraph(MultiMap<PsiJavaModule, PsiJavaModule> map) {
-      myMap = map;
-
-      DFSTBuilder<PsiJavaModule> builder = new DFSTBuilder<>(this);
-      myCycles = builder.getComponents().stream()
-        .map(ContainerUtil::newLinkedHashSet)
-        .collect(Collectors.toList());
-    }
-
-    @Override
-    public Collection<PsiJavaModule> getNodes() {
-      return myMap.keySet();
-    }
-
-    @Override
-    public Iterator<PsiJavaModule> getIn(PsiJavaModule n) {
-      return ContainerUtil.emptyIterator();
-    }
-
-    @Override
-    public Iterator<PsiJavaModule> getOut(PsiJavaModule n) {
-      return myMap.get(n).iterator();
-    }
-  }
-}
\ No newline at end of file
diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/JavaModuleGraphUtil.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/JavaModuleGraphUtil.java
new file mode 100644 (file)
index 0000000..8c77bb0
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2000-2016 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.codeInsight.daemon.impl.analysis;
+
+import com.intellij.openapi.application.ReadAction;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.psi.search.FilenameIndex;
+import com.intellij.psi.util.CachedValueProvider.Result;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.MultiMap;
+import com.intellij.util.graph.DFSTBuilder;
+import com.intellij.util.graph.Graph;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static com.intellij.psi.PsiJavaModule.MODULE_INFO_FILE;
+import static com.intellij.psi.SyntaxTraverser.psiTraverser;
+import static com.intellij.psi.util.PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT;
+
+public class JavaModuleGraphUtil {
+  private JavaModuleGraphUtil() { }
+
+  @Nullable
+  public static Collection<PsiJavaModule> findCycle(@NotNull PsiJavaModule module) {
+    Project project = module.getProject();
+    List<Set<PsiJavaModule>> cycles = CachedValuesManager.getManager(project).getCachedValue(project, () ->
+      Result.create(ReadAction.compute(() -> findCycles(project)), OUT_OF_CODE_BLOCK_MODIFICATION_COUNT));
+    return ContainerUtil.find(cycles, set -> set.contains(module));
+  }
+
+  // Looks for cycles between Java modules in the project sources.
+  // Library/JDK modules are excluded - in assumption there can't be any lib -> src dependencies.
+  // Module references are resolved "globally" (i.e., without taking project dependencies into account).
+  private static List<Set<PsiJavaModule>> findCycles(Project project) {
+    Set<PsiJavaModule> projectModules = ContainerUtil.newHashSet();
+    for (Module module : ModuleManager.getInstance(project).getModules()) {
+      Collection<VirtualFile> files = FilenameIndex.getVirtualFilesByName(project, MODULE_INFO_FILE, module.getModuleScope(false));
+      if (files.size() > 1) return Collections.emptyList();  // aborts the process when there are incorrect modules in the project
+      Optional.ofNullable(ContainerUtil.getFirstItem(files))
+        .map(PsiManager.getInstance(project)::findFile)
+        .map(f -> f instanceof PsiJavaFile ? ((PsiJavaFile)f).getModuleDeclaration() : null)
+        .ifPresent(projectModules::add);
+    }
+
+    if (!projectModules.isEmpty()) {
+      MultiMap<PsiJavaModule, PsiJavaModule> relations = MultiMap.create();
+      for (PsiJavaModule moduleDeclaration : projectModules) {
+        for (PsiRequiresStatement statement : psiTraverser().children(moduleDeclaration).filter(PsiRequiresStatement.class)) {
+          Optional.ofNullable(statement.getReferenceElement())
+            .map(PsiJavaModuleReferenceElement::getReference)
+            .map(ref -> ref.multiResolve(true))
+            .map(a -> a.length == 1 ? a[0].getElement() : null)
+            .map(e -> e instanceof PsiJavaModule ? (PsiJavaModule)e : null)
+            .filter(projectModules::contains)
+            .ifPresent(dependency -> relations.putValue(moduleDeclaration, dependency));
+        }
+      }
+
+      if (!relations.isEmpty()) {
+        Graph<PsiJavaModule> graph = new SourceSemiGraph(relations);
+        DFSTBuilder<PsiJavaModule> builder = new DFSTBuilder<>(graph);
+        Collection<Collection<PsiJavaModule>> components = builder.getComponents();
+        if (!components.isEmpty()) {
+          return components.stream().map(ContainerUtil::newLinkedHashSet).collect(Collectors.toList());
+        }
+      }
+    }
+
+    return Collections.emptyList();
+  }
+
+  private static class SourceSemiGraph implements Graph<PsiJavaModule> {
+    private final MultiMap<PsiJavaModule, PsiJavaModule> myMap;
+
+    public SourceSemiGraph(MultiMap<PsiJavaModule, PsiJavaModule> map) {
+      myMap = map;
+    }
+
+    @Override
+    public Collection<PsiJavaModule> getNodes() {
+      return myMap.keySet();
+    }
+
+    @Override
+    public Iterator<PsiJavaModule> getIn(PsiJavaModule n) {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Iterator<PsiJavaModule> getOut(PsiJavaModule n) {
+      return myMap.get(n).iterator();
+    }
+  }
+}
\ No newline at end of file
index f8100e070e4f512f44f5a6fb26d62057192f0977..75b3e8a0b15f8f344ab64c95abb813ad115cb3ff 100644 (file)
@@ -37,7 +37,6 @@ import com.intellij.psi.util.PsiUtil;
 import com.intellij.util.ObjectUtils;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.JBIterable;
-import com.intellij.util.graph.Graph;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 import org.jetbrains.annotations.PropertyKey;
@@ -198,15 +197,12 @@ public class ModuleHighlightUtil {
         return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(refElement).description(message).create();
       }
       else {
-        Graph<PsiJavaModule> graph = JavaModuleGraphBuilder.getOrBuild(target.getProject());
-        if (graph != null) {
-          Collection<PsiJavaModule> cycle = JavaModuleGraphBuilder.findCycle(graph, (PsiJavaModule)target);
-          if (cycle != null && cycle.contains(container)) {
-            Stream<String> stream = cycle.stream().map(PsiJavaModule::getModuleName);
-            if (ApplicationManager.getApplication().isUnitTestMode()) stream = stream.sorted();
-            String message = JavaErrorMessages.message("module.cyclic.dependence", stream.collect(Collectors.joining(", ")));
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(refElement).description(message).create();
-          }
+        Collection<PsiJavaModule> cycle = JavaModuleGraphUtil.findCycle((PsiJavaModule)target);
+        if (cycle != null && cycle.contains(container)) {
+          Stream<String> stream = cycle.stream().map(PsiJavaModule::getModuleName);
+          if (ApplicationManager.getApplication().isUnitTestMode()) stream = stream.sorted();
+          String message = JavaErrorMessages.message("module.cyclic.dependence", stream.collect(Collectors.joining(", ")));
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(refElement).description(message).create();
         }
       }
     }
index eaecb9b92551d1d7b8fc9f48d6444c481f73109b..0300a2e1f30cc9e6d5d7752faddb7308c7c71e3a 100644 (file)
@@ -359,16 +359,10 @@ public class AnonymousCanBeLambdaInspection extends BaseJavaBatchLocalInspection
   }
 
   private static class ReplaceWithLambdaFix implements LocalQuickFix, HighPriorityAction {
-    @NotNull
-    @Override
-    public String getName() {
-      return "Replace with lambda";
-    }
-
     @NotNull
     @Override
     public String getFamilyName() {
-      return getName();
+      return "Replace with lambda";
     }
 
     @Override
index f74912d75516b5e4acf6dc1203e645d69ac1c408..d0a5790a98825cad9b97fa0f6a2529cacfdcc8bd 100644 (file)
@@ -112,19 +112,13 @@ public class AnonymousCanBeMethodReferenceInspection extends BaseJavaBatchLocalI
   }
 
   private static class ReplaceWithMethodRefFix implements LocalQuickFix {
-      @NotNull
-      @Override
-      public String getName() {
-        return "Replace with method reference";
-      }
-
       @NotNull
       @Override
       public String getFamilyName() {
-        return getName();
+        return "Replace with method reference";
       }
 
-      @Override
+    @Override
       public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
         final PsiElement element = descriptor.getPsiElement();
         if (element instanceof PsiNewExpression) {
index 100cc979e235db6e77537fb724505c83dac87c76..000e9d7887f4a046ba464d405eb205ad8596cfb1 100644 (file)
@@ -82,16 +82,10 @@ public class ExplicitTypeCanBeDiamondInspection extends BaseJavaBatchLocalInspec
   }
 
   private static class ReplaceWithDiamondFix implements LocalQuickFix, HighPriorityAction {
-    @NotNull
-    @Override
-    public String getName() {
-      return "Replace with <>";
-    }
-
     @NotNull
     @Override
     public String getFamilyName() {
-      return getName();
+      return "Replace with <>";
     }
 
     @Override
index ef9890c0e6545f92a32d90356a743f6290818684..c86d71191de25755ec2ad436704e5f149d6929d1 100644 (file)
@@ -587,16 +587,10 @@ public class LambdaCanBeMethodReferenceInspection extends BaseJavaBatchLocalInsp
   }
 
   private static class ReplaceWithMethodRefFix implements LocalQuickFix {
-    @NotNull
-    @Override
-    public String getName() {
-      return "Replace lambda with method reference";
-    }
-
     @NotNull
     @Override
     public String getFamilyName() {
-      return getName();
+      return "Replace lambda with method reference";
     }
 
     @Override
index eb136dc4136f80a252e6e9e10556f0ee5b948c4d..cd8d9f319325dd9cd6ffaa37fb428a91b39b0ebe 100644 (file)
@@ -92,16 +92,10 @@ public class PossibleHeapPollutionVarargsInspection extends BaseJavaBatchLocalIn
   }
 
   private static class AnnotateAsSafeVarargsQuickFix implements LocalQuickFix {
-    @NotNull
-    @Override
-    public String getName() {
-      return "Annotate as @SafeVarargs";
-    }
-
     @NotNull
     @Override
     public String getFamilyName() {
-      return getName();
+      return "Annotate as @SafeVarargs";
     }
 
     @Override
@@ -117,16 +111,10 @@ public class PossibleHeapPollutionVarargsInspection extends BaseJavaBatchLocalIn
   }
 
   private static class MakeFinalAndAnnotateQuickFix implements LocalQuickFix {
-    @NotNull
-    @Override
-    public String getName() {
-      return "Make final and annotate as @SafeVarargs";
-    }
-
     @NotNull
     @Override
     public String getFamilyName() {
-      return getName();
+      return "Make final and annotate as @SafeVarargs";
     }
 
     @Override
index a05dd88c4700b42eec394e270df0070a02e89466..71425f84396e91eb4027cbcf83288ad4bb3b1880 100644 (file)
@@ -124,16 +124,10 @@ public class RedundantLambdaCodeBlockInspection extends BaseJavaBatchLocalInspec
   }
 
   private static class ReplaceWithExprFix implements LocalQuickFix, HighPriorityAction {
-    @NotNull
-    @Override
-    public String getName() {
-      return "Replace with expression lambda";
-    }
-
     @NotNull
     @Override
     public String getFamilyName() {
-      return getName();
+      return "Replace with expression lambda";
     }
 
     @Override
index 9899198be6aacfb0e82d61f2348523209b00245e..be605fa364cbd0b14482021b856a93afa75315eb 100644 (file)
@@ -40,7 +40,7 @@ public class RemoveAnnotationQuickFix implements LocalQuickFix {
 
   @Override
   @NotNull
-  public String getName() {
+  public String getFamilyName() {
     return CodeInsightBundle.message("remove.annotation");
   }
 
@@ -58,10 +58,4 @@ public class RemoveAnnotationQuickFix implements LocalQuickFix {
       ExternalAnnotationsManager.getInstance(project).deannotate(myListOwner, myAnnotation.getQualifiedName());
     }
   }
-
-  @Override
-  @NotNull
-  public String getFamilyName() {
-    return getName();
-  }
 }
\ No newline at end of file
index 9ca3844e0987753a2b1d0e0b4ae6cb247ae64fbe..3b874fdfdc71e6b46ed8a5951df4a18ae0ec070c 100644 (file)
@@ -269,16 +269,10 @@ public class CanBeFinalInspection extends GlobalJavaBatchInspectionTool {
       myManager = manager;
     }
 
-    @Override
-    @NotNull
-    public String getName() {
-      return QUICK_FIX_NAME;
-    }
-
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
+      return QUICK_FIX_NAME;
     }
 
     @Override
index 69206a74251a54a78eaebc5dbd25b8f5641cd4b9..1bdd1b256bd05b4887d53cacb51e1e28e62ba4e1 100644 (file)
@@ -95,6 +95,9 @@ public class ContractInspection extends BaseJavaBatchLocalInspectionTool {
       if (returnType != null && !InferenceFromSourceUtil.isReturnTypeCompatible(returnType, contract.returnValue)) {
         return "Method returns " + returnType.getPresentableText() + " but the contract specifies " + contract.returnValue;
       }
+      if (method.isConstructor() && contract.returnValue != MethodContract.ValueConstraint.THROW_EXCEPTION) {
+        return "Invalid contract return value for a constructor: " + contract.returnValue;
+      }
     }
     return null;
   }
index 4d72212249f3cebef7d756087e7fd2ec70aae95c..2a356bd66862e4174ef4ac781b9ec32f6312cac1 100644 (file)
@@ -1586,7 +1586,7 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
       PsiMethod constructor = pushConstructorArguments(expression);
 
       addConditionalRuntimeThrow();
-      addInstruction(new MethodCallInstruction(expression, null, Collections.emptyList()));
+      addInstruction(new MethodCallInstruction(expression, null, constructor == null ? Collections.emptyList() : getMethodContracts(constructor)));
 
       if (!myCatchStack.isEmpty()) {
         addMethodThrows(constructor, expression);
@@ -1597,6 +1597,7 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
     finishElement(expression);
   }
 
+  @Nullable
   private PsiMethod pushConstructorArguments(PsiConstructorCall call) {
     PsiExpressionList args = call.getArgumentList();
     PsiMethod ctr = call.resolveConstructor();
index 4da776776b0ff5e54467ab482e80969c8e746f4f..6ca88c6ea6782ff8c676f8b704cd0c5b611f39a0 100644 (file)
@@ -48,12 +48,10 @@ import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.util.PsiUtil;
 import com.intellij.psi.util.TypeConversionUtil;
 import com.intellij.refactoring.extractMethod.ExtractMethodUtil;
-import com.intellij.util.ArrayUtil;
-import com.intellij.util.ArrayUtilRt;
-import com.intellij.util.IncorrectOperationException;
-import com.intellij.util.SmartList;
+import com.intellij.util.*;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.MultiMap;
+import one.util.streamex.StreamEx;
 import org.jdom.Element;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -319,6 +317,8 @@ public class DataFlowInspectionBase extends BaseJavaBatchLocalInspectionTool {
       }
     }
 
+    reportAlwaysFailingCalls(holder, visitor, reportedAnchors);
+
     reportConstantPushes(runner, holder, visitor, reportedAnchors);
 
     reportNullableArguments(visitor, holder, reportedAnchors);
@@ -337,6 +337,35 @@ public class DataFlowInspectionBase extends BaseJavaBatchLocalInspectionTool {
     }
   }
 
+  private static void reportAlwaysFailingCalls(ProblemsHolder holder,
+                                               DataFlowInstructionVisitor visitor,
+                                               HashSet<PsiElement> reportedAnchors) {
+    for (PsiCall call : visitor.getAlwaysFailingCalls()) {
+      PsiMethod method = call.resolveMethod();
+      if (method != null && reportedAnchors.add(call)) {
+        holder.registerProblem(getElementToHighlight(call), "The call to #ref always fails, according to its method contracts");
+      }
+    }
+  }
+
+  @NotNull private static PsiElement getElementToHighlight(@NotNull PsiCall call) {
+    PsiJavaCodeReferenceElement ref;
+    if (call instanceof PsiNewExpression) {
+      ref = ((PsiNewExpression)call).getClassReference();
+    }
+    else if (call instanceof PsiMethodCallExpression) {
+      ref = ((PsiMethodCallExpression)call).getMethodExpression();
+    }
+    else {
+      return call;
+    }
+    if (ref != null) {
+      PsiElement name = ref.getReferenceNameElement();
+      return name != null ? name : ref;
+    }
+    return call;
+  }
+
   private void reportConstantPushes(StandardDataFlowRunner runner,
                                     ProblemsHolder holder,
                                     DataFlowInstructionVisitor visitor,
@@ -465,8 +494,7 @@ public class DataFlowInspectionBase extends BaseJavaBatchLocalInspectionTool {
     List<LocalQuickFix> fixes = createNPEFixes(methodExpression.getQualifierExpression(), callExpression, onTheFly);
     ContainerUtil.addIfNotNull(fixes, ReplaceWithObjectsEqualsFix.createFix(callExpression, methodExpression));
 
-    PsiElement toHighlight = methodExpression.getReferenceNameElement();
-    if (toHighlight == null) toHighlight = methodExpression;
+    PsiElement toHighlight = getElementToHighlight(callExpression);
     holder.registerProblem(toHighlight,
                            InspectionsBundle.message("dataflow.message.npe.method.invocation"),
                            fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
@@ -805,7 +833,7 @@ public class DataFlowInspectionBase extends BaseJavaBatchLocalInspectionTool {
   private static class RedundantInstanceofFix implements LocalQuickFix {
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionsBundle.message("inspection.data.flow.redundant.instanceof.quickfix");
     }
 
@@ -824,12 +852,6 @@ public class DataFlowInspectionBase extends BaseJavaBatchLocalInspectionTool {
         }
       }
     }
-
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
   }
 
 
@@ -855,6 +877,7 @@ public class DataFlowInspectionBase extends BaseJavaBatchLocalInspectionTool {
     private final MultiMap<NullabilityProblem, PsiElement> myProblems = new MultiMap<>();
     private final Map<Pair<NullabilityProblem, PsiElement>, StateInfo> myStateInfos = ContainerUtil.newHashMap();
     private final Set<Instruction> myCCEInstructions = ContainerUtil.newHashSet();
+    private final Map<MethodCallInstruction, Boolean> myFailingCalls = new HashMap<>();
 
     @Override
     protected void onInstructionProducesCCE(TypeCastInstruction instruction) {
@@ -871,6 +894,36 @@ public class DataFlowInspectionBase extends BaseJavaBatchLocalInspectionTool {
       });
     }
 
+    Collection<PsiCall> getAlwaysFailingCalls() {
+      return StreamEx.of(myFailingCalls.keySet()).filter(this::isAlwaysFailing).map(MethodCallInstruction::getCallExpression).toList();
+    }
+
+    @Override
+    public DfaInstructionState[] visitMethodCall(MethodCallInstruction instruction,
+                                                 DataFlowRunner runner,
+                                                 DfaMemoryState memState) {
+      DfaInstructionState[] states = super.visitMethodCall(instruction, runner, memState);
+      if (hasNonTrivialFailingContracts(instruction)) {
+        boolean allFail = Arrays.stream(states).allMatch(s -> s.getMemoryState().peek() == runner.getFactory().getConstFactory().getContractFail());
+        myFailingCalls.put(instruction, allFail && isAlwaysFailing(instruction));
+      }
+      return states;
+    }
+
+    private static boolean hasNonTrivialFailingContracts(MethodCallInstruction instruction) {
+      List<MethodContract> contracts = instruction.getContracts();
+      return !contracts.isEmpty() && contracts.stream().allMatch(DataFlowInstructionVisitor::isNonTrivialFailingContract);
+    }
+
+    private static boolean isNonTrivialFailingContract(MethodContract contract) {
+      return contract.returnValue == MethodContract.ValueConstraint.THROW_EXCEPTION &&
+             Arrays.stream(contract.arguments).anyMatch(v -> v != MethodContract.ValueConstraint.ANY_VALUE);
+    }
+
+    private boolean isAlwaysFailing(MethodCallInstruction instruction) {
+      return !Boolean.FALSE.equals(myFailingCalls.get(instruction));
+    }
+
     @Override
     protected boolean checkNotNullable(DfaMemoryState state, DfaValue value, NullabilityProblem problem, PsiElement anchor) {
       boolean ok = super.checkNotNullable(state, value, problem, anchor);
index a4d2ea70c7c1850c592f16747cf50be090f384a7..0a8c02246af9d77d522d48d7642cbaa99abc1f7c 100644 (file)
@@ -325,7 +325,7 @@ public class LocalCanBeFinal extends BaseJavaBatchLocalInspectionTool {
   private static class AcceptSuggested implements LocalQuickFix {
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionsBundle.message("inspection.can.be.final.accept.quickfix");
     }
 
@@ -344,12 +344,6 @@ public class LocalCanBeFinal extends BaseJavaBatchLocalInspectionTool {
         LOG.error(e);
       }
     }
-
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
   }
 
   @Override
index 896f1061f6e19898f235d38f3769ec5d2dd63969..01d79e175996ca3dfd3e87001fc99ecbca378841 100644 (file)
@@ -167,7 +167,7 @@ public class RedundantTypeArgsInspection extends GenericsInspectionToolBase {
   private static class MyQuickFixAction implements LocalQuickFix {
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionsBundle.message("inspection.redundant.type.remove.quickfix");
     }
 
@@ -186,12 +186,6 @@ public class RedundantTypeArgsInspection extends GenericsInspectionToolBase {
         LOG.error(e);
       }
     }
-
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
   }
 
   //separate quickfix is needed to invalidate initial method reference
@@ -199,7 +193,7 @@ public class RedundantTypeArgsInspection extends GenericsInspectionToolBase {
   private static class MyMethodReferenceFixAction implements LocalQuickFix {
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionsBundle.message("inspection.redundant.type.remove.quickfix");
     }
 
@@ -212,11 +206,5 @@ public class RedundantTypeArgsInspection extends GenericsInspectionToolBase {
         expression.replace(createMethodReference(expression, typeElement));
       }
     }
-
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
   }
 }
index aa3f0d087de8a39fdd64bd56f6c987bb2f92d888..237f227c4aa3aee648fc986a30374192233c4af9 100644 (file)
@@ -43,16 +43,10 @@ class ChangeNullableDefaultsFix implements LocalQuickFix {
     myNullableName = nullable;
   }
 
-  @NotNull
-  @Override
-  public String getName() {
-    return "Make \"" + (myNotNullName != null ? myNotNullName : myNullableName) + "\" default annotation";
-  }
-
   @NotNull
   @Override
   public String getFamilyName() {
-    return getName();
+    return "Make \"" + (myNotNullName != null ? myNotNullName : myNullableName) + "\" default annotation";
   }
 
   @Override
index fadb67ca50ca57e886282eced8c8613adb232429..c4b07295251053844e63526a95203266d5281d5e 100644 (file)
@@ -133,7 +133,7 @@ public class RedundantCastInspection extends GenericsInspectionToolBase {
   private static class AcceptSuggested implements LocalQuickFix {
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionsBundle.message("inspection.redundant.cast.remove.quickfix");
     }
 
@@ -146,12 +146,6 @@ public class RedundantCastInspection extends GenericsInspectionToolBase {
         RedundantCastUtil.removeCast(cast);
       }
     }
-
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
   }
 
   @Override
index fa63230009c9b18c44a942836480f1b2d896cddb..f2198709ad8e9a7e952ede6b7f945ade47460c57 100644 (file)
@@ -156,16 +156,10 @@ public class UnnecessaryModuleDependencyInspection extends GlobalInspectionTool
       myDependency = dependency;
     }
 
-    @Override
-    @NotNull
-    public String getName() {
-      return "Remove dependency";
-    }
-
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
+      return "Remove dependency";
     }
 
     @Override
index be7c4c43d3af8695c605891fd3b52a687cc3f3de..4cb330bb8315df5addf6ef7db08e8fb9556dd4d7 100644 (file)
@@ -201,7 +201,7 @@ public class RedundantThrows extends GlobalJavaBatchInspectionTool {
 
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionsBundle.message("inspection.redundant.throws.remove.quickfix");
     }
 
@@ -225,12 +225,6 @@ public class RedundantThrows extends GlobalJavaBatchInspectionTool {
       }
     }
 
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
-
     private void removeExcessiveThrows(@Nullable RefMethod refMethod, @Nullable final PsiModifierListOwner element, final CommonProblemDescriptor[] problems) {
       try {
         @Nullable final PsiMethod psiMethod;
index 55ab95f5c3a7aef213e71ef2beadbeae11ed1010..6147a0d7ea5b9a22e1cab06335936bfaf07092d3 100644 (file)
@@ -131,16 +131,10 @@ public class UnusedLibrariesInspection extends GlobalInspectionTool {
       myFiles = files;
     }
 
-    @Override
-    @NotNull
-    public String getName() {
-      return myFiles == null ? InspectionsBundle.message("detach.library.quickfix.name") : InspectionsBundle.message("detach.library.roots.quickfix.name");
-    }
-
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
+      return myFiles == null ? InspectionsBundle.message("detach.library.quickfix.name") : InspectionsBundle.message("detach.library.roots.quickfix.name");
     }
 
     @Override
index cb9265c6a86bc74166ba2953ed6052a6b6734ced..065527c5564232eceb979dd263dcf7219b880556 100644 (file)
@@ -21,11 +21,15 @@ import com.intellij.codeInsight.lookup.*;
 import com.intellij.codeInsight.lookup.impl.JavaElementLookupRenderer;
 import com.intellij.codeInsight.template.*;
 import com.intellij.codeInsight.template.impl.ConstantNode;
+import com.intellij.codeInsight.template.impl.TemplateImpl;
 import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
 import com.intellij.codeInsight.template.impl.TemplateState;
 import com.intellij.featureStatistics.FeatureUsageTracker;
+import com.intellij.openapi.command.WriteCommandAction;
 import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.event.DocumentAdapter;
+import com.intellij.openapi.editor.event.DocumentEvent;
 import com.intellij.openapi.util.ClassConditionKey;
 import com.intellij.openapi.util.Disposer;
 import com.intellij.openapi.util.Key;
@@ -40,6 +44,8 @@ import com.intellij.psi.util.TypeConversionUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
+import java.util.concurrent.atomic.AtomicInteger;
+
 /**
  * @author peter
  */
@@ -243,6 +249,8 @@ public class JavaMethodCallElement extends LookupItem<PsiMethod> implements Type
     TemplateState templateState = TemplateManagerImpl.getTemplateState(editor);
     if (templateState == null) return;
 
+    setupNonFilledArgumentRemoving(editor, templateState);
+
     editor.putUserData(ARGUMENT_TEMPLATE_ACTIVE, this);
     Disposer.register(templateState, () -> {
       if (editor.getUserData(ARGUMENT_TEMPLATE_ACTIVE) == this) {
@@ -251,6 +259,42 @@ public class JavaMethodCallElement extends LookupItem<PsiMethod> implements Type
     });
   }
 
+  private static void setupNonFilledArgumentRemoving(final Editor editor, final TemplateState templateState) {
+    AtomicInteger maxEditedVariable = new AtomicInteger(-1);
+    editor.getDocument().addDocumentListener(new DocumentAdapter() {
+      @Override
+      public void documentChanged(DocumentEvent e) {
+        maxEditedVariable.set(Math.max(maxEditedVariable.get(), templateState.getCurrentVariableNumber()));
+      }
+    }, templateState);
+
+    templateState.addTemplateStateListener(new TemplateEditingAdapter() {
+      @Override
+      public void currentVariableChanged(TemplateState templateState, Template template, int oldIndex, int newIndex) {
+        maxEditedVariable.set(Math.max(maxEditedVariable.get(), oldIndex));
+      }
+
+      @Override
+      public void beforeTemplateFinished(TemplateState state, Template template, boolean brokenOff) {
+        if (brokenOff) {
+          removeUntouchedArguments((TemplateImpl)template);
+        }
+      }
+
+      private void removeUntouchedArguments(TemplateImpl template) {
+        int firstUnchangedVar = maxEditedVariable.get() + 1;
+        if (firstUnchangedVar >= template.getVariableCount()) return;
+
+        TextRange startRange = templateState.getVariableRange(template.getVariableNameAt(firstUnchangedVar));
+        TextRange endRange = templateState.getVariableRange(template.getVariableNameAt(template.getVariableCount() - 1));
+        if (startRange == null || endRange == null) return;
+
+        WriteCommandAction.runWriteCommandAction(editor.getProject(), () ->
+          editor.getDocument().deleteString(startRange.getStartOffset(), endRange.getEndOffset()));
+      }
+    });
+  }
+
   private boolean shouldInsertTypeParameters() {
     return myMayNeedExplicitTypeParameters && !getInferenceSubstitutor().equals(PsiSubstitutor.EMPTY) && myMethod.getParameterList().getParametersCount() == 0;
   }
index 75df5e590034d0042c09fd3dfddd32f3c84245ee..6106fc11576756a98b5cae1265a51c2d5c94bb07 100644 (file)
@@ -15,7 +15,6 @@
  */
 package com.intellij.codeInsight.daemon.impl;
 
-import com.intellij.openapi.editor.ex.EditorSettingsExternalizable;
 import com.intellij.openapi.util.Couple;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.psi.*;
@@ -38,6 +37,12 @@ public class ParameterNameHintsManager {
     Couple.of("key", "value"),
     Couple.of("min", "max")
   );
+  
+  private static final List<String> COMMON_METHODS = ContainerUtil.newArrayList(
+    "get", "set", "contains", "append", 
+    "print", "println", 
+    "charAt", "startsWith", "indexOf"
+  );
 
   @NotNull
   private final List<InlayInfo> myDescriptors;
@@ -45,12 +50,12 @@ public class ParameterNameHintsManager {
   public ParameterNameHintsManager(@NotNull PsiCallExpression callExpression) {
     PsiExpression[] callArguments = getArguments(callExpression);
     JavaResolveResult resolveResult = callExpression.resolveMethodGenerics();
-
-    EditorSettingsExternalizable settings = EditorSettingsExternalizable.getInstance();
+    
     List<InlayInfo> descriptors = Collections.emptyList();
-    if (callArguments.length >= settings.getMinArgsToShow() &&
-        hasLiteralExpression(callArguments) &&
-        resolveResult.getElement() instanceof PsiMethod) {
+    if (resolveResult.getElement() instanceof PsiMethod
+        && isMethodToShowParams(resolveResult)
+        && hasUnclearExpressions(callArguments)) 
+    {
       PsiMethod method = (PsiMethod)resolveResult.getElement();
       PsiParameter[] parameters = method.getParameterList().getParameters();
       descriptors = buildDescriptorsForLiteralArguments(callArguments, parameters, resolveResult);
@@ -59,6 +64,30 @@ public class ParameterNameHintsManager {
     myDescriptors = descriptors;
   }
 
+  private static boolean isMethodToShowParams(JavaResolveResult resolveResult) {
+    PsiElement element = resolveResult.getElement();
+    if (element instanceof PsiMethod) {
+      PsiMethod method = (PsiMethod)element;
+      return !isSetter(method) && !isCommonMethod(method);
+    }
+    return false;
+  }
+
+  private static boolean isCommonMethod(PsiMethod method) {
+    String methodName = method.getName();
+    return COMMON_METHODS.stream().anyMatch((name) -> methodName.equals(name));
+  }
+
+  private static boolean isSetter(PsiMethod method) {
+    String methodName = method.getName();
+    if (method.getParameterList().getParametersCount() == 1
+        && methodName.startsWith("set")
+        && methodName.length() > 3 && Character.isUpperCase(methodName.charAt(3))) {
+      return true;
+    }
+    return false;
+  }
+
   static boolean isUnclearExpression(@Nullable PsiElement callArgument) {
     if (callArgument instanceof PsiLiteralExpression)
       return true;
@@ -108,16 +137,12 @@ public class ParameterNameHintsManager {
       index++;
     }
 
-    if (ContainerUtil.find(descriptors, hint -> hasProperLength(hint.getText())) != null) {
-      return descriptors;
-    }
-
-    return ContainerUtil.emptyList();
+    return descriptors;
   }
 
   @NotNull
   private static InlayInfo createInlayInfo(@NotNull PsiExpression callArgument, @NotNull PsiParameter methodParam) {
-    String paramName = methodParam.getName() + ((methodParam.getType() instanceof PsiEllipsisType) ? "..." : "");
+    String paramName = ((methodParam.getType() instanceof PsiEllipsisType) ? "..." : "") + methodParam.getName();
     return new InlayInfo(paramName, callArgument.getTextRange().getStartOffset());
   }
 
@@ -150,7 +175,7 @@ public class ParameterNameHintsManager {
     PsiType argType = argument.getType();
     PsiType paramType = parameter.getType();
 
-    if (isVarargParam(paramType, argType) && hasLiteralInVarargs(paramIndex, callArguments)) {
+    if (isVarargParam(paramType, argType) && hasUnclearExpression(paramIndex, callArguments)) {
       return true;
     }
 
@@ -161,13 +186,8 @@ public class ParameterNameHintsManager {
 
     return false;
   }
-
-  private static boolean hasProperLength(@Nullable String paramName) {
-    final int minLength = EditorSettingsExternalizable.getInstance().getMinParamNameLengthToShow();
-    return paramName != null && paramName.length() >= minLength;
-  }
-
-  private static boolean hasLiteralInVarargs(int index, PsiExpression[] callArguments) {
+  
+  private static boolean hasUnclearExpression(int index, PsiExpression[] callArguments) {
     for (int i = index; i < callArguments.length; i++) {
       PsiExpression arg = callArguments[i];
       if (isUnclearExpression(arg)) return true;
@@ -180,7 +200,7 @@ public class ParameterNameHintsManager {
     return param instanceof PsiEllipsisType && TypeConversionUtil.isAssignable(deepType, argument);
   }
 
-  private static boolean hasLiteralExpression(@NotNull PsiExpression[] arguments) {
+  private static boolean hasUnclearExpressions(@NotNull PsiExpression[] arguments) {
     for (PsiExpression argument : arguments) {
       if (isUnclearExpression(argument)) return true;
     }
index 5fa4f4285051a2dd9736f5602f7fa88d153ada0c..1f8caf6565ed9251fa2ef4220a11611ac987c96d 100644 (file)
@@ -42,18 +42,11 @@ public class DefaultAnnotationParamInspection extends BaseJavaBatchLocalInspecti
         if (defaultValue == null) return;
         if (areEqual(value, defaultValue)) {
           holder.registerProblem(value, "Redundant default parameter value assignment", ProblemHighlightType.LIKE_UNUSED_SYMBOL, new LocalQuickFix() {
-            @Nls
-            @NotNull
-            @Override
-            public String getName() {
-              return "Remove redundant parameter";
-            }
-
             @Nls
             @NotNull
             @Override
             public String getFamilyName() {
-              return getName();
+              return "Remove redundant parameter";
             }
 
             @Override
index 3a5da370be6746105caa6154ef35694801fc738d..6ffd46aca6df5a53bd8eb8a44f03585a373b7b07 100644 (file)
@@ -36,7 +36,7 @@ public class RemoveInitializerFix implements LocalQuickFix {
 
   @Override
   @NotNull
-  public String getName() {
+  public String getFamilyName() {
     return InspectionsBundle.message("inspection.unused.assignment.remove.quickfix");
   }
 
@@ -91,10 +91,4 @@ public class RemoveInitializerFix implements LocalQuickFix {
       LOG.error(e);
     }
   }
-  
-  @Override
-  @NotNull
-  public String getFamilyName() {
-    return getName();
-  }
 }
index f06ba2a958cfeb410840bde6304cbc5e817c2594..53340a90d5b63beecdbedd4230dd941d1a25b75e 100644 (file)
@@ -210,16 +210,10 @@ class UnusedParametersInspection extends GlobalJavaBatchInspectionTool {
       return myHint;
     }
 
-    @Override
-    @NotNull
-    public String getName() {
-      return InspectionsBundle.message("inspection.unused.parameter.delete.quickfix");
-    }
-
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
+      return InspectionsBundle.message("inspection.unused.parameter.delete.quickfix");
     }
 
     @Override
index e0927704d563b07163d28d2e60dc1574795220c1..58cbd1d85fc45b3f51729a4ef08c109e65a26c13 100644 (file)
@@ -84,16 +84,10 @@ public class DefaultFileTemplateUsageInspection extends BaseJavaLocalInspectionT
       myReplaceTemplateFix = replaceTemplateFix;
     }
 
-    @Override
-    @NotNull
-    public String getName() {
-      return InspectionsBundle.message("default.file.template.edit.template");
-    }
-
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
+      return InspectionsBundle.message("default.file.template.edit.template");
     }
 
     @Override
index d13986e35a1afb0c545a642a6b70c634c965cc5c..99ded0b3b8339158d2f93700eb121decbcc90926 100644 (file)
@@ -23,15 +23,9 @@ import org.jetbrains.annotations.NotNull;
  * @author cdr
  */
 public abstract class ReplaceWithFileTemplateFix implements LocalQuickFix {
-  @Override
-  @NotNull
-  public String getName() {
-    return InspectionsBundle.message("default.file.template.replace.with.actual.file.template");
-  }
-
   @Override
   @NotNull
   public String getFamilyName() {
-    return getName();
+    return InspectionsBundle.message("default.file.template.replace.with.actual.file.template");
   }
 }
index 6a108d6ed4a5b96a76e4a61e0bf5079fda58f5c9..1a1cd17b857bba256cc03db51e0b750da55102e1 100644 (file)
@@ -352,7 +352,7 @@ public class EmptyMethodInspection extends GlobalJavaBatchInspectionTool {
 
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return QUICK_FIX_NAME;
     }
 
@@ -361,12 +361,6 @@ public class EmptyMethodInspection extends GlobalJavaBatchInspectionTool {
        applyFix(project, new ProblemDescriptor[]{descriptor}, new ArrayList<>(), null);
     }
 
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
-
     private void deleteHierarchy(RefMethod refMethod, List<PsiElement> result) {
       Collection<RefMethod> derivedMethods = refMethod.getDerivedMethods();
       RefMethod[] refMethods = derivedMethods.toArray(new RefMethod[derivedMethods.size()]);
index 3887640051c4cde85c1058c13a65d68a1de2a42c..c315401c6ceb6c7a19262b04929de4967930da0e 100644 (file)
@@ -47,18 +47,12 @@ public class EqualsAndHashcode extends EqualsAndHashcodeBase {
 
     @NotNull
     @Override
-    public String getName() {
+    public String getFamilyName() {
       return myHasEquals
              ? InspectionsBundle.message("inspection.equals.hashcode.generate.hashcode.quickfix")
              : InspectionsBundle.message("inspection.equals.hashcode.generate.equals.quickfix");
     }
 
-    @NotNull
-    @Override
-    public String getFamilyName() {
-      return getName();
-    }
-
     @Override
     public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
       final Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
index 816a191b3a6b860ac0d372752c3b1c7a837d1be0..4860cfa1949c75cd84b414f2d37e9560c470d00a 100644 (file)
@@ -69,16 +69,10 @@ public class JavaDocReferenceInspection extends JavaDocReferenceInspectionBase {
       myUnboundParams = unboundParams;
     }
 
-    @Override
-    @NotNull
-    public String getName() {
-      return "Change to ...";
-    }
-
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
+      return "Change to ...";
     }
 
     @Override
index 2d84ba4350a0486a318f0323003bfa14fb4ecf55..6cc93d4cd16537a9bec10780965adfa1f8bb2f13 100644 (file)
@@ -203,16 +203,10 @@ public class MagicConstantInspection extends BaseJavaLocalInspectionTool {
     String text = "No IDEA annotations attached to the JDK " + finalJdk.getName() + (path == null ? "" : " (" + FileUtil.toSystemDependentName(path) + ")")
                   +", some issues will not be found";
     holder.registerProblem(file, text, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new LocalQuickFix() {
-      @NotNull
-      @Override
-      public String getName() {
-        return "Attach annotations";
-      }
-
       @NotNull
       @Override
       public String getFamilyName() {
-        return getName();
+        return "Attach annotations";
       }
 
       @Override
index ad340fb68355178422d3f5969a2f7ac368fabc1c..d7ab946a7ed737f3e0a7854d35e54657599f9585 100644 (file)
@@ -54,12 +54,6 @@ public class RedundantArrayForVarargsCallInspection extends GenericsInspectionTo
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
-    }
-
-    @Override
-    @NotNull
-    public String getName() {
       return InspectionsBundle.message("inspection.redundant.array.creation.quickfix");
     }
   }
index 69c88c46a6d4b029081764d6f9af4ab48f6d1703..26af65fb83bdc60bfcd243d6dcaa5c054c8fcd93 100644 (file)
@@ -45,18 +45,11 @@ public class SillyAssignmentInspection extends SillyAssignmentInspectionBase {
 
   private static class RemoveSillyAssignmentFix implements LocalQuickFix {
 
-    @Nls
-    @NotNull
-    @Override
-    public String getName() {
-      return InspectionsBundle.message("assignment.to.itself.quickfix.name");
-    }
-
     @Nls
     @NotNull
     @Override
     public String getFamilyName() {
-      return getName();
+      return InspectionsBundle.message("assignment.to.itself.quickfix.name");
     }
 
     @Override
index f0b92e20c6661c0123885991a64397b8928c2781..f295d2361d9cc820103768df72811a221d6e23dc 100644 (file)
@@ -154,7 +154,7 @@ public class UnusedReturnValue extends GlobalJavaBatchInspectionTool{
 
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionsBundle.message("inspection.unused.return.value.make.void.quickfix");
     }
 
@@ -179,12 +179,6 @@ public class UnusedReturnValue extends GlobalJavaBatchInspectionTool{
       return false;
     }
 
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
-
     private static void makeMethodHierarchyVoid(Project project, @NotNull PsiMethod psiMethod) {
       replaceReturnStatements(psiMethod);
       for (final PsiMethod oMethod : OverridingMethodsSearch.search(psiMethod)) {
index c993cc143b6e1aac2fbd9f1f79dc83caee596a2e..69a70e61654644c1393ff4ccae9d2c4abe3d2b16 100644 (file)
@@ -50,7 +50,7 @@ public abstract class BaseConvertToLocalQuickFix<V extends PsiVariable> implemen
 
   @Override
   @NotNull
-  public final String getName() {
+  public final String getFamilyName() {
     return InspectionsBundle.message("inspection.convert.to.local.quickfix");
   }
 
@@ -225,12 +225,6 @@ public abstract class BaseConvertToLocalQuickFix<V extends PsiVariable> implemen
     }
   }
 
-  @Override
-  @NotNull
-  public String getFamilyName() {
-    return getName();
-  }
-
   @Nullable
   private static PsiElement getAnchorElement(PsiCodeBlock anchorBlock, @NotNull PsiElement firstElement) {
     PsiElement element = firstElement;
index 67b9e9a47d07ede4926641f727057e068db902df..38ece57ff05e80c905f7f3852f6af766b0ee8abf 100644 (file)
@@ -197,12 +197,9 @@ public class LambdaUtil {
     for (HierarchicalMethodSignature signature : signatures) {
       boolean subsignature = true;
       for (HierarchicalMethodSignature methodSignature : signatures) {
-        if (!signature.equals(methodSignature)) {
-          if (!MethodSignatureUtil.isSubsignature(signature, methodSignature) &&
-              !skipMethod(signature, methodSignature)) {
-            subsignature = false;
-            break;
-          }
+        if (!signature.equals(methodSignature) && !skipMethod(signature, methodSignature)) {
+          subsignature = false;
+          break;
         }
       }
       if (subsignature) return Collections.singletonList(signature);
diff --git a/java/java-tests/testData/inspection/dataFlow/contractCheck/CheckConstructorContracts.java b/java/java-tests/testData/inspection/dataFlow/contractCheck/CheckConstructorContracts.java
new file mode 100644 (file)
index 0000000..a10d634
--- /dev/null
@@ -0,0 +1,15 @@
+import org.jetbrains.annotations.Contract;
+
+class Zoo {
+  @Contract(<warning descr="Invalid contract return value for a constructor: null">"null->null"</warning> )
+  Zoo(Object o) {}
+
+  @Contract("_->fail" )
+  <warning descr="Contract clause '_ -> fail' is violated: no exception is thrown">Zoo</warning>(int o) {}
+
+  @Contract("true->fail" )
+  Zoo(boolean o) {
+    if (o) throw new RuntimeException();
+  }
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/dataFlow/fixture/ContractConstructor.java b/java/java-tests/testData/inspection/dataFlow/fixture/ContractConstructor.java
new file mode 100644 (file)
index 0000000..c29ed07
--- /dev/null
@@ -0,0 +1,17 @@
+import org.jetbrains.annotations.*;
+
+class CandidateInfo<T> {
+  @Contract("null, true, _ -> fail")
+  private CandidateInfo(@Nullable Object candidate, boolean applicable, boolean fullySubstituted) {
+    assert !applicable || candidate != null;
+  }
+
+  static void test() {
+    new <warning descr="The call to CandidateInfo always fails, according to its method contracts">CandidateInfo</warning>(null, true, false);
+    new <warning descr="The call to CandidateInfo always fails, according to its method contracts">CandidateInfo</warning>(null, true, true);
+
+    new CandidateInfo(null, false, true);
+    new CandidateInfo(new Object(), true, true);
+    new CandidateInfo(new Object(), false, true);
+  }
+}
\ No newline at end of file
index 43c15c19eb7067f3a06c14058651378f3437ea2d..e25c89ab650f42b5c1e2bf25f3461a08ff697451 100644 (file)
@@ -8,7 +8,7 @@ class Test {
     String a = notNull(getNullable());
 
     @NotNull
-    String b = notNull(null);
+    String b = <warning descr="The call to notNull always fails, according to its method contracts">notNull</warning>(null);
   }
 
   @Nullable
index 23956dad34a920d8fa9dccc6e1c068d1fd5e6ed8..d5e1cc9322a62ea053e91398e74dedc21ef00a75 100644 (file)
@@ -121,7 +121,7 @@ public class VarArgTest {
 """)
     
     onLineStartingWith("testBooleanVarargs")
-        .assertInlays("test->13", "booleans...->false")
+        .assertInlays("test->13", "...booleans->false")
   }
   
   fun `test no hint if varargs null`() {
@@ -140,7 +140,7 @@ public class VarArgTest {
 }
 """)
     
-    onLineStartingWith("testBooleanVarargs").assertNoInlays()
+    onLineStartingWith("testBooleanVarargs").assertInlays("test->13")
   }
   
   fun `test multiple vararg hint`() {
@@ -160,7 +160,7 @@ public class VarArgTest {
 """)
     
     onLineStartingWith("testBooleanVarargs")
-        .assertInlays("test->13", "booleans...->false")
+        .assertInlays("test->13", "...booleans->false")
   }
   
   fun `test do not inline if parameter length is one or two`() {
@@ -179,7 +179,7 @@ public class CharSymbol {
 }
 """)
     
-    onLineStartingWith("count").assertNoInlays()
+    onLineStartingWith("count").assertInlays("t->1", "fa->false")
   }
   
   fun `test do not inline known subsequent parameter names`() {
@@ -274,12 +274,47 @@ public class Test {
 """)
     
     onLineStartingWith("System")
-        .assertInlays("""x->"AAA"""")
+        .assertNoInlays()
     
     onLineStartingWith("main(t")
         .assertInlays("isActive->true", "requestFocus->false", "xoo->2")
   }
   
+  
+  fun `test ignored methods`() {
+    setup("""
+public class Test {
+  
+  public void main() {
+    println("A");
+    print("A");
+    get(1);
+    set(1, new Object());
+    setNewIndex(10);
+    "sss".contains("s");
+    append("sdfsdf");
+    "sfsdf".startWith("s");
+    "sss".charAt(3);
+    
+    clearStatus(false);
+  }
+  
+  void print(String s) {}
+  void println(String s) {}
+  void get(int index) {}
+  void set(int index, Object object) {}
+  void append(String s) {}
+  void clearStatus(boolean updatedRecently) {}
+
+}
+""")
+
+    val inlays = getInlays()
+    assertThat(inlays).hasSize(1)
+    
+    assertThat(inlays[0].offset).isEqualTo(myFixture.editor.document.text.indexOf("false"))
+  }
+  
   fun `test hints for generic arguments`() {
     val settings = EditorSettingsExternalizable.getInstance()
     settings.minArgsToShow = 1
@@ -367,7 +402,7 @@ public class VarArgTest {
 """)
     
     onLineStartingWith("testBooleanVarargs")
-        .assertInlays("booleans...->isCheck")
+        .assertInlays("...booleans->isCheck")
   }
 
   fun `test if any param matches inline all`() {
@@ -443,6 +478,10 @@ public class VarArgTest {
         .assertInlays("test->this", "endIndex->1000")
   }
 
+  private fun getInlays(): List<Inlay> {
+    val editor = myFixture.editor
+    return editor.inlayModel.getInlineElementsInRange(0, editor.document.textLength)
+  }
 
   private fun onLineStartingWith(text: String): InlayAssert {
     val range = getLineRangeStartingWith(text)
index e220967e9a3c9d42c8e01a8829ccb7076189a29c..8d5eccab914cca14035b17a8f21ee2feb9a196d9 100644 (file)
@@ -44,6 +44,7 @@ public class ContractCheckTest extends LightCodeInsightFixtureTestCase {
   public void testVarargInferred() { doTest(); }
   public void testDoubleParameter() { doTest(); }
   public void testReturnPrimitiveArray() { doTest(); }
+  public void testCheckConstructorContracts() { doTest(); }
 
   public void testPassingVarargsToDelegate() { doTest(); }
 }
index a661955992af3d4ca269b88acce17c9b307345f2..7128b952ae18267a4c469d29a3923e2adb5a32c1 100644 (file)
@@ -237,6 +237,7 @@ public class DataFlowInspectionTest extends DataFlowInspectionTestCase {
   public void testContractPreservesUnknownMethodNullability() { doTest(); }
   public void testContractSeveralClauses() { doTest(); }
   public void testContractVarargs() { doTest(); }
+  public void testContractConstructor() { doTest(); }
 
   public void testBoxingImpliesNotNull() { doTest(); }
   public void testLargeIntegersAreNotEqualWhenBoxed() { doTest(); }
index b78e2de180d4dda13f4350cb13237982fece9189..cfbf21525baec2e548915074fc12bcf389eb6cab 100644 (file)
Binary files a/java/mockJDK-1.7/jre/lib/annotations.jar and b/java/mockJDK-1.7/jre/lib/annotations.jar differ
index 3f47bb1fb661773c2e04d485cadc94417f08e4dc..d1fa0b9ca1dfedc6815612c45e159c3819bdb4d9 100644 (file)
  */
 package com.siyeh.ig;
 
+import com.intellij.codeHighlighting.HighlightDisplayLevel;
+import com.intellij.codeInsight.daemon.HighlightDisplayKey;
 import com.intellij.codeInspection.InspectionProfileEntry;
+import com.intellij.codeInspection.ex.InspectionProfileImpl;
 import com.intellij.openapi.module.ModuleManager;
+import com.intellij.openapi.project.Project;
 import com.intellij.openapi.projectRoots.Sdk;
 import com.intellij.openapi.roots.ModuleRootManager;
 import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.profile.codeInspection.ProjectInspectionProfileManager;
 import com.intellij.psi.JavaPsiFacade;
 import com.intellij.psi.PsiClass;
 import com.intellij.psi.search.GlobalSearchScope;
@@ -44,6 +49,14 @@ public abstract class LightInspectionTestCase extends LightCodeInsightFixtureTes
     final InspectionProfileEntry inspection = getInspection();
     if (inspection != null) {
       myFixture.enableInspections(inspection);
+
+      final Project project = myFixture.getProject();
+      final HighlightDisplayKey displayKey = HighlightDisplayKey.find(inspection.getShortName());
+      final InspectionProfileImpl currentProfile = ProjectInspectionProfileManager.getInstanceImpl(project).getCurrentProfile();
+      final HighlightDisplayLevel errorLevel = currentProfile.getErrorLevel(displayKey, null);
+      if (errorLevel == HighlightDisplayLevel.DO_NOT_SHOW) {
+        currentProfile.setErrorLevel(displayKey, HighlightDisplayLevel.WARNING, project);
+      }
     }
 
     Sdk sdk = ModuleRootManager.getInstance(ModuleManager.getInstance(getProject()).getModules()[0]).getSdk();
index 64af4b986c5f847308d614dd391b7fa1858de1b5..34c7f8d23487564806839a6693f9fbcab88434c8 100644 (file)
@@ -197,13 +197,14 @@ final class BuildSession implements Runnable, CanceledStatus {
       msgHandler.processMessage(new CompilerMessage("build", BuildMessage.Kind.ERROR, "Cannot determine build data storage root for project " + myProjectPath));
       return;
     }
-    if (!dataStorageRoot.exists()) {
+    final boolean storageFilesAbsent = !dataStorageRoot.exists() || !new File(dataStorageRoot, FS_STATE_FILE).exists();
+    if (storageFilesAbsent) {
       // invoked the very first time for this project
       myBuildRunner.setForceCleanCaches(true);
     }
     final ProjectDescriptor preloadedProject = myPreloadedData != null? myPreloadedData.getProjectDescriptor() : null;
     final DataInputStream fsStateStream = 
-      preloadedProject != null || myInitialFSDelta == null /*this will force FS rescan*/? null : createFSDataStream(dataStorageRoot, myInitialFSDelta.getOrdinal());
+      storageFilesAbsent || preloadedProject != null || myInitialFSDelta == null /*this will force FS rescan*/? null : createFSDataStream(dataStorageRoot, myInitialFSDelta.getOrdinal());
 
     if (fsStateStream != null || myPreloadedData != null) {
       // optimization: check whether we can skip the build
index 24a3d927f632f9f1b442a7ec5acfaff185f697fb..ce4220603e7da95c7265b7967e20eb5dc7e30be2 100644 (file)
@@ -140,16 +140,10 @@ public class JsonStandardComplianceInspection extends LocalInspectionTool {
   }
 
   private static class AddDoubleQuotesFix implements LocalQuickFix {
-    @NotNull
-    @Override
-    public String getName() {
-      return JsonBundle.message("quickfix.add.double.quotes.desc");
-    }
-
     @NotNull
     @Override
     public String getFamilyName() {
-      return getName();
+      return JsonBundle.message("quickfix.add.double.quotes.desc");
     }
 
     @Override
index e585d3bc49b1f2e2118bbf81500762b73b23c80e..2b0c46077a6cba6906b610036ad44517701eeb82 100644 (file)
@@ -37,7 +37,9 @@ public interface QuickFix<D extends CommonProblemDescriptor> extends WriteAction
    */
   @Nls(capitalization = Nls.Capitalization.Sentence)
   @NotNull
-  String getName();
+  default String getName() {
+    return getFamilyName();
+  }
 
   /**
    * @return text to appear in "Apply Fix" popup when multiple Quick Fixes exist (in the results of batch code inspection). For example,
index 153d936341326d832f3a7999fa0613e30bc22861..5b3b97e379e1cfb731b849bf6953238c840258d9 100644 (file)
@@ -268,8 +268,10 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr
           return;
         }
 
-        int change = Math.abs(e.getWheelRotation());
-        boolean increase = e.getWheelRotation() <= 0;
+        int rotation = e.getWheelRotation();
+        if (rotation == 0) return;
+        int change = Math.abs(rotation);
+        boolean increase = rotation <= 0;
         FontSize newFontSize = getQuickDocFontSize();
         for (; change > 0; change--) {
           if (increase) {
index 59ff3be18f905870707b7acd372e8a993b918fc5..5145043cee676bb89dec1eaa7b277cbe34b53096 100644 (file)
@@ -23,6 +23,11 @@ import com.intellij.codeInsight.template.impl.TemplateState;
  */
 public interface TemplateEditingListener {
   void beforeTemplateFinished(TemplateState state, Template template);
+
+  default void beforeTemplateFinished(TemplateState state, Template template, boolean brokenOff) {
+    beforeTemplateFinished(state, template);
+  }
+
   void templateFinished(Template template, boolean brokenOff);
   void templateCancelled(Template template);
   void currentVariableChanged(TemplateState templateState, Template template, int oldIndex, int newIndex);
index 2e9f250f12be0931e4e89427dd43b903fd537525..bcd4b755470eb7c145b977c7da2270331d3ea50b 100644 (file)
@@ -1090,7 +1090,7 @@ public class TemplateState implements Disposable {
 
   private void cleanupTemplateState(boolean brokenOff) {
     final Editor editor = myEditor;
-    fireBeforeTemplateFinished();
+    fireBeforeTemplateFinished(brokenOff);
     if (!isDisposed()) {
       int oldVar = myCurrentVariableNumber;
       setCurrentVariableNumber(-1);
@@ -1398,9 +1398,9 @@ public class TemplateState implements Disposable {
     }
   }
 
-  private void fireBeforeTemplateFinished() {
+  private void fireBeforeTemplateFinished(boolean brokenOff) {
     for (TemplateEditingListener listener : myListeners) {
-      listener.beforeTemplateFinished(this, myTemplate);
+      listener.beforeTemplateFinished(this, myTemplate, brokenOff);
     }
   }
 
index 3666be983e233e79416177c21794643671ef33c0..8a129f9aaad61d8f5676a55df0b070b8ee2d26f4 100644 (file)
@@ -218,16 +218,10 @@ public class LossyEncodingInspection extends LocalInspectionTool {
   }
 
   private static class ChangeEncodingFix implements LocalQuickFix {
-    @NotNull
-    @Override
-    public String getName() {
-      return "Change file encoding";
-    }
-
     @NotNull
     @Override
     public String getFamilyName() {
-      return getName();
+      return "Change file encoding";
     }
 
     @Override
index 17d262159cc51b5594e043a1f56df9acc1ce736f..487b1cbbfb68b2fb860932c24c68f26a9ecfee2e 100644 (file)
@@ -39,16 +39,10 @@ public class ProblematicWhitespaceInspection extends LocalInspectionTool {
 
   private static class ShowWhitespaceFix implements LocalQuickFix {
 
-    @NotNull
-    @Override
-    public String getName() {
-      return InspectionsBundle.message("problematic.whitespace.show.whitespaces.quickfix");
-    }
-
     @NotNull
     @Override
     public String getFamilyName() {
-      return getName();
+      return InspectionsBundle.message("problematic.whitespace.show.whitespaces.quickfix");
     }
 
     @Override
index 891c6ddad4630e0bc6a7dea7498c56e79dae77af..46c0b9ca1622c1c3e38f0811b4ab36f4f3984376 100644 (file)
@@ -226,33 +226,7 @@ public abstract class AbstractBlockWrapper {
       //    }
       AlignmentImpl alignment = child.getAlignment();
       if (alignment != null) {
-        // Generally, we want to handle situation like the one below:
-        //   test("text", new Runnable() { 
-        //            @Override
-        //            public void run() {
-        //            }
-        //        },
-        //        new Runnable() {
-        //            @Override
-        //            public void run() {
-        //            }
-        //        }
-        //   );
-        // I.e. we want 'run()' method from the first anonymous class to be aligned with the 'run()' method of the second anonymous class.
-
-        AbstractBlockWrapper anchorBlock = alignment.getOffsetRespBlockBefore(child);
-        if (anchorBlock == null) {
-          anchorBlock = this;
-          if (anchorBlock instanceof CompositeBlockWrapper) {
-            List<AbstractBlockWrapper> children = ((CompositeBlockWrapper)anchorBlock).getChildren();
-            for (AbstractBlockWrapper c : children) {
-              if (c.getStartOffset() != getStartOffset() && c.getStartOffset() < targetBlockStartOffset) {
-                anchorBlock = c;
-                break;
-              }
-            }
-          }
-        }
+        AbstractBlockWrapper anchorBlock = getAnchorBlock(child, targetBlockStartOffset, alignment);
         return anchorBlock.getNumberOfSymbolsBeforeBlock();
       }
       childIndent = CoreFormatterUtil.getIndent(options, child, getStartOffset());
@@ -321,6 +295,38 @@ public abstract class AbstractBlockWrapper {
     }
   }
 
+  @NotNull
+  private AbstractBlockWrapper getAnchorBlock(AbstractBlockWrapper child, int targetBlockStartOffset, AlignmentImpl alignment) {
+    // Generally, we want to handle situation like the one below:
+    //   test("text", new Runnable() { 
+    //            @Override
+    //            public void run() {
+    //            }
+    //        },
+    //        new Runnable() {
+    //            @Override
+    //            public void run() {
+    //            }
+    //        }
+    //   );
+    // I.e. we want 'run()' method from the first anonymous class to be aligned with the 'run()' method of the second anonymous class.
+
+    AbstractBlockWrapper anchorBlock = alignment.getOffsetRespBlockBefore(child);
+    if (anchorBlock == null) {
+      anchorBlock = this;
+      if (anchorBlock instanceof CompositeBlockWrapper) {
+        List<AbstractBlockWrapper> children = ((CompositeBlockWrapper)anchorBlock).getChildren();
+        for (AbstractBlockWrapper c : children) {
+          if (c.getStartOffset() != getStartOffset() && c.getStartOffset() < targetBlockStartOffset) {
+            anchorBlock = c;
+            break;
+          }
+        }
+      }
+    }
+    return anchorBlock;
+  }
+
   /**
    * Allows to answer if current wrapped block has a child block that is located before given block and has line feed.
    *
index 4f42e77828fb8c8b4ac80321518fca27341ab366..f7f02589ed03660b6f1efa08774502ff9071ea7f 100644 (file)
@@ -61,7 +61,7 @@
                     </properties>
                     <border type="none"/>
                     <children>
-                      <component id="db08a" class="javax.swing.JEditorPane" binding="myDescriptionTextArea">
+                      <component id="db08a" class="javax.swing.JEditorPane" binding="myDescriptionTextArea" custom-create="true">
                         <constraints/>
                         <properties>
                           <contentType value="text/html"/>
index 59695873a77aa3108d6899c6c5c5af8338a45ea4..5961f6c3b86edf4ee4d60f7b2884bb7878a89d54 100644 (file)
@@ -33,6 +33,7 @@ import com.intellij.util.Function;
 import com.intellij.util.ObjectUtils;
 import com.intellij.util.ui.JBUI;
 import com.intellij.util.ui.PlatformColors;
+import com.intellij.util.ui.SwingHelper;
 import com.intellij.util.ui.UIUtil;
 import com.intellij.util.ui.update.UiNotifyConnector;
 import org.jetbrains.annotations.NotNull;
@@ -337,6 +338,7 @@ public class ManagePackagesDialog extends DialogWrapper {
 
   private void createUIComponents() {
     myFilter = new MyPackageFilter();
+    myDescriptionTextArea = SwingHelper.createHtmlViewer(true, null, null, null);
   }
 
   public void setOptionsText(@NotNull String optionsText) {
index f203dabcb4c5b2cf4b06de1b42ada61d3f3c7716..6be32a0e4103519c180748e21dfcfa1ee8276737 100644 (file)
@@ -36,7 +36,7 @@ public class MouseShortcut extends Shortcut {
   public static int getButton(MouseEvent event) {
     if (event instanceof MouseWheelEvent) {
       MouseWheelEvent wheel = (MouseWheelEvent)event;
-      return 0 < wheel.getWheelRotation()
+      return 0 < wheel.getPreciseWheelRotation()
              ? BUTTON_WHEEL_DOWN
              : BUTTON_WHEEL_UP;
     }
index 69e969d91858855ae50a555f50b87f8e5cdc6d02..be8e65fed8eec924865e8d7d486ed61b5b1bd07d 100644 (file)
@@ -55,6 +55,8 @@ public class JBPopupMenu extends JPopupMenu {
   public void processMouseWheelEvent(MouseWheelEvent e) {
     if (!isShowing()) return;
 
+    int rotation = e.getWheelRotation();
+    if (rotation == 0) return;
     if (e.getComponent() != this) {
       e = (MouseWheelEvent)SwingUtilities.convertMouseEvent(e.getComponent(), e, this);
     }
@@ -62,7 +64,7 @@ public class JBPopupMenu extends JPopupMenu {
     SwingUtilities.convertPointToScreen(p, this);
     Point tPoint = getLocationOnScreen();
     if (p.x >= tPoint.x && p.x <= tPoint.x + getWidth() && p.y >= tPoint.y && p.y <= tPoint.y + getHeight()) {
-      myLayout.updateShift(e.getWheelRotation() * 10);
+      myLayout.updateShift(rotation * 10);
     }
   }
 
index ccae37445e31d3a9a31cbe03c3df7de35f889a4a..f2cc6f9dd2947498a607039ea5d24d60010b32af 100644 (file)
@@ -37,6 +37,12 @@ public interface ToolWindowFactory {
    */
   default void init(ToolWindow window) {}
 
+  /**
+   * Check if toolwindow (and its stripe button) should be visible after startup.
+   * @see ToolWindow#isAvailable()
+   */
+  default boolean shouldBeAvailable(@NotNull Project project) { return true;}
+
   /**
    * Tool Window saves its state on project close and restore on when project opens
    * In some cases, it is useful to postpone Tool Window activation until user explicitly activates it.
index 165c38ab3140870cef401a839b3a48a382dfd03c..b1646d78196bd6bf35814fb85bb376ac7a84b0e6 100644 (file)
@@ -91,6 +91,8 @@ public class PortField extends JSpinner {
 
     @Override
     public void mouseWheelMoved(MouseWheelEvent e) {
+      int units = e.getUnitsToScroll();
+      if (units == 0) return;
       final Object source = e.getSource();
       if (source instanceof JSpinner) {
         final JSpinner spinner = (JSpinner)source;
@@ -101,7 +103,7 @@ public class PortField extends JSpinner {
           final Number stepSize = numberModel.getStepSize();
           final Comparable minimum = numberModel.getMinimum();
           final Comparable maximum = numberModel.getMaximum();
-          final Number newValue = calculateNewValue(value, stepSize, minimum, maximum, e.getUnitsToScroll());
+          final Number newValue = calculateNewValue(value, stepSize, minimum, maximum, units);
           if (newValue != null) {
             numberModel.setValue(newValue);
           }
index 939020ccc266683b0a895587d4de7640f472238b..61acf6325506cae7396c180a8566c629533f58db 100644 (file)
@@ -245,13 +245,12 @@ public class JBTabsImpl extends JComponent
         }
       }
     });
-    addMouseWheelListener(new MouseWheelListener() {
-      @Override
-      public void mouseWheelMoved(MouseWheelEvent e) {
-        if (mySingleRowLayout.myLastSingRowLayout != null) {
-          mySingleRowLayout.scroll(e.getUnitsToScroll() * mySingleRowLayout.getScrollUnitIncrement());
-          revalidateAndRepaint(false);
-        }
+    addMouseWheelListener(event -> {
+      int units = event.getUnitsToScroll();
+      if (units == 0) return;
+      if (mySingleRowLayout.myLastSingRowLayout != null) {
+        mySingleRowLayout.scroll(units * mySingleRowLayout.getScrollUnitIncrement());
+        revalidateAndRepaint(false);
       }
     });
 
index 4aa2ea1e946d05d4b81186a361461d82f2ddfc62..bda01679295f2ec5b7c695e9989e45abbfd97380 100644 (file)
@@ -56,6 +56,8 @@ class AsyncFilterRunner {
   }
 
   void highlightHyperlinks(final Filter customFilter, final int startLine, final int endLine) {
+    if (endLine < 0) return;
+
     Computable<FilterResults> bgComputation = highlightHyperlinksAsync(customFilter, startLine, endLine);
     if (ApplicationManager.getApplication().isWriteAccessAllowed()) {
       bgComputation.compute().applyHighlights(myHyperlinks);
index 81c0b5e97f0ee2eb838d2a748f4104fd62ff818b..d7773879c4483ff92450828e574d7f24e7f9dcac 100644 (file)
@@ -319,6 +319,7 @@ public class LaterInvocator {
 
   @NotNull
   public static ModalityState getCurrentModalityState() {
+    ApplicationManager.getApplication().assertIsDispatchThread();
     return ourModalityStack.peek();
   }
 
index 768c285ad94b4895c2a2cd9923e9e94446d3b5a7..f4261e87558a66958ab247cdfe0ce618194ead33 100644 (file)
@@ -800,6 +800,7 @@ public final class EditorUtil {
   }
 
   public static boolean isChangeFontSize(@NotNull MouseWheelEvent e) {
+    if (e.getWheelRotation() == 0) return false;
     return SystemInfo.isMac
            ? !e.isControlDown() && e.isMetaDown() && !e.isAltDown() && !e.isShiftDown()
            : e.isControlDown() && !e.isMetaDown() && !e.isAltDown() && !e.isShiftDown();
index ce514ca402724110c4eb7b09ab98d8fbb1d86f62..43877419b0ea2644648b054dd357e9494eb9e6e2 100644 (file)
@@ -885,11 +885,11 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
     @Override
     public void mouseWheelMoved(@NotNull MouseWheelEvent e) {
       if (myEditorPreviewHint == null) return;
-      int inc = e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL ? e.getUnitsToScroll() * e.getScrollAmount() :
-              e.getWheelRotation() < 0 ? -e.getScrollAmount() : e.getScrollAmount();
+      int units = e.getUnitsToScroll();
+      if (units == 0) return;
       // Stop accumulating when the last or the first line has been reached as 'adjusted' position to show lens.
-      if (myLastVisualLine < myEditor.getVisibleLineCount() - 1 && inc > 0 || myLastVisualLine > 0 && inc < 0) {
-        myWheelAccumulator += inc;
+      if (myLastVisualLine < myEditor.getVisibleLineCount() - 1 && units > 0 || myLastVisualLine > 0 && units < 0) {
+        myWheelAccumulator += units;
       }
       myRowAdjuster = myWheelAccumulator / myEditor.getLineHeight();
       showToolTipByMouseMove(e);
index bf0ee5686a130a36c110e9fab057a86f26d0f761..daa7142c9dbcbb167fbb7447ae930a790c07d803 100644 (file)
@@ -429,9 +429,9 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements
     JLabel label = createInitializingLabel();
     ToolWindowAnchor toolWindowAnchor = ToolWindowAnchor.fromText(bean.anchor);
     final ToolWindowFactory factory = bean.getToolWindowFactory();
-    final ToolWindowImpl toolWindow =
-      (ToolWindowImpl)registerToolWindow(bean.id, label, toolWindowAnchor, myProject, DumbService.isDumbAware(factory),
-                                         bean.canCloseContents);
+    ToolWindow window = registerToolWindow(bean.id, label, toolWindowAnchor, false, bean.canCloseContents,
+                                           DumbService.isDumbAware(factory), factory.shouldBeAvailable(myProject));
+    final ToolWindowImpl toolWindow = (ToolWindowImpl)registerDisposable(bean.id, myProject, window);
     toolWindow.setContentFactory(factory);
     if (bean.icon != null && toolWindow.getIcon() == null) {
       Icon icon = IconLoader.findIcon(bean.icon, factory.getClass());
@@ -1055,7 +1055,7 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements
                                        @NotNull ToolWindowAnchor anchor,
                                        @NotNull Disposable parentDisposable,
                                        boolean canWorkInDumbMode, boolean canCloseContents) {
-    return registerDisposable(id, parentDisposable, registerToolWindow(id, component, anchor, false, canCloseContents, canWorkInDumbMode));
+    return registerDisposable(id, parentDisposable, registerToolWindow(id, component, anchor, false, canCloseContents, canWorkInDumbMode, true));
   }
 
   @NotNull
@@ -1063,13 +1063,13 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements
                                         @NotNull final JComponent component,
                                         @NotNull final ToolWindowAnchor anchor,
                                         boolean canWorkInDumbMode) {
-    return registerToolWindow(id, component, anchor, false, false, canWorkInDumbMode);
+    return registerToolWindow(id, component, anchor, false, false, canWorkInDumbMode, true);
   }
 
   @NotNull
   @Override
   public ToolWindow registerToolWindow(@NotNull final String id, final boolean canCloseContent, @NotNull final ToolWindowAnchor anchor) {
-    return registerToolWindow(id, null, anchor, false, canCloseContent, false);
+    return registerToolWindow(id, null, anchor, false, canCloseContent, false, true);
   }
 
   @NotNull
@@ -1078,7 +1078,7 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements
                                        final boolean canCloseContent,
                                        @NotNull final ToolWindowAnchor anchor,
                                        final boolean secondary) {
-    return registerToolWindow(id, null, anchor, secondary, canCloseContent, false);
+    return registerToolWindow(id, null, anchor, secondary, canCloseContent, false, true);
   }
 
 
@@ -1100,7 +1100,7 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements
                                        @NotNull Disposable parentDisposable,
                                        boolean canWorkInDumbMode,
                                        boolean secondary) {
-    ToolWindow window = registerToolWindow(id, null, anchor, secondary, canCloseContent, canWorkInDumbMode);
+    ToolWindow window = registerToolWindow(id, null, anchor, secondary, canCloseContent, canWorkInDumbMode, true);
     return registerDisposable(id, parentDisposable, window);
   }
 
@@ -1110,7 +1110,8 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements
                                         @NotNull final ToolWindowAnchor anchor,
                                         boolean sideTool,
                                         boolean canCloseContent,
-                                        final boolean canWorkInDumbMode) {
+                                        final boolean canWorkInDumbMode,
+                                        boolean shouldBeAvailable) {
     if (LOG.isDebugEnabled()) {
       LOG.debug("enter: installToolWindow(" + id + "," + component + "," + anchor + "\")");
     }
@@ -1124,6 +1125,7 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements
     final boolean wasVisible = info.isVisible();
     info.setActive(false);
     info.setVisible(false);
+    info.setShowStripeButton(shouldBeAvailable);
 
     // Create decorator
 
index 5fae91891c4ddb9ab6f0d2039d0eeb3a3a72a918..19f4b48be666dee68c4a86453a1220d17e734d45 100644 (file)
@@ -18,6 +18,22 @@ package com.intellij.remote.ext;
 import com.intellij.openapi.extensions.ExtensionPointName;
 
 public abstract class CredentialsLanguageContribution<T> {
+  public static final CredentialsLanguageContribution<Void> NOT_IMPLEMENTED = new CredentialsLanguageContribution<Void>() {
+    @Override
+    public CredentialsTypeEx getType() {
+      return null;
+    }
+
+    @Override
+    public Class<Void> getLanguageContributionClass() {
+      return null;
+    }
+
+    @Override
+    public Void getLanguageContribution() {
+      return null;
+    }
+  };
 
   public static final ExtensionPointName<CredentialsLanguageContribution> EP_NAME
     = ExtensionPointName.create("com.intellij.remote.credentialsLanguageContribution");
index 79564bfdbad613622570120672c4306b844f84f8..9a99b427b41b8e5d9fa9edcfea0809ed6b51da2f 100644 (file)
@@ -100,22 +100,19 @@ class SlideComponent extends JComponent {
       }
     });
 
-    addMouseWheelListener(new MouseWheelListener() {
-      @Override
-      public void mouseWheelMoved(MouseWheelEvent e) {
-        final int amount = e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL ? e.getUnitsToScroll() * e.getScrollAmount() :
-                           e.getWheelRotation() < 0 ? -e.getScrollAmount() : e.getScrollAmount();
-        int pointerValue = myPointerValue + amount;
-        pointerValue = pointerValue < OFFSET ? OFFSET : pointerValue;
-        int size = myVertical ? getHeight() : getWidth();
-        pointerValue = pointerValue > (size - 12) ? size - 12 : pointerValue;
-
-        myPointerValue = pointerValue;
-        myValue = pointerValueToValue(myPointerValue);
-
-        repaint();
-        fireValueChanged();
-      }
+    addMouseWheelListener(event -> {
+      int units = event.getUnitsToScroll();
+      if (units == 0) return;
+      int pointerValue = myPointerValue + units;
+      pointerValue = pointerValue < OFFSET ? OFFSET : pointerValue;
+      int size = myVertical ? getHeight() : getWidth();
+      pointerValue = pointerValue > (size - 12) ? size - 12 : pointerValue;
+
+      myPointerValue = pointerValue;
+      myValue = pointerValueToValue(myPointerValue);
+
+      repaint();
+      fireValueChanged();
     });
 
     addComponentListener(new ComponentAdapter() {
index 1abeb18a411c49e8affd0a7605df92f5a6aaa160..49de5ecd9b165eb5cae9126506144dc92d4d9959 100644 (file)
@@ -103,8 +103,17 @@ public class MacPathChooserDialog implements PathChooserDialog, FileChooserDialo
   @Override
   public void choose(@Nullable VirtualFile toSelect, @NotNull Consumer<List<VirtualFile>> callback) {
     if (toSelect != null && toSelect.getParent() != null) {
-      myFileDialog.setDirectory(toSelect.getParent().getCanonicalPath());
-      myFileDialog.setFile(toSelect.getPath());
+
+      String directoryName;
+      String fileName = null;
+      if (toSelect.isDirectory()) {
+        directoryName = toSelect.getCanonicalPath();
+      } else {
+        directoryName = toSelect.getParent().getCanonicalPath();
+        fileName = toSelect.getPath();
+      }
+      myFileDialog.setDirectory(directoryName);
+      myFileDialog.setFile(fileName);
     }
 
     myFileDialog.setMultipleMode(myFileChooserDescriptor.isChooseMultiple());
index c16ac4c66132b80ea42d469596b45d5d890ff420..3200bf9f471cdad6a6aa5e00aa7559c346014d90 100644 (file)
@@ -620,7 +620,7 @@ public class SwingHelper {
       textPane = new JEditorPane();
     }
     textPane.setFont(font != null ? font : UIUtil.getLabelFont());
-    textPane.setContentType(UIUtil.HTML_MIME);
+    textPane.setEditorKit(UIUtil.getHTMLEditorKit());
     textPane.setEditable(false);
     if (background != null) {
       textPane.setBackground(background);
index 8f981039dec795d8cdb9a1495c2946214d1374c1..9a5252648b1f154495c6d4685a3456d8bc7e4a6c 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.ui.EditorTextField;
 import com.intellij.ui.TableUtil;
 import com.intellij.ui.table.JBTable;
 import com.intellij.util.ui.AbstractTableCellEditor;
+import com.intellij.util.ui.MouseEventHandler;
 import com.intellij.util.ui.UIUtil;
 import gnu.trove.TIntArrayList;
 import gnu.trove.TIntObjectHashMap;
@@ -472,7 +473,7 @@ public abstract class JBListTable {
         editor.setFocusCycleRoot(true);
 
         editor.setFocusTraversalPolicy(new JBListTableFocusTraversalPolicy(editor));
-        MouseSuppressor.install(editor);
+        editor.addMouseListener(MouseEventHandler.CONSUMER);
 
         myCellEditor = new MyCellEditor(editor);
         return myCellEditor;
diff --git a/platform/platform-impl/src/com/intellij/util/ui/table/MouseSuppressor.java b/platform/platform-impl/src/com/intellij/util/ui/table/MouseSuppressor.java
deleted file mode 100644 (file)
index e4c9198..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2000-2011 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.intellij.util.ui.table;
-
-import org.jetbrains.annotations.NotNull;
-
-import javax.swing.*;
-import java.awt.event.*;
-
-/**
-* @author Konstantin Bulenkov
-*/
-class MouseSuppressor implements MouseListener, MouseWheelListener, MouseMotionListener {
-  private static void handle(InputEvent e) {
-    e.consume();
-  }
-
-  public static void install(@NotNull JComponent component) {
-    component.addMouseListener(new MouseSuppressor());
-  }
-
-  @Override
-  public void mouseClicked(MouseEvent e) {handle(e);}
-
-  @Override
-  public void mousePressed(MouseEvent e) {handle(e);}
-
-  @Override
-  public void mouseReleased(MouseEvent e) {handle(e);}
-
-  @Override
-  public void mouseEntered(MouseEvent e) {handle(e);}
-
-  @Override
-  public void mouseExited(MouseEvent e) {handle(e);}
-
-  @Override
-  public void mouseWheelMoved(MouseWheelEvent e) {handle(e);}
-
-  @Override
-  public void mouseDragged(MouseEvent e) {handle(e);}
-
-  @Override
-  public void mouseMoved(MouseEvent e) {handle(e);}
-}
index 2fc0c573c217dbed42715b7bea04292d98a23132..c8902987347cd7944df2674fb16a178db0870245 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.application.ModalityState;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.util.Conditions;
+import com.intellij.testFramework.LoggedErrorProcessor;
 import com.intellij.testFramework.PlatformTestCase;
 import com.intellij.testFramework.SkipInHeadlessEnvironment;
 import com.intellij.testFramework.UsefulTestCase;
@@ -30,6 +31,9 @@ import javax.swing.*;
 import java.awt.*;
 import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
 
 @SuppressWarnings({"SSBasedInspection", "SynchronizeOnThis"})
 @SkipInHeadlessEnvironment
@@ -561,4 +565,16 @@ public class LaterInvocatorTest extends PlatformTestCase {
       assertOrderedEquals(myOrder, "m12", "m2", "m1", "m1x");
     });
   }
+
+  public void testModalityStateCurrentAllowedOnlyFromEDT() throws Exception {
+    LoggedErrorProcessor.getInstance().disableStderrDumping(getTestRootDisposable());
+    Future<ModalityState> future = ApplicationManager.getApplication().executeOnPooledThread(() -> ModalityState.current());
+    try {
+      future.get(1000, TimeUnit.MILLISECONDS);
+      fail("should fail");
+    }
+    catch (ExecutionException e) {
+      assertTrue(e.getMessage(), e.getMessage().contains("Access is allowed from event dispatch thread only"));
+    }
+  }
 }
index 7894681f8928745b5ebf1c1f26680308718ec9e4..5aee60f8e536682cad60c135135efea49af60b99 100644 (file)
@@ -392,6 +392,7 @@ public class GeneralToSMTRunnerEventsConvertor extends GeneralTestEventsProcesso
         testProxy.setTestFailed(localizedMessage, stackTrace, isTestError);
       }
       else {
+        testProxy.setTestFailed(localizedMessage, stackTrace, isTestError);
         logProblem("Comparison failure actual and expected texts should be both null or not null.\n"
                    + "Expected:\n"
                    + comparisionFailureExpectedText + "\n"
index 505215eb7626f4749d7ddc24c6eddbbde29e53c3..e702c6805ed1b1aaf8e071ff91a1e84f01bfd139 100644 (file)
@@ -177,6 +177,18 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase
     assertFalse(proxy.isInProgress());
   }
 
+  public void testOnTestTruncatedComparisonFailure() {
+    onTestStarted("some_test");
+    myEventsProcessor.onTestFailure(new TestFailedEvent("some_test", "", "", false, "actual", null));
+
+    final String fullName = myEventsProcessor.getFullTestName("some_test");
+    final SMTestProxy proxy = myEventsProcessor.getProxyByFullTestName(fullName);
+
+    assertNotNull(proxy);
+    assertTrue(proxy.isDefect());
+    assertFalse(proxy.isInProgress());
+  }
+
   public void testOnTestFailure_Twice() {
     myMockResettablePrinter.resetIfNecessary();
     onTestStarted("some_test");
index 4a638a9149c80ff1d96e589c1dcd87aee54bdbfb..39f324d601f4ccc8d282b1a1d8e917d67f366d2b 100644 (file)
@@ -17,6 +17,7 @@ package com.intellij.execution.testframework.sm.runner;
 
 import com.intellij.execution.process.ProcessOutputTypes;
 import com.intellij.execution.runners.ExecutionEnvironment;
+import com.intellij.execution.testframework.CompositePrintable;
 import com.intellij.execution.testframework.Printable;
 import com.intellij.execution.testframework.Printer;
 import com.intellij.execution.testframework.TestConsoleProperties;
@@ -27,6 +28,8 @@ import com.intellij.execution.testframework.sm.runner.ui.SMTestRunnerResultsForm
 import com.intellij.execution.testframework.ui.TestsOutputConsolePrinter;
 import com.intellij.execution.ui.ConsoleViewContentType;
 import com.intellij.openapi.util.Disposer;
+import com.intellij.psi.impl.DebugUtil;
+import com.intellij.util.concurrency.Semaphore;
 import org.jetbrains.annotations.NotNull;
 
 /**
@@ -536,6 +539,22 @@ public class SMTRunnerConsoleTest extends BaseSMTRunnerTestCase {
     assertAllOutputs(myMockResettablePrinter, "preved", "","Empty test suite.\n");
   }
 
+  public void testEnsureOrderedClearFlush() throws Exception {
+    StringBuffer buf = new StringBuffer();
+    String expected = "";
+    for(int i = 0; i < 100; i++) {
+      expected += "1" ;
+      expected += "2" ;
+      CompositePrintable.invokeInAlarm(() -> buf.append("1"), false);
+      CompositePrintable.invokeInAlarm(() -> buf.append("2"), false);
+    }
+    Semaphore s = new Semaphore();
+    s.down();
+    CompositePrintable.invokeInAlarm(s::up, false);
+    assertTrue(s.waitFor(1000));
+    assertEquals(expected, buf.toString());
+  }
+
   @NotNull
   private SMTestProxy startTestWithPrinter(final String testName) {
     myEventsProcessor.onTestStarted(new TestStartedEvent(testName, null));
index 46e5fa6c280025ed82b55e691915c8923363a524..9b4a7b04720e441fcf6e003f70abae5532b14d15 100644 (file)
@@ -31,6 +31,7 @@ import org.jetbrains.annotations.Nullable;
 import java.io.*;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.ExecutorService;
 
 public class CompositePrintable implements Printable, Disposable {
   public static final String NEW_LINE = "\n";
@@ -41,6 +42,7 @@ public class CompositePrintable implements Printable, Disposable {
   private int myCurrentSize = 0;
   private String myOutputFile = null;
   private String myFrameworkOutputFile;
+  private static final ExecutorService ourTestExecutorService = AppExecutorUtil.createBoundedApplicationPoolExecutor("tests", 1);
 
   public void flush() {
     synchronized (myNestedPrintables) {
@@ -65,7 +67,7 @@ public class CompositePrintable implements Printable, Disposable {
     if (sync) {
       runnable.run();
     } else {
-      AppExecutorUtil.getAppExecutorService().execute(runnable);
+      ourTestExecutorService.execute(runnable);
     }
   }
 
@@ -140,7 +142,7 @@ public class CompositePrintable implements Printable, Disposable {
   public void setOutputFilePath(String outputFile) {
     myOutputFile = outputFile;
   }
-  
+
   public void setFrameworkOutputFile(String frameworkOutputFile) {
     myFrameworkOutputFile = frameworkOutputFile;
   }
index 9e8aeb14e34e7078616c1ff459669cea76e28825..29c86aec241643fcf0a6d9d671f34ba05a29cfc8 100644 (file)
@@ -28,7 +28,6 @@ import com.intellij.diff.util.DiffUserDataKeysEx.ScrollToPolicy;
 import com.intellij.execution.ExecutionBundle;
 import com.intellij.execution.testframework.stacktrace.DiffHyperlink;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.Pair;
 import com.intellij.openapi.vfs.LocalFileSystem;
 import com.intellij.openapi.vfs.VirtualFile;
 import org.jetbrains.annotations.NotNull;
@@ -62,33 +61,51 @@ public class TestDiffRequestProcessor extends DiffRequestProcessor {
     if (myIndex < 0 || myIndex >= myRequests.size()) return NoDiffRequest.INSTANCE;
     DiffHyperlink hyperlink = myRequests.get(myIndex);
     try {
-      String title = hyperlink.getDiffTitle();
+      String windowTitle = hyperlink.getDiffTitle();
 
-      Pair<String, DiffContent> content1 = createContentWithTitle("diff.content.expected.title", 
-                                                                  hyperlink.getLeft(), hyperlink.getFilePath());
-      Pair<String, DiffContent> content2 = createContentWithTitle("diff.content.actual.title", 
-                                                                  hyperlink.getRight(), hyperlink.getActualFilePath());
+      String text1 = hyperlink.getLeft();
+      String text2 = hyperlink.getRight();
+      VirtualFile file1 = findFile(hyperlink.getFilePath());
+      VirtualFile file2 = findFile(hyperlink.getActualFilePath());
 
-      return new SimpleDiffRequest(title, content1.second, content2.second, content1.first, content2.first);
+      DiffContent content1 = createContentWithTitle(getProject(), text1, file1, file2);
+      DiffContent content2 = createContentWithTitle(getProject(), text2, file2, file1);
+
+      String title1 = getContentTitle("diff.content.expected.title", file1);
+      String title2 = getContentTitle("diff.content.actual.title", file2);
+
+      return new SimpleDiffRequest(windowTitle, content1, content2, title1, title2);
     }
     catch (Exception e) {
       return new ErrorDiffRequest(e);
     }
   }
-  
-  private Pair<String, DiffContent> createContentWithTitle(String titleKey, String contentString, String contentFilePath) {
-    String title;
-    DiffContent content;
-    VirtualFile vFile;
-    if (contentFilePath != null && (vFile = LocalFileSystem.getInstance().findFileByPath(contentFilePath)) != null) {
-      title = ExecutionBundle.message(titleKey) + " (" + vFile.getPresentableUrl() + ")";
-      content = DiffContentFactory.getInstance().create(getProject(), vFile);
+
+  @Nullable
+  private static VirtualFile findFile(@Nullable String path) {
+    return path != null ? LocalFileSystem.getInstance().findFileByPath(path) : null;
+  }
+
+  @NotNull
+  private static DiffContent createContentWithTitle(@Nullable Project project,
+                                                    @NotNull String content,
+                                                    @Nullable VirtualFile contentFile,
+                                                    @Nullable VirtualFile highlightFile) {
+    if (contentFile != null) {
+      return DiffContentFactory.getInstance().create(project, contentFile);
     }
     else {
-      title = ExecutionBundle.message(titleKey);
-      content = DiffContentFactory.getInstance().create(contentString);
+      return DiffContentFactory.getInstance().create(content, highlightFile);
+    }
+  }
+
+  @NotNull
+  private static String getContentTitle(@NotNull String titleKey, @Nullable VirtualFile file) {
+    String title = ExecutionBundle.message(titleKey);
+    if (file != null) {
+      title += " (" + file.getPresentableUrl() + ")";
     }
-    return Pair.create(title, content);
+    return title;
   }
 
   //
index 5b7b03a3a68b59e7816fde8a2b9e7e8e48f3d240..be9fe2bdad1d1943f9aa79ba1d8b255c9bc8187e 100644 (file)
@@ -17,13 +17,15 @@ package com.intellij.util.ui;
 
 import javax.swing.SwingUtilities;
 import javax.swing.event.MenuDragMouseEvent;
+import javax.swing.event.MouseInputListener;
 import java.awt.*;
 import java.awt.event.*;
 
 /**
  * @author Sergey.Malenkov
  */
-public class MouseEventAdapter<T> implements MouseListener, MouseMotionListener, MouseWheelListener {
+public class MouseEventAdapter<T> extends MouseAdapter implements MouseListener, MouseInputListener,
+                                                                  MouseMotionListener, MouseWheelListener {
   private final T myAdapter;
 
   public MouseEventAdapter(T adapter) {
@@ -119,6 +121,8 @@ public class MouseEventAdapter<T> implements MouseListener, MouseMotionListener,
 
   public static MouseWheelEvent convert(MouseWheelEvent event, Component source, int id, long when, int modifiers, int x, int y) {
     return new MouseWheelEvent(source, id, when, modifiers, x, y,
+                               event.getXOnScreen(),
+                               event.getYOnScreen(),
                                event.getClickCount(),
                                event.isPopupTrigger(),
                                event.getScrollType(),
index 7477ed4afca833ad9b13861c1b5753755208eaf6..92aa467b364e664eace15f1fae8bed60b114c7f8 100644 (file)
  */
 package com.intellij.util.ui;
 
+import javax.swing.event.MouseInputListener;
 import java.awt.event.*;
 
 /**
  * @author Sergey.Malenkov
  */
-public abstract class MouseEventHandler implements MouseListener, MouseMotionListener, MouseWheelListener {
+public abstract class MouseEventHandler extends MouseAdapter implements MouseListener, MouseInputListener,
+                                                                        MouseMotionListener, MouseWheelListener {
   protected abstract void handle(MouseEvent event);
 
   @Override
@@ -62,4 +64,11 @@ public abstract class MouseEventHandler implements MouseListener, MouseMotionLis
   public void mouseWheelMoved(MouseWheelEvent event) {
     handle(event);
   }
+
+  public static final MouseEventHandler CONSUMER = new MouseEventHandler() {
+    @Override
+    protected void handle(MouseEvent event) {
+      event.consume();
+    }
+  };
 }
index eda297d861c429fa74553c3d8a20128f7b1893cf..a926335bc0cbb5aa21e3b500674835a18d2438bc 100644 (file)
@@ -146,7 +146,9 @@ public class ChangesViewContentManager extends AbstractProjectComponent implemen
   private void updateToolWindowAvailability() {
     ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(TOOLWINDOW_ID);
     if (toolWindow != null) {
-      toolWindow.setAvailable(isAvailable(), null);
+      boolean available = isAvailable();
+      toolWindow.setShowStripeButton(available);
+      toolWindow.setAvailable(available, null);
     }
   }
 
index 74713e21ca512abf9f9c87aa630f4270d654828d..8a9a5d8b3ce89c365978b773b5b3de16b468957e 100644 (file)
@@ -29,4 +29,9 @@ public class ChangesViewToolWindowFactory implements ToolWindowFactory, DumbAwar
   public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
     ChangesViewContentManager.getInstance(project).setUp(toolWindow);
   }
+
+  @Override
+  public boolean shouldBeAvailable(@NotNull Project project) {
+    return ChangesViewContentManager.getInstance(project).isAvailable();
+  }
 }
index 8836daac974594e502a628a75d8ab2d051705352..a357b81da38bd5597b4d016ede7ab16c8cbfcda9 100644 (file)
@@ -156,10 +156,7 @@ public class XDebuggerUtilImpl extends XDebuggerUtil {
         final XBreakpointManager breakpointManager = XDebuggerManager.getInstance(project).getBreakpointManager();
         XLineBreakpoint<P> breakpoint = breakpointManager.findBreakpointAtLine(type, file, line);
         if (breakpoint != null) {
-          if (Registry.is("debugger.click.disable.breakpoints")) {
-            breakpoint.setEnabled(!breakpoint.isEnabled());
-          }
-          else {
+          if (!temporary && !Registry.is("debugger.click.disable.breakpoints")) {
             breakpointManager.removeBreakpoint(breakpoint);
           }
         }
index ed699ea6bbf6b20f638788a10634d6647acd27fd..44f6874bd9559436529e01b4c7d99fb11a38ae17 100644 (file)
@@ -22,6 +22,9 @@ import com.intellij.openapi.project.DumbAwareAction;
 import com.intellij.xdebugger.XDebuggerBundle;
 import com.intellij.xdebugger.XDebuggerUtil;
 
+import java.awt.event.InputEvent;
+import java.awt.event.MouseEvent;
+
 class RemoveBreakpointGutterIconAction extends DumbAwareAction {
   private final XBreakpointBase<?,?,?> myBreakpoint;
 
@@ -34,6 +37,10 @@ class RemoveBreakpointGutterIconAction extends DumbAwareAction {
 
   @Override
   public void actionPerformed(final AnActionEvent e) {
-    XDebuggerUtil.getInstance().removeBreakpoint(myBreakpoint.getProject(), myBreakpoint);
+    InputEvent event = e.getInputEvent();
+    // for mouse events check that no modifiers applied
+    if (!(event instanceof MouseEvent) || event.getModifiersEx() == 0) {
+      XDebuggerUtil.getInstance().removeBreakpoint(myBreakpoint.getProject(), myBreakpoint);
+    }
   }
 }
\ No newline at end of file
index 8cfbcfffb79454d55f3828946e392ddff1a1baff..3b6c42086a6c362e162b08fd3679eba7ce102ed0 100644 (file)
@@ -151,15 +151,11 @@ public class XBreakpointUtil {
       int maxPriority = 0;
       for (XLineBreakpointType<?> type : lineTypes) {
         maxPriority = Math.max(maxPriority, type.getPriority());
-        final XLineBreakpoint<? extends XBreakpointProperties> breakpoint = breakpointManager.findBreakpointAtLine(type, file, line);
-        if (breakpoint != null && temporary && !breakpoint.isTemporary()) {
-          breakpoint.setTemporary(true);
-        }
-        else if (type.canPutAt(file, line, project) || breakpoint != null) {
-          if (typeWinner == null || type.getPriority() > typeWinner.getPriority()) {
-            typeWinner = type;
-            lineWinner = line;
-          }
+        XLineBreakpoint<? extends XBreakpointProperties> breakpoint = breakpointManager.findBreakpointAtLine(type, file, line);
+        if ((type.canPutAt(file, line, project) || breakpoint != null) &&
+            (typeWinner == null || type.getPriority() > typeWinner.getPriority())) {
+          typeWinner = type;
+          lineWinner = line;
         }
       }
       // already found max priority type - stop
index 2eb85c66e042dd634c71cb3687ee0bcb587d6b17..333249ada39664c3a0adaaf450c0a1d6f136ad7a 100644 (file)
                      key="class.initializer.display.name" groupBundle="messages.InspectionsBundle" groupKey="group.names.class.structure"
                      enabledByDefault="false" level="WARNING" implementationClass="com.siyeh.ig.classlayout.ClassInitializerInspection"/>
     <localInspection groupPath="Java" language="JAVA" shortName="ClassMayBeInterface" bundle="com.siyeh.InspectionGadgetsBundle" key="class.may.be.interface.display.name"
-                     groupBundle="messages.InspectionsBundle" groupKey="group.names.class.structure" enabledByDefault="false"
-                     level="WARNING" implementationClass="com.siyeh.ig.classlayout.ClassMayBeInterfaceInspection"/>
+                     groupBundle="messages.InspectionsBundle" groupKey="group.names.class.structure" enabledByDefault="true"
+                     level="INFORMATION" implementationClass="com.siyeh.ig.classlayout.ClassMayBeInterfaceInspection"/>
     <localInspection groupPath="Java" language="JAVA" shortName="ClassNameDiffersFromFileName" bundle="com.siyeh.InspectionGadgetsBundle"
                      key="class.name.differs.from.file.name.display.name" groupBundle="messages.InspectionsBundle"
                      groupKey="group.names.class.structure" enabledByDefault="false" level="WARNING"
index def3b314f69d072f76c7e49ef1b58c9eebc6e6fc..2f213319dd35516598a4ddda323396f8874272ba 100644 (file)
@@ -352,7 +352,7 @@ inner.class.field.hides.outer.ignore.option=Ignore outer fields not visible from
 inner.class.field.hides.outer.problem.descriptor=Inner class field <code>#ref</code> hides outer class field #loc
 local.variable.hides.member.variable.display.name=Local variable hides field
 local.variable.hides.member.variable.problem.descriptor=Local variable <code>#ref</code> hides field in class ''{0}'' #loc
-local.variable.hides.member.variable.ignore.option=Ignore local variables in static methods
+local.variable.hides.member.variable.ignore.option=Ignore local variables in a static context
 method.overloads.display.name=Method overloads method of superclass
 method.overloads.problem.descriptor=Method <code>#ref()</code> overloads a compatible method of a superclass, when overriding might have been intended #loc
 method.overloads.report.incompatible.option=Report even if parameter types are not compatible
@@ -2194,4 +2194,6 @@ array.creation.without.new.keyword.name=Array creation without 'new' expression
 array.creation.without.new.keyword.quickfix=Add ''new {0}''
 array.creation.without.new.keyword.family.quickfix=Add 'new' expression
 malformed.set.up.tear.down.display.name=Malformed 'setUp()' or 'tearDown()'
-malformed.set.up.tear.down.problem.descriptor='#ref()' has incorrect signature #loc
\ No newline at end of file
+malformed.set.up.tear.down.problem.descriptor='#ref()' has incorrect signature #loc
+method.missing.return.statement.display.name=Method contains logic but is missing a 'return' statement
+method.missing.return.statement.problem.descriptor=Method <code>#ref</code> contains logic but is missing a 'return' statement
\ No newline at end of file
index 09705fc74f1114bcb0fcef6cbbe5675825f44b68..4c7da771eee7289ff0c73379752cc7c7f24577d6 100644 (file)
@@ -66,15 +66,10 @@ public class OverlyStrongTypeCastInspection extends BaseInspection {
   }
 
   private static class OverlyStrongCastFix extends InspectionGadgetsFix {
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
 
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionGadgetsBundle.message("overly.strong.type.cast.weaken.quickfix");
     }
 
index 087c6d5ff7593764fc12c213c64f362f51d07bb4..ab876907bc07d550e50992ef7518723f4c7a7623 100644 (file)
@@ -48,14 +48,8 @@ public class AssignmentUsedAsConditionInspection extends BaseInspection {
 
     @Override
     @NotNull
-    public String getName() {
-      return InspectionGadgetsBundle.message("assignment.used.as.condition.replace.quickfix");
-    }
-
-    @NotNull
-    @Override
     public String getFamilyName() {
-      return getName();
+      return InspectionGadgetsBundle.message("assignment.used.as.condition.replace.quickfix");
     }
 
     @Override
index c124f27b1dbfe7a0897cdad4e2779029e5c40e77..a9ef00bae3ecc389ef4136211b6c2637f2dc49a3 100644 (file)
@@ -176,15 +176,10 @@ public class PointlessBitwiseExpressionInspection extends BaseInspection {
 
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionGadgetsBundle.message(
         "pointless.bitwise.expression.simplify.quickfix");
     }
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
 
     @Override
     public void doFix(Project project, ProblemDescriptor descriptor)
index 32ea04579a19b8b66152398930143baa485cb109..3e47deccccfa35efdf007226726137d818b2acd6 100644 (file)
@@ -61,17 +61,11 @@ public class ClassNewInstanceInspection extends BaseInspection {
 
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionGadgetsBundle.message(
         "class.new.instance.quickfix");
     }
 
-    @NotNull
-    @Override
-    public String getFamilyName() {
-      return getName();
-    }
-
     @Override
     protected void doFix(Project project, ProblemDescriptor descriptor) {
       final PsiElement element = descriptor.getPsiElement();
index e9816051af24df77e48b92b6aa2b2ac62e7bcf68..446fe46228df623283c117fb84657ddfe90b90b3 100644 (file)
@@ -56,15 +56,10 @@ public class EmptyInitializerInspection extends BaseInspection {
   }
 
   private static class EmptyInitializerFix extends InspectionGadgetsFix {
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
 
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionGadgetsBundle.message(
         "empty.class.initializer.delete.quickfix");
     }
index 36eac11d51069f8a65c1b0ca8ec7d849fc597b47..bd54f9f22f994796a872374adc380d62acb822fb 100644 (file)
@@ -55,15 +55,10 @@ public class InnerClassReferencedViaSubclassInspection extends BaseInspection {
 
   private static class InnerClassReferencedViaSubclassFix extends InspectionGadgetsFix {
 
-    @Override
-    @NotNull
-    public String getName() {
-      return InspectionGadgetsBundle.message("inner.class.referenced.via.subclass.quickfix");
-    }
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
+      return InspectionGadgetsBundle.message("inner.class.referenced.via.subclass.quickfix");
     }
 
     @Override
index 3ae0b6e6038b6fa1bfcb134efc46f9f5026c3283..777bde1408386da5dc72f5a2e944a5384082d434 100644 (file)
@@ -68,11 +68,6 @@ public class MathRandomCastToIntInspection extends BaseInspection {
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
-    }
-    @Override
-    @NotNull
-    public String getName() {
       return InspectionGadgetsBundle.message("math.random.cast.to.int.quickfix");
     }
 
index 4f8851ca691841d8fadb7880079c11ebe8b42a94..3f91300595bd025d8e72abe6cc40307fcbfcfb43 100644 (file)
@@ -63,15 +63,10 @@ public class NewStringBufferWithCharArgumentInspection extends BaseInspection {
 
   private static class NewStringBufferWithCharArgumentFix
     extends InspectionGadgetsFix {
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
 
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionGadgetsBundle.message(
         "new.string.buffer.with.char.argument.quickfix");
     }
index 8299974dbd6d5cacdda55c087753d6eaf444cc60..5471960d3186b3744f908b55a8040cbd460e4246 100644 (file)
@@ -60,14 +60,8 @@ public class NonShortCircuitBooleanInspection extends BaseInspection {
 
     @Override
     @NotNull
-    public String getName() {
-      return InspectionGadgetsBundle.message("non.short.circuit.boolean.expression.replace.quickfix");
-    }
-
-    @NotNull
-    @Override
     public String getFamilyName() {
-      return getName();
+      return InspectionGadgetsBundle.message("non.short.circuit.boolean.expression.replace.quickfix");
     }
 
     @Override
index 5844ebed3a48d6ad8056badefb18a9f0303e10cb..67f405fc65a924ea8f1dba57317d1b02b8791c30 100644 (file)
@@ -59,15 +59,10 @@ public class StaticCallOnSubclassInspection extends BaseInspection implements Cl
 
   private static class StaticCallOnSubclassFix extends InspectionGadgetsFix {
 
-    @Override
-    @NotNull
-    public String getName() {
-      return InspectionGadgetsBundle.message("static.method.via.subclass.rationalize.quickfix");
-    }
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
+      return InspectionGadgetsBundle.message("static.method.via.subclass.rationalize.quickfix");
     }
 
     @Override
index 696df9bd2fb02a50d2ec5ada06fcadd3c3871094..5238155ea345244e6e59f30fc9ea83360212063f 100644 (file)
@@ -59,15 +59,10 @@ public class StaticFieldReferenceOnSubclassInspection
   }
 
   private static class StaticFieldOnSubclassFix extends InspectionGadgetsFix {
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
 
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionGadgetsBundle.message(
         "static.field.via.subclass.rationalize.quickfix");
     }
index 74011bd8560787cc2e441386fb9612d1ddf72548..883ac1fd99dc7ad1ed829a0ec791cd300e75730c 100644 (file)
@@ -81,16 +81,10 @@ public class ClassInitializerInspection extends BaseInspection {
 
   private static class MoveToConstructorFix extends InspectionGadgetsFix {
 
-    @NotNull
-    @Override
-    public String getName() {
-      return InspectionGadgetsBundle.message("class.initializer.move.code.to.constructor.quickfix");
-    }
-
     @NotNull
     @Override
     public String getFamilyName() {
-      return getName();
+      return InspectionGadgetsBundle.message("class.initializer.move.code.to.constructor.quickfix");
     }
 
     @Override
index 4196bcb80785fe42901916ddd3f0feb72c07e5e3..32014028dcdcbf9f8854fc4dd7fb6a2dfac4ea59 100644 (file)
@@ -77,15 +77,10 @@ public class ClassMayBeInterfaceInspection extends BaseInspection {
 
   private static class ClassMayBeInterfaceFix extends InspectionGadgetsFix {
 
-    @Override
-    @NotNull
-    public String getName() {
-      return InspectionGadgetsBundle.message("class.may.be.interface.convert.quickfix");
-    }
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
+      return InspectionGadgetsBundle.message("class.may.be.interface.convert.quickfix");
     }
 
     @Override
index cfe033dd2498f167247fd250588908988d12940f..764f2e7c3f21151b9db0de7dbc767c6ab2a8c77d 100644 (file)
@@ -57,16 +57,10 @@ public class UtilityClassCanBeEnumInspection extends BaseInspection {
   private static class UtilityClassCanBeEnumFix extends InspectionGadgetsFix {
 
     @Nls
-    @NotNull
-    @Override
-    public String getName() {
-      return InspectionGadgetsBundle.message("utility.class.code.can.be.enum.quickfix");
-    }
-
     @NotNull
     @Override
     public String getFamilyName() {
-      return getName();
+      return InspectionGadgetsBundle.message("utility.class.code.can.be.enum.quickfix");
     }
 
     @Override
index 9bf28d537da385a1fbc611dcc0e51c67aebaa809..967c29059ec1339cb4e225cadf071fe87fa1584d 100644 (file)
@@ -83,15 +83,10 @@ public class CloneDeclaresCloneNotSupportedInspection extends BaseInspection {
 
   private static class CloneDeclaresCloneNotSupportedInspectionFix extends InspectionGadgetsFix {
 
-    @Override
-    @NotNull
-    public String getName() {
-      return InspectionGadgetsBundle.message("clone.doesnt.declare.clonenotsupportedexception.declare.quickfix");
-    }
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
+      return InspectionGadgetsBundle.message("clone.doesnt.declare.clonenotsupportedexception.declare.quickfix");
     }
 
     @Override
index 961e6b30bfc54bb774c60c1c1a19fe18f0501f2c..529925a515e33c987703eee019e808c846a82c9b 100644 (file)
@@ -67,13 +67,8 @@ public class CloneableImplementsCloneInspection extends BaseInspection {
   private static class CreateCloneMethodFix extends InspectionGadgetsFix {
     @NotNull
     @Override
-    public String getName() {
-      return InspectionGadgetsBundle.message("cloneable.class.without.clone.quickfix");
-    }
-    @Override
-    @NotNull
     public String getFamilyName() {
-      return getName();
+      return InspectionGadgetsBundle.message("cloneable.class.without.clone.quickfix");
     }
 
     @Override
index 2a26d9d31a54e5d3fb5da086402bd314be234833..4619be68c181520d0d0f97e1b543dd4e8df38806 100644 (file)
@@ -62,14 +62,8 @@ public class BooleanExpressionMayBeConditionalInspection extends BaseInspection
 
     @Override
     @NotNull
-    public String getName() {
-      return InspectionGadgetsBundle.message("if.may.be.conditional.quickfix");
-    }
-
-    @NotNull
-    @Override
     public String getFamilyName() {
-      return getName();
+      return InspectionGadgetsBundle.message("if.may.be.conditional.quickfix");
     }
 
     @Override
index 11062a32395353ed312e32683e37280618913fbe..85c6cd048c525ca1d83738a693253017a154eaf6 100644 (file)
@@ -71,15 +71,10 @@ public class ConfusingElseInspection extends BaseInspection {
   }
 
   private static class ConfusingElseFix extends InspectionGadgetsFix {
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
 
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionGadgetsBundle.message("confusing.else.unwrap.quickfix");
     }
 
index d663d91386436e9ec5844fdc6b707061b0955fc1..85646a38c8a6d554aee8d4ddfc8d43c536d31430 100644 (file)
@@ -77,17 +77,11 @@ public class ConstantConditionalExpressionInspection
 
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionGadgetsBundle.message(
         "constant.conditional.expression.simplify.quickfix");
     }
 
-    @NotNull
-    @Override
-    public String getFamilyName() {
-      return getName();
-    }
-
     @Override
     public void doFix(Project project, ProblemDescriptor descriptor)
       throws IncorrectOperationException {
index de7cd1053bfb279f1ec0c42b2bac1beb05bb171f..6838882fa06820ffb1c1e19b3fc777d947f2af1d 100644 (file)
@@ -65,15 +65,10 @@ public class ConstantIfStatementInspection extends BaseInspection {
   }
 
   private static class ConstantIfStatementFix extends InspectionGadgetsFix {
-    @Override
-    @NotNull
-    public String getFamilyName() {
-      return getName();
-    }
 
     @Override
     @NotNull
-    public String getName() {
+    public String getFamilyName() {
       return InspectionGadgetsBundle.message(
         "constant.conditional.expression.simplify.quickfix");
     }
index c0a149e74f57b97df52d44775d87881fc0c75975..e0c5a602ed8c13b5eada0f5d9f529095b75ac4ba 100644 (file)
@@ -56,15 +56,10 @@ public class DoubleNegationInspection extends BaseInspection {
 
   private static class DoubleNegationFix extends InspectionGadgetsFix {
 
-    @Override
-    @NotNull
-    public String getName() {
-      return InspectionGadgetsBundle.message("double.negation.quickfix");
-    }
     @Override
     @NotNull
     public String getFamilyName() {
-      return getName();
+      return InspectionGadgetsBundle.message("double.negation.quickfix");
     }
 
     @Override