From 719c0163cb13655aa537f9174d3e0546e458d604 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 15 Oct 2009 12:33:57 +0100 Subject: [PATCH] smart completion tests -> community --- .../smartType/AbstractClassTwice.java | 3 + .../completion/smartType/AfterNew15-out.java | 12 + .../completion/smartType/AfterNew15.java | 5 + .../smartType/AfterNewInTernary-out.java | 5 + .../smartType/AfterNewInTernary.java | 5 + .../smartType/AfterNewWithGenerics-out.java | 15 + .../smartType/AfterNewWithGenerics.java | 15 + .../smartType/AmbiguousConstant-out.java | 15 + .../smartType/AmbiguousConstant.java | 15 + .../completion/smartType/Annotation-out.java | 5 + .../completion/smartType/Annotation.java | 5 + .../completion/smartType/Annotation2-out.java | 5 + .../completion/smartType/Annotation2.java | 5 + .../smartType/Annotation2_2-out.java | 5 + .../completion/smartType/Annotation2_2.java | 5 + .../completion/smartType/Annotation3-out.java | 13 + .../completion/smartType/Annotation3.java | 13 + .../smartType/Annotation3_2-out.java | 17 + .../completion/smartType/Annotation3_2.java | 17 + .../completion/smartType/Annotation4-out.java | 8 + .../completion/smartType/Annotation4.java | 8 + .../completion/smartType/Annotation5-out.java | 16 + .../completion/smartType/Annotation5.java | 16 + .../completion/smartType/Annotation6-out.java | 5 + .../completion/smartType/Annotation6.java | 5 + .../smartType/ArrayAccessIndex-out.java | 7 + .../smartType/ArrayAccessIndex.java | 7 + .../smartType/ArrayAnnoParameter-out.java | 10 + .../smartType/ArrayAnnoParameter.java | 10 + .../completion/smartType/ArrayClone-out.java | 6 + .../completion/smartType/ArrayClone.java | 6 + .../smartType/ArrayIndexTailType-out.java | 10 + .../smartType/ArrayIndexTailType.java | 10 + ...gnFromTheSameFieldOfAnotherObject-out.java | 8 + ...AssignFromTheSameFieldOfAnotherObject.java | 8 + .../smartType/AssignableToAfterCast-out.java | 8 + .../smartType/AssignableToAfterCast.java | 8 + .../AutoCastWhenAlreadyCasted-out.java | 9 + .../smartType/AutoCastWhenAlreadyCasted.java | 9 + ...eforeBinaryExpressionInMethodCall-out.java | 10 + .../BeforeBinaryExpressionInMethodCall.java | 10 + .../smartType/BeforeCastToArray-out.java | 8 + .../smartType/BeforeCastToArray.java | 8 + .../completion/smartType/Bug1-out.java | 12 + .../completion/smartType/Bug1.java | 12 + .../completion/smartType/Bug2.java | 7 + .../smartType/CallVarargArgument-out.java | 18 + .../smartType/CallVarargArgument.java | 18 + .../smartType/CastGenericQualifier-out.java | 13 + .../smartType/CastGenericQualifier.java | 13 + .../completion/smartType/CastInThrow-out.java | 11 + .../completion/smartType/CastInThrow.java | 11 + .../completion/smartType/CastToArray-out.java | 7 + .../completion/smartType/CastToArray.java | 7 + .../CastToParameterizedType-out.java | 11 + .../smartType/CastToParameterizedType.java | 11 + .../CastWith2TypeParameters-out.java | 10 + .../smartType/CastWith2TypeParameters.java | 10 + .../smartType/CastWithGenerics-out.java | 9 + .../smartType/CastWithGenerics.java | 9 + .../smartType/CatchInAnonymous-out.java | 17 + .../smartType/CatchInAnonymous.java | 17 + .../smartType/ClassLiteral-out.java | 6 + .../completion/smartType/ClassLiteral.java | 6 + .../smartType/ClassLiteralInAnno1-out.java | 5 + .../smartType/ClassLiteralInAnno1.java | 5 + .../smartType/ClassLiteralInAnno2-out.java | 5 + .../smartType/ClassLiteralInAnno2.java | 5 + .../smartType/ClassLiteralInheritors-out.java | 6 + .../smartType/ClassLiteralInheritors.java | 6 + .../ClassLiteralShouldInsertImport-out.java | 6 + .../ClassLiteralShouldInsertImport.java | 5 + .../CollectionsEmptySetInMethodCall-out.java | 14 + .../CollectionsEmptySetInMethodCall.java | 14 + .../CollectionsEmptySetInTernary-out.java | 14 + .../CollectionsEmptySetInTernary.java | 14 + .../CollectionsEmptySetInTernary2-out.java | 14 + .../CollectionsEmptySetInTernary2.java | 14 + .../smartType/CommaDoublePenetration-out.java | 11 + .../smartType/CommaDoublePenetration.java | 11 + .../CommonPrefixWithSelection-out.java | 13 + .../smartType/CommonPrefixWithSelection.java | 13 + .../smartType/ConstantTwice-out.java | 11 + .../completion/smartType/ConstantTwice.java | 11 + .../completion/smartType/ConstantTwice2.java | 10 + ...tructorOnSeparateLineInMethodCall-out.java | 10 + ...ConstructorOnSeparateLineInMethodCall.java | 10 + .../ConstructorWithExistingParens-out.java | 7 + .../ConstructorWithExistingParens.java | 7 + .../smartType/DefaultAnnoMethodValue-out.java | 8 + .../smartType/DefaultAnnoMethodValue.java | 8 + .../smartType/DefaultAnnoParam-out.java | 16 + .../smartType/DefaultAnnoParam.java | 16 + .../smartType/DefaultAnnoParam2-out.java | 14 + .../smartType/DefaultAnnoParam2.java | 14 + .../DelegateMethodArguments-out.java | 14 + .../smartType/DelegateMethodArguments.java | 14 + .../smartType/DelegationToParent-out.java | 15 + .../smartType/DelegationToParent.java | 15 + .../DoNotExcludeAssignedVariable-out.java | 11 + .../DoNotExcludeAssignedVariable.java | 11 + .../DontAutoCastWhenAlreadyCasted-out.java | 9 + .../DontAutoCastWhenAlreadyCasted.java | 9 + .../smartType/DoubleEmptyArray.java | 12 + .../DoubleSemicolonPenetration-out.java | 11 + .../smartType/DoubleSemicolonPenetration.java | 11 + .../completion/smartType/DoubleThis-out.java | 11 + .../completion/smartType/DoubleThis.java | 11 + .../DoubleTrueInOverloadedMethodCall-out.java | 8 + .../DoubleTrueInOverloadedMethodCall.java | 8 + .../EmptyListBeforeSemicolon-out.java | 7 + .../smartType/EmptyListBeforeSemicolon.java | 5 + .../smartType/EmptyListInReturn-out.java | 7 + .../smartType/EmptyListInReturn.java | 5 + .../smartType/EmptyListInReturn2-out.java | 5 + .../smartType/EmptyListInReturn2.java | 5 + .../EmptyListInReturnTernary-out.java | 7 + .../smartType/EmptyListInReturnTernary.java | 5 + .../EnumAsDefaultAnnotationParam-out.java | 12 + .../EnumAsDefaultAnnotationParam.java | 12 + .../smartType/EnumConstInSwitch-out.java | 9 + .../smartType/EnumConstInSwitch.java | 9 + .../EnumConstInSwitchOutside-out.java | 11 + .../smartType/EnumConstInSwitchOutside.java | 11 + .../completion/smartType/EnumField-out.java | 9 + .../completion/smartType/EnumField.java | 9 + .../completion/smartType/EnumField1-out.java | 9 + .../completion/smartType/EnumField1.java | 9 + .../smartType/EverythingDoubles.java | 6 + .../smartType/ExceptionTwice-out.java | 7 + .../completion/smartType/ExceptionTwice.java | 7 + .../smartType/ExceptionTwice2-out.java | 7 + .../completion/smartType/ExceptionTwice2.java | 7 + .../smartType/ExcessiveTail-out.java | 5 + .../completion/smartType/ExcessiveTail.java | 5 + .../ExclamationFinishNonBoolean-out.java | 11 + .../ExclamationFinishNonBoolean.java | 11 + .../ExclamationMethodFinish-out.java | 8 + .../smartType/ExclamationMethodFinish.java | 8 + .../ExclamationStaticFieldFinish-out.java | 12 + .../ExclamationStaticFieldFinish.java | 12 + .../ExclamationVariableFinish-out.java | 8 + .../smartType/ExclamationVariableFinish.java | 8 + .../ExcludeDeclaredConstant-out.java | 5 + .../smartType/ExcludeDeclaredConstant.java | 5 + ...plicitMethodTypeParametersQualify-out.java | 11 + .../ExplicitMethodTypeParametersQualify.java | 9 + .../ExplicitWildcardArrayParam-out.java | 12 + .../smartType/ExplicitWildcardArrayParam.java | 12 + .../smartType/ExplicitWildcardParam-out.java | 12 + .../smartType/ExplicitWildcardParam.java | 12 + .../smartType/ExtendsInTypeCast-out.java | 10 + .../smartType/ExtendsInTypeCast.java | 10 + .../ExtraSemicolonAfterMethodParam-out.java | 20 + .../ExtraSemicolonAfterMethodParam.java | 20 + .../FilterPrivateConstructors-out.java | 5 + .../smartType/FilterPrivateConstructors.java | 5 + .../completion/smartType/Foreach-out.java | 11 + .../completion/smartType/Foreach.java | 11 + .../smartType/HidingFields-out.java | 12 + .../completion/smartType/HidingFields.java | 12 + .../smartType/HonorSelection-out.java | 9 + .../completion/smartType/HonorSelection.java | 9 + .../completion/smartType/IDEADEV13148.java | 6 + .../completion/smartType/IDEADEV2626-out.java | 12 + .../completion/smartType/IDEADEV2626.java | 12 + .../completion/smartType/IDEADEV2668-out.java | 11 + .../completion/smartType/IDEADEV2668.java | 11 + .../completion/smartType/IDEADEV5150-out.java | 12 + .../completion/smartType/IDEADEV5150.java | 12 + .../completion/smartType/IDEADEV7835-out.java | 10 + .../completion/smartType/IDEADEV7835.java | 10 + .../IfConditionBinaryExpression-out.java | 6 + .../IfConditionBinaryExpression.java | 6 + .../smartType/InThisExpression-out.java | 8 + .../smartType/InThisExpression.java | 8 + .../smartType/InferFromCall-out.java | 14 + .../completion/smartType/InferFromCall.java | 14 + .../smartType/InferFromCall1-out.java | 11 + .../completion/smartType/InferFromCall1.java | 11 + .../smartType/InheritedClass-out.java | 10 + .../completion/smartType/InheritedClass.java | 10 + .../completion/smartType/InnerEnum-out.java | 11 + .../completion/smartType/InnerEnum.java | 11 + .../smartType/InnerEnumInMethod-out.java | 10 + .../smartType/InnerEnumInMethod.java | 10 + .../smartType/InsertOverride-out.java | 10 + .../completion/smartType/InsertOverride.java | 5 + .../InsertTypeParametersOnImporting-out.java | 8 + .../InsertTypeParametersOnImporting.java | 7 + .../completion/smartType/InsideCatch-out.java | 9 + .../completion/smartType/InsideCatch.java | 9 + .../smartType/InsideGenericClassLiteral.java | 9 + .../smartType/InsideStringLiteral.java | 3 + ...MethodParametersFromStaticContext-out.java | 13 + ...anceMethodParametersFromStaticContext.java | 13 + ...ethodParametersFromStaticContext2-out.java | 10 + ...nceMethodParametersFromStaticContext2.java | 10 + .../InstanceofedInsideAnonymous-out.java | 16 + .../InstanceofedInsideAnonymous.java | 16 + .../smartType/IntConstInSwitch-out.java | 11 + .../smartType/IntConstInSwitch.java | 11 + .../smartType/IntPlusLongNotDouble-out.java | 7 + .../smartType/IntPlusLongNotDouble.java | 7 + .../smartType/JavadocThrows-out.java | 9 + .../completion/smartType/JavadocThrows.java | 9 + .../smartType/LiveTemplate-out.java | 12 + .../completion/smartType/LiveTemplate.java | 12 + .../MethodAnnotationNamedParameter-out.java | 9 + .../MethodAnnotationNamedParameter.java | 9 + .../smartType/MethodCallDot-out.java | 9 + .../completion/smartType/MethodCallDot.java | 9 + .../smartType/MethodCallInScriplet-out.jsp | 5 + .../smartType/MethodCallInScriplet.jsp | 5 + .../smartType/NegateVariable-out.java | 9 + .../completion/smartType/NegateVariable.java | 9 + .../smartType/NestedAssignments-out.java | 5 + .../smartType/NestedAssignments.java | 5 + .../NewInnerOfParameterizedClass-out.java | 12 + .../NewInnerOfParameterizedClass.java | 12 + .../smartType/NewInnerRunnable-out.java | 13 + .../smartType/NewInnerRunnable.java | 13 + .../completion/smartType/NewVararg.java | 9 + .../smartType/NoClassLiteral-out.java | 6 + .../completion/smartType/NoClassLiteral.java | 6 + .../smartType/NoInstanceofedValueInElse.java | 13 + ...oInstanceofedValueInElseWithComplexIf.java | 13 + .../NoInstanceofedValueInThenNegated.java | 9 + ...NoInstanceofedValueWhenBasicSuits-out.java | 11 + .../NoInstanceofedValueWhenBasicSuits.java | 11 + .../completion/smartType/NoKeyConstant.java | 25 + .../completion/smartType/NoNullAfterDot.java | 6 + .../NoTypeParametersForToArray-out.java | 8 + .../smartType/NoTypeParametersForToArray.java | 8 + .../smartType/NonStaticInnerClass.java | 12 + .../smartType/OneElementArray-out.java | 8 + .../completion/smartType/OneElementArray.java | 8 + .../smartType/OverloadedMethods-out.java | 13 + .../smartType/OverloadedMethods.java | 13 + .../ParameterizedConstructor-out.java | 14 + .../smartType/ParameterizedConstructor.java | 14 + .../ProtectedAnonymousConstructor-out.java | 9 + .../ProtectedAnonymousConstructor.java | 9 + .../ProtectedAnonymousConstructor2-out.java | 11 + .../ProtectedAnonymousConstructor2.java | 9 + .../smartType/QualifiedThis-out.java | 13 + .../completion/smartType/QualifiedThis.java | 13 + ...alifiedThisInAnonymousConstructor-out.java | 11 + .../QualifiedThisInAnonymousConstructor.java | 11 + .../ReplaceWholeReferenceChain-out.java | 11 + .../smartType/ReplaceWholeReferenceChain.java | 11 + .../SameFieldInAnotherObject-out.java | 8 + .../smartType/SameFieldInAnotherObject.java | 8 + .../smartType/SameNamedFieldAndLocal-out.java | 8 + .../smartType/SameNamedFieldAndLocal.java | 8 + .../completion/smartType/Silly1.java | 7 + .../SillyAssignmentInTernary-out.java | 7 + .../smartType/SillyAssignmentInTernary.java | 7 + .../completion/smartType/SmartFinish-out.java | 11 + .../completion/smartType/SmartFinish.java | 10 + .../smartType/StaticSubclass-out.java | 13 + .../completion/smartType/StaticSubclass.java | 13 + .../StaticallyImportedMagicMethod-out.java | 15 + .../StaticallyImportedMagicMethod.java | 15 + .../smartType/StringConstantInAnno-out.java | 9 + .../smartType/StringConstantInAnno.java | 9 + .../SuggestAnythingWhenWildcardExpected.java | 7 + .../SuggestCastedValueAfterCast-out.java | 10 + .../SuggestCastedValueAfterCast.java | 10 + .../SuggestInstanceofedValue-out.java | 10 + .../smartType/SuggestInstanceofedValue.java | 10 + ...ggestInstanceofedValueAfterReturn-out.java | 11 + .../SuggestInstanceofedValueAfterReturn.java | 11 + ...ggestInstanceofedValueInComplexIf-out.java | 11 + .../SuggestInstanceofedValueInComplexIf.java | 11 + ...estInstanceofedValueInElseNegated-out.java | 11 + ...SuggestInstanceofedValueInElseNegated.java | 11 + ...SuggestInstanceofedValueInTernary-out.java | 9 + .../SuggestInstanceofedValueInTernary.java | 9 + .../completion/smartType/SuggestNull-out.java | 6 + .../completion/smartType/SuggestNull.java | 6 + .../SuperConstructorArguments-out.java | 16 + .../smartType/SuperConstructorArguments.java | 16 + .../smartType/SuperMethodArguments-out.java | 14 + .../smartType/SuperMethodArguments.java | 14 + .../TabMethodInBinaryExpression-out.java | 13 + .../TabMethodInBinaryExpression.java | 13 + .../TabToReplaceClassKeyword-out.java | 7 + .../smartType/TabToReplaceClassKeyword.java | 7 + .../smartType/TailAfterInstanceOf-out.java | 9 + .../smartType/TailAfterInstanceOf.java | 9 + .../ThrowExceptionConstructor-out.java | 9 + .../smartType/ThrowExceptionConstructor.java | 9 + .../smartType/ThrowRuntimeException-out.java | 7 + .../smartType/ThrowRuntimeException.java | 7 + .../completion/smartType/TypeArgs1-out.java | 9 + .../completion/smartType/TypeArgs1.java | 9 + .../completion/smartType/TypeArgs2-out.java | 10 + .../completion/smartType/TypeArgs2.java | 8 + .../TypeParametersInheritors-out.java | 7 + .../smartType/TypeParametersInheritors.java | 7 + .../TypeParametersInheritorsComma-out.java | 5 + .../TypeParametersInheritorsComma.java | 5 + ...eParametersInheritorsInExpression-out.java | 6 + .../TypeParametersInheritorsInExpression.java | 6 + .../TypeParametersObjectInheritors-out.java | 6 + .../TypeParametersObjectInheritors.java | 6 + .../smartType/TypeVariableInstanceOf.java | 10 + .../smartType/UnlockDocument-out.java | 10 + .../completion/smartType/UnlockDocument.java | 8 + .../UnqualifiedConstantInSwitch-out.java | 16 + .../UnqualifiedConstantInSwitch.java | 16 + ...eIntConstantsFromConstructedClass-out.java | 15 + .../UseIntConstantsFromConstructedClass.java | 15 + .../UseIntConstantsFromTargetClass-out.java | 13 + .../UseIntConstantsFromTargetClass.java | 13 + ...nstantsFromTargetClassReturnValue-out.java | 13 + ...ntConstantsFromTargetClassReturnValue.java | 13 + .../smartType/UserDataListAddAll-out.java | 18 + .../smartType/UserDataListAddAll.java | 18 + .../completion/smartType/Varargs1-out.java | 8 + .../completion/smartType/Varargs1.java | 8 + .../completion/smartType/VoidCast.java | 5 + .../smartType/VoidExpectedType-out.java | 8 + .../smartType/VoidExpectedType.java | 8 + .../smartType/WildcardedInstanceof-out.java | 9 + .../smartType/WildcardedInstanceof.java | 9 + .../smartType/WildcardedInstanceof2-out.java | 9 + .../smartType/WildcardedInstanceof2.java | 9 + .../smartType/WildcardedInstanceof3-out.java | 9 + .../smartType/WildcardedInstanceof3.java | 9 + .../smartType/afterInstanceOf/after1.java | 11 + .../smartType/afterInstanceOf/after2.java | 11 + .../smartType/afterInstanceOf/before1.java | 11 + .../smartType/afterInstanceOf/before2.java | 11 + .../afterNew/LastArgInInnerNewAfter.java | 10 + .../afterNew/LastArgInInnerNewAfter2.java | 9 + .../afterNew/LastArgInInnerNewAfter3.java | 13 + .../afterNew/LastArgInInnerNewAfter4.java | 8 + .../afterNew/LastArgInInnerNewBefore.java | 10 + .../afterNew/LastArgInInnerNewBefore2.java | 9 + .../afterNew/LastArgInInnerNewBefore3.java | 13 + .../afterNew/LastArgInInnerNewBefore4.java | 8 + .../completion/smartType/afterNew/after1.java | 5 + .../smartType/afterNew/after10.java | 11 + .../smartType/afterNew/after11.java | 5 + .../smartType/afterNew/after12.java | 4 + .../smartType/afterNew/after13.java | 3 + .../smartType/afterNew/after14.java | 5 + .../smartType/afterNew/after15.java | 7 + .../smartType/afterNew/after16.java | 7 + .../completion/smartType/afterNew/after2.java | 5 + .../completion/smartType/afterNew/after3.java | 9 + .../completion/smartType/afterNew/after4.java | 8 + .../completion/smartType/afterNew/after5.java | 8 + .../completion/smartType/afterNew/after6.java | 8 + .../completion/smartType/afterNew/after7.java | 8 + .../completion/smartType/afterNew/after8.java | 8 + .../completion/smartType/afterNew/after9.java | 7 + .../smartType/afterNew/before1.java | 5 + .../smartType/afterNew/before10.java | 11 + .../smartType/afterNew/before11.java | 11 + .../smartType/afterNew/before12.java | 4 + .../smartType/afterNew/before13.java | 3 + .../smartType/afterNew/before14.java | 5 + .../smartType/afterNew/before15.java | 7 + .../smartType/afterNew/before16.java | 7 + .../smartType/afterNew/before2.java | 5 + .../smartType/afterNew/before3.java | 9 + .../smartType/afterNew/before4.java | 8 + .../smartType/afterNew/before5.java | 8 + .../smartType/afterNew/before6.java | 8 + .../smartType/afterNew/before7.java | 8 + .../smartType/afterNew/before8.java | 8 + .../smartType/afterNew/before9.java | 7 + .../smartType/foo/GetInstance-out.java | 11 + .../completion/smartType/foo/GetInstance.java | 11 + .../completion/smartType/generics/after1.java | 9 + .../completion/smartType/generics/after2.java | 9 + .../completion/smartType/generics/after3.java | 10 + .../completion/smartType/generics/after4.java | 10 + .../completion/smartType/generics/after5.java | 9 + .../completion/smartType/generics/after6.java | 9 + .../completion/smartType/generics/after7.java | 7 + .../completion/smartType/generics/after8.java | 7 + .../completion/smartType/generics/after9.java | 7 + .../smartType/generics/before1.java | 9 + .../smartType/generics/before2.java | 9 + .../smartType/generics/before3.java | 10 + .../smartType/generics/before4.java | 10 + .../smartType/generics/before5.java | 9 + .../smartType/generics/before6.java | 9 + .../smartType/generics/before7.java | 7 + .../smartType/generics/before8.java | 7 + .../smartType/generics/before9.java | 7 + .../smartType/parenAfterCall/after1.java | 5 + .../parenAfterCall/after1_space.java | 5 + .../smartType/parenAfterCall/after2.java | 5 + .../smartType/parenAfterCall/after3.java | 5 + .../smartType/parenAfterCall/after4.java | 5 + .../smartType/parenAfterCall/after5.java | 5 + .../smartType/parenAfterCall/after6.java | 7 + .../smartType/parenAfterCall/before1.java | 5 + .../smartType/parenAfterCall/before2.java | 5 + .../smartType/parenAfterCall/before3.java | 5 + .../smartType/parenAfterCall/before4.java | 5 + .../smartType/parenAfterCall/before5.java | 5 + .../smartType/parenAfterCall/before6.java | 7 + .../smartType/parenAfterCast/after1.java | 5 + .../smartType/parenAfterCast/after2.java | 5 + .../smartType/parenAfterCast/after3.java | 8 + .../smartType/parenAfterCast/before1.java | 5 + .../smartType/parenAfterCast/before2.java | 5 + .../smartType/parenAfterCast/before3.java | 8 + .../smartType/parenAfterIf/after1.java | 5 + .../smartType/parenAfterIf/after2.java | 5 + .../smartType/parenAfterIf/before1.java | 5 + .../smartType/parenAfterIf/before2.java | 5 + .../completion/smartType/return/after1.java | 12 + .../completion/smartType/return/after2.java | 12 + .../completion/smartType/return/after3.java | 12 + .../completion/smartType/return/before1.java | 12 + .../completion/smartType/return/before2.java | 12 + .../completion/smartType/return/before3.java | 12 + .../second/ArrayMemberAccess-out.java | 6 + .../smartType/second/ArrayMemberAccess.java | 6 + .../second/CastInstanceofedQualifier-out.java | 19 + .../second/CastInstanceofedQualifier.java | 19 + .../smartType/second/ChainingPerformance.java | 7 + .../smartType/second/DifferentQualifiers.java | 14 + .../DontChainStringMethodsOnString-out.java | 9 + .../DontChainStringMethodsOnString.java | 9 + .../DontIgnoreToStringInStringBuilders.java | 8 + .../DontIgnoreToStringInsideIt-out.java | 8 + .../second/DontIgnoreToStringInsideIt.java | 8 + .../second/DontSuggestTooGenericMethods.java | 19 + .../second/EmptyListInMethodCall-out.java | 13 + .../second/EmptyListInMethodCall.java | 12 + .../second/FieldAsQualifier-out.java | 13 + .../smartType/second/FieldAsQualifier.java | 13 + .../smartType/second/Generics-out.java | 13 + .../completion/smartType/second/Generics.java | 13 + .../smartType/second/GetClassLoader-out.java | 7 + .../smartType/second/GetClassLoader.java | 7 + .../smartType/second/IgnoreToString-out.java | 10 + .../smartType/second/IgnoreToString.java | 10 + .../smartType/second/MergeMethods-out.java | 14 + .../smartType/second/MergeMethods.java | 14 + .../second/MethodAsQualifier-out.java | 13 + .../smartType/second/MethodAsQualifier.java | 13 + .../second/MethodDelegation-out.java | 9 + .../smartType/second/MethodDelegation.java | 9 + .../second/MethodWithParams-out.java | 13 + .../smartType/second/MethodWithParams.java | 13 + .../NoArraysAsListCommonPrefix-out.java | 12 + .../second/NoArraysAsListCommonPrefix.java | 12 + .../smartType/second/NoLeftRecursion.java | 15 + .../NoObjectMethodsAsFirstPart-out.java | 12 + .../second/NoObjectMethodsAsFirstPart.java | 12 + .../smartType/second/NoRedundantCasts.java | 17 + .../NoUnqualifiedCastsInQualifiedContext.java | 12 + .../QualifiedArrayMemberAccess-out.java | 8 + .../second/QualifiedArrayMemberAccess.java | 8 + .../second/QualifierMatters-out.java | 19 + .../smartType/second/QualifierMatters.java | 19 + .../second/RestoreInitialPrefix-out.java | 18 + .../second/RestoreInitialPrefix.java | 18 + .../smartType/second/SingletonMap-out.java | 13 + .../smartType/second/SingletonMap.java | 12 + .../second/SuggestArraysAsList-out.java | 11 + .../smartType/second/SuggestArraysAsList.java | 10 + .../SuggestArraysAsListWildcard-out.java | 13 + .../second/SuggestArraysAsListWildcard.java | 12 + ...gestToArrayWithExistingEmptyArray-out.java | 14 + .../SuggestToArrayWithExistingEmptyArray.java | 14 + ...xistingEmptyArrayFromAnotherClass-out.java | 16 + ...ithExistingEmptyArrayFromAnotherClass.java | 16 + .../SuggestToArrayWithNewEmptyArray-out.java | 11 + .../SuggestToArrayWithNewEmptyArray.java | 11 + ...uggestToArrayWithNewNonEmptyArray-out.java | 10 + .../SuggestToArrayWithNewNonEmptyArray.java | 10 + .../second/ToArrayFieldsQualifier-out.java | 13 + .../second/ToArrayFieldsQualifier.java | 13 + .../ToArrayGenericArrayCreation-out.java | 11 + .../second/ToArrayGenericArrayCreation.java | 11 + .../second/ToArrayMethodQualifier-out.java | 13 + .../second/ToArrayMethodQualifier.java | 13 + .../second/ToListWithQualifier-out.java | 14 + .../smartType/second/ToListWithQualifier.java | 13 + .../second/VarargMemberAccess-out.java | 5 + .../smartType/second/VarargMemberAccess.java | 5 + .../HeavySmartTypeCompletion15Test.java | 88 ++ .../SecondSmartTypeCompletionTest.java | 195 +++++ .../completion/SmartTypeCompletion15Test.java | 300 +++++++ .../completion/SmartTypeCompletionTest.java | 807 ++++++++++++++++++ .../completion/CompletionTestCase.java | 88 ++ .../completion/LightCompletionTestCase.java | 103 +++ 497 files changed, 6384 insertions(+) create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AbstractClassTwice.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AfterNew15-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AfterNew15.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AfterNewInTernary-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AfterNewInTernary.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AfterNewWithGenerics-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AfterNewWithGenerics.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AmbiguousConstant-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AmbiguousConstant.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation2-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation2_2-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation2_2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation3-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation3_2-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation3_2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation4-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation4.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation5-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation5.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation6-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Annotation6.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ArrayAccessIndex-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ArrayAccessIndex.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ArrayAnnoParameter-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ArrayAnnoParameter.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ArrayClone-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ArrayClone.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ArrayIndexTailType-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ArrayIndexTailType.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AssignFromTheSameFieldOfAnotherObject-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AssignFromTheSameFieldOfAnotherObject.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AssignableToAfterCast-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AssignableToAfterCast.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AutoCastWhenAlreadyCasted-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/AutoCastWhenAlreadyCasted.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/BeforeBinaryExpressionInMethodCall-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/BeforeBinaryExpressionInMethodCall.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/BeforeCastToArray-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/BeforeCastToArray.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Bug1-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Bug1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Bug2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CallVarargArgument-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CallVarargArgument.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CastGenericQualifier-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CastGenericQualifier.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CastInThrow-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CastInThrow.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CastToArray-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CastToArray.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CastToParameterizedType-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CastToParameterizedType.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CastWith2TypeParameters-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CastWith2TypeParameters.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CastWithGenerics-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CastWithGenerics.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CatchInAnonymous-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CatchInAnonymous.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ClassLiteral-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ClassLiteral.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno1-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno2-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInheritors-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInheritors.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralShouldInsertImport-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralShouldInsertImport.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInMethodCall-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInMethodCall.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary2-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CommaDoublePenetration-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CommaDoublePenetration.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CommonPrefixWithSelection-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/CommonPrefixWithSelection.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ConstantTwice-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ConstantTwice.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ConstantTwice2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ConstructorOnSeparateLineInMethodCall-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ConstructorOnSeparateLineInMethodCall.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ConstructorWithExistingParens-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ConstructorWithExistingParens.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoMethodValue-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoMethodValue.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam2-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DelegateMethodArguments-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DelegateMethodArguments.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DelegationToParent-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DelegationToParent.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DoNotExcludeAssignedVariable-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DoNotExcludeAssignedVariable.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DontAutoCastWhenAlreadyCasted-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DontAutoCastWhenAlreadyCasted.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DoubleEmptyArray.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DoubleSemicolonPenetration-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DoubleSemicolonPenetration.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DoubleThis-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DoubleThis.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DoubleTrueInOverloadedMethodCall-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/DoubleTrueInOverloadedMethodCall.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EmptyListBeforeSemicolon-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EmptyListBeforeSemicolon.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn2-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturnTernary-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturnTernary.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EnumAsDefaultAnnotationParam-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EnumAsDefaultAnnotationParam.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitch-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitch.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitchOutside-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitchOutside.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EnumField-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EnumField.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EnumField1-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EnumField1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/EverythingDoubles.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice2-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExcessiveTail-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExcessiveTail.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExclamationFinishNonBoolean-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExclamationFinishNonBoolean.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExclamationMethodFinish-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExclamationMethodFinish.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExclamationStaticFieldFinish-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExclamationStaticFieldFinish.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExclamationVariableFinish-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExclamationVariableFinish.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExcludeDeclaredConstant-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExcludeDeclaredConstant.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExplicitMethodTypeParametersQualify-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExplicitMethodTypeParametersQualify.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardArrayParam-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardArrayParam.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardParam-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardParam.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExtendsInTypeCast-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExtendsInTypeCast.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExtraSemicolonAfterMethodParam-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ExtraSemicolonAfterMethodParam.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/FilterPrivateConstructors-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/FilterPrivateConstructors.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Foreach-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Foreach.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/HidingFields-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/HidingFields.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/HonorSelection-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/HonorSelection.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IDEADEV13148.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2626-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2626.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2668-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2668.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IDEADEV5150-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IDEADEV5150.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IDEADEV7835-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IDEADEV7835.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IfConditionBinaryExpression-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IfConditionBinaryExpression.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InThisExpression-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InThisExpression.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InferFromCall-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InferFromCall.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InferFromCall1-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InferFromCall1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InheritedClass-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InheritedClass.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InnerEnum-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InnerEnum.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InnerEnumInMethod-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InnerEnumInMethod.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InsertOverride-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InsertOverride.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InsertTypeParametersOnImporting-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InsertTypeParametersOnImporting.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InsideCatch-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InsideCatch.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InsideGenericClassLiteral.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InsideStringLiteral.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext2-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InstanceofedInsideAnonymous-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/InstanceofedInsideAnonymous.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IntConstInSwitch-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IntConstInSwitch.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IntPlusLongNotDouble-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/IntPlusLongNotDouble.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/JavadocThrows-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/JavadocThrows.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/LiveTemplate-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/LiveTemplate.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/MethodAnnotationNamedParameter-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/MethodAnnotationNamedParameter.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/MethodCallDot-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/MethodCallDot.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/MethodCallInScriplet-out.jsp create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/MethodCallInScriplet.jsp create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NegateVariable-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NegateVariable.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NestedAssignments-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NestedAssignments.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NewInnerOfParameterizedClass-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NewInnerOfParameterizedClass.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NewInnerRunnable-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NewInnerRunnable.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NewVararg.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NoClassLiteral-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NoClassLiteral.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueInElse.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueInElseWithComplexIf.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueInThenNegated.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueWhenBasicSuits-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueWhenBasicSuits.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NoKeyConstant.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NoNullAfterDot.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NoTypeParametersForToArray-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NoTypeParametersForToArray.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/NonStaticInnerClass.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/OneElementArray-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/OneElementArray.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/OverloadedMethods-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/OverloadedMethods.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ParameterizedConstructor-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ParameterizedConstructor.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor2-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/QualifiedThis-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/QualifiedThis.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/QualifiedThisInAnonymousConstructor-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/QualifiedThisInAnonymousConstructor.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ReplaceWholeReferenceChain-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ReplaceWholeReferenceChain.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SameFieldInAnotherObject-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SameFieldInAnotherObject.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SameNamedFieldAndLocal-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SameNamedFieldAndLocal.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Silly1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SillyAssignmentInTernary-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SillyAssignmentInTernary.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SmartFinish-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SmartFinish.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/StaticSubclass-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/StaticSubclass.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/StaticallyImportedMagicMethod-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/StaticallyImportedMagicMethod.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/StringConstantInAnno-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/StringConstantInAnno.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestAnythingWhenWildcardExpected.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestCastedValueAfterCast-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestCastedValueAfterCast.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValue-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValue.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueAfterReturn-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueAfterReturn.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInComplexIf-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInComplexIf.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInElseNegated-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInElseNegated.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInTernary-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInTernary.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestNull-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuggestNull.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuperConstructorArguments-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuperConstructorArguments.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuperMethodArguments-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/SuperMethodArguments.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TabMethodInBinaryExpression-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TabMethodInBinaryExpression.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TabToReplaceClassKeyword-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TabToReplaceClassKeyword.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TailAfterInstanceOf-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TailAfterInstanceOf.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ThrowExceptionConstructor-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ThrowExceptionConstructor.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ThrowRuntimeException-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/ThrowRuntimeException.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeArgs1-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeArgs1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeArgs2-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeArgs2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritors-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritors.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsComma-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsComma.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsInExpression-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsInExpression.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeParametersObjectInheritors-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeParametersObjectInheritors.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/TypeVariableInstanceOf.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/UnlockDocument-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/UnlockDocument.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/UnqualifiedConstantInSwitch-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/UnqualifiedConstantInSwitch.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromConstructedClass-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromConstructedClass.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClass-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClass.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClassReturnValue-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClassReturnValue.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/UserDataListAddAll-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/UserDataListAddAll.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Varargs1-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/Varargs1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/VoidCast.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/VoidExpectedType-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/VoidExpectedType.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof2-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof3-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/after1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/after2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/before1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/before2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter4.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore4.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after10.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after11.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after12.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after13.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after14.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after15.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after16.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after4.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after5.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after6.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after7.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after8.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/after9.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before10.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before11.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before12.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before13.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before14.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before15.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before16.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before4.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before5.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before6.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before7.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before8.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/afterNew/before9.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/foo/GetInstance-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/foo/GetInstance.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/after1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/after2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/after3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/after4.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/after5.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/after6.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/after7.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/after8.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/after9.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/before1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/before2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/before3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/before4.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/before5.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/before6.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/before7.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/before8.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/generics/before9.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after1_space.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after4.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after5.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after6.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before4.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before5.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before6.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/after1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/after2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/after3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/before1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/before2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/before3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/after1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/after2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/before1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/before2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/return/after1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/return/after2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/return/after3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/return/before1.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/return/before2.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/return/before3.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/ArrayMemberAccess-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/ArrayMemberAccess.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/CastInstanceofedQualifier-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/CastInstanceofedQualifier.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/ChainingPerformance.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/DifferentQualifiers.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/DontChainStringMethodsOnString-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/DontChainStringMethodsOnString.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/DontIgnoreToStringInStringBuilders.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/DontIgnoreToStringInsideIt-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/DontIgnoreToStringInsideIt.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/DontSuggestTooGenericMethods.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/EmptyListInMethodCall-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/EmptyListInMethodCall.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/FieldAsQualifier-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/FieldAsQualifier.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/Generics-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/Generics.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/GetClassLoader-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/GetClassLoader.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/IgnoreToString-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/IgnoreToString.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/MergeMethods-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/MergeMethods.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/MethodAsQualifier-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/MethodAsQualifier.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/MethodDelegation-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/MethodDelegation.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/MethodWithParams-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/MethodWithParams.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/NoArraysAsListCommonPrefix-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/NoArraysAsListCommonPrefix.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/NoLeftRecursion.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/NoObjectMethodsAsFirstPart-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/NoObjectMethodsAsFirstPart.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/NoRedundantCasts.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/NoUnqualifiedCastsInQualifiedContext.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/QualifiedArrayMemberAccess-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/QualifiedArrayMemberAccess.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/QualifierMatters-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/QualifierMatters.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/RestoreInitialPrefix-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/RestoreInitialPrefix.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SingletonMap-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SingletonMap.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsList-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsList.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsListWildcard-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsListWildcard.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArray-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArray.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArrayFromAnotherClass-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArrayFromAnotherClass.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewEmptyArray-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewEmptyArray.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewNonEmptyArray-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewNonEmptyArray.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayFieldsQualifier-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayFieldsQualifier.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayGenericArrayCreation-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayGenericArrayCreation.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayMethodQualifier-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayMethodQualifier.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/ToListWithQualifier-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/ToListWithQualifier.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/VarargMemberAccess-out.java create mode 100644 java/java-tests/testData/codeInsight/completion/smartType/second/VarargMemberAccess.java create mode 100644 java/java-tests/testSrc/com/intellij/codeInsight/completion/HeavySmartTypeCompletion15Test.java create mode 100644 java/java-tests/testSrc/com/intellij/codeInsight/completion/SecondSmartTypeCompletionTest.java create mode 100644 java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletion15Test.java create mode 100644 java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java create mode 100644 java/testFramework/src/com/intellij/codeInsight/completion/CompletionTestCase.java create mode 100644 java/testFramework/src/com/intellij/codeInsight/completion/LightCompletionTestCase.java diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AbstractClassTwice.java b/java/java-tests/testData/codeInsight/completion/smartType/AbstractClassTwice.java new file mode 100644 index 000000000000..d27017a8f614 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AbstractClassTwice.java @@ -0,0 +1,3 @@ +abstract class Foo { + Foo f = new +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AfterNew15-out.java b/java/java-tests/testData/codeInsight/completion/smartType/AfterNew15-out.java new file mode 100644 index 000000000000..6d43d5e3aa6e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AfterNew15-out.java @@ -0,0 +1,12 @@ +import java.io.File; +import java.io.FilenameFilter; + +class A { + { + new java.io.File("aaa").list(new FilenameFilter() { + public boolean accept(File dir, String name) { + return false; //To change body of implemented methods use File | Settings | File Templates. + } + }); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AfterNew15.java b/java/java-tests/testData/codeInsight/completion/smartType/AfterNew15.java new file mode 100644 index 000000000000..2244e86247f6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AfterNew15.java @@ -0,0 +1,5 @@ +class A { + { + new java.io.File("aaa").list(new ); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AfterNewInTernary-out.java b/java/java-tests/testData/codeInsight/completion/smartType/AfterNewInTernary-out.java new file mode 100644 index 000000000000..d18e846ee338 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AfterNewInTernary-out.java @@ -0,0 +1,5 @@ +class User { + { + String s = new String() == null ? getDefaultEjbName() : s; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AfterNewInTernary.java b/java/java-tests/testData/codeInsight/completion/smartType/AfterNewInTernary.java new file mode 100644 index 000000000000..8d0c02414dc1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AfterNewInTernary.java @@ -0,0 +1,5 @@ +class User { + { + String s = new == null ? getDefaultEjbName() : s; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AfterNewWithGenerics-out.java b/java/java-tests/testData/codeInsight/completion/smartType/AfterNewWithGenerics-out.java new file mode 100644 index 000000000000..0984e6a3f47b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AfterNewWithGenerics-out.java @@ -0,0 +1,15 @@ +class Pair { + public final A first; + public final B second; + + Pair(A first, B second) { + this.first = first; + this.second = second; + } +} + +class Test { + void test(Pair p) { + Pair p2 = new Pair(p.first, ); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AfterNewWithGenerics.java b/java/java-tests/testData/codeInsight/completion/smartType/AfterNewWithGenerics.java new file mode 100644 index 000000000000..eb46f9f44215 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AfterNewWithGenerics.java @@ -0,0 +1,15 @@ +class Pair { + public final A first; + public final B second; + + Pair(A first, B second) { + this.first = first; + this.second = second; + } +} + +class Test { + void test(Pair p) { + Pair p2 = new Pair(p.f); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AmbiguousConstant-out.java b/java/java-tests/testData/codeInsight/completion/smartType/AmbiguousConstant-out.java new file mode 100644 index 000000000000..3b199d7be22a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AmbiguousConstant-out.java @@ -0,0 +1,15 @@ +interface Foo { + int ABC = 1; +} + +interface Bar extends Foo { + boolean ABC = 2; +} + +class FooImpl implements Foo {} + +class BarImpl extends FooImpl implements Bar { + { + boolean a = Bar.ABC; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AmbiguousConstant.java b/java/java-tests/testData/codeInsight/completion/smartType/AmbiguousConstant.java new file mode 100644 index 000000000000..8bddaaaa0e0f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AmbiguousConstant.java @@ -0,0 +1,15 @@ +interface Foo { + int ABC = 1; +} + +interface Bar extends Foo { + boolean ABC = 2; +} + +class FooImpl implements Foo {} + +class BarImpl extends FooImpl implements Bar { + { + boolean a = A; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation-out.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation-out.java new file mode 100644 index 000000000000..d2902b36e2b6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation-out.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Target; +@Target(value={ElementType.}) +@interface Annotation { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation.java new file mode 100644 index 000000000000..3b986c7bc5a7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Target; +@Target(value={}) +@interface Annotation { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation2-out.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation2-out.java new file mode 100644 index 000000000000..2ae51781a041 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation2-out.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Retention; +@Retention(RetentionPolicy.) +@interface Annotation { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation2.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation2.java new file mode 100644 index 000000000000..f4c8343844fa --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation2.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Retention; +@Retention() +@interface Annotation { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation2_2-out.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation2_2-out.java new file mode 100644 index 000000000000..e00816cbb1d4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation2_2-out.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Retention; +@Retention(value=RetentionPolicy.) +@interface Annotation { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation2_2.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation2_2.java new file mode 100644 index 000000000000..77cedc201c03 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation2_2.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Retention; +@Retention(value=) +@interface Annotation { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation3-out.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation3-out.java new file mode 100644 index 000000000000..8e790ebdd21c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation3-out.java @@ -0,0 +1,13 @@ +@interface Table { + int columnCount(); +} + +@interface Join { + Table table(); +} + + +@Join(table = @Table() ) +@interface Annotation { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation3.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation3.java new file mode 100644 index 000000000000..209b83d1395b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation3.java @@ -0,0 +1,13 @@ +@interface Table { + int columnCount(); +} + +@interface Join { + Table table(); +} + + +@Join(table = ) +@interface Annotation { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation3_2-out.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation3_2-out.java new file mode 100644 index 000000000000..888338a3f4c0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation3_2-out.java @@ -0,0 +1,17 @@ +@interface Column { + String name(); +} + +@interface Table { + Column id(); +} + +@interface Join { + Table[] table(); +} + + +@Join({@Table(id = @Column())} ) +@interface Annotation { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation3_2.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation3_2.java new file mode 100644 index 000000000000..6dd157d9bf1a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation3_2.java @@ -0,0 +1,17 @@ +@interface Column { + String name(); +} + +@interface Table { + Column id(); +} + +@interface Join { + Table[] table(); +} + + +@Join({@Table(id = )} ) +@interface Annotation { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation4-out.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation4-out.java new file mode 100644 index 000000000000..dd32bc11cfd2 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation4-out.java @@ -0,0 +1,8 @@ +@interface Join { + boolean nestedLoops(); +} + +@Join(nestedLoops = ) +@interface Annotation { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation4.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation4.java new file mode 100644 index 000000000000..dd32bc11cfd2 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation4.java @@ -0,0 +1,8 @@ +@interface Join { + boolean nestedLoops(); +} + +@Join(nestedLoops = ) +@interface Annotation { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation5-out.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation5-out.java new file mode 100644 index 000000000000..c074aa93361f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation5-out.java @@ -0,0 +1,16 @@ +enum Setup { + NO_CONNECTION, + CONNECTION +} + +@Target(value = ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Test { + Setup setup(); +} + +public class Client { + @Test(setup = Setup.) + public void run() { + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation5.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation5.java new file mode 100644 index 000000000000..c074aa93361f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation5.java @@ -0,0 +1,16 @@ +enum Setup { + NO_CONNECTION, + CONNECTION +} + +@Target(value = ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Test { + Setup setup(); +} + +public class Client { + @Test(setup = Setup.) + public void run() { + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation6-out.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation6-out.java new file mode 100644 index 000000000000..3e059cead79c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation6-out.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Target; + +@Target(ElementType.) +public @interface Test { +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Annotation6.java b/java/java-tests/testData/codeInsight/completion/smartType/Annotation6.java new file mode 100644 index 000000000000..15838a2cd649 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Annotation6.java @@ -0,0 +1,5 @@ +import java.lang.annotation.Target; + +@Target() +public @interface Test { +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ArrayAccessIndex-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ArrayAccessIndex-out.java new file mode 100644 index 000000000000..8cae38f61ff5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ArrayAccessIndex-out.java @@ -0,0 +1,7 @@ +public class Foo { + { + int pppp; + int[] aaaa; + aaaa[pppp] + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ArrayAccessIndex.java b/java/java-tests/testData/codeInsight/completion/smartType/ArrayAccessIndex.java new file mode 100644 index 000000000000..2522531ee662 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ArrayAccessIndex.java @@ -0,0 +1,7 @@ +public class Foo { + { + int pppp; + int[] aaaa; + aaaa[p] + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ArrayAnnoParameter-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ArrayAnnoParameter-out.java new file mode 100644 index 000000000000..8c76cb03be0b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ArrayAnnoParameter-out.java @@ -0,0 +1,10 @@ +public @interface A { + String[] value(); +} + +class WontComplete { + public static final String STRING = "aaaaa"; + + @A(STRING{"x"}) + int x; +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ArrayAnnoParameter.java b/java/java-tests/testData/codeInsight/completion/smartType/ArrayAnnoParameter.java new file mode 100644 index 000000000000..690e5998c3dd --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ArrayAnnoParameter.java @@ -0,0 +1,10 @@ +public @interface A { + String[] value(); +} + +class WontComplete { + public static final String STRING = "aaaaa"; + + @A({"x"}) + int x; +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ArrayClone-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ArrayClone-out.java new file mode 100644 index 000000000000..3c7a2653a47f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ArrayClone-out.java @@ -0,0 +1,6 @@ +public class ArrayClone { + public static void main(String[] arg) { + String[] strings1 = {""}; + String[] strings2 = strings1.clone(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ArrayClone.java b/java/java-tests/testData/codeInsight/completion/smartType/ArrayClone.java new file mode 100644 index 000000000000..025398dbd866 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ArrayClone.java @@ -0,0 +1,6 @@ +public class ArrayClone { + public static void main(String[] arg) { + String[] strings1 = {""}; + String[] strings2 = strings1.cl(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ArrayIndexTailType-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ArrayIndexTailType-out.java new file mode 100644 index 000000000000..093cd7c1d949 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ArrayIndexTailType-out.java @@ -0,0 +1,10 @@ +public class Foo { + + { + int abcdef; + int[] xxx; + int z = xxx[abcdef] + + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ArrayIndexTailType.java b/java/java-tests/testData/codeInsight/completion/smartType/ArrayIndexTailType.java new file mode 100644 index 000000000000..1dc2aa68632f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ArrayIndexTailType.java @@ -0,0 +1,10 @@ +public class Foo { + + { + int abcdef; + int[] xxx; + int z = xxx[a] + + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AssignFromTheSameFieldOfAnotherObject-out.java b/java/java-tests/testData/codeInsight/completion/smartType/AssignFromTheSameFieldOfAnotherObject-out.java new file mode 100644 index 000000000000..fa8d90fa93f0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AssignFromTheSameFieldOfAnotherObject-out.java @@ -0,0 +1,8 @@ +class Foo { + int foo; + + { + Foo f; + foo = f.foo; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AssignFromTheSameFieldOfAnotherObject.java b/java/java-tests/testData/codeInsight/completion/smartType/AssignFromTheSameFieldOfAnotherObject.java new file mode 100644 index 000000000000..9e3f69b9c81c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AssignFromTheSameFieldOfAnotherObject.java @@ -0,0 +1,8 @@ +class Foo { + int foo; + + { + Foo f; + foo = f.f + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AssignableToAfterCast-out.java b/java/java-tests/testData/codeInsight/completion/smartType/AssignableToAfterCast-out.java new file mode 100644 index 000000000000..6a1511fb6c7f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AssignableToAfterCast-out.java @@ -0,0 +1,8 @@ +public class ZZZ { + Object foo(); + + { + ZZZ z; + ZZZ y = (ZZZ ) z.foo() + } + } \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AssignableToAfterCast.java b/java/java-tests/testData/codeInsight/completion/smartType/AssignableToAfterCast.java new file mode 100644 index 000000000000..5f42aebd4833 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AssignableToAfterCast.java @@ -0,0 +1,8 @@ +public class ZZZ { + Object foo(); + + { + ZZZ z; + ZZZ y = (ZZZ ) z.f + } + } \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AutoCastWhenAlreadyCasted-out.java b/java/java-tests/testData/codeInsight/completion/smartType/AutoCastWhenAlreadyCasted-out.java new file mode 100644 index 000000000000..01e305163555 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AutoCastWhenAlreadyCasted-out.java @@ -0,0 +1,9 @@ +class B { + { + Object o; + if (o instanceof String) { + String s = (String) o; + String ss = (String) o; + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/AutoCastWhenAlreadyCasted.java b/java/java-tests/testData/codeInsight/completion/smartType/AutoCastWhenAlreadyCasted.java new file mode 100644 index 000000000000..34cc868a6cf5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/AutoCastWhenAlreadyCasted.java @@ -0,0 +1,9 @@ +class B { + { + Object o; + if (o instanceof String) { + String s = (String) o; + String ss = o + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/BeforeBinaryExpressionInMethodCall-out.java b/java/java-tests/testData/codeInsight/completion/smartType/BeforeBinaryExpressionInMethodCall-out.java new file mode 100644 index 000000000000..6eb3407eff22 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/BeforeBinaryExpressionInMethodCall-out.java @@ -0,0 +1,10 @@ +public class Foo { + + { + Foo foo = null; + Foo bar = id(foo, Foo.class.toString() + "[]")); + } + + Foo id(Foo foo, String a) {return foo;} + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/BeforeBinaryExpressionInMethodCall.java b/java/java-tests/testData/codeInsight/completion/smartType/BeforeBinaryExpressionInMethodCall.java new file mode 100644 index 000000000000..013b71f1eaed --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/BeforeBinaryExpressionInMethodCall.java @@ -0,0 +1,10 @@ +public class Foo { + + { + Foo foo = null; + Foo bar = id(fFoo.class.toString() + "[]")); + } + + Foo id(Foo foo, String a) {return foo;} + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/BeforeCastToArray-out.java b/java/java-tests/testData/codeInsight/completion/smartType/BeforeCastToArray-out.java new file mode 100644 index 000000000000..d33efbdeb1e5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/BeforeCastToArray-out.java @@ -0,0 +1,8 @@ +class Foo { + public static final Foo[] EMPTY_ARRAY = new Foo[0]; + + public Foo[] foo(boolean b){ + return EMPTY_ARRAY;(Bar[]); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/BeforeCastToArray.java b/java/java-tests/testData/codeInsight/completion/smartType/BeforeCastToArray.java new file mode 100644 index 000000000000..6d1621e270ca --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/BeforeCastToArray.java @@ -0,0 +1,8 @@ +class Foo { + public static final Foo[] EMPTY_ARRAY = new Foo[0]; + + public Foo[] foo(boolean b){ + return EMA(Bar[]); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Bug1-out.java b/java/java-tests/testData/codeInsight/completion/smartType/Bug1-out.java new file mode 100644 index 000000000000..3f15d9f6d641 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Bug1-out.java @@ -0,0 +1,12 @@ + +public class QQQ { + void f(QQQ q) { } + + { + new Runnable() { + public void run() { + f(QQQ.this); + } + }; + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Bug1.java b/java/java-tests/testData/codeInsight/completion/smartType/Bug1.java new file mode 100644 index 000000000000..375826d2f8b5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Bug1.java @@ -0,0 +1,12 @@ + +public class QQQ { + void f(QQQ q) { } + + { + new Runnable() { + public void run() { + f(); + } + }; + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Bug2.java b/java/java-tests/testData/codeInsight/completion/smartType/Bug2.java new file mode 100644 index 000000000000..32fe05ba91b5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Bug2.java @@ -0,0 +1,7 @@ +class Test { + /** + * @exception IllegalStateException + */ + public void foo() throws java.io.IOException, IllegalStateException { + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CallVarargArgument-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CallVarargArgument-out.java new file mode 100644 index 000000000000..f5cec0ae49f7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CallVarargArgument-out.java @@ -0,0 +1,18 @@ +public class JavaClass { + + + + V foo(Class s) {} +} + +class Zoo { + { + Class xcccccccc = null; + JavaClass cccc = new JavaClass(); + bar(cccc.foo(xcccccccc)); + } + + void bar(String... s) { + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CallVarargArgument.java b/java/java-tests/testData/codeInsight/completion/smartType/CallVarargArgument.java new file mode 100644 index 000000000000..da6cfc9911dd --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CallVarargArgument.java @@ -0,0 +1,18 @@ +public class JavaClass { + + + + V foo(Class s) {} +} + +class Zoo { + { + Class xcccccccc = null; + JavaClass cccc = new JavaClass(); + bar(cccc.foo(xcc)); + } + + void bar(String... s) { + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CastGenericQualifier-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CastGenericQualifier-out.java new file mode 100644 index 000000000000..14543b6a1821 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CastGenericQualifier-out.java @@ -0,0 +1,13 @@ +class A { + T get() { + return null; + } +} +class B extends A {} +class C { + void m(A a) { + if (a instanceof B) { + StringBuffer s = ((B) a).get(); + } + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CastGenericQualifier.java b/java/java-tests/testData/codeInsight/completion/smartType/CastGenericQualifier.java new file mode 100644 index 000000000000..b84a1c5f4479 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CastGenericQualifier.java @@ -0,0 +1,13 @@ +class A { + T get() { + return null; + } +} +class B extends A {} +class C { + void m(A a) { + if (a instanceof B) { + StringBuffer s = a. + } + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CastInThrow-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CastInThrow-out.java new file mode 100644 index 000000000000..0ba02a78a402 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CastInThrow-out.java @@ -0,0 +1,11 @@ +class MyException extends Exception {} + +class Test { + void test() throws MyException { + try { + throw new RuntimeException(); + } catch(Exception e) { + throw (MyException) + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CastInThrow.java b/java/java-tests/testData/codeInsight/completion/smartType/CastInThrow.java new file mode 100644 index 000000000000..79892bdce87c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CastInThrow.java @@ -0,0 +1,11 @@ +class MyException extends Exception {} + +class Test { + void test() throws MyException { + try { + throw new RuntimeException(); + } catch(Exception e) { + throw () + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CastToArray-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CastToArray-out.java new file mode 100644 index 000000000000..c693df5eb1b9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CastToArray-out.java @@ -0,0 +1,7 @@ +public class SomeClass { + + { + String[] aaa = (String[]) + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CastToArray.java b/java/java-tests/testData/codeInsight/completion/smartType/CastToArray.java new file mode 100644 index 000000000000..3eff52654ffd --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CastToArray.java @@ -0,0 +1,7 @@ +public class SomeClass { + + { + String[] aaa = ( + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CastToParameterizedType-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CastToParameterizedType-out.java new file mode 100644 index 000000000000..2bf1038d67e7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CastToParameterizedType-out.java @@ -0,0 +1,11 @@ +public class A { + private static final A X = null; + + A get(B o) { + return (A) X; + } + } + +class B { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CastToParameterizedType.java b/java/java-tests/testData/codeInsight/completion/smartType/CastToParameterizedType.java new file mode 100644 index 000000000000..dea9c61d876c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CastToParameterizedType.java @@ -0,0 +1,11 @@ +public class A { + private static final A X = null; + + A get(B o) { + return (X; + } + } + +class B { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CastWith2TypeParameters-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CastWith2TypeParameters-out.java new file mode 100644 index 000000000000..2a5b79da314d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CastWith2TypeParameters-out.java @@ -0,0 +1,10 @@ +interface Foo {} + + class Bar { + Bar(Foo foo) {} + } + + class Main { + Foo foo; + Bar bar = new Bar((Foo) foo); + } diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CastWith2TypeParameters.java b/java/java-tests/testData/codeInsight/completion/smartType/CastWith2TypeParameters.java new file mode 100644 index 000000000000..1e2d46d989af --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CastWith2TypeParameters.java @@ -0,0 +1,10 @@ +interface Foo {} + + class Bar { + Bar(Foo foo) {} + } + + class Main { + Foo foo; + Bar bar = new Bar((foo); + } diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CastWithGenerics-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CastWithGenerics-out.java new file mode 100644 index 000000000000..9e5e012b6fb3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CastWithGenerics-out.java @@ -0,0 +1,9 @@ +public class Aaaaaaa { + + void foo(Class c) {} + + void bar() { + foo((Class) Class.forName("sdd")); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CastWithGenerics.java b/java/java-tests/testData/codeInsight/completion/smartType/CastWithGenerics.java new file mode 100644 index 000000000000..8e3735ac74cb --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CastWithGenerics.java @@ -0,0 +1,9 @@ +public class Aaaaaaa { + + void foo(Class c) {} + + void bar() { + foo((Class.forName("sdd")); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CatchInAnonymous-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CatchInAnonymous-out.java new file mode 100644 index 000000000000..1d95df578c72 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CatchInAnonymous-out.java @@ -0,0 +1,17 @@ +import java.io.*; + +class Foo { + { + Runnable runnable = new Runnable() { + public void run() { + try { + throw new IOException(); + } catch (IOException ) { + + } + } + }; + + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CatchInAnonymous.java b/java/java-tests/testData/codeInsight/completion/smartType/CatchInAnonymous.java new file mode 100644 index 000000000000..8ef3ccd6e548 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CatchInAnonymous.java @@ -0,0 +1,17 @@ +import java.io.*; + +class Foo { + { + Runnable runnable = new Runnable() { + public void run() { + try { + throw new IOException(); + } catch () { + + } + } + }; + + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteral-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteral-out.java new file mode 100644 index 000000000000..823663bc65e2 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteral-out.java @@ -0,0 +1,6 @@ +class C { + void h (Class clazz) {} + { + h(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteral.java b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteral.java new file mode 100644 index 000000000000..823663bc65e2 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteral.java @@ -0,0 +1,6 @@ +class C { + void h (Class clazz) {} + { + h(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno1-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno1-out.java new file mode 100644 index 000000000000..ee8001b7492f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno1-out.java @@ -0,0 +1,5 @@ +@interface Anno { + Class value(); +} +@Anno(String.class) +class Foo {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno1.java b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno1.java new file mode 100644 index 000000000000..15e1ab6577b4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno1.java @@ -0,0 +1,5 @@ +@interface Anno { + Class value(); +} +@Anno(String.cl) +class Foo {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno2-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno2-out.java new file mode 100644 index 000000000000..ee8001b7492f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno2-out.java @@ -0,0 +1,5 @@ +@interface Anno { + Class value(); +} +@Anno(String.class) +class Foo {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno2.java b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno2.java new file mode 100644 index 000000000000..9abed98d2e9d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInAnno2.java @@ -0,0 +1,5 @@ +@interface Anno { + Class value(); +} +@Anno() +class Foo {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInheritors-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInheritors-out.java new file mode 100644 index 000000000000..9768a732505a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInheritors-out.java @@ -0,0 +1,6 @@ +@interface Anno { + Class value(); +} +@Anno(Bar.class) +class Foo {} +class Bar extends Foo{} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInheritors.java b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInheritors.java new file mode 100644 index 000000000000..5080121720ce --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralInheritors.java @@ -0,0 +1,6 @@ +@interface Anno { + Class value(); +} +@Anno(B) +class Foo {} +class Bar extends Foo{} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralShouldInsertImport-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralShouldInsertImport-out.java new file mode 100644 index 000000000000..daaa873ae42a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralShouldInsertImport-out.java @@ -0,0 +1,6 @@ +import bar.Intf; +import foo.Bar; + +class Fooooo { + Class f = Bar.class; +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralShouldInsertImport.java b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralShouldInsertImport.java new file mode 100644 index 000000000000..ce0d69ea6ab4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ClassLiteralShouldInsertImport.java @@ -0,0 +1,5 @@ +import bar.Intf; + +class Fooooo { + Class f = B +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInMethodCall-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInMethodCall-out.java new file mode 100644 index 000000000000..ebec3527b870 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInMethodCall-out.java @@ -0,0 +1,14 @@ +class Set {} + +class Collections { + static Set emptySet() {} +} + +class Bar { + + { + foo(Collections.emptySet()); + } + + void foo(Set set){} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInMethodCall.java b/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInMethodCall.java new file mode 100644 index 000000000000..fc0353e73fb8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInMethodCall.java @@ -0,0 +1,14 @@ +class Set {} + +class Collections { + static Set emptySet() {} +} + +class Bar { + + { + foo(Collections.e) + } + + void foo(Set set){} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary-out.java new file mode 100644 index 000000000000..f292f19899ea --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary-out.java @@ -0,0 +1,14 @@ +class Set {} + +class Collections { + static Set emptySet() {} +} + +class Bar { + + Set bar() { + return true ? Collections.emptySet() : + } + + void foo(Set set){} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary.java b/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary.java new file mode 100644 index 000000000000..1f913e8f96ad --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary.java @@ -0,0 +1,14 @@ +class Set {} + +class Collections { + static Set emptySet() {} +} + +class Bar { + + Set bar() { + return true ? Collections.e + } + + void foo(Set set){} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary2-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary2-out.java new file mode 100644 index 000000000000..e0081fbd8123 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary2-out.java @@ -0,0 +1,14 @@ +class Set {} + +class Collections { + static Set emptySet() {} +} + +class Bar { + + Set bar() { + return true ? null : Collections.emptySet(); + } + + void foo(Set set){} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary2.java b/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary2.java new file mode 100644 index 000000000000..f0d94b4faf69 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CollectionsEmptySetInTernary2.java @@ -0,0 +1,14 @@ +class Set {} + +class Collections { + static Set emptySet() {} +} + +class Bar { + + Set bar() { + return true ? null : Collections.e + } + + void foo(Set set){} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CommaDoublePenetration-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CommaDoublePenetration-out.java new file mode 100644 index 000000000000..b3e7f1e72b58 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CommaDoublePenetration-out.java @@ -0,0 +1,11 @@ +public abstract class Zzz { + + { + foo(aaaa(), ) + } + + int aaaa() {} + + void foo(int a) {} + void foo(int a, String b) {} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CommaDoublePenetration.java b/java/java-tests/testData/codeInsight/completion/smartType/CommaDoublePenetration.java new file mode 100644 index 000000000000..d3fa180ad98e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CommaDoublePenetration.java @@ -0,0 +1,11 @@ +public abstract class Zzz { + + { + foo() + } + + int aaaa() {} + + void foo(int a) {} + void foo(int a, String b) {} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CommonPrefixWithSelection-out.java b/java/java-tests/testData/codeInsight/completion/smartType/CommonPrefixWithSelection-out.java new file mode 100644 index 000000000000..d3032771ca67 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CommonPrefixWithSelection-out.java @@ -0,0 +1,13 @@ +import java.util.*; + +public class FooBar { + + { + List laaaaaa; + List laaaabbbbbb; + for (String s : laaaaaa) { + + } + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/CommonPrefixWithSelection.java b/java/java-tests/testData/codeInsight/completion/smartType/CommonPrefixWithSelection.java new file mode 100644 index 000000000000..9d169ba94fbb --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/CommonPrefixWithSelection.java @@ -0,0 +1,13 @@ +import java.util.*; + +public class FooBar { + + { + List laaaaaa; + List laaaabbbbbb; + for (String s : laaaasdafsdf) { + + } + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ConstantTwice-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ConstantTwice-out.java new file mode 100644 index 000000000000..cf770500a758 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ConstantTwice-out.java @@ -0,0 +1,11 @@ +class Key {} + +public class Foo { + static final Key FOO; + + void foo(Key key) {} + + { + foo(FOO); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ConstantTwice.java b/java/java-tests/testData/codeInsight/completion/smartType/ConstantTwice.java new file mode 100644 index 000000000000..e2e62dd81be6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ConstantTwice.java @@ -0,0 +1,11 @@ +class Key {} + +public class Foo { + static final Key FOO; + + void foo(Key key) {} + + { + foo() + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ConstantTwice2.java b/java/java-tests/testData/codeInsight/completion/smartType/ConstantTwice2.java new file mode 100644 index 000000000000..3886f2804906 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ConstantTwice2.java @@ -0,0 +1,10 @@ +interface Bar { + char c; + char d; +} + +class Foo { + { + String s = "".substring("".lastIndexOf(Bar.)); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ConstructorOnSeparateLineInMethodCall-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ConstructorOnSeparateLineInMethodCall-out.java new file mode 100644 index 000000000000..d859597e9f48 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ConstructorOnSeparateLineInMethodCall-out.java @@ -0,0 +1,10 @@ +class Main { + private static void method(Integer param) { + } + + public static void main(String[] args) { + method( + new Integer() + ); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ConstructorOnSeparateLineInMethodCall.java b/java/java-tests/testData/codeInsight/completion/smartType/ConstructorOnSeparateLineInMethodCall.java new file mode 100644 index 000000000000..4f17aeccc373 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ConstructorOnSeparateLineInMethodCall.java @@ -0,0 +1,10 @@ +class Main { + private static void method(Integer param) { + } + + public static void main(String[] args) { + method( + new + ); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ConstructorWithExistingParens-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ConstructorWithExistingParens-out.java new file mode 100644 index 000000000000..5dc3bf7e7727 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ConstructorWithExistingParens-out.java @@ -0,0 +1,7 @@ +public class TestSmartComplete { + public static void main(String[] args) { + Long var; + + var = new Long(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ConstructorWithExistingParens.java b/java/java-tests/testData/codeInsight/completion/smartType/ConstructorWithExistingParens.java new file mode 100644 index 000000000000..d4349c954db8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ConstructorWithExistingParens.java @@ -0,0 +1,7 @@ +public class TestSmartComplete { + public static void main(String[] args) { + Long var; + + var = new (); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoMethodValue-out.java b/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoMethodValue-out.java new file mode 100644 index 000000000000..f110255d95de --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoMethodValue-out.java @@ -0,0 +1,8 @@ +enum MyEnum { + FOO, BAR; +} + +public @interface Foo { + + MyEnum en() default MyEnum.FOO; +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoMethodValue.java b/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoMethodValue.java new file mode 100644 index 000000000000..8553b0bb216b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoMethodValue.java @@ -0,0 +1,8 @@ +enum MyEnum { + FOO, BAR; +} + +public @interface Foo { + + MyEnum en() default F +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam-out.java b/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam-out.java new file mode 100644 index 000000000000..b233dd26fa07 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam-out.java @@ -0,0 +1,16 @@ +@interface Anno { + String value(); +} + +public class FooBar { + public static final String FOO_BAR; + + @Anno(FOO_BAR) + void m() {} + + String FooBarrrrrr() {} + + public static String FooBarrrr() {} + + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam.java b/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam.java new file mode 100644 index 000000000000..f0b8d8bfb77b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam.java @@ -0,0 +1,16 @@ +@interface Anno { + String value(); +} + +public class FooBar { + public static final String FOO_BAR; + + @Anno(FB) + void m() {} + + String FooBarrrrrr() {} + + public static String FooBarrrr() {} + + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam2-out.java b/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam2-out.java new file mode 100644 index 000000000000..6ee7a991b731 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam2-out.java @@ -0,0 +1,14 @@ +@interface Anno { + String value(); +} + +@Anno(FooBar.FEE_BAR) +public class FooBar { + public static final String FEE_BAR; + + String FooBarrrrrr() {} + + public static String FooBarrrr() {} + + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam2.java b/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam2.java new file mode 100644 index 000000000000..0167b0892cff --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DefaultAnnoParam2.java @@ -0,0 +1,14 @@ +@interface Anno { + String value(); +} + +@Anno(FB) +public class FooBar { + public static final String FEE_BAR; + + String FooBarrrrrr() {} + + public static String FooBarrrr() {} + + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DelegateMethodArguments-out.java b/java/java-tests/testData/codeInsight/completion/smartType/DelegateMethodArguments-out.java new file mode 100644 index 000000000000..d92f9e5013c6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DelegateMethodArguments-out.java @@ -0,0 +1,14 @@ +public class SomeClass { + + public void foo(int count) {} + public static Object foo(int count, String descr) { + + } + +} + +class SomeClassImpl { + public Object foo(int count, String description) { + SomeClass.foo(count, description); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DelegateMethodArguments.java b/java/java-tests/testData/codeInsight/completion/smartType/DelegateMethodArguments.java new file mode 100644 index 000000000000..4fa21e0a7f68 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DelegateMethodArguments.java @@ -0,0 +1,14 @@ +public class SomeClass { + + public void foo(int count) {} + public static Object foo(int count, String descr) { + + } + +} + +class SomeClassImpl { + public Object foo(int count, String description) { + SomeClass.foo(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DelegationToParent-out.java b/java/java-tests/testData/codeInsight/completion/smartType/DelegationToParent-out.java new file mode 100644 index 000000000000..f35e7a489826 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DelegationToParent-out.java @@ -0,0 +1,15 @@ +class ExtensionPointName { + public static ExtensionPointName create(String s) { return null; } +} + +class Foo { + public static T[] getExtensions(ExtensionPointName extensionPointName) { + return null; + } + + ExtensionPointName EXTENSION_POINT_NAME = ExtensionPointName.create("com.intellij.fileBasedIndex"); + + void f() { + final B[] extensions = getExtensions(XXX.EXTENSION_POINT_NAME); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DelegationToParent.java b/java/java-tests/testData/codeInsight/completion/smartType/DelegationToParent.java new file mode 100644 index 000000000000..f35e7a489826 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DelegationToParent.java @@ -0,0 +1,15 @@ +class ExtensionPointName { + public static ExtensionPointName create(String s) { return null; } +} + +class Foo { + public static T[] getExtensions(ExtensionPointName extensionPointName) { + return null; + } + + ExtensionPointName EXTENSION_POINT_NAME = ExtensionPointName.create("com.intellij.fileBasedIndex"); + + void f() { + final B[] extensions = getExtensions(XXX.EXTENSION_POINT_NAME); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DoNotExcludeAssignedVariable-out.java b/java/java-tests/testData/codeInsight/completion/smartType/DoNotExcludeAssignedVariable-out.java new file mode 100644 index 000000000000..08d29c058729 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DoNotExcludeAssignedVariable-out.java @@ -0,0 +1,11 @@ +class Foo { + Foo myFoo; + + Foo foo(Foo foo) { + } + + { + myFoo = foo(myFoo) + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DoNotExcludeAssignedVariable.java b/java/java-tests/testData/codeInsight/completion/smartType/DoNotExcludeAssignedVariable.java new file mode 100644 index 000000000000..158c72a746c2 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DoNotExcludeAssignedVariable.java @@ -0,0 +1,11 @@ +class Foo { + Foo myFoo; + + Foo foo(Foo foo) { + } + + { + myFoo = foo(m) + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DontAutoCastWhenAlreadyCasted-out.java b/java/java-tests/testData/codeInsight/completion/smartType/DontAutoCastWhenAlreadyCasted-out.java new file mode 100644 index 000000000000..e3ece2d7d8f8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DontAutoCastWhenAlreadyCasted-out.java @@ -0,0 +1,9 @@ +class B { + { + Object o; + if (o instanceof String) { + String s = (String) o; + String ss = s; + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DontAutoCastWhenAlreadyCasted.java b/java/java-tests/testData/codeInsight/completion/smartType/DontAutoCastWhenAlreadyCasted.java new file mode 100644 index 000000000000..8df19e91dd7d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DontAutoCastWhenAlreadyCasted.java @@ -0,0 +1,9 @@ +class B { + { + Object o; + if (o instanceof String) { + String s = (String) o; + String ss = + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DoubleEmptyArray.java b/java/java-tests/testData/codeInsight/completion/smartType/DoubleEmptyArray.java new file mode 100644 index 000000000000..13c784b02223 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DoubleEmptyArray.java @@ -0,0 +1,12 @@ +class Foo { + public static final Foo[] EMPTY = new Foo[0]; +} + +class Bar { + + Foo[] bar() {} + + Foo[] foo() { + return ; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DoubleSemicolonPenetration-out.java b/java/java-tests/testData/codeInsight/completion/smartType/DoubleSemicolonPenetration-out.java new file mode 100644 index 000000000000..c8faef104750 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DoubleSemicolonPenetration-out.java @@ -0,0 +1,11 @@ +public class Foo { + + void bar() { + this.foo(); + } + + void foo() { + + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DoubleSemicolonPenetration.java b/java/java-tests/testData/codeInsight/completion/smartType/DoubleSemicolonPenetration.java new file mode 100644 index 000000000000..0f8e12083963 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DoubleSemicolonPenetration.java @@ -0,0 +1,11 @@ +public class Foo { + + void bar() { + this.fo + } + + void foo() { + + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DoubleThis-out.java b/java/java-tests/testData/codeInsight/completion/smartType/DoubleThis-out.java new file mode 100644 index 000000000000..aef4adfabbbd --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DoubleThis-out.java @@ -0,0 +1,11 @@ +interface Aaa {} +interface Bbb {} + +class Ccc implements Aaa, Bbb { + void foo(Aaa a); + void foo(Bbb b); + + { + foo(this); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DoubleThis.java b/java/java-tests/testData/codeInsight/completion/smartType/DoubleThis.java new file mode 100644 index 000000000000..542e6bffa219 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DoubleThis.java @@ -0,0 +1,11 @@ +interface Aaa {} +interface Bbb {} + +class Ccc implements Aaa, Bbb { + void foo(Aaa a); + void foo(Bbb b); + + { + foo() + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DoubleTrueInOverloadedMethodCall-out.java b/java/java-tests/testData/codeInsight/completion/smartType/DoubleTrueInOverloadedMethodCall-out.java new file mode 100644 index 000000000000..fb3d316218b3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DoubleTrueInOverloadedMethodCall-out.java @@ -0,0 +1,8 @@ +class Client { + { + foo(true); + } + + void foo(Object o) {} + void foo(boolean o) {} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/DoubleTrueInOverloadedMethodCall.java b/java/java-tests/testData/codeInsight/completion/smartType/DoubleTrueInOverloadedMethodCall.java new file mode 100644 index 000000000000..de813b530280 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/DoubleTrueInOverloadedMethodCall.java @@ -0,0 +1,8 @@ +class Client { + { + foo(tr) + } + + void foo(Object o) {} + void foo(boolean o) {} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EmptyListBeforeSemicolon-out.java b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListBeforeSemicolon-out.java new file mode 100644 index 000000000000..197b8d11a2b1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListBeforeSemicolon-out.java @@ -0,0 +1,7 @@ +import java.util.Collections; + +class Foo { + java.util.List foo() { + return Collections.emptyList(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EmptyListBeforeSemicolon.java b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListBeforeSemicolon.java new file mode 100644 index 000000000000..2a1a5639cb08 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListBeforeSemicolon.java @@ -0,0 +1,5 @@ +class Foo { + java.util.List foo() { + return em; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn-out.java b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn-out.java new file mode 100644 index 000000000000..197b8d11a2b1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn-out.java @@ -0,0 +1,7 @@ +import java.util.Collections; + +class Foo { + java.util.List foo() { + return Collections.emptyList(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn.java b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn.java new file mode 100644 index 000000000000..fe6e5790f526 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn.java @@ -0,0 +1,5 @@ +class Foo { + java.util.List foo() { + return + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn2-out.java b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn2-out.java new file mode 100644 index 000000000000..3e129fe652d0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn2-out.java @@ -0,0 +1,5 @@ +class Foo { + java.util.List foo() { + return java.util.Collections.emptyList(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn2.java b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn2.java new file mode 100644 index 000000000000..3b5ded69395e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturn2.java @@ -0,0 +1,5 @@ +class Foo { + java.util.List foo() { + return java.util.Collections.em + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturnTernary-out.java b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturnTernary-out.java new file mode 100644 index 000000000000..b9d10450880f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturnTernary-out.java @@ -0,0 +1,7 @@ +import java.util.Collections; + +class Foo { + java.util.Set foo() { + return true ? Collections.emptySet() : + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturnTernary.java b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturnTernary.java new file mode 100644 index 000000000000..da3036574a77 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EmptyListInReturnTernary.java @@ -0,0 +1,5 @@ +class Foo { + java.util.Set foo() { + return true ? em + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EnumAsDefaultAnnotationParam-out.java b/java/java-tests/testData/codeInsight/completion/smartType/EnumAsDefaultAnnotationParam-out.java new file mode 100644 index 000000000000..7fa11521c63c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EnumAsDefaultAnnotationParam-out.java @@ -0,0 +1,12 @@ +enum MyEnum { + FOO, BAR +} + +@interface Anno { + MyEnum value(); +} + + +@Anno(MyEnum.FOO) +class Foo { +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EnumAsDefaultAnnotationParam.java b/java/java-tests/testData/codeInsight/completion/smartType/EnumAsDefaultAnnotationParam.java new file mode 100644 index 000000000000..14364f5bf55a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EnumAsDefaultAnnotationParam.java @@ -0,0 +1,12 @@ +enum MyEnum { + FOO, BAR +} + +@interface Anno { + MyEnum value(); +} + + +@Anno(MyEnum.F) +class Foo { +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitch-out.java b/java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitch-out.java new file mode 100644 index 000000000000..8e383bc19e11 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitch-out.java @@ -0,0 +1,9 @@ +enum E { + CONS; + + void foo (E e) { + switch (e) { + case CONS: + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitch.java b/java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitch.java new file mode 100644 index 000000000000..d0916ff49ac4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitch.java @@ -0,0 +1,9 @@ +enum E { + CONS; + + void foo (E e) { + switch (e) { + case + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitchOutside-out.java b/java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitchOutside-out.java new file mode 100644 index 000000000000..6b095d2586cc --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitchOutside-out.java @@ -0,0 +1,11 @@ +enum E { + CONS +} + +class Foo { + void foo (E e) { + switch (e) { + case CONS: + } + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitchOutside.java b/java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitchOutside.java new file mode 100644 index 000000000000..e4ddf2e63812 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EnumConstInSwitchOutside.java @@ -0,0 +1,11 @@ +enum E { + CONS +} + +class Foo { + void foo (E e) { + switch (e) { + case C + } + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EnumField-out.java b/java/java-tests/testData/codeInsight/completion/smartType/EnumField-out.java new file mode 100644 index 000000000000..8944fcbc4d04 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EnumField-out.java @@ -0,0 +1,9 @@ +enum MyEnum { + FOO, BAR +} + +class Foo { + { + MyEnum me = MyEnum.FOO; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EnumField.java b/java/java-tests/testData/codeInsight/completion/smartType/EnumField.java new file mode 100644 index 000000000000..5e600acdb6e3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EnumField.java @@ -0,0 +1,9 @@ +enum MyEnum { + FOO, BAR +} + +class Foo { + { + MyEnum me = FO + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EnumField1-out.java b/java/java-tests/testData/codeInsight/completion/smartType/EnumField1-out.java new file mode 100644 index 000000000000..74fb6ea81308 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EnumField1-out.java @@ -0,0 +1,9 @@ +enum MyEnum { + FOO, BAR +} + +class Foo { + MyEnum foo() { + return + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EnumField1.java b/java/java-tests/testData/codeInsight/completion/smartType/EnumField1.java new file mode 100644 index 000000000000..74fb6ea81308 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EnumField1.java @@ -0,0 +1,9 @@ +enum MyEnum { + FOO, BAR +} + +class Foo { + MyEnum foo() { + return + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/EverythingDoubles.java b/java/java-tests/testData/codeInsight/completion/smartType/EverythingDoubles.java new file mode 100644 index 000000000000..bfabccf85256 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/EverythingDoubles.java @@ -0,0 +1,6 @@ +class Foo { + { + java.util.List l; + new int[l.] + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice-out.java new file mode 100644 index 000000000000..963a3acd4ee6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice-out.java @@ -0,0 +1,7 @@ +class MyException extends RuntimeException{} + +class MyClass { +public void foo() throws MyException { + throw new MyException(); +} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice.java b/java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice.java new file mode 100644 index 000000000000..364a577d8d0f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice.java @@ -0,0 +1,7 @@ +class MyException extends RuntimeException{} + +class MyClass { +public void foo() throws MyException { + throw new MyEx +} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice2-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice2-out.java new file mode 100644 index 000000000000..b08b5fd7a666 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice2-out.java @@ -0,0 +1,7 @@ +class MyException extends Exception{} + +class MyClass { +public void foo() throws MyException { + throw new MyException(); +} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice2.java b/java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice2.java new file mode 100644 index 000000000000..038e6eb8b723 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExceptionTwice2.java @@ -0,0 +1,7 @@ +class MyException extends Exception{} + +class MyClass { +public void foo() throws MyException { + throw new MyEx +} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExcessiveTail-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExcessiveTail-out.java new file mode 100644 index 000000000000..2c3c66313e77 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExcessiveTail-out.java @@ -0,0 +1,5 @@ +class HashMap {} + +public class A { + private HashMap m = new HashMap(); +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExcessiveTail.java b/java/java-tests/testData/codeInsight/completion/smartType/ExcessiveTail.java new file mode 100644 index 000000000000..b444d8ebb76d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExcessiveTail.java @@ -0,0 +1,5 @@ +class HashMap {} + +public class A { + private HashMap m = new HashMapInteger>(); +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExclamationFinishNonBoolean-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationFinishNonBoolean-out.java new file mode 100644 index 000000000000..776853718dca --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationFinishNonBoolean-out.java @@ -0,0 +1,11 @@ +class BarBase { + + { + Foo f = Foo.fo! + } + +} + +class Foo { + static final Foo foo; +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExclamationFinishNonBoolean.java b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationFinishNonBoolean.java new file mode 100644 index 000000000000..8ecd872f6c32 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationFinishNonBoolean.java @@ -0,0 +1,11 @@ +class BarBase { + + { + Foo f = Foo.fo + } + +} + +class Foo { + static final Foo foo; +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExclamationMethodFinish-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationMethodFinish-out.java new file mode 100644 index 000000000000..b63adc2ffd8f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationMethodFinish-out.java @@ -0,0 +1,8 @@ +class BarBase { + + { + boolean f = !foo(); + } + + boolean foo(); +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExclamationMethodFinish.java b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationMethodFinish.java new file mode 100644 index 000000000000..ce518e6a6e5a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationMethodFinish.java @@ -0,0 +1,8 @@ +class BarBase { + + { + boolean f = fo + } + + boolean foo(); +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExclamationStaticFieldFinish-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationStaticFieldFinish-out.java new file mode 100644 index 000000000000..3747d7cf063e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationStaticFieldFinish-out.java @@ -0,0 +1,12 @@ +class BarBase { + + { + boolean foo; + boolean f = !Foo.foo; + } + +} + +class Foo { + static final Boolean foo; +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExclamationStaticFieldFinish.java b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationStaticFieldFinish.java new file mode 100644 index 000000000000..9a153a9f6362 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationStaticFieldFinish.java @@ -0,0 +1,12 @@ +class BarBase { + + { + boolean foo; + boolean f = Foo.fo + } + +} + +class Foo { + static final Boolean foo; +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExclamationVariableFinish-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationVariableFinish-out.java new file mode 100644 index 000000000000..41155185452a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationVariableFinish-out.java @@ -0,0 +1,8 @@ +class BarBase { + + { + boolean foo; + boolean f = !foo; + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExclamationVariableFinish.java b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationVariableFinish.java new file mode 100644 index 000000000000..b000061a9bcc --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExclamationVariableFinish.java @@ -0,0 +1,8 @@ +class BarBase { + + { + boolean foo; + boolean f = fo + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExcludeDeclaredConstant-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExcludeDeclaredConstant-out.java new file mode 100644 index 000000000000..bff1ac7145d5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExcludeDeclaredConstant-out.java @@ -0,0 +1,5 @@ +public class Foo { + public static final Foo FOO = ""; + public static final Foo BAR = FOO; + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExcludeDeclaredConstant.java b/java/java-tests/testData/codeInsight/completion/smartType/ExcludeDeclaredConstant.java new file mode 100644 index 000000000000..2cad3ce8c96c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExcludeDeclaredConstant.java @@ -0,0 +1,5 @@ +public class Foo { + public static final Foo FOO = ""; + public static final Foo BAR = ; + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExplicitMethodTypeParametersQualify-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExplicitMethodTypeParametersQualify-out.java new file mode 100644 index 000000000000..9cd3adc2cca7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExplicitMethodTypeParametersQualify-out.java @@ -0,0 +1,11 @@ +import java.io.File; + +public class Foo { + { + bar(this.foo()); + } + + T foo() {} + + void bar(java.io.File s) {} +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExplicitMethodTypeParametersQualify.java b/java/java-tests/testData/codeInsight/completion/smartType/ExplicitMethodTypeParametersQualify.java new file mode 100644 index 000000000000..85ececbff0d6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExplicitMethodTypeParametersQualify.java @@ -0,0 +1,9 @@ +public class Foo { + { + bar(fo) + } + + T foo() {} + + void bar(java.io.File s) {} +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardArrayParam-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardArrayParam-out.java new file mode 100644 index 000000000000..5398df76b577 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardArrayParam-out.java @@ -0,0 +1,12 @@ +class Key { + static Key create(String s); +} + +class Foo { + void putUserData(Key key, T value) {} + + { + putUserData(Key.create(), ) + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardArrayParam.java b/java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardArrayParam.java new file mode 100644 index 000000000000..5ce30d3704ec --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardArrayParam.java @@ -0,0 +1,12 @@ +class Key { + static Key create(String s); +} + +class Foo { + void putUserData(Key key, T value) {} + + { + putUserData() + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardParam-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardParam-out.java new file mode 100644 index 000000000000..ac8041399650 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardParam-out.java @@ -0,0 +1,12 @@ +class Key { + static Key create(String s); +} + +class Foo { + void putUserData(Key key, T value) {} + + { + putUserData(Key.create(), ) + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardParam.java b/java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardParam.java new file mode 100644 index 000000000000..379381ea6b11 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExplicitWildcardParam.java @@ -0,0 +1,12 @@ +class Key { + static Key create(String s); +} + +class Foo { + void putUserData(Key key, T value) {} + + { + putUserData() + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExtendsInTypeCast-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExtendsInTypeCast-out.java new file mode 100644 index 000000000000..445f8a06abb3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExtendsInTypeCast-out.java @@ -0,0 +1,10 @@ +class List { + public void add(T t) {}; +} + +public class A { + { + List list; + list.add((Object) ) + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExtendsInTypeCast.java b/java/java-tests/testData/codeInsight/completion/smartType/ExtendsInTypeCast.java new file mode 100644 index 000000000000..44d945b61772 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExtendsInTypeCast.java @@ -0,0 +1,10 @@ +class List { + public void add(T t) {}; +} + +public class A { + { + List list; + list.add(()) + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExtraSemicolonAfterMethodParam-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ExtraSemicolonAfterMethodParam-out.java new file mode 100644 index 000000000000..19e323e60ad6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExtraSemicolonAfterMethodParam-out.java @@ -0,0 +1,20 @@ +public class MyAspect { + + public void foo() { + State state; + StateListener stateListener; + state.addListener( stateListener ); + + } + + private static class State { + void addListener(StateListener listener) {} + } + + + + private static class StateListener { + + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ExtraSemicolonAfterMethodParam.java b/java/java-tests/testData/codeInsight/completion/smartType/ExtraSemicolonAfterMethodParam.java new file mode 100644 index 000000000000..b3739e8ee8db --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ExtraSemicolonAfterMethodParam.java @@ -0,0 +1,20 @@ +public class MyAspect { + + public void foo() { + State state; + StateListener stateListener; + state.addListener( sta); + + } + + private static class State { + void addListener(StateListener listener) {} + } + + + + private static class StateListener { + + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/FilterPrivateConstructors-out.java b/java/java-tests/testData/codeInsight/completion/smartType/FilterPrivateConstructors-out.java new file mode 100644 index 000000000000..31d2d7b6fc2f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/FilterPrivateConstructors-out.java @@ -0,0 +1,5 @@ +class Foo { + { + Class c = new + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/FilterPrivateConstructors.java b/java/java-tests/testData/codeInsight/completion/smartType/FilterPrivateConstructors.java new file mode 100644 index 000000000000..31d2d7b6fc2f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/FilterPrivateConstructors.java @@ -0,0 +1,5 @@ +class Foo { + { + Class c = new + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Foreach-out.java b/java/java-tests/testData/codeInsight/completion/smartType/Foreach-out.java new file mode 100644 index 000000000000..da4a0b06a015 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Foreach-out.java @@ -0,0 +1,11 @@ +import java.util.List; +class Foreach { + void foo (Foreach e) { + for (String s : e.f()) {} + } + + List f () { + return null; + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Foreach.java b/java/java-tests/testData/codeInsight/completion/smartType/Foreach.java new file mode 100644 index 000000000000..dd9dd91aa99d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Foreach.java @@ -0,0 +1,11 @@ +import java.util.List; +class Foreach { + void foo (Foreach e) { + for (String s : e.) {} + } + + List f () { + return null; + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/HidingFields-out.java b/java/java-tests/testData/codeInsight/completion/smartType/HidingFields-out.java new file mode 100644 index 000000000000..2b15203ba094 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/HidingFields-out.java @@ -0,0 +1,12 @@ +interface A { + int ABC; +} +interface B extends A{ + int ABC; +} + +class Foo { + { + int x = B.ABC; + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/HidingFields.java b/java/java-tests/testData/codeInsight/completion/smartType/HidingFields.java new file mode 100644 index 000000000000..8c405fc4b5e3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/HidingFields.java @@ -0,0 +1,12 @@ +interface A { + int ABC; +} +interface B extends A{ + int ABC; +} + +class Foo { + { + int x = B.A + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/HonorSelection-out.java b/java/java-tests/testData/codeInsight/completion/smartType/HonorSelection-out.java new file mode 100644 index 000000000000..39b617ab06cd --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/HonorSelection-out.java @@ -0,0 +1,9 @@ +class Foo { + { + Foo fa; + String foo; + String s = foo; + } + + public String toString() {} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/HonorSelection.java b/java/java-tests/testData/codeInsight/completion/smartType/HonorSelection.java new file mode 100644 index 000000000000..b838fdea36df --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/HonorSelection.java @@ -0,0 +1,9 @@ +class Foo { + { + Foo fa; + String foo; + String s = f.toString(); + } + + public String toString() {} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV13148.java b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV13148.java new file mode 100644 index 000000000000..bd148a690a4e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV13148.java @@ -0,0 +1,6 @@ +class Clazz { + + static void foo() { + synchronized() + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2626-out.java b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2626-out.java new file mode 100644 index 000000000000..86d5e639030a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2626-out.java @@ -0,0 +1,12 @@ +class Generic { } + +class Other { + static T take(Generic thing) { return null; } +} + +class Tester { + Generic str; + void method() { + CharSequence x = Other.take(str); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2626.java b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2626.java new file mode 100644 index 000000000000..ca2e8213682b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2626.java @@ -0,0 +1,12 @@ +class Generic { } + +class Other { + static T take(Generic thing) { return null; } +} + +class Tester { + Generic str; + void method() { + CharSequence x = Other.take(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2668-out.java b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2668-out.java new file mode 100644 index 000000000000..9140574399ec --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2668-out.java @@ -0,0 +1,11 @@ +class BigDecimal{} + +enum Treasures { + DIAMOND(new BigDecimal()); + + Treasures(BigDecimal value) { + this.value = value; + } + + private BigDecimal value; +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2668.java b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2668.java new file mode 100644 index 000000000000..4729a7c3084d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV2668.java @@ -0,0 +1,11 @@ +class BigDecimal{} + +enum Treasures { + DIAMOND(new ); + + Treasures(BigDecimal value) { + this.value = value; + } + + private BigDecimal value; +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV5150-out.java b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV5150-out.java new file mode 100644 index 000000000000..6dc7948a0110 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV5150-out.java @@ -0,0 +1,12 @@ +import java.util.*; + +class Test +{ + private String[] strings; + + public List getStrings() + { + return Arrays.asList(strings); + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV5150.java b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV5150.java new file mode 100644 index 000000000000..97605ac876dd --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV5150.java @@ -0,0 +1,12 @@ +import java.util.*; + +class Test +{ + private String[] strings; + + public List getStrings() + { + return Arrays.asList(str); + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV7835-out.java b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV7835-out.java new file mode 100644 index 000000000000..21f8a8e447f9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV7835-out.java @@ -0,0 +1,10 @@ +import java.util.*; + +class List {} + +class Clazz { + + static void foo(Foo foo) { + List f = new List(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV7835.java b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV7835.java new file mode 100644 index 000000000000..ec2ce5aced05 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IDEADEV7835.java @@ -0,0 +1,10 @@ +import java.util.*; + +class List {} + +class Clazz { + + static void foo(Foo foo) { + List f = new L + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IfConditionBinaryExpression-out.java b/java/java-tests/testData/codeInsight/completion/smartType/IfConditionBinaryExpression-out.java new file mode 100644 index 000000000000..59941305e798 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IfConditionBinaryExpression-out.java @@ -0,0 +1,6 @@ +public class TabComplete { + public void scene() { + boolean bbb; + if (bbb == 2) {} + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IfConditionBinaryExpression.java b/java/java-tests/testData/codeInsight/completion/smartType/IfConditionBinaryExpression.java new file mode 100644 index 000000000000..e2eef4d45f43 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IfConditionBinaryExpression.java @@ -0,0 +1,6 @@ +public class TabComplete { + public void scene() { + boolean bbb; + if (b == 2) {} + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InThisExpression-out.java b/java/java-tests/testData/codeInsight/completion/smartType/InThisExpression-out.java new file mode 100644 index 000000000000..c5ccb3867854 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InThisExpression-out.java @@ -0,0 +1,8 @@ +public class Foo { + + Runnable r = new Runnable() { + public void run() { + Foo f = Foo.this;Foo.this; + } + }; +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InThisExpression.java b/java/java-tests/testData/codeInsight/completion/smartType/InThisExpression.java new file mode 100644 index 000000000000..fba4e083699d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InThisExpression.java @@ -0,0 +1,8 @@ +public class Foo { + + Runnable r = new Runnable() { + public void run() { + Foo f = Foo.this; + } + }; +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InferFromCall-out.java b/java/java-tests/testData/codeInsight/completion/smartType/InferFromCall-out.java new file mode 100644 index 000000000000..c8fe903355e5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InferFromCall-out.java @@ -0,0 +1,14 @@ +import java.util.ArrayList; + +class Arrays { + static ArrayList asList(T... ts) { + return null; + } +} + +class DDD { + static { + DDD ddd = new DDD(); + new ArrayList(Arrays.asList(ddd)); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InferFromCall.java b/java/java-tests/testData/codeInsight/completion/smartType/InferFromCall.java new file mode 100644 index 000000000000..cd6592abda59 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InferFromCall.java @@ -0,0 +1,14 @@ +import java.util.ArrayList; + +class Arrays { + static ArrayList asList(T... ts) { + return null; + } +} + +class DDD { + static { + DDD ddd = new DDD(); + new ArrayList(Arrays.asList()); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InferFromCall1-out.java b/java/java-tests/testData/codeInsight/completion/smartType/InferFromCall1-out.java new file mode 100644 index 000000000000..9c55bce377e6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InferFromCall1-out.java @@ -0,0 +1,11 @@ +class Key {} +class Foo { + void putUserData(Key k, T t) {} + + Key getKey(Key t) {} + + { + Key> k = new Key>(); + putUserData(k, getKey(new Key())); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InferFromCall1.java b/java/java-tests/testData/codeInsight/completion/smartType/InferFromCall1.java new file mode 100644 index 000000000000..5e8b38988c58 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InferFromCall1.java @@ -0,0 +1,11 @@ +class Key {} +class Foo { + void putUserData(Key k, T t) {} + + Key getKey(Key t) {} + + { + Key> k = new Key>(); + putUserData(k, getKey(new )); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InheritedClass-out.java b/java/java-tests/testData/codeInsight/completion/smartType/InheritedClass-out.java new file mode 100644 index 000000000000..e0fd7a5624e8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InheritedClass-out.java @@ -0,0 +1,10 @@ +class Foo {} +class Bar extends Foo { + +void test() { + method(new Bar()); +} + +void method(Foo f) {} + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InheritedClass.java b/java/java-tests/testData/codeInsight/completion/smartType/InheritedClass.java new file mode 100644 index 000000000000..c64748a9c800 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InheritedClass.java @@ -0,0 +1,10 @@ +class Foo {} +class Bar extends Foo { + +void test() { + method(new B) +} + +void method(Foo f) {} + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InnerEnum-out.java b/java/java-tests/testData/codeInsight/completion/smartType/InnerEnum-out.java new file mode 100644 index 000000000000..d63e5777fa79 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InnerEnum-out.java @@ -0,0 +1,11 @@ +public class Foo { + void foo() { + Bar.Fubar b = true ? Bar.Fubar.Bar : + } +} + +public static class Bar { + public enum Fubar { + Foo, Bar + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InnerEnum.java b/java/java-tests/testData/codeInsight/completion/smartType/InnerEnum.java new file mode 100644 index 000000000000..22cb9156bf05 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InnerEnum.java @@ -0,0 +1,11 @@ +public class Foo { + void foo() { + Bar.Fubar b = true ? + } +} + +public static class Bar { + public enum Fubar { + Foo, Bar + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InnerEnumInMethod-out.java b/java/java-tests/testData/codeInsight/completion/smartType/InnerEnumInMethod-out.java new file mode 100644 index 000000000000..465b8bca1026 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InnerEnumInMethod-out.java @@ -0,0 +1,10 @@ +public class Foo { + + { + enum Bar { + Fubar + } + Bar b = Bar.Fubar; + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InnerEnumInMethod.java b/java/java-tests/testData/codeInsight/completion/smartType/InnerEnumInMethod.java new file mode 100644 index 000000000000..5802730d6752 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InnerEnumInMethod.java @@ -0,0 +1,10 @@ +public class Foo { + + { + enum Bar { + Fubar + } + Bar b = Fub + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InsertOverride-out.java b/java/java-tests/testData/codeInsight/completion/smartType/InsertOverride-out.java new file mode 100644 index 000000000000..bd86c539af73 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InsertOverride-out.java @@ -0,0 +1,10 @@ +class C { + void f() { + Runnable r = new Runnable() { + @Override + public void run() { + //To change body of implemented methods use File | Settings | File Templates. + } + }; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InsertOverride.java b/java/java-tests/testData/codeInsight/completion/smartType/InsertOverride.java new file mode 100644 index 000000000000..f030be33501e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InsertOverride.java @@ -0,0 +1,5 @@ +class C { + void f() { + Runnable r = new + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InsertTypeParametersOnImporting-out.java b/java/java-tests/testData/codeInsight/completion/smartType/InsertTypeParametersOnImporting-out.java new file mode 100644 index 000000000000..b95c096c53cc --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InsertTypeParametersOnImporting-out.java @@ -0,0 +1,8 @@ +import java.util.HashMap; +import java.util.Map; + +class Foo { + { + Map m = new HashMap(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InsertTypeParametersOnImporting.java b/java/java-tests/testData/codeInsight/completion/smartType/InsertTypeParametersOnImporting.java new file mode 100644 index 000000000000..d0f7a83dd062 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InsertTypeParametersOnImporting.java @@ -0,0 +1,7 @@ +import java.util.Map; + +class Foo { + { + Map m = new HashM + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InsideCatch-out.java b/java/java-tests/testData/codeInsight/completion/smartType/InsideCatch-out.java new file mode 100644 index 000000000000..846e15611421 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InsideCatch-out.java @@ -0,0 +1,9 @@ +class A{ + +{ + try{ + throw new Exception(); + } + catch(Exception ) +} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InsideCatch.java b/java/java-tests/testData/codeInsight/completion/smartType/InsideCatch.java new file mode 100644 index 000000000000..86f69aabdcc4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InsideCatch.java @@ -0,0 +1,9 @@ +class A{ + +{ + try{ + throw new Exception(); + } + catch() +} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InsideGenericClassLiteral.java b/java/java-tests/testData/codeInsight/completion/smartType/InsideGenericClassLiteral.java new file mode 100644 index 000000000000..60419b7b6c84 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InsideGenericClassLiteral.java @@ -0,0 +1,9 @@ +class Foo { + + T bar(Class t) {} + + { + bar(St.class) + } + + } \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InsideStringLiteral.java b/java/java-tests/testData/codeInsight/completion/smartType/InsideStringLiteral.java new file mode 100644 index 000000000000..77522e480edc --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InsideStringLiteral.java @@ -0,0 +1,3 @@ +public class ZZZ { + String s = ""; +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext-out.java b/java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext-out.java new file mode 100644 index 000000000000..d8bce2af925d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext-out.java @@ -0,0 +1,13 @@ +public class MyFirstTestClassBoo { + + static void foo(int a) {} + + void foo(String s) {} + + static { + int xxy; + String xxz; + foo(xxy); + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext.java b/java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext.java new file mode 100644 index 000000000000..a7dc2e0efc25 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext.java @@ -0,0 +1,13 @@ +public class MyFirstTestClassBoo { + + static void foo(int a) {} + + void foo(String s) {} + + static { + int xxy; + String xxz; + foo(xx) + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext2-out.java b/java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext2-out.java new file mode 100644 index 000000000000..01c0bc7786a4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext2-out.java @@ -0,0 +1,10 @@ +public class MyFirstTestClassBoo { + + void foo(String s) {} + + static { + String xxz; + foo(xxz); + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext2.java b/java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext2.java new file mode 100644 index 000000000000..b1b85bbcda13 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InstanceMethodParametersFromStaticContext2.java @@ -0,0 +1,10 @@ +public class MyFirstTestClassBoo { + + void foo(String s) {} + + static { + String xxz; + foo(xx) + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InstanceofedInsideAnonymous-out.java b/java/java-tests/testData/codeInsight/completion/smartType/InstanceofedInsideAnonymous-out.java new file mode 100644 index 000000000000..3cfb17dfc9a6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InstanceofedInsideAnonymous-out.java @@ -0,0 +1,16 @@ +class C{ + { + Object o; + if (o instanceof Foo) { + new Runnable() { + public void run() { + Foo f = (Foo) o; + } + } + } + } +} + +class Foo { + void dofoo(); +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/InstanceofedInsideAnonymous.java b/java/java-tests/testData/codeInsight/completion/smartType/InstanceofedInsideAnonymous.java new file mode 100644 index 000000000000..eb08b22142e9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/InstanceofedInsideAnonymous.java @@ -0,0 +1,16 @@ +class C{ + { + Object o; + if (o instanceof Foo) { + new Runnable() { + public void run() { + Foo f = + } + } + } + } +} + +class Foo { + void dofoo(); +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IntConstInSwitch-out.java b/java/java-tests/testData/codeInsight/completion/smartType/IntConstInSwitch-out.java new file mode 100644 index 000000000000..8547f5064d5b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IntConstInSwitch-out.java @@ -0,0 +1,11 @@ +class E { + static final int ABC; + static final int DEF; + + void foo (int e) { + int ADF; + switch (e) { + case ABC: + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IntConstInSwitch.java b/java/java-tests/testData/codeInsight/completion/smartType/IntConstInSwitch.java new file mode 100644 index 000000000000..e2d37dff8147 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IntConstInSwitch.java @@ -0,0 +1,11 @@ +class E { + static final int ABC; + static final int DEF; + + void foo (int e) { + int ADF; + switch (e) { + case A + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IntPlusLongNotDouble-out.java b/java/java-tests/testData/codeInsight/completion/smartType/IntPlusLongNotDouble-out.java new file mode 100644 index 000000000000..802500875f8c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IntPlusLongNotDouble-out.java @@ -0,0 +1,7 @@ +class Foo { + { + int a; + long b; + int c = a + (int) b; + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/IntPlusLongNotDouble.java b/java/java-tests/testData/codeInsight/completion/smartType/IntPlusLongNotDouble.java new file mode 100644 index 000000000000..288fe21f5a49 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/IntPlusLongNotDouble.java @@ -0,0 +1,7 @@ +class Foo { + { + int a; + long b; + int c = a + (b; + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/JavadocThrows-out.java b/java/java-tests/testData/codeInsight/completion/smartType/JavadocThrows-out.java new file mode 100644 index 000000000000..d97ac7c28707 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/JavadocThrows-out.java @@ -0,0 +1,9 @@ +class MyException extends RuntimeException{} + +class MyClass { +/** +* @throws MyException +*/ +public void foo() throws MyException { +} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/JavadocThrows.java b/java/java-tests/testData/codeInsight/completion/smartType/JavadocThrows.java new file mode 100644 index 000000000000..2295fbab106e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/JavadocThrows.java @@ -0,0 +1,9 @@ +class MyException extends RuntimeException{} + +class MyClass { +/** +* @throws +*/ +public void foo() throws MyException { +} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/LiveTemplate-out.java b/java/java-tests/testData/codeInsight/completion/smartType/LiveTemplate-out.java new file mode 100644 index 000000000000..a969d7eeb87d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/LiveTemplate-out.java @@ -0,0 +1,12 @@ +class Foo { +} + +class FooFactory { + static Foo createFoo() {} +} + +class XXX { + { + Foo f = FooFactory.createFoo() + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/LiveTemplate.java b/java/java-tests/testData/codeInsight/completion/smartType/LiveTemplate.java new file mode 100644 index 000000000000..bd9978f25af1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/LiveTemplate.java @@ -0,0 +1,12 @@ +class Foo { +} + +class FooFactory { + static Foo createFoo() {} +} + +class XXX { + { + Foo f = + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/MethodAnnotationNamedParameter-out.java b/java/java-tests/testData/codeInsight/completion/smartType/MethodAnnotationNamedParameter-out.java new file mode 100644 index 000000000000..20882968acbe --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/MethodAnnotationNamedParameter-out.java @@ -0,0 +1,9 @@ +public class BarBaz { + + @Foo(isBar = true) + public void x() {} + + public @interface Foo { + boolean isBar() default false; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/MethodAnnotationNamedParameter.java b/java/java-tests/testData/codeInsight/completion/smartType/MethodAnnotationNamedParameter.java new file mode 100644 index 000000000000..a354191ea208 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/MethodAnnotationNamedParameter.java @@ -0,0 +1,9 @@ +public class BarBaz { + + @Foo(isBar = t) + public void x() {} + + public @interface Foo { + boolean isBar() default false; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/MethodCallDot-out.java b/java/java-tests/testData/codeInsight/completion/smartType/MethodCallDot-out.java new file mode 100644 index 000000000000..59e89a08af31 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/MethodCallDot-out.java @@ -0,0 +1,9 @@ +public class Foo { + { + String ssss; + foo(ssss).; + } + + void foo(String s); + + } diff --git a/java/java-tests/testData/codeInsight/completion/smartType/MethodCallDot.java b/java/java-tests/testData/codeInsight/completion/smartType/MethodCallDot.java new file mode 100644 index 000000000000..582a945c58a9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/MethodCallDot.java @@ -0,0 +1,9 @@ +public class Foo { + { + String ssss; + foo(s).; + } + + void foo(String s); + + } diff --git a/java/java-tests/testData/codeInsight/completion/smartType/MethodCallInScriplet-out.jsp b/java/java-tests/testData/codeInsight/completion/smartType/MethodCallInScriplet-out.jsp new file mode 100644 index 000000000000..80e2c9f1b7e8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/MethodCallInScriplet-out.jsp @@ -0,0 +1,5 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + Simple jsp page + <%=System.currentTimeMillis()%> + \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/MethodCallInScriplet.jsp b/java/java-tests/testData/codeInsight/completion/smartType/MethodCallInScriplet.jsp new file mode 100644 index 000000000000..4682b7507268 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/MethodCallInScriplet.jsp @@ -0,0 +1,5 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + Simple jsp page + <%=System.cur%> + \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NegateVariable-out.java b/java/java-tests/testData/codeInsight/completion/smartType/NegateVariable-out.java new file mode 100644 index 000000000000..94fe93618510 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NegateVariable-out.java @@ -0,0 +1,9 @@ +public class Foo { + { + boolean bbbb; + bbbb = !bbbb; + } + + + } + diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NegateVariable.java b/java/java-tests/testData/codeInsight/completion/smartType/NegateVariable.java new file mode 100644 index 000000000000..1040072a4f06 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NegateVariable.java @@ -0,0 +1,9 @@ +public class Foo { + { + boolean bbbb; + bbbb = !b + } + + + } + diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NestedAssignments-out.java b/java/java-tests/testData/codeInsight/completion/smartType/NestedAssignments-out.java new file mode 100644 index 000000000000..dd2d55c22e45 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NestedAssignments-out.java @@ -0,0 +1,5 @@ +class User { + { + int a = hashCode(); = c; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NestedAssignments.java b/java/java-tests/testData/codeInsight/completion/smartType/NestedAssignments.java new file mode 100644 index 000000000000..58f0a0e5aba1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NestedAssignments.java @@ -0,0 +1,5 @@ +class User { + { + int a = h = c; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NewInnerOfParameterizedClass-out.java b/java/java-tests/testData/codeInsight/completion/smartType/NewInnerOfParameterizedClass-out.java new file mode 100644 index 000000000000..6c015fc8c562 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NewInnerOfParameterizedClass-out.java @@ -0,0 +1,12 @@ +public class ExecutionChannel< + T_ConversationId, + T_Conversation, + T_Configuration, + T_ProtocolObject> { + + private ExecutionChannelCacheObserver y = new ExecutionChannelCacheObserver(); + + private class ExecutionChannelCacheObserver { + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NewInnerOfParameterizedClass.java b/java/java-tests/testData/codeInsight/completion/smartType/NewInnerOfParameterizedClass.java new file mode 100644 index 000000000000..600374a84b97 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NewInnerOfParameterizedClass.java @@ -0,0 +1,12 @@ +public class ExecutionChannel< + T_ConversationId, + T_Conversation, + T_Configuration, + T_ProtocolObject> { + + private ExecutionChannelCacheObserver y = new + + private class ExecutionChannelCacheObserver { + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NewInnerRunnable-out.java b/java/java-tests/testData/codeInsight/completion/smartType/NewInnerRunnable-out.java new file mode 100644 index 000000000000..60dfc497e925 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NewInnerRunnable-out.java @@ -0,0 +1,13 @@ +interface Runnable {} + +class MyClass { + static class Foo implements Runnable {} +} + +class Goo implements Runnable {} + +class XXX { + { + Runnable r = new MyClass.Foo(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NewInnerRunnable.java b/java/java-tests/testData/codeInsight/completion/smartType/NewInnerRunnable.java new file mode 100644 index 000000000000..361d3c03af85 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NewInnerRunnable.java @@ -0,0 +1,13 @@ +interface Runnable {} + +class MyClass { + static class Foo implements Runnable {} +} + +class Goo implements Runnable {} + +class XXX { + { + Runnable r = new MyClass. + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NewVararg.java b/java/java-tests/testData/codeInsight/completion/smartType/NewVararg.java new file mode 100644 index 000000000000..bd4ad4d9e4ee --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NewVararg.java @@ -0,0 +1,9 @@ +interface Foo {} + +class Bar { + void foo(Foo... f) + + { + foo(new ) + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NoClassLiteral-out.java b/java/java-tests/testData/codeInsight/completion/smartType/NoClassLiteral-out.java new file mode 100644 index 000000000000..2a9b61a2d119 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NoClassLiteral-out.java @@ -0,0 +1,6 @@ +class C { + void h (Class clazz) {} + { + h(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NoClassLiteral.java b/java/java-tests/testData/codeInsight/completion/smartType/NoClassLiteral.java new file mode 100644 index 000000000000..2a9b61a2d119 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NoClassLiteral.java @@ -0,0 +1,6 @@ +class C { + void h (Class clazz) {} + { + h(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueInElse.java b/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueInElse.java new file mode 100644 index 000000000000..9203d6dd72d3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueInElse.java @@ -0,0 +1,13 @@ +public class TestCase extends Zzz { + boolean foo(String s) { + } + + + { + Object ooo; + if (ooo instanceof String) { + } else { + foo(o) + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueInElseWithComplexIf.java b/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueInElseWithComplexIf.java new file mode 100644 index 000000000000..49a320ad1da0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueInElseWithComplexIf.java @@ -0,0 +1,13 @@ +public class TestCase extends Zzz { + boolean foo(String s) { + } + + + { + Object ooo; + if (ooo instanceof String && true) { + } else { + foo(o) + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueInThenNegated.java b/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueInThenNegated.java new file mode 100644 index 000000000000..f3ce944e59b0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueInThenNegated.java @@ -0,0 +1,9 @@ +public class TestCase extends Zzz { + + { + Object ooo; + if (!(ooo instanceof String)) { + String s = o + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueWhenBasicSuits-out.java b/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueWhenBasicSuits-out.java new file mode 100644 index 000000000000..030beb8ee657 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueWhenBasicSuits-out.java @@ -0,0 +1,11 @@ +public class TestCase extends Zzz { + + Object ooo() {} + + { + if (!(ooo() instanceof String)) { + return; + } + Object s = ooo(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueWhenBasicSuits.java b/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueWhenBasicSuits.java new file mode 100644 index 000000000000..a13bc05745d1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NoInstanceofedValueWhenBasicSuits.java @@ -0,0 +1,11 @@ +public class TestCase extends Zzz { + + Object ooo() {} + + { + if (!(ooo() instanceof String)) { + return; + } + Object s = o + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NoKeyConstant.java b/java/java-tests/testData/codeInsight/completion/smartType/NoKeyConstant.java new file mode 100644 index 000000000000..73022c5905cf --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NoKeyConstant.java @@ -0,0 +1,25 @@ +class Key { + static Key create() {} +} + +interface Intf {} +class Impl implements Intf {} + +interface IBar { + Key A_KEY = Key.create("a"); +} + +class Bar implements IBar { + + { + IBar item; + new Foo().incUseCount(item); + } +} + +class Foo { + + public void incUseCount(final Key> key, + final T element, + final Loc location) {} +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NoNullAfterDot.java b/java/java-tests/testData/codeInsight/completion/smartType/NoNullAfterDot.java new file mode 100644 index 000000000000..beb78eff3e39 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NoNullAfterDot.java @@ -0,0 +1,6 @@ +public class Foo { + + { + String s = StringUtil.n + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NoTypeParametersForToArray-out.java b/java/java-tests/testData/codeInsight/completion/smartType/NoTypeParametersForToArray-out.java new file mode 100644 index 000000000000..bb687d3a8960 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NoTypeParametersForToArray-out.java @@ -0,0 +1,8 @@ +class Foo { + void bar(Object[] o) {} + + Object[] foo() { + java.util.Set set; + bar(set.toArray()); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NoTypeParametersForToArray.java b/java/java-tests/testData/codeInsight/completion/smartType/NoTypeParametersForToArray.java new file mode 100644 index 000000000000..9c47b717ffa6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NoTypeParametersForToArray.java @@ -0,0 +1,8 @@ +class Foo { + void bar(Object[] o) {} + + Object[] foo() { + java.util.Set set; + bar(set.to) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/NonStaticInnerClass.java b/java/java-tests/testData/codeInsight/completion/smartType/NonStaticInnerClass.java new file mode 100644 index 000000000000..87cd9eb6aa0a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/NonStaticInnerClass.java @@ -0,0 +1,12 @@ +public class Outer { + public class Inner { + public Inner() { + } + } +} + +class OuterMain { + public static void main(String[] args) { + Outer.Inner inner = new + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/OneElementArray-out.java b/java/java-tests/testData/codeInsight/completion/smartType/OneElementArray-out.java new file mode 100644 index 000000000000..362ea5057b02 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/OneElementArray-out.java @@ -0,0 +1,8 @@ +public class SomeClass { + + { + int[] aaa = new int[1]; + int bbb = aaa[0]; + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/OneElementArray.java b/java/java-tests/testData/codeInsight/completion/smartType/OneElementArray.java new file mode 100644 index 000000000000..531162c7d363 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/OneElementArray.java @@ -0,0 +1,8 @@ +public class SomeClass { + + { + int[] aaa = new int[1]; + int bbb = a + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/OverloadedMethods-out.java b/java/java-tests/testData/codeInsight/completion/smartType/OverloadedMethods-out.java new file mode 100644 index 000000000000..9c91cf642781 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/OverloadedMethods-out.java @@ -0,0 +1,13 @@ +interface Comparable> {} +class List {} +class Collections { + static > void sort(List list) {} + static void sort(List list, Comparator c) {} +} + +class Foo implements Comparable { + public static void main(String[] args){ + List list; + Collections.sort(list) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/OverloadedMethods.java b/java/java-tests/testData/codeInsight/completion/smartType/OverloadedMethods.java new file mode 100644 index 000000000000..8ad289aba4bb --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/OverloadedMethods.java @@ -0,0 +1,13 @@ +interface Comparable> {} +class List {} +class Collections { + static > void sort(List list) {} + static void sort(List list, Comparator c) {} +} + +class Foo implements Comparable { + public static void main(String[] args){ + List list; + Collections.sort(l) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ParameterizedConstructor-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ParameterizedConstructor-out.java new file mode 100644 index 000000000000..434490c123e1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ParameterizedConstructor-out.java @@ -0,0 +1,14 @@ +class Collection {} + +class CommentCompletion { + + static { + Collection c; + new CommentCompletion(c); + } + + CommentCompletion(Collection collection) { + + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ParameterizedConstructor.java b/java/java-tests/testData/codeInsight/completion/smartType/ParameterizedConstructor.java new file mode 100644 index 000000000000..630b02539031 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ParameterizedConstructor.java @@ -0,0 +1,14 @@ +class Collection {} + +class CommentCompletion { + + static { + Collection c; + new CommentCompletion(); + } + + CommentCompletion(Collection collection) { + + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor-out.java new file mode 100644 index 000000000000..0503b49a92ea --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor-out.java @@ -0,0 +1,9 @@ +import pkg.Foo; + +class Bar { + + public void foo() { + new Foo(hashCode()) {} + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor.java b/java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor.java new file mode 100644 index 000000000000..01cb39ad3b48 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor.java @@ -0,0 +1,9 @@ +import pkg.Foo; + +class Bar { + + public void foo() { + new Foo(hash) {} + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor2-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor2-out.java new file mode 100644 index 000000000000..b7f3dea22ab9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor2-out.java @@ -0,0 +1,11 @@ +import pkg.Bar; + +import java.util.ArrayList; + +class Goo { + + public void foo() { + new Bar(new ArrayList()) {} + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor2.java b/java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor2.java new file mode 100644 index 000000000000..30ee9c0f1929 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ProtectedAnonymousConstructor2.java @@ -0,0 +1,9 @@ +import pkg.Bar; + +class Goo { + + public void foo() { + new Bar(new ArrL) {} + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/QualifiedThis-out.java b/java/java-tests/testData/codeInsight/completion/smartType/QualifiedThis-out.java new file mode 100644 index 000000000000..14dd7ef281b0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/QualifiedThis-out.java @@ -0,0 +1,13 @@ +class A { + public void f(A a){} + + public void g(){ + B b = new B(){ + void h(){ + f(A.this); + } + }; + } + + private class B{} +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/QualifiedThis.java b/java/java-tests/testData/codeInsight/completion/smartType/QualifiedThis.java new file mode 100644 index 000000000000..72efffac348a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/QualifiedThis.java @@ -0,0 +1,13 @@ +class A { + public void f(A a){} + + public void g(){ + B b = new B(){ + void h(){ + f(A.) + } + }; + } + + private class B{} +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/QualifiedThisInAnonymousConstructor-out.java b/java/java-tests/testData/codeInsight/completion/smartType/QualifiedThisInAnonymousConstructor-out.java new file mode 100644 index 000000000000..3a11c07c4089 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/QualifiedThisInAnonymousConstructor-out.java @@ -0,0 +1,11 @@ +public class Foo { + + { + new Bar(this) {} + } + +} + +class Bar { + Bar(Foo f) {} +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/QualifiedThisInAnonymousConstructor.java b/java/java-tests/testData/codeInsight/completion/smartType/QualifiedThisInAnonymousConstructor.java new file mode 100644 index 000000000000..166cd0abc688 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/QualifiedThisInAnonymousConstructor.java @@ -0,0 +1,11 @@ +public class Foo { + + { + new Bar() {} + } + +} + +class Bar { + Bar(Foo f) {} +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ReplaceWholeReferenceChain-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ReplaceWholeReferenceChain-out.java new file mode 100644 index 000000000000..043a58775711 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ReplaceWholeReferenceChain-out.java @@ -0,0 +1,11 @@ +public class TestCase { + Object field; + + int foo() { + } + + + { + int a = foo() + 2; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ReplaceWholeReferenceChain.java b/java/java-tests/testData/codeInsight/completion/smartType/ReplaceWholeReferenceChain.java new file mode 100644 index 000000000000..7ceea6b69a2b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ReplaceWholeReferenceChain.java @@ -0,0 +1,11 @@ +public class TestCase { + Object field; + + int foo() { + } + + + { + int a = fothis.field.clone().hashCode() + 2; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SameFieldInAnotherObject-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SameFieldInAnotherObject-out.java new file mode 100644 index 000000000000..54c34d48418b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SameFieldInAnotherObject-out.java @@ -0,0 +1,8 @@ +class Foo { + int abcde; + + { + Foo a; + a.abcde = abcde; + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SameFieldInAnotherObject.java b/java/java-tests/testData/codeInsight/completion/smartType/SameFieldInAnotherObject.java new file mode 100644 index 000000000000..250d8778c5ff --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SameFieldInAnotherObject.java @@ -0,0 +1,8 @@ +class Foo { + int abcde; + + { + Foo a; + a.abcde = ab + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SameNamedFieldAndLocal-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SameNamedFieldAndLocal-out.java new file mode 100644 index 000000000000..9650878ab658 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SameNamedFieldAndLocal-out.java @@ -0,0 +1,8 @@ +public class Test { + int ffa; + + { + int ffa = 2; + int b = ffa; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SameNamedFieldAndLocal.java b/java/java-tests/testData/codeInsight/completion/smartType/SameNamedFieldAndLocal.java new file mode 100644 index 000000000000..d18cf6e43098 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SameNamedFieldAndLocal.java @@ -0,0 +1,8 @@ +public class Test { + int ffa; + + { + int ffa = 2; + int b = ff + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Silly1.java b/java/java-tests/testData/codeInsight/completion/smartType/Silly1.java new file mode 100644 index 000000000000..25c53dd75fd4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Silly1.java @@ -0,0 +1,7 @@ +class A{ + { + int iiiii = 0; + + iiiii = iii + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SillyAssignmentInTernary-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SillyAssignmentInTernary-out.java new file mode 100644 index 000000000000..6bb40f35daeb --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SillyAssignmentInTernary-out.java @@ -0,0 +1,7 @@ +class Foo { + Foo[] myFoos; + + Foo(Foo[] foos) { + myFoos = true ? foos : + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SillyAssignmentInTernary.java b/java/java-tests/testData/codeInsight/completion/smartType/SillyAssignmentInTernary.java new file mode 100644 index 000000000000..84a08401810f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SillyAssignmentInTernary.java @@ -0,0 +1,7 @@ +class Foo { + Foo[] myFoos; + + Foo(Foo[] foos) { + myFoos = true ? + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SmartFinish-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SmartFinish-out.java new file mode 100644 index 000000000000..1583beea2183 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SmartFinish-out.java @@ -0,0 +1,11 @@ +public class Foo { + + { + Foo foo = null; + Foo bar = id(foo); + + } + + Foo id(Foo foo) {return foo;} + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SmartFinish.java b/java/java-tests/testData/codeInsight/completion/smartType/SmartFinish.java new file mode 100644 index 000000000000..e6bc95315b89 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SmartFinish.java @@ -0,0 +1,10 @@ +public class Foo { + + { + Foo foo = null; + Foo bar = idfoo; + } + + Foo id(Foo foo) {return foo;} + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/StaticSubclass-out.java b/java/java-tests/testData/codeInsight/completion/smartType/StaticSubclass-out.java new file mode 100644 index 000000000000..d6a5b3d7f809 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/StaticSubclass-out.java @@ -0,0 +1,13 @@ +class BarBase { + { + FooBase f = FooBase.EMPTY; + } +} + +class FooBase { + public static final FooBase EMPTY; + + public static class FooBaseImpl extends FooBase {} + + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/StaticSubclass.java b/java/java-tests/testData/codeInsight/completion/smartType/StaticSubclass.java new file mode 100644 index 000000000000..2b4e8ad8503d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/StaticSubclass.java @@ -0,0 +1,13 @@ +class BarBase { + { + FooBase f = + } +} + +class FooBase { + public static final FooBase EMPTY; + + public static class FooBaseImpl extends FooBase {} + + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/StaticallyImportedMagicMethod-out.java b/java/java-tests/testData/codeInsight/completion/smartType/StaticallyImportedMagicMethod-out.java new file mode 100644 index 000000000000..33213d413133 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/StaticallyImportedMagicMethod-out.java @@ -0,0 +1,15 @@ +import static Foo.foo; + +class Foo { + public static T foo () + +} + +class Bar { + void f(String s) { + } + + { + f(Foo.foo()); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/StaticallyImportedMagicMethod.java b/java/java-tests/testData/codeInsight/completion/smartType/StaticallyImportedMagicMethod.java new file mode 100644 index 000000000000..28a87f11ea26 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/StaticallyImportedMagicMethod.java @@ -0,0 +1,15 @@ +import static Foo.foo; + +class Foo { + public static T foo () + +} + +class Bar { + void f(String s) { + } + + { + f(fo) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/StringConstantInAnno-out.java b/java/java-tests/testData/codeInsight/completion/smartType/StringConstantInAnno-out.java new file mode 100644 index 000000000000..0c8216897481 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/StringConstantInAnno-out.java @@ -0,0 +1,9 @@ +@interface Anno { + String value(); +} + +@Anno(A.AAA) +class A { + public static final String AAA = "aaa"; +} + diff --git a/java/java-tests/testData/codeInsight/completion/smartType/StringConstantInAnno.java b/java/java-tests/testData/codeInsight/completion/smartType/StringConstantInAnno.java new file mode 100644 index 000000000000..fa96439e270a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/StringConstantInAnno.java @@ -0,0 +1,9 @@ +@interface Anno { + String value(); +} + +@Anno(A.) +class A { + public static final String AAA = "aaa"; +} + diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestAnythingWhenWildcardExpected.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestAnythingWhenWildcardExpected.java new file mode 100644 index 000000000000..7f7e487234be --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestAnythingWhenWildcardExpected.java @@ -0,0 +1,7 @@ +class X {} +class Y extends X{} +class Z extends X{} + +class Main { + X a = new +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestCastedValueAfterCast-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestCastedValueAfterCast-out.java new file mode 100644 index 000000000000..1a4cf34f1d18 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestCastedValueAfterCast-out.java @@ -0,0 +1,10 @@ +public class TestCase extends Zzz { + + Object ooo() {} + + { + ((String) ooo()).toString(); + + String s = (String) ooo(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestCastedValueAfterCast.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestCastedValueAfterCast.java new file mode 100644 index 000000000000..8c4ff0f63233 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestCastedValueAfterCast.java @@ -0,0 +1,10 @@ +public class TestCase extends Zzz { + + Object ooo() {} + + { + ((String) ooo()).toString(); + + String s = o + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValue-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValue-out.java new file mode 100644 index 000000000000..0d123995b0bb --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValue-out.java @@ -0,0 +1,10 @@ +public class TestCase extends Zzz { + public TestCase ttt(Zzz ooo) { + if (ooo instanceof TestCase) { + return (TestCase) ooo; + } + } +} + +class Zzz { +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValue.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValue.java new file mode 100644 index 000000000000..37360793fc9e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValue.java @@ -0,0 +1,10 @@ +public class TestCase extends Zzz { + public TestCase ttt(Zzz ooo) { + if (ooo instanceof TestCase) { + return o + } + } +} + +class Zzz { +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueAfterReturn-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueAfterReturn-out.java new file mode 100644 index 000000000000..8a43ecf03466 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueAfterReturn-out.java @@ -0,0 +1,11 @@ +public class TestCase extends Zzz { + + Object ooo() {} + + { + if (!(ooo() instanceof String)) { + return; + } + String s = (String) ooo(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueAfterReturn.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueAfterReturn.java new file mode 100644 index 000000000000..7ed279f14487 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueAfterReturn.java @@ -0,0 +1,11 @@ +public class TestCase extends Zzz { + + Object ooo() {} + + { + if (!(ooo() instanceof String)) { + return; + } + String s = o + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInComplexIf-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInComplexIf-out.java new file mode 100644 index 000000000000..00acc2eee5da --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInComplexIf-out.java @@ -0,0 +1,11 @@ +public class TestCase extends Zzz { + boolean foo(String s) { + } + + + { + Object ooo; + if (ooo instanceof String && foo((String) ooo)) { + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInComplexIf.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInComplexIf.java new file mode 100644 index 000000000000..1bb3bc4f4d8a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInComplexIf.java @@ -0,0 +1,11 @@ +public class TestCase extends Zzz { + boolean foo(String s) { + } + + + { + Object ooo; + if (ooo instanceof String && foo(o)) { + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInElseNegated-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInElseNegated-out.java new file mode 100644 index 000000000000..b9667616e4ad --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInElseNegated-out.java @@ -0,0 +1,11 @@ +public class TestCase extends Zzz { + + Object ooo() {} + + { + if (!(ooo() instanceof String)) { + } else { + String s = (String) ooo(); + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInElseNegated.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInElseNegated.java new file mode 100644 index 000000000000..f7f4d56119f8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInElseNegated.java @@ -0,0 +1,11 @@ +public class TestCase extends Zzz { + + Object ooo() {} + + { + if (!(ooo() instanceof String)) { + } else { + String s = o + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInTernary-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInTernary-out.java new file mode 100644 index 000000000000..3865ec929612 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInTernary-out.java @@ -0,0 +1,9 @@ +public class TestCase extends Zzz { + public TestCase ttt(Zzz ooo) { + return ooo.g() instanceof TestCase ? (TestCase) ooo.g() : + } +} + +class Zzz { + Object g(); +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInTernary.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInTernary.java new file mode 100644 index 000000000000..c59cca4a645e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestInstanceofedValueInTernary.java @@ -0,0 +1,9 @@ +public class TestCase extends Zzz { + public TestCase ttt(Zzz ooo) { + return ooo.g() instanceof TestCase ? o + } +} + +class Zzz { + Object g(); +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestNull-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestNull-out.java new file mode 100644 index 000000000000..29c821048cbf --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestNull-out.java @@ -0,0 +1,6 @@ +public class Foo { + + { + String s = null; + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuggestNull.java b/java/java-tests/testData/codeInsight/completion/smartType/SuggestNull.java new file mode 100644 index 000000000000..05b6d47b92ef --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuggestNull.java @@ -0,0 +1,6 @@ +public class Foo { + + { + String s = n + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuperConstructorArguments-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SuperConstructorArguments-out.java new file mode 100644 index 000000000000..3aff214c3036 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuperConstructorArguments-out.java @@ -0,0 +1,16 @@ +public class SomeClass { + public SomeClass() { + } + public SomeClass(int i, int j) { + } + public SomeClass(int j, int i, int k) { + } + +} + +class SomeClassImpl extends SomeClass { + SomeClassImpl(int i, int j) { + super(i, j); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuperConstructorArguments.java b/java/java-tests/testData/codeInsight/completion/smartType/SuperConstructorArguments.java new file mode 100644 index 000000000000..b8dce40463c6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuperConstructorArguments.java @@ -0,0 +1,16 @@ +public class SomeClass { + public SomeClass() { + } + public SomeClass(int i, int j) { + } + public SomeClass(int j, int i, int k) { + } + +} + +class SomeClassImpl extends SomeClass { + SomeClassImpl(int i, int j) { + super(); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuperMethodArguments-out.java b/java/java-tests/testData/codeInsight/completion/smartType/SuperMethodArguments-out.java new file mode 100644 index 000000000000..eec55fb7e95a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuperMethodArguments-out.java @@ -0,0 +1,14 @@ +public class SomeClass { + + public void foo(int count) {} + public Object foo(int count, String descr) { + + } + +} + +class SomeClassImpl extends SomeClass { + public Object foo(int count, String description) { + super.foo(count, description); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/SuperMethodArguments.java b/java/java-tests/testData/codeInsight/completion/smartType/SuperMethodArguments.java new file mode 100644 index 000000000000..a4788d2365d0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/SuperMethodArguments.java @@ -0,0 +1,14 @@ +public class SomeClass { + + public void foo(int count) {} + public Object foo(int count, String descr) { + + } + +} + +class SomeClassImpl extends SomeClass { + public Object foo(int count, String description) { + super.foo(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TabMethodInBinaryExpression-out.java b/java/java-tests/testData/codeInsight/completion/smartType/TabMethodInBinaryExpression-out.java new file mode 100644 index 000000000000..7fcb5653c464 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TabMethodInBinaryExpression-out.java @@ -0,0 +1,13 @@ +public class TabComplete { + public void scene() { + Servant servant = new Servant(); + int var = servant.method1() + 1; + } +} + +class Servant { + public int method1() { + return 1; + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TabMethodInBinaryExpression.java b/java/java-tests/testData/codeInsight/completion/smartType/TabMethodInBinaryExpression.java new file mode 100644 index 000000000000..e3fe222a899c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TabMethodInBinaryExpression.java @@ -0,0 +1,13 @@ +public class TabComplete { + public void scene() { + Servant servant = new Servant(); + int var = servant.method1() + 1; + } +} + +class Servant { + public int method1() { + return 1; + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TabToReplaceClassKeyword-out.java b/java/java-tests/testData/codeInsight/completion/smartType/TabToReplaceClassKeyword-out.java new file mode 100644 index 000000000000..f2b4f613e009 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TabToReplaceClassKeyword-out.java @@ -0,0 +1,7 @@ +class Foo { + void foo() { + Class c = Foo.class; + } +} + +class Bar extends Foo {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TabToReplaceClassKeyword.java b/java/java-tests/testData/codeInsight/completion/smartType/TabToReplaceClassKeyword.java new file mode 100644 index 000000000000..e093a23bfee9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TabToReplaceClassKeyword.java @@ -0,0 +1,7 @@ +class Foo { + void foo() { + Class c = Fa.class; + } +} + +class Bar extends Foo {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TailAfterInstanceOf-out.java b/java/java-tests/testData/codeInsight/completion/smartType/TailAfterInstanceOf-out.java new file mode 100644 index 000000000000..cc049f306c56 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TailAfterInstanceOf-out.java @@ -0,0 +1,9 @@ +public class TestCase extends Zzz { + public boolean ttt(Zzz o) { + return o instanceof TestCase + } +} + +class Zzz { + private void fax() {} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TailAfterInstanceOf.java b/java/java-tests/testData/codeInsight/completion/smartType/TailAfterInstanceOf.java new file mode 100644 index 000000000000..de7261497c23 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TailAfterInstanceOf.java @@ -0,0 +1,9 @@ +public class TestCase extends Zzz { + public boolean ttt(Zzz o) { + return o instanceof + } +} + +class Zzz { + private void fax() {} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ThrowExceptionConstructor-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ThrowExceptionConstructor-out.java new file mode 100644 index 000000000000..d105afd9a5d7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ThrowExceptionConstructor-out.java @@ -0,0 +1,9 @@ +class MyException extends RuntimeException { + public MyException(String[] s) {} +} + +class XXX { + { + throw new MyException(new String[]); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ThrowExceptionConstructor.java b/java/java-tests/testData/codeInsight/completion/smartType/ThrowExceptionConstructor.java new file mode 100644 index 000000000000..1a77926ac086 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ThrowExceptionConstructor.java @@ -0,0 +1,9 @@ +class MyException extends RuntimeException { + public MyException(String[] s) {} +} + +class XXX { + { + throw new MyException(new ) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ThrowRuntimeException-out.java b/java/java-tests/testData/codeInsight/completion/smartType/ThrowRuntimeException-out.java new file mode 100644 index 000000000000..d67cac06cf3f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ThrowRuntimeException-out.java @@ -0,0 +1,7 @@ +class Foo { + { + RuntimeException e; + throw e; + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/ThrowRuntimeException.java b/java/java-tests/testData/codeInsight/completion/smartType/ThrowRuntimeException.java new file mode 100644 index 000000000000..c821a6e74c56 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/ThrowRuntimeException.java @@ -0,0 +1,7 @@ +class Foo { + { + RuntimeException e; + throw + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeArgs1-out.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeArgs1-out.java new file mode 100644 index 000000000000..185c36184587 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeArgs1-out.java @@ -0,0 +1,9 @@ +class List {} + +public class AA { + class Entry {} + + { + List l = new List(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeArgs1.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeArgs1.java new file mode 100644 index 000000000000..7072c1480216 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeArgs1.java @@ -0,0 +1,9 @@ +class List {} + +public class AA { + class Entry {} + + { + List l = new + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeArgs2-out.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeArgs2-out.java new file mode 100644 index 000000000000..28d7baec7c41 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeArgs2-out.java @@ -0,0 +1,10 @@ +import java.util.Collection; + +class List {} + +public class A { + void f() { + class Collection {} + List l = new List(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeArgs2.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeArgs2.java new file mode 100644 index 000000000000..4fb01c7899f7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeArgs2.java @@ -0,0 +1,8 @@ +class List {} + +public class A { + void f() { + class Collection {} + List l = new + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritors-out.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritors-out.java new file mode 100644 index 000000000000..c1e2e9284bc9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritors-out.java @@ -0,0 +1,7 @@ +class Foo {} +class Bar extends Foo {} +class Goo extends Bar {} + +class Params {} +class Main extends Params + diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritors.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritors.java new file mode 100644 index 000000000000..218593776acf --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritors.java @@ -0,0 +1,7 @@ +class Foo {} +class Bar extends Foo {} +class Goo extends Bar {} + +class Params {} +class Main extends Params< + diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsComma-out.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsComma-out.java new file mode 100644 index 000000000000..7c24b57356f9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsComma-out.java @@ -0,0 +1,5 @@ +class Foo {} + +class Params {} +class Main extends Params + diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsComma.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsComma.java new file mode 100644 index 000000000000..3d8c026584b2 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsComma.java @@ -0,0 +1,5 @@ +class Foo {} + +class Params {} +class Main extends Params< + diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsInExpression-out.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsInExpression-out.java new file mode 100644 index 000000000000..351e177d0bc8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsInExpression-out.java @@ -0,0 +1,6 @@ +class CharSequence {} + +class Stringy { } + +class Tester { +void method() { new Stringy } \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsInExpression.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsInExpression.java new file mode 100644 index 000000000000..746cd0be4f8d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersInheritorsInExpression.java @@ -0,0 +1,6 @@ +class CharSequence {} + +class Stringy { } + +class Tester { +void method() { new Stringy } \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersObjectInheritors-out.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersObjectInheritors-out.java new file mode 100644 index 000000000000..1f6764a74c68 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersObjectInheritors-out.java @@ -0,0 +1,6 @@ +class CharSequenceX {} + +class Stringy { } + +class Tester { +void method() { new Stringy } \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersObjectInheritors.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersObjectInheritors.java new file mode 100644 index 000000000000..9a626cb83589 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeParametersObjectInheritors.java @@ -0,0 +1,6 @@ +class CharSequenceX {} + +class Stringy { } + +class Tester { +void method() { new Stringy } \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TypeVariableInstanceOf.java b/java/java-tests/testData/codeInsight/completion/smartType/TypeVariableInstanceOf.java new file mode 100644 index 000000000000..0c9030f4edef --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/TypeVariableInstanceOf.java @@ -0,0 +1,10 @@ +interface Foo {} +class Bar implements Foo {} +class Goo implements Foo {} + +class Main { + { + T t; + if (t instanceof ) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/UnlockDocument-out.java b/java/java-tests/testData/codeInsight/completion/smartType/UnlockDocument-out.java new file mode 100644 index 000000000000..a5cc8dd35c1b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/UnlockDocument-out.java @@ -0,0 +1,10 @@ +import java.util.*; + +import pkg.Bar; +import pkg.Foo; + +class MyClass { +{ + Foo.foo(Collections.emptyList()); +} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/UnlockDocument.java b/java/java-tests/testData/codeInsight/completion/smartType/UnlockDocument.java new file mode 100644 index 000000000000..2473d8c382ed --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/UnlockDocument.java @@ -0,0 +1,8 @@ +import java.util.*; +import pkg.Foo; + +class MyClass { +{ + Foo.foo(Collections.em) +} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/UnqualifiedConstantInSwitch-out.java b/java/java-tests/testData/codeInsight/completion/smartType/UnqualifiedConstantInSwitch-out.java new file mode 100644 index 000000000000..397513de6d9d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/UnqualifiedConstantInSwitch-out.java @@ -0,0 +1,16 @@ +enum Foo { + FOO, BAR + } + + +class Main { + + { + Foo a; + Foo b; + switch (a) { + case FOO: b = Foo.BAR; + } + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/UnqualifiedConstantInSwitch.java b/java/java-tests/testData/codeInsight/completion/smartType/UnqualifiedConstantInSwitch.java new file mode 100644 index 000000000000..75d9f49d2359 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/UnqualifiedConstantInSwitch.java @@ -0,0 +1,16 @@ +enum Foo { + FOO, BAR + } + + +class Main { + + { + Foo a; + Foo b; + switch (a) { + case FOO: b = B + } + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromConstructedClass-out.java b/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromConstructedClass-out.java new file mode 100644 index 000000000000..945a588b682b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromConstructedClass-out.java @@ -0,0 +1,15 @@ +class Foo { + public static final int FOO_FOO; + public static final int FOO_BAR; + + Foo(int a) {} + + void foo(int x); +} + +public class Bar { + + { + new Foo(Foo.FOO_BAR); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromConstructedClass.java b/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromConstructedClass.java new file mode 100644 index 000000000000..dfbb0e27022a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromConstructedClass.java @@ -0,0 +1,15 @@ +class Foo { + public static final int FOO_FOO; + public static final int FOO_BAR; + + Foo(int a) {} + + void foo(int x); +} + +public class Bar { + + { + new Foo(FB) + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClass-out.java b/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClass-out.java new file mode 100644 index 000000000000..8ee6bc907e44 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClass-out.java @@ -0,0 +1,13 @@ +class Foo { + public static final int FOO_FOO; + public static final int FOO_BAR; + + void foo(int x); +} + +public class Bar { + + { + new Foo().foo(Foo.FOO_BAR); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClass.java b/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClass.java new file mode 100644 index 000000000000..3ee926c78969 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClass.java @@ -0,0 +1,13 @@ +class Foo { + public static final int FOO_FOO; + public static final int FOO_BAR; + + void foo(int x); +} + +public class Bar { + + { + new Foo().foo(FB) + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClassReturnValue-out.java b/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClassReturnValue-out.java new file mode 100644 index 000000000000..57fef989522e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClassReturnValue-out.java @@ -0,0 +1,13 @@ +class Foo { + public static final int FOO_FOO; + public static final int FOO_BAR; + + int foo(); +} + +public class Bar { + + { + if (new Foo().foo() == Foo.FOO_BAR) + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClassReturnValue.java b/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClassReturnValue.java new file mode 100644 index 000000000000..00c2495c7245 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/UseIntConstantsFromTargetClassReturnValue.java @@ -0,0 +1,13 @@ +class Foo { + public static final int FOO_FOO; + public static final int FOO_BAR; + + int foo(); +} + +public class Bar { + + { + if (new Foo().foo() == FB) + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/UserDataListAddAll-out.java b/java/java-tests/testData/codeInsight/completion/smartType/UserDataListAddAll-out.java new file mode 100644 index 000000000000..19dc86d1ac9a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/UserDataListAddAll-out.java @@ -0,0 +1,18 @@ +class List { + void addAll(List l); +} + +class Key {} + +class FooBase { + Key> STRING_LIST; + + T get(Key key); + + { + List l; + l.addAll(get(STRING_LIST)) + } + + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/UserDataListAddAll.java b/java/java-tests/testData/codeInsight/completion/smartType/UserDataListAddAll.java new file mode 100644 index 000000000000..d8e40cd6cb38 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/UserDataListAddAll.java @@ -0,0 +1,18 @@ +class List { + void addAll(List l); +} + +class Key {} + +class FooBase { + Key> STRING_LIST; + + T get(Key key); + + { + List l; + l.addAll(get(S)) + } + + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Varargs1-out.java b/java/java-tests/testData/codeInsight/completion/smartType/Varargs1-out.java new file mode 100644 index 000000000000..c1fb01b359ab --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Varargs1-out.java @@ -0,0 +1,8 @@ +public class Varargs { + void foo (String s, String ... objs) {} + + void bar () { + String sss = new String(); + foo ("", "", sss); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/Varargs1.java b/java/java-tests/testData/codeInsight/completion/smartType/Varargs1.java new file mode 100644 index 000000000000..656c5c8c8cd0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/Varargs1.java @@ -0,0 +1,8 @@ +public class Varargs { + void foo (String s, String ... objs) {} + + void bar () { + String sss = new String(); + foo ("", "", s); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/VoidCast.java b/java/java-tests/testData/codeInsight/completion/smartType/VoidCast.java new file mode 100644 index 000000000000..3e924916e8b7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/VoidCast.java @@ -0,0 +1,5 @@ +class C{ + { + () + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/VoidExpectedType-out.java b/java/java-tests/testData/codeInsight/completion/smartType/VoidExpectedType-out.java new file mode 100644 index 000000000000..b3a9d7a1942c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/VoidExpectedType-out.java @@ -0,0 +1,8 @@ +class Main { + + { + new Foo().equals(); + } +} + +class Foo {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/VoidExpectedType.java b/java/java-tests/testData/codeInsight/completion/smartType/VoidExpectedType.java new file mode 100644 index 000000000000..8bf51956c777 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/VoidExpectedType.java @@ -0,0 +1,8 @@ +class Main { + + { + new Foo(). + } +} + +class Foo {} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof-out.java b/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof-out.java new file mode 100644 index 000000000000..a7d20008f407 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof-out.java @@ -0,0 +1,9 @@ +class A {} +class Bbbb extends A {} +public class C { + void m(A a) { + if (a instanceof Bbbb) { + + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof.java b/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof.java new file mode 100644 index 000000000000..27c6bdc19418 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof.java @@ -0,0 +1,9 @@ +class A {} +class Bbbb extends A {} +public class C { + void m(A a) { + if (a instanceof B) { + + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof2-out.java b/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof2-out.java new file mode 100644 index 000000000000..e2bdb77d17a0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof2-out.java @@ -0,0 +1,9 @@ +class A {} +class Bbbb extends A {} +public class C { + void m(A a) { + if (a instanceof Bbbb) { + + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof2.java b/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof2.java new file mode 100644 index 000000000000..46d373e47bb6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof2.java @@ -0,0 +1,9 @@ +class A {} +class Bbbb extends A {} +public class C { + void m(A a) { + if (a instanceof B) { + + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof3-out.java b/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof3-out.java new file mode 100644 index 000000000000..7750ed73c90d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof3-out.java @@ -0,0 +1,9 @@ +class A {} +class Bbbb extends A {} +public class C { + void m(A a) { + if (a instanceof Bbbb) { + + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof3.java b/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof3.java new file mode 100644 index 000000000000..a8e697062d57 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/WildcardedInstanceof3.java @@ -0,0 +1,9 @@ +class A {} +class Bbbb extends A {} +public class C { + void m(A a) { + if (a instanceof B) { + + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/after1.java b/java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/after1.java new file mode 100644 index 000000000000..8ecf6ed99ae6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/after1.java @@ -0,0 +1,11 @@ +class A{ + { + A a; + + if(a instanceof B) + + } + + class B extends A{} + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/after2.java b/java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/after2.java new file mode 100644 index 000000000000..1e85e51303bf --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/after2.java @@ -0,0 +1,11 @@ +class A{ + { + A a; + + if(a instanceof BBBB) + + } + + class BBBB extends A{} + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/before1.java b/java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/before1.java new file mode 100644 index 000000000000..688de520ad5f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/before1.java @@ -0,0 +1,11 @@ +class A{ + { + A a; + + if(a instanceof ) + + } + + class B extends A{} + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/before2.java b/java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/before2.java new file mode 100644 index 000000000000..d1b8cdf9db82 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterInstanceOf/before2.java @@ -0,0 +1,11 @@ +class A{ + { + A a; + + if(a instanceof BB) + + } + + class BBBB extends A{} + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter.java new file mode 100644 index 000000000000..63728c238d9b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter.java @@ -0,0 +1,10 @@ +class B { + class A { + A(int i) {} + } + static B createB(A a) {} + public static void main(String[] args) { + int i; + foo(createB(new A(i))); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter2.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter2.java new file mode 100644 index 000000000000..323b284df102 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter2.java @@ -0,0 +1,9 @@ +class B { + private static int getSeed() { return 0; } + class A { + A(int i) {} + } + public static void main(String[] args) { + new A(getSeed()).show(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter3.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter3.java new file mode 100644 index 000000000000..938ebae51078 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter3.java @@ -0,0 +1,13 @@ +class AAA { + AAA(int i) {} +} + +class B { + int iiii=0; + B(int i,AAA aaa, int j, int k) { + B b = new B( + 0, + new AAA(iiii), + ); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter4.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter4.java new file mode 100644 index 000000000000..3e2fa6f18192 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewAfter4.java @@ -0,0 +1,8 @@ +class _Map {} + +class B { + B(_Map map) {} + public static void main(String[] argv) { + B b = new B( (_Map) ); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore.java new file mode 100644 index 000000000000..a2a3b956c182 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore.java @@ -0,0 +1,10 @@ +class B { + class A { + A(int i) {} + } + static B createB(A a) {} + public static void main(String[] args) { + int i; + foo(createB(new A())); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore2.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore2.java new file mode 100644 index 000000000000..94d848f456da --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore2.java @@ -0,0 +1,9 @@ +class B { + private static int getSeed() { return 0; } + class A { + A(int i) {} + } + public static void main(String[] args) { + new A(get).show(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore3.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore3.java new file mode 100644 index 000000000000..bd30d9bb6ff2 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore3.java @@ -0,0 +1,13 @@ +class AAA { + AAA(int i) {} +} + +class B { + int iiii=0; + B(int i,AAA aaa, int j, int k) { + B b = new B( + 0, + new AAA(ii), + ); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore4.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore4.java new file mode 100644 index 000000000000..e8828b99758a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/LastArgInInnerNewBefore4.java @@ -0,0 +1,8 @@ +class _Map {} + +class B { + B(_Map map) {} + public static void main(String[] argv) { + B b = new B( () ); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after1.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after1.java new file mode 100644 index 000000000000..6b0db840c98f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after1.java @@ -0,0 +1,5 @@ +class AAA{ + { + AAA aa = new AAA(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after10.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after10.java new file mode 100644 index 000000000000..8368802b8736 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after10.java @@ -0,0 +1,11 @@ +import java.io.InputStream; +class Test { + InputStream inputStream = new MyInputStream(); + + private class MyInputStream extends InputStream { + MyInputStream(String nmame){} + public int read() throws IOException { + return 0; + } + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after11.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after11.java new file mode 100644 index 000000000000..6b0db840c98f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after11.java @@ -0,0 +1,5 @@ +class AAA{ + { + AAA aa = new AAA(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after12.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after12.java new file mode 100644 index 000000000000..052d2656908d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after12.java @@ -0,0 +1,4 @@ + +class Test { + Test test = new Test +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after13.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after13.java new file mode 100644 index 000000000000..4ffffb2667f1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after13.java @@ -0,0 +1,3 @@ +class AAAAA{ + AAAAA asd = new AAAAA +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after14.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after14.java new file mode 100644 index 000000000000..1c28f2b03323 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after14.java @@ -0,0 +1,5 @@ +class A{ + void foo(){ + throw new RuntimeException(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after15.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after15.java new file mode 100644 index 000000000000..cb778f9c2393 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after15.java @@ -0,0 +1,7 @@ +class A{ + void foo() throws MyException{ + throw new Erro + } + + class MyException extends Exception{} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after16.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after16.java new file mode 100644 index 000000000000..9964bf1e5aa3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after16.java @@ -0,0 +1,7 @@ +class A{ + void foo() throws MyException{ + throw new MyException(); + } + + class MyException extends Exception{} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after2.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after2.java new file mode 100644 index 000000000000..560883e825e6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after2.java @@ -0,0 +1,5 @@ +class AAA{ + { + AAA aa = new AAA(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after3.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after3.java new file mode 100644 index 000000000000..2fd00bb47bfa --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after3.java @@ -0,0 +1,9 @@ +interface XXX{} + +class BBB implements XXX{} + +class AAA{ + { + XXX aa = new BBB(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after4.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after4.java new file mode 100644 index 000000000000..b111daeb25d9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after4.java @@ -0,0 +1,8 @@ +class AAA{ + interface XXX{} + + class BBB implements XXX{} + { + XXX aa = new BBB(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after5.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after5.java new file mode 100644 index 000000000000..8c25b3ef4cf3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after5.java @@ -0,0 +1,8 @@ +class AAA{ + interface XXX{} + + class BBB implements XXX{} + { + XXX aa = new BBB(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after6.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after6.java new file mode 100644 index 000000000000..b1a6cfe9f15d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after6.java @@ -0,0 +1,8 @@ +class AAA{ + interface XXX{} + + class BBB implements XXX{} + { + XXX aa = new BBB(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after7.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after7.java new file mode 100644 index 000000000000..9087c1e0f79a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after7.java @@ -0,0 +1,8 @@ +class AAA{ + interface XXX{} + + class BBB implements XXX{} + { + XXX aa = new BBB(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after8.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after8.java new file mode 100644 index 000000000000..8e17e8abc6e1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after8.java @@ -0,0 +1,8 @@ +class AAA{ + interface XXX{} + interface ZZZ{} + class BBB implements XXX>{} + { + XXX> aa = new BBB(); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after9.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after9.java new file mode 100644 index 000000000000..0bb0342da8a0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/after9.java @@ -0,0 +1,7 @@ +class A{ + interface Interface{} + + { + Interface in = new + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before1.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before1.java new file mode 100644 index 000000000000..390f787c6c1f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before1.java @@ -0,0 +1,5 @@ +class AAA{ + { + AAA aa = new + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before10.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before10.java new file mode 100644 index 000000000000..ff6693ad004a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before10.java @@ -0,0 +1,11 @@ +import java.io.InputStream; +class Test { + InputStream inputStream = new MyIn + + private class MyInputStream extends InputStream { + MyInputStream(String nmame){} + public int read() throws IOException { + return 0; + } + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before11.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before11.java new file mode 100644 index 000000000000..ff6693ad004a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before11.java @@ -0,0 +1,11 @@ +import java.io.InputStream; +class Test { + InputStream inputStream = new MyIn + + private class MyInputStream extends InputStream { + MyInputStream(String nmame){} + public int read() throws IOException { + return 0; + } + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before12.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before12.java new file mode 100644 index 000000000000..18af02000543 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before12.java @@ -0,0 +1,4 @@ + +class Test { + Test test = new Test< +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before13.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before13.java new file mode 100644 index 000000000000..817fedc38bdb --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before13.java @@ -0,0 +1,3 @@ +class AAAAA{ + AAAAA asd = new AAAAA< +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before14.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before14.java new file mode 100644 index 000000000000..f2485899f0e0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before14.java @@ -0,0 +1,5 @@ +class A{ + void foo(){ + throw new RuntimeEx + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before15.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before15.java new file mode 100644 index 000000000000..cb778f9c2393 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before15.java @@ -0,0 +1,7 @@ +class A{ + void foo() throws MyException{ + throw new Erro + } + + class MyException extends Exception{} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before16.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before16.java new file mode 100644 index 000000000000..221a4c42f4f1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before16.java @@ -0,0 +1,7 @@ +class A{ + void foo() throws MyException{ + throw new MyEx + } + + class MyException extends Exception{} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before2.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before2.java new file mode 100644 index 000000000000..998bba4fa535 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before2.java @@ -0,0 +1,5 @@ +class AAA{ + { + AAA aa = new + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before3.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before3.java new file mode 100644 index 000000000000..3e48edaf8c3b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before3.java @@ -0,0 +1,9 @@ +interface XXX{} + +class BBB implements XXX{} + +class AAA{ + { + XXX aa = new B + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before4.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before4.java new file mode 100644 index 000000000000..a8a85850bb15 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before4.java @@ -0,0 +1,8 @@ +class AAA{ + interface XXX{} + + class BBB implements XXX{} + { + XXX aa = new B + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before5.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before5.java new file mode 100644 index 000000000000..71d3cc3c070a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before5.java @@ -0,0 +1,8 @@ +class AAA{ + interface XXX{} + + class BBB implements XXX{} + { + XXX aa = new B + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before6.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before6.java new file mode 100644 index 000000000000..ecbc1a27c1f0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before6.java @@ -0,0 +1,8 @@ +class AAA{ + interface XXX{} + + class BBB implements XXX{} + { + XXX aa = new B + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before7.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before7.java new file mode 100644 index 000000000000..c5fc6d6134dd --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before7.java @@ -0,0 +1,8 @@ +class AAA{ + interface XXX{} + + class BBB implements XXX{} + { + XXX aa = new B + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before8.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before8.java new file mode 100644 index 000000000000..f31ab8a0d28b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before8.java @@ -0,0 +1,8 @@ +class AAA{ + interface XXX{} + interface ZZZ{} + class BBB implements XXX>{} + { + XXX> aa = new B + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before9.java b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before9.java new file mode 100644 index 000000000000..0bb0342da8a0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/afterNew/before9.java @@ -0,0 +1,7 @@ +class A{ + interface Interface{} + + { + Interface in = new + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/foo/GetInstance-out.java b/java/java-tests/testData/codeInsight/completion/smartType/foo/GetInstance-out.java new file mode 100644 index 000000000000..d1947a47a5de --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/foo/GetInstance-out.java @@ -0,0 +1,11 @@ +package foo; + +class ServiceManager { + static T getService(Class aClass) {} +} + +class MyClass { + public MyClass getInstance() { + return ServiceManager.getService(MyClass.class); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/foo/GetInstance.java b/java/java-tests/testData/codeInsight/completion/smartType/foo/GetInstance.java new file mode 100644 index 000000000000..338114304f9b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/foo/GetInstance.java @@ -0,0 +1,11 @@ +package foo; + +class ServiceManager { + static T getService(Class aClass) {} +} + +class MyClass { + public MyClass getInstance() { + return ServiceManager.getService(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/after1.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/after1.java new file mode 100644 index 000000000000..9ff05f0ee39d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/after1.java @@ -0,0 +1,9 @@ +class A{ + + T get(){return null;} + void put(String str); + + { + put(new A().get()); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/after2.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/after2.java new file mode 100644 index 000000000000..ee4a000794d4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/after2.java @@ -0,0 +1,9 @@ +class A{ + + T get(){return null;} + void put(T str); + + { + new A().put(new A().get()); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/after3.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/after3.java new file mode 100644 index 000000000000..8ffd2de0c2c5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/after3.java @@ -0,0 +1,10 @@ +class A{ + + T get(){return null;} + void put(T str); + + { + Object obj; + put(obj); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/after4.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/after4.java new file mode 100644 index 000000000000..f6f9a23ce04d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/after4.java @@ -0,0 +1,10 @@ +class A{ + + T get(){return null;} + void put(T[] str); + + { + Object[] obj; + put(obj); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/after5.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/after5.java new file mode 100644 index 000000000000..398e0101b084 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/after5.java @@ -0,0 +1,9 @@ +class A{ + class Map{ + V get(U u){} + } + + { + String str = new Map().get(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/after6.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/after6.java new file mode 100644 index 000000000000..d3dad3c95f3d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/after6.java @@ -0,0 +1,9 @@ +class C{ + class X{} + + public X foo(T sdhg);' + { + + X dsd = foo() + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/after7.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/after7.java new file mode 100644 index 000000000000..a278de9767cf --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/after7.java @@ -0,0 +1,7 @@ +class List {} + +class C { + void foo () { + List l = new List(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/after8.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/after8.java new file mode 100644 index 000000000000..e8bcd680a265 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/after8.java @@ -0,0 +1,7 @@ +class List {} + +class C { + void foo () { + List[] array = new List[]; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/after9.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/after9.java new file mode 100644 index 000000000000..e7495d309f3a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/after9.java @@ -0,0 +1,7 @@ +class A { + void foo(T[] ts) {} + + { + foo(new Object[]); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/before1.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/before1.java new file mode 100644 index 000000000000..7673bffd4667 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/before1.java @@ -0,0 +1,9 @@ +class A{ + + T get(){return null;} + void put(String str); + + { + put(new A().g) + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/before2.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/before2.java new file mode 100644 index 000000000000..4a8c644df90b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/before2.java @@ -0,0 +1,9 @@ +class A{ + + T get(){return null;} + void put(T str); + + { + new A().put(new A().g) + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/before3.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/before3.java new file mode 100644 index 000000000000..25d94360e5bd --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/before3.java @@ -0,0 +1,10 @@ +class A{ + + T get(){return null;} + void put(T str); + + { + Object obj; + put(ob) + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/before4.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/before4.java new file mode 100644 index 000000000000..5e434c2fc827 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/before4.java @@ -0,0 +1,10 @@ +class A{ + + T get(){return null;} + void put(T[] str); + + { + Object[] obj; + put(ob) + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/before5.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/before5.java new file mode 100644 index 000000000000..45444b96f395 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/before5.java @@ -0,0 +1,9 @@ +class A{ + class Map{ + V get(U u){} + } + + { + String str = new Map().g + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/before6.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/before6.java new file mode 100644 index 000000000000..9948d5d43a30 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/before6.java @@ -0,0 +1,9 @@ +class C{ + class X{} + + public X foo(T sdhg);' + { + + X dsd = f + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/before7.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/before7.java new file mode 100644 index 000000000000..b386d20d58e1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/before7.java @@ -0,0 +1,7 @@ +class List {} + +class C { + void foo () { + List l = new + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/before8.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/before8.java new file mode 100644 index 000000000000..64f5232b3c43 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/before8.java @@ -0,0 +1,7 @@ +class List {} + +class C { + void foo () { + List[] array = new + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/generics/before9.java b/java/java-tests/testData/codeInsight/completion/smartType/generics/before9.java new file mode 100644 index 000000000000..a2e62aebb8d6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/generics/before9.java @@ -0,0 +1,7 @@ +class A { + void foo(T[] ts) {} + + { + foo(new ); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after1.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after1.java new file mode 100644 index 000000000000..8362398c1d35 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after1.java @@ -0,0 +1,5 @@ +public class TestClass { + public void foo(TestClass p) { + foo(this); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after1_space.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after1_space.java new file mode 100644 index 000000000000..f6f88d014d93 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after1_space.java @@ -0,0 +1,5 @@ +public class TestClass { + public void foo(TestClass p) { + foo(this ); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after2.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after2.java new file mode 100644 index 000000000000..d629fa686200 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after2.java @@ -0,0 +1,5 @@ +public class TestClass { + public int foo(TestClass p) { + foo(this) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after3.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after3.java new file mode 100644 index 000000000000..8362398c1d35 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after3.java @@ -0,0 +1,5 @@ +public class TestClass { + public void foo(TestClass p) { + foo(this); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after4.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after4.java new file mode 100644 index 000000000000..35316e065b0f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after4.java @@ -0,0 +1,5 @@ +public class TestClass { + public int foo(TestClass p) { + bar(foo(this)) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after5.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after5.java new file mode 100644 index 000000000000..77332b496138 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after5.java @@ -0,0 +1,5 @@ +public class TestClass { + public int foo(TestClass p) { + if(foo(this)) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after6.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after6.java new file mode 100644 index 000000000000..821072b4ef2f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/after6.java @@ -0,0 +1,7 @@ +public class TestClass { + static TestClass getInstance() { return new TestClass(); } + public int foo(TestClass p) { + foo(getInstance() + ); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before1.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before1.java new file mode 100644 index 000000000000..b9d5cefe1570 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before1.java @@ -0,0 +1,5 @@ +public class TestClass { + public void foo(TestClass p) { + foo(t + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before2.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before2.java new file mode 100644 index 000000000000..18ef895a3466 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before2.java @@ -0,0 +1,5 @@ +public class TestClass { + public int foo(TestClass p) { + foo(t + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before3.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before3.java new file mode 100644 index 000000000000..e79a90fd28a1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before3.java @@ -0,0 +1,5 @@ +public class TestClass { + public void foo(TestClass p) { + foo(t); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before4.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before4.java new file mode 100644 index 000000000000..134fd2c3a083 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before4.java @@ -0,0 +1,5 @@ +public class TestClass { + public int foo(TestClass p) { + bar(foo(t) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before5.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before5.java new file mode 100644 index 000000000000..972ab60d5b8f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before5.java @@ -0,0 +1,5 @@ +public class TestClass { + public int foo(TestClass p) { + if(foo(t) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before6.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before6.java new file mode 100644 index 000000000000..8f1a2eac52f6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCall/before6.java @@ -0,0 +1,7 @@ +public class TestClass { + static TestClass getInstance() { return new TestClass(); } + public int foo(TestClass p) { + foo(get + ); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/after1.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/after1.java new file mode 100644 index 000000000000..129178ffd07f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/after1.java @@ -0,0 +1,5 @@ +public class TestClass { + public void foo(TestClass p) { + foo((TestClass) ); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/after2.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/after2.java new file mode 100644 index 000000000000..9036f9524b64 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/after2.java @@ -0,0 +1,5 @@ +public class TestClass { + TestClass(TestClass p){ + new TestClass((TestClass) obj).f(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/after3.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/after3.java new file mode 100644 index 000000000000..140236cc89e0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/after3.java @@ -0,0 +1,8 @@ +class A{ + { + String str = (String)foo() + + } + + Object foo(){} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/before1.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/before1.java new file mode 100644 index 000000000000..e8916abeac80 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/before1.java @@ -0,0 +1,5 @@ +public class TestClass { + public void foo(TestClass p) { + foo((); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/before2.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/before2.java new file mode 100644 index 000000000000..1e6317103940 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/before2.java @@ -0,0 +1,5 @@ +public class TestClass { + TestClass(TestClass p){ + new TestClass((AAA)obj).f(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/before3.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/before3.java new file mode 100644 index 000000000000..d01eac621b86 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterCast/before3.java @@ -0,0 +1,8 @@ +class A{ + { + String str = (String)fo + + } + + Object foo(){} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/after1.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/after1.java new file mode 100644 index 000000000000..9f11d7e0d14d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/after1.java @@ -0,0 +1,5 @@ +public class TestClass { + public void foo(boolean parm) { + if (parm) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/after2.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/after2.java new file mode 100644 index 000000000000..9f11d7e0d14d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/after2.java @@ -0,0 +1,5 @@ +public class TestClass { + public void foo(boolean parm) { + if (parm) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/before1.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/before1.java new file mode 100644 index 000000000000..ef9fc4b29b3d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/before1.java @@ -0,0 +1,5 @@ +public class TestClass { + public void foo(boolean parm) { + if (p + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/before2.java b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/before2.java new file mode 100644 index 000000000000..b28925616713 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/parenAfterIf/before2.java @@ -0,0 +1,5 @@ +public class TestClass { + public void foo(boolean parm) { + if (p) + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/return/after1.java b/java/java-tests/testData/codeInsight/completion/smartType/return/after1.java new file mode 100644 index 000000000000..045b2ffc1e0a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/return/after1.java @@ -0,0 +1,12 @@ +class A{ + class B{ + int fooo(){ + } + } + + int fooo(){ + B b = null; + + return b.fooo(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/return/after2.java b/java/java-tests/testData/codeInsight/completion/smartType/return/after2.java new file mode 100644 index 000000000000..a68033e58ed4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/return/after2.java @@ -0,0 +1,12 @@ +class A{ + class B{ + int fooo(){ + } + } + + int fooo(){ + A b = null; + + return b.fooo(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/return/after3.java b/java/java-tests/testData/codeInsight/completion/smartType/return/after3.java new file mode 100644 index 000000000000..02ab02bc6ce7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/return/after3.java @@ -0,0 +1,12 @@ +class A{ + class B{ + int fooo(){ + } + } + + int fooo(){ + A b = null; + + return fo + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/return/before1.java b/java/java-tests/testData/codeInsight/completion/smartType/return/before1.java new file mode 100644 index 000000000000..f97e57e43883 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/return/before1.java @@ -0,0 +1,12 @@ +class A{ + class B{ + int fooo(){ + } + } + + int fooo(){ + B b = null; + + return b.fo + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/return/before2.java b/java/java-tests/testData/codeInsight/completion/smartType/return/before2.java new file mode 100644 index 000000000000..6645ebdeaff9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/return/before2.java @@ -0,0 +1,12 @@ +class A{ + class B{ + int fooo(){ + } + } + + int fooo(){ + A b = null; + + return b.fo + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/return/before3.java b/java/java-tests/testData/codeInsight/completion/smartType/return/before3.java new file mode 100644 index 000000000000..02ab02bc6ce7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/return/before3.java @@ -0,0 +1,12 @@ +class A{ + class B{ + int fooo(){ + } + } + + int fooo(){ + A b = null; + + return fo + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/ArrayMemberAccess-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/ArrayMemberAccess-out.java new file mode 100644 index 000000000000..6baaaef5a5d9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/ArrayMemberAccess-out.java @@ -0,0 +1,6 @@ +class Goo { + { + boolean[] ls; + boolean a = ls[]; + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/ArrayMemberAccess.java b/java/java-tests/testData/codeInsight/completion/smartType/second/ArrayMemberAccess.java new file mode 100644 index 000000000000..260590763d58 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/ArrayMemberAccess.java @@ -0,0 +1,6 @@ +class Goo { + { + boolean[] ls; + boolean a = l + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/CastInstanceofedQualifier-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/CastInstanceofedQualifier-out.java new file mode 100644 index 000000000000..7943f45da8c4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/CastInstanceofedQualifier-out.java @@ -0,0 +1,19 @@ +interface Zip extends Bar{ + Foo getZip(); +} + +interface Bar {} + +class Foo { + +} + +class Goo { + { + Bar o; + if (o instanceof Zip) { + Foo f = ((Zip) o).getZip(); + } + } +} + diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/CastInstanceofedQualifier.java b/java/java-tests/testData/codeInsight/completion/smartType/second/CastInstanceofedQualifier.java new file mode 100644 index 000000000000..a3275d2eda8a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/CastInstanceofedQualifier.java @@ -0,0 +1,19 @@ +interface Zip extends Bar{ + Foo getZip(); +} + +interface Bar {} + +class Foo { + +} + +class Goo { + { + Bar o; + if (o instanceof Zip) { + Foo f = + } + } +} + diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/ChainingPerformance.java b/java/java-tests/testData/codeInsight/completion/smartType/second/ChainingPerformance.java new file mode 100644 index 000000000000..14125cc17895 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/ChainingPerformance.java @@ -0,0 +1,7 @@ +class Foo extends javax.swing.JComponent { + + { + String cl = + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/DifferentQualifiers.java b/java/java-tests/testData/codeInsight/completion/smartType/second/DifferentQualifiers.java new file mode 100644 index 000000000000..2a2c56bd1d3a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/DifferentQualifiers.java @@ -0,0 +1,14 @@ +class Bar { + Goo getGoo(int a); +} +class Goo {} + +class Foo { + Bar getBar() {} + Bar b; + + + { + Goo g = + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/DontChainStringMethodsOnString-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/DontChainStringMethodsOnString-out.java new file mode 100644 index 000000000000..ce60f2b47794 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/DontChainStringMethodsOnString-out.java @@ -0,0 +1,9 @@ +class Foo { + + String afoo(); + + { + String cl = afoo(); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/DontChainStringMethodsOnString.java b/java/java-tests/testData/codeInsight/completion/smartType/second/DontChainStringMethodsOnString.java new file mode 100644 index 000000000000..9751a698fb36 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/DontChainStringMethodsOnString.java @@ -0,0 +1,9 @@ +class Foo { + + String afoo(); + + { + String cl = af + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/DontIgnoreToStringInStringBuilders.java b/java/java-tests/testData/codeInsight/completion/smartType/second/DontIgnoreToStringInStringBuilders.java new file mode 100644 index 000000000000..ced29eff175d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/DontIgnoreToStringInStringBuilders.java @@ -0,0 +1,8 @@ +class Foo { + + public String foo() { + AbstractStringBuilder bar; + String f = b + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/DontIgnoreToStringInsideIt-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/DontIgnoreToStringInsideIt-out.java new file mode 100644 index 000000000000..17e4e41fde31 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/DontIgnoreToStringInsideIt-out.java @@ -0,0 +1,8 @@ +class Foo { + + public String toString() { + Foo bar; + String f = bar.toString(); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/DontIgnoreToStringInsideIt.java b/java/java-tests/testData/codeInsight/completion/smartType/second/DontIgnoreToStringInsideIt.java new file mode 100644 index 000000000000..fce4760c2796 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/DontIgnoreToStringInsideIt.java @@ -0,0 +1,8 @@ +class Foo { + + public String toString() { + Foo bar; + String f = b + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/DontSuggestTooGenericMethods.java b/java/java-tests/testData/codeInsight/completion/smartType/second/DontSuggestTooGenericMethods.java new file mode 100644 index 000000000000..99617ee34461 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/DontSuggestTooGenericMethods.java @@ -0,0 +1,19 @@ +interface Zip extends Bar{} + +interface Bar {} + +interface Foo { + T any(); + T gooAny(); + T zipAny(); + T barAny(); + +} + +class Goo { + { + Foo f; + Bar a = f + } +} + diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/EmptyListInMethodCall-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/EmptyListInMethodCall-out.java new file mode 100644 index 000000000000..b4312509c82e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/EmptyListInMethodCall-out.java @@ -0,0 +1,13 @@ +import java.util.Collections; +import java.util.List; + +public class SomeClass { + void foo(List l) { + + } + + { + foo(Collections.emptyList()); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/EmptyListInMethodCall.java b/java/java-tests/testData/codeInsight/completion/smartType/second/EmptyListInMethodCall.java new file mode 100644 index 000000000000..f50a1debb436 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/EmptyListInMethodCall.java @@ -0,0 +1,12 @@ +import java.util.List; + +public class SomeClass { + void foo(List l) { + + } + + { + foo(em) + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/FieldAsQualifier-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/FieldAsQualifier-out.java new file mode 100644 index 000000000000..ec3494432e34 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/FieldAsQualifier-out.java @@ -0,0 +1,13 @@ +class Bar { + Goo goo; +} +class Goo {} + +class Foo { + Bar b; + + + { + Goo g = b.goo; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/FieldAsQualifier.java b/java/java-tests/testData/codeInsight/completion/smartType/second/FieldAsQualifier.java new file mode 100644 index 000000000000..873c5eac0664 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/FieldAsQualifier.java @@ -0,0 +1,13 @@ +class Bar { + Goo goo; +} +class Goo {} + +class Foo { + Bar b; + + + { + Goo g = + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/Generics-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/Generics-out.java new file mode 100644 index 000000000000..d5269cc1cc51 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/Generics-out.java @@ -0,0 +1,13 @@ +class Bar { + T getGoo(int a); +} +class Goo {} + +class Foo { + Bar bgetBar() {} + + + { + Goo g = bgetBar().getGoo(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/Generics.java b/java/java-tests/testData/codeInsight/completion/smartType/second/Generics.java new file mode 100644 index 000000000000..0d4088996c7a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/Generics.java @@ -0,0 +1,13 @@ +class Bar { + T getGoo(int a); +} +class Goo {} + +class Foo { + Bar bgetBar() {} + + + { + Goo g = b + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/GetClassLoader-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/GetClassLoader-out.java new file mode 100644 index 000000000000..3bea6cd25677 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/GetClassLoader-out.java @@ -0,0 +1,7 @@ +class Foo { + + { + ClassLoader cl = getClass().getClassLoader(); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/GetClassLoader.java b/java/java-tests/testData/codeInsight/completion/smartType/second/GetClassLoader.java new file mode 100644 index 000000000000..d0760dc013e2 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/GetClassLoader.java @@ -0,0 +1,7 @@ +class Foo { + + { + ClassLoader cl = getCl + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/IgnoreToString-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/IgnoreToString-out.java new file mode 100644 index 000000000000..5ce8170f4a70 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/IgnoreToString-out.java @@ -0,0 +1,10 @@ +class Foo { + + String foo(); + + { + Foo bar; + String f = bar.foo(); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/IgnoreToString.java b/java/java-tests/testData/codeInsight/completion/smartType/second/IgnoreToString.java new file mode 100644 index 000000000000..40a9a7f8142d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/IgnoreToString.java @@ -0,0 +1,10 @@ +class Foo { + + String foo(); + + { + Foo bar; + String f = b + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/MergeMethods-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/MergeMethods-out.java new file mode 100644 index 000000000000..215284f1388c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/MergeMethods-out.java @@ -0,0 +1,14 @@ +class Bar { + Goo getGoo(int a); + Goo getGoo(); +} +class Goo {} + +class Foo { + Bar getBar() {} + + + { + Goo g = getBar().getGoo(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/MergeMethods.java b/java/java-tests/testData/codeInsight/completion/smartType/second/MergeMethods.java new file mode 100644 index 000000000000..8bb6b1fd2dd1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/MergeMethods.java @@ -0,0 +1,14 @@ +class Bar { + Goo getGoo(int a); + Goo getGoo(); +} +class Goo {} + +class Foo { + Bar getBar() {} + + + { + Goo g = + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/MethodAsQualifier-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/MethodAsQualifier-out.java new file mode 100644 index 000000000000..759ebf0e3e9a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/MethodAsQualifier-out.java @@ -0,0 +1,13 @@ +class Bar { + Goo getGoo(); +} +class Goo {} + +class Foo { + Bar getBar() {} + + + { + Goo g = getBar().getGoo(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/MethodAsQualifier.java b/java/java-tests/testData/codeInsight/completion/smartType/second/MethodAsQualifier.java new file mode 100644 index 000000000000..a32ba818d2d5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/MethodAsQualifier.java @@ -0,0 +1,13 @@ +class Bar { + Goo getGoo(); +} +class Goo {} + +class Foo { + Bar getBar() {} + + + { + Goo g = + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/MethodDelegation-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/MethodDelegation-out.java new file mode 100644 index 000000000000..f018d39078a8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/MethodDelegation-out.java @@ -0,0 +1,9 @@ +class Bar {} + +class Foo { + Foo myFoo; + + Bar getBar() { + return myFoo.getBar(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/MethodDelegation.java b/java/java-tests/testData/codeInsight/completion/smartType/second/MethodDelegation.java new file mode 100644 index 000000000000..f2ae6a4839df --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/MethodDelegation.java @@ -0,0 +1,9 @@ +class Bar {} + +class Foo { + Foo myFoo; + + Bar getBar() { + return m + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/MethodWithParams-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/MethodWithParams-out.java new file mode 100644 index 000000000000..9a4e17c19f6a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/MethodWithParams-out.java @@ -0,0 +1,13 @@ +class Bar { + Goo getGoo(int a); +} +class Goo {} + +class Foo { + Bar getBar() {} + + + { + Goo g = getBar().getGoo(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/MethodWithParams.java b/java/java-tests/testData/codeInsight/completion/smartType/second/MethodWithParams.java new file mode 100644 index 000000000000..4ae7e08713de --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/MethodWithParams.java @@ -0,0 +1,13 @@ +class Bar { + Goo getGoo(int a); +} +class Goo {} + +class Foo { + Bar getBar() {} + + + { + Goo g = + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/NoArraysAsListCommonPrefix-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/NoArraysAsListCommonPrefix-out.java new file mode 100644 index 000000000000..117c28da18a8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/NoArraysAsListCommonPrefix-out.java @@ -0,0 +1,12 @@ +import java.util.*; + +class Foo { + + String[] foo(); + String[] bar(); + + static { + Foo f; + List g = Arrays.asList(f.foo()); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/NoArraysAsListCommonPrefix.java b/java/java-tests/testData/codeInsight/completion/smartType/second/NoArraysAsListCommonPrefix.java new file mode 100644 index 000000000000..27be5d14c9b7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/NoArraysAsListCommonPrefix.java @@ -0,0 +1,12 @@ +import java.util.*; + +class Foo { + + String[] foo(); + String[] bar(); + + static { + Foo f; + List g = f. + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/NoLeftRecursion.java b/java/java-tests/testData/codeInsight/completion/smartType/second/NoLeftRecursion.java new file mode 100644 index 000000000000..f4724e77c25b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/NoLeftRecursion.java @@ -0,0 +1,15 @@ +public class Test { + + static MyEnum getAvailabilityStatusCode() { + + return get + } + + + public static enum MyEnum { + + VALUE_1, + VALUE_2 + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/NoObjectMethodsAsFirstPart-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/NoObjectMethodsAsFirstPart-out.java new file mode 100644 index 000000000000..45dcd4e1ac72 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/NoObjectMethodsAsFirstPart-out.java @@ -0,0 +1,12 @@ +class Foo { + + boolean is(); + + public String toString() { + boolean foo; + boolean bar; + Foo to; + boolean f = to.is(); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/NoObjectMethodsAsFirstPart.java b/java/java-tests/testData/codeInsight/completion/smartType/second/NoObjectMethodsAsFirstPart.java new file mode 100644 index 000000000000..084ad18cba77 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/NoObjectMethodsAsFirstPart.java @@ -0,0 +1,12 @@ +class Foo { + + boolean is(); + + public String toString() { + boolean foo; + boolean bar; + Foo to; + boolean f = to + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/NoRedundantCasts.java b/java/java-tests/testData/codeInsight/completion/smartType/second/NoRedundantCasts.java new file mode 100644 index 000000000000..091e671e93d5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/NoRedundantCasts.java @@ -0,0 +1,17 @@ +public abstract class Zzz { + + boolean gggg() {} + + static { + Zzz o; + if (o instanceof Yyy && ) { + + } + } + + +} + +class Yyy extends Zzz { + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/NoUnqualifiedCastsInQualifiedContext.java b/java/java-tests/testData/codeInsight/completion/smartType/second/NoUnqualifiedCastsInQualifiedContext.java new file mode 100644 index 000000000000..9144d10238c8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/NoUnqualifiedCastsInQualifiedContext.java @@ -0,0 +1,12 @@ +class C{ + { + Object o; + if (o instanceof Foo) { + new Object().do + } + } +} + +class Foo { + void dofoo(); +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/QualifiedArrayMemberAccess-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/QualifiedArrayMemberAccess-out.java new file mode 100644 index 000000000000..a2f5c8e041e7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/QualifiedArrayMemberAccess-out.java @@ -0,0 +1,8 @@ +class Goo { + boolean[] array(); + + { + + boolean a = this.array()[]; + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/QualifiedArrayMemberAccess.java b/java/java-tests/testData/codeInsight/completion/smartType/second/QualifiedArrayMemberAccess.java new file mode 100644 index 000000000000..fb5ae024f2db --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/QualifiedArrayMemberAccess.java @@ -0,0 +1,8 @@ +class Goo { + boolean[] array(); + + { + + boolean a = this.a + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/QualifierMatters-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/QualifierMatters-out.java new file mode 100644 index 000000000000..6a0c8011785b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/QualifierMatters-out.java @@ -0,0 +1,19 @@ +class Goo {} +class Foo { + public static final Bar BAR; + + +} + +class Bar { + T getGoo(); + +} + +class Main { + { + + Goo g = Foo.BAR.getGoo(); + + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/QualifierMatters.java b/java/java-tests/testData/codeInsight/completion/smartType/second/QualifierMatters.java new file mode 100644 index 000000000000..bac22ea59617 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/QualifierMatters.java @@ -0,0 +1,19 @@ +class Goo {} +class Foo { + public static final Bar BAR; + + +} + +class Bar { + T getGoo(); + +} + +class Main { + { + + Goo g = Foo. + + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/RestoreInitialPrefix-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/RestoreInitialPrefix-out.java new file mode 100644 index 000000000000..5c52715ed46a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/RestoreInitialPrefix-out.java @@ -0,0 +1,18 @@ +class MyEnum { + public static final MyEnum Foo; + public static final MyEnum Bar; +} + +class Bar { + MyEnum getEnum(); +} + +class Foo { + + Bar my; + + { + MyEnum cl = MyEnum. + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/RestoreInitialPrefix.java b/java/java-tests/testData/codeInsight/completion/smartType/second/RestoreInitialPrefix.java new file mode 100644 index 000000000000..53517207f578 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/RestoreInitialPrefix.java @@ -0,0 +1,18 @@ +class MyEnum { + public static final MyEnum Foo; + public static final MyEnum Bar; +} + +class Bar { + MyEnum getEnum(); +} + +class Foo { + + Bar my; + + { + MyEnum cl = + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SingletonMap-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SingletonMap-out.java new file mode 100644 index 000000000000..3a0adafb27d4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SingletonMap-out.java @@ -0,0 +1,13 @@ +import java.util.Collections; +import java.util.Map; + +public class SomeClass { + void foo(Map l) { + + } + + { + foo(Collections.singletonMap()); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SingletonMap.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SingletonMap.java new file mode 100644 index 000000000000..cd4de1b1aae4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SingletonMap.java @@ -0,0 +1,12 @@ +import java.util.Map; + +public class SomeClass { + void foo(Map l) { + + } + + { + foo(sing) + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsList-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsList-out.java new file mode 100644 index 000000000000..739f216701da --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsList-out.java @@ -0,0 +1,11 @@ +import java.util.Arrays; +import java.util.Collection; + +class Foo { + + { + Foo[] foos; + Collection c = Arrays.asList(foos); + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsList.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsList.java new file mode 100644 index 000000000000..0074bf67976b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsList.java @@ -0,0 +1,10 @@ +import java.util.Collection; + +class Foo { + + { + Foo[] foos; + Collection c = f + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsListWildcard-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsListWildcard-out.java new file mode 100644 index 000000000000..84530c7617e9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsListWildcard-out.java @@ -0,0 +1,13 @@ +import java.util.Arrays; +import java.util.Collection; + +interface Bar {} + +class Foo implements Bar { + + { + Foo[] foos; + Collection c = Arrays.asList(foos); + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsListWildcard.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsListWildcard.java new file mode 100644 index 000000000000..b0eea8ae1ed1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestArraysAsListWildcard.java @@ -0,0 +1,12 @@ +import java.util.Collection; + +interface Bar {} + +class Foo implements Bar { + + { + Foo[] foos; + Collection c = f + } + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArray-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArray-out.java new file mode 100644 index 000000000000..2197774c5607 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArray-out.java @@ -0,0 +1,14 @@ +import java.util.Collection; + +class Foo { + public static final Foo[] EMPTY_ARRAY = new Foo[0]; + public static final Foo[] EMPTY_ARRAY2 = new Foo[]{}; + public static final Foo[] NON_EMPTY_ARRAY = new Foo[1]; + + Collection foos() {} + + { + Foo[] f = foos().toArray(EMPTY_ARRAY); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArray.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArray.java new file mode 100644 index 000000000000..68c037ae812f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArray.java @@ -0,0 +1,14 @@ +import java.util.Collection; + +class Foo { + public static final Foo[] EMPTY_ARRAY = new Foo[0]; + public static final Foo[] EMPTY_ARRAY2 = new Foo[]{}; + public static final Foo[] NON_EMPTY_ARRAY = new Foo[1]; + + Collection foos() {} + + { + Foo[] f = f + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArrayFromAnotherClass-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArrayFromAnotherClass-out.java new file mode 100644 index 000000000000..e77ad33435c9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArrayFromAnotherClass-out.java @@ -0,0 +1,16 @@ +import java.util.Collection; + +class Bar { + public static final Bar[] EMPTY_ARRAY = new Bar[0]; + public static final Bar[] EMPTY_ARRAY2 = new Bar[]{}; + public static final Bar[] NON_EMPTY_ARRAY = new Bar[1]; + +} + +class Foo { + Collection foos() {} + + { + Bar[] f = foos().toArray(Bar.EMPTY_ARRAY); + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArrayFromAnotherClass.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArrayFromAnotherClass.java new file mode 100644 index 000000000000..b3c29ea602cc --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithExistingEmptyArrayFromAnotherClass.java @@ -0,0 +1,16 @@ +import java.util.Collection; + +class Bar { + public static final Bar[] EMPTY_ARRAY = new Bar[0]; + public static final Bar[] EMPTY_ARRAY2 = new Bar[]{}; + public static final Bar[] NON_EMPTY_ARRAY = new Bar[1]; + +} + +class Foo { + Collection foos() {} + + { + Bar[] f = f + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewEmptyArray-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewEmptyArray-out.java new file mode 100644 index 000000000000..c577f090a5c1 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewEmptyArray-out.java @@ -0,0 +1,11 @@ +import java.util.Collection; + +class Foo { + + Collection foos() {} + + { + Foo[] f = foos().toArray(new Foo[0]); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewEmptyArray.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewEmptyArray.java new file mode 100644 index 000000000000..df8b91247337 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewEmptyArray.java @@ -0,0 +1,11 @@ +import java.util.Collection; + +class Foo { + + Collection foos() {} + + { + Foo[] f = + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewNonEmptyArray-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewNonEmptyArray-out.java new file mode 100644 index 000000000000..b50973089ce4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewNonEmptyArray-out.java @@ -0,0 +1,10 @@ +import java.util.Collection; + +class Foo { + + { + Collection foos; + Foo[] f = foos.toArray(new Foo[foos.size()]); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewNonEmptyArray.java b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewNonEmptyArray.java new file mode 100644 index 000000000000..9ca7a674a116 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/SuggestToArrayWithNewNonEmptyArray.java @@ -0,0 +1,10 @@ +import java.util.Collection; + +class Foo { + + { + Collection foos; + Foo[] f = + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayFieldsQualifier-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayFieldsQualifier-out.java new file mode 100644 index 000000000000..2c4d8360732c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayFieldsQualifier-out.java @@ -0,0 +1,13 @@ +import java.util.Collection; + +class Bar { + public static final Collection foos; +} + +class Foo { + + { + Foo[] f = Bar.foos.toArray(new Foo[Bar.foos.size()]); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayFieldsQualifier.java b/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayFieldsQualifier.java new file mode 100644 index 000000000000..a291388afb66 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayFieldsQualifier.java @@ -0,0 +1,13 @@ +import java.util.Collection; + +class Bar { + public static final Collection foos; +} + +class Foo { + + { + Foo[] f = Bar. + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayGenericArrayCreation-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayGenericArrayCreation-out.java new file mode 100644 index 000000000000..00b3b3e18b25 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayGenericArrayCreation-out.java @@ -0,0 +1,11 @@ +import java.util.Collection; + +class Foo { + + Collection> foos() {} + + { + Foo[] f = + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayGenericArrayCreation.java b/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayGenericArrayCreation.java new file mode 100644 index 000000000000..00b3b3e18b25 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayGenericArrayCreation.java @@ -0,0 +1,11 @@ +import java.util.Collection; + +class Foo { + + Collection> foos() {} + + { + Foo[] f = + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayMethodQualifier-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayMethodQualifier-out.java new file mode 100644 index 000000000000..3a4d8ef6663c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayMethodQualifier-out.java @@ -0,0 +1,13 @@ +import java.util.Collection; + +class Bar { + public static final Collection foos(); +} + +class Foo { + + { + Foo[] f = Bar.foos().toArray(new Foo[0]); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayMethodQualifier.java b/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayMethodQualifier.java new file mode 100644 index 000000000000..afbedf10d8c3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/ToArrayMethodQualifier.java @@ -0,0 +1,13 @@ +import java.util.Collection; + +class Bar { + public static final Collection foos(); +} + +class Foo { + + { + Foo[] f = Bar. + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/ToListWithQualifier-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/ToListWithQualifier-out.java new file mode 100644 index 000000000000..8bdb21b2fa01 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/ToListWithQualifier-out.java @@ -0,0 +1,14 @@ +import java.util.Arrays; +import java.util.Collection; + +class Bar { + public static final Foo[] foos(); +} + +class Foo { + + { + Collection f = Arrays.asList(Bar.foos()); + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/ToListWithQualifier.java b/java/java-tests/testData/codeInsight/completion/smartType/second/ToListWithQualifier.java new file mode 100644 index 000000000000..1e143c2d809e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/ToListWithQualifier.java @@ -0,0 +1,13 @@ +import java.util.Collection; + +class Bar { + public static final Foo[] foos(); +} + +class Foo { + + { + Collection f = Bar. + } + +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/VarargMemberAccess-out.java b/java/java-tests/testData/codeInsight/completion/smartType/second/VarargMemberAccess-out.java new file mode 100644 index 000000000000..7d258b790f8e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/VarargMemberAccess-out.java @@ -0,0 +1,5 @@ +class Goo { + void foo(boolean... ls) { + boolean a = ls[]; + } +} diff --git a/java/java-tests/testData/codeInsight/completion/smartType/second/VarargMemberAccess.java b/java/java-tests/testData/codeInsight/completion/smartType/second/VarargMemberAccess.java new file mode 100644 index 000000000000..658a87a8c198 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/smartType/second/VarargMemberAccess.java @@ -0,0 +1,5 @@ +class Goo { + void foo(boolean... ls) { + boolean a = l + } +} diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/HeavySmartTypeCompletion15Test.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/HeavySmartTypeCompletion15Test.java new file mode 100644 index 000000000000..a74f1a917b26 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/HeavySmartTypeCompletion15Test.java @@ -0,0 +1,88 @@ +package com.intellij.codeInsight.completion; + +import com.intellij.JavaTestUtil; +import com.intellij.codeInsight.lookup.LookupManager; +import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.projectRoots.impl.JavaSdkImpl; +import com.intellij.openapi.roots.LanguageLevelProjectExtension; +import com.intellij.pom.java.LanguageLevel; + +@SuppressWarnings({"ALL"}) +public class HeavySmartTypeCompletion15Test extends CompletionTestCase { + private static final String BASE_PATH = "/codeInsight/completion/smartType"; + + public HeavySmartTypeCompletion15Test() { + setType(CompletionType.SMART); + } + + @Override + protected String getTestDataPath() { + return JavaTestUtil.getJavaTestDataPath(); + } + + + public void testGetInstance() throws Throwable { + configureByFile(BASE_PATH + "/foo/" + getTestName(false) + ".java", BASE_PATH); + performAction(); + selectItem(myItems[0]); + checkResultByFile(BASE_PATH + "/foo/" + getTestName(false) + "-out.java"); + } + + public void testProtectedAnonymousConstructor() throws Throwable { + createClass("package pkg;" + + "public class Foo {" + + " protected Foo(int a) {}" + + "}"); + createClass("package pkg;" + + "public class Bar {" + + " protected Bar(java.util.List list) {}" + + "}"); + + configureByFile(BASE_PATH + "/ProtectedAnonymousConstructor.java"); + checkResultByFile(BASE_PATH + "/ProtectedAnonymousConstructor-out.java"); + + configureByFile(BASE_PATH + "/ProtectedAnonymousConstructor2.java"); + checkResultByFile(BASE_PATH + "/ProtectedAnonymousConstructor2-out.java"); + } + + public void testUnlockDocument() throws Throwable { + createClass("package pkg; public class Bar {}"); + createClass("package pkg; public class Foo {" + + " public static void foo(java.util.List list) {}" + + "}"); + + doTest(); + } + + private void doTest() throws Exception { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testClassLiteralShouldInsertImport() throws Throwable { + createClass("package bar; public class Intf {}"); + createClass("package foo; public class Bar extends bar.Intf {}"); + + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + selectItem(myItems[0]); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + private void performAction() { + complete(); + } + + protected void setUp() throws Exception { + super.setUp(); + LanguageLevelProjectExtension.getInstance(myJavaFacade.getProject()).setLanguageLevel(LanguageLevel.JDK_1_5); + } + + protected void tearDown() throws Exception { + LookupManager.getInstance(myProject).hideActiveLookup(); + super.tearDown(); + } + + protected Sdk getTestProjectJdk() { + return JavaSdkImpl.getMockJdk15("java 1.5"); + } +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SecondSmartTypeCompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SecondSmartTypeCompletionTest.java new file mode 100644 index 000000000000..1cd9f5cff3a8 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SecondSmartTypeCompletionTest.java @@ -0,0 +1,195 @@ +package com.intellij.codeInsight.completion; + +import com.intellij.JavaTestUtil; +import com.intellij.codeInsight.CodeInsightSettings; +import com.intellij.codeInsight.lookup.LookupElement; +import com.intellij.codeInsight.lookup.LookupElementDecorator; +import com.intellij.codeInsight.lookup.LookupItem; +import com.intellij.codeInsight.lookup.LookupManager; +import com.intellij.codeInsight.lookup.impl.LookupImpl; +import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.projectRoots.impl.JavaSdkImpl; +import com.intellij.openapi.roots.LanguageLevelProjectExtension; +import com.intellij.pom.java.LanguageLevel; +import com.intellij.testFramework.IdeaTestUtil; +import org.jetbrains.annotations.NonNls; + +import java.util.Arrays; + +@SuppressWarnings({"ALL"}) +public class SecondSmartTypeCompletionTest extends LightCompletionTestCase { + private static final String BASE_PATH = "/codeInsight/completion/smartType/second"; + + public SecondSmartTypeCompletionTest() { + setType(CompletionType.SMART); + } + + @Override + protected String getTestDataPath() { + return JavaTestUtil.getJavaTestDataPath(); + } + + public void testMethodAsQualifier() throws Throwable { doTest(); } + public void testFieldAsQualifier() throws Throwable { doTest(); } + public void testMethodWithParams() throws Throwable { doTest(); } + public void testMergeMethods() throws Throwable { doTest(); } + + public void testMethodDelegation() throws Throwable { doTest(); } + + public void testGenerics() throws Throwable { doTest(); } + public void testQualifierMatters() throws Throwable { doTest(); } + + public void testDifferentQualifiers() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertStringItems("b.getGoo", "getBar().getGoo"); + } + + public void testSuggestArraysAsList() throws Throwable { doTest(); } + public void testSuggestArraysAsListWildcard() throws Throwable { doTest(); } + + public void testSuggestToArrayWithNewEmptyArray() throws Throwable { doTest(); } + public void testSuggestToArrayWithNewNonEmptyArray() throws Throwable { doTest(); } + + public void testSuggestToArrayWithExistingEmptyArray() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertStringItems("foos().toArray(EMPTY_ARRAY)", "foos().toArray(EMPTY_ARRAY2)"); + selectItem(myItems[0]); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testToArrayGenericArrayCreation() throws Throwable { doTest(); } + + public void testToArrayFieldsQualifier() throws Throwable { doTest(); } + public void testToArrayMethodQualifier() throws Throwable { doTest(); } + + public void testToListWithQualifier() throws Throwable { doTest(); } + + public void testSuggestToArrayWithExistingEmptyArrayFromAnotherClass() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertStringItems("foos().toArray(Bar.EMPTY_ARRAY)", "foos().toArray(Bar.EMPTY_ARRAY2)"); + selectItem(myItems[0]); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testIgnoreToString() throws Throwable { doTest(); } + public void testDontIgnoreToStringInsideIt() throws Throwable { doTest(); } + public void testDontIgnoreToStringInStringBuilders() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertStringItems("bar.substring", "bar.substring", "bar.toString"); + } + + public void testNoObjectMethodsAsFirstPart() throws Throwable { doTest(); } + public void testGetClassLoader() throws Throwable { doTest(); } + + public void testChainingPerformance() throws Throwable { + long time = System.currentTimeMillis(); + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + IdeaTestUtil.assertTiming("", 3000, System.currentTimeMillis() - time); + assertNotNull(myItems); + } + + public void testArrayMemberAccess() throws Throwable { doTest(); } + public void testVarargMemberAccess() throws Throwable { doTest(); } + public void testQualifiedArrayMemberAccess() throws Throwable { doTest(); } + + public void testNoArraysAsListCommonPrefix() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertStringItems("bar()", "foo()"); + assertEquals("Arrays.asList(f.bar())", ((LookupItem)((LookupElementDecorator)myItems[0]).getDelegate()).getPresentableText()); + assertEquals("Arrays.asList(f.foo())", ((LookupItem)((LookupElementDecorator)myItems[1]).getDelegate()).getPresentableText()); + selectItem(myItems[1]); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testRestoreInitialPrefix() throws Throwable { + configureByFileNoComplete(BASE_PATH + "/" + getTestName(false) + ".java"); + complete(1); + assertStringItems("MyEnum.Bar", "MyEnum.Foo"); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + complete(1); + assertStringItems("MyEnum.Bar", "MyEnum.Foo", "my.getEnum"); + } + + public void testDontChainStringMethodsOnString() throws Throwable { doTest(); } + + public void testDontSuggestTooGenericMethods() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertEquals("f.barAny", myItems[0].getLookupString()); + assertEquals("f.zipAny", myItems[1].getLookupString()); + } + + public void testNoUnqualifiedCastsInQualifiedContext() throws Throwable { doAntiTest(); } + + private void doAntiTest() throws Exception { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertNull(myItems); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + } + + public void testCastInstanceofedQualifier() throws Throwable { doTest(); } + + public void testNoLeftRecursion() throws Throwable { + final boolean old = CodeInsightSettings.getInstance().SHOW_STATIC_AFTER_INSTANCE; + CodeInsightSettings.getInstance().SHOW_STATIC_AFTER_INSTANCE = true; + try { + doAntiTest(); + } + finally { + CodeInsightSettings.getInstance().SHOW_STATIC_AFTER_INSTANCE = old; + } + } + + public void testNoRedundantCasts() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertStringItems("o.gggg", "false", "true"); + } + + public void testEmptyListInMethodCall() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + selectItem(myItems[0]); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testSingletonMap() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + selectItem(myItems[0]); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + protected void checkResultByFile(@NonNls final String filePath) throws Exception { + if (myItems != null) { + System.out.println("items = " + Arrays.asList(myItems)); + } + super.checkResultByFile(filePath); + } + + + private void doTest() throws Exception { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + @Override + protected void complete() { + complete(2); + LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(myEditor); + myItems = lookup == null ? null : lookup.getItems().toArray(LookupElement.EMPTY_ARRAY); + } + + protected void setUp() throws Exception { + super.setUp(); + LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_5); + } + + protected void tearDown() throws Exception { + LookupManager.getInstance(getProject()).hideActiveLookup(); + super.tearDown(); + } + + @Override + protected Sdk getProjectJDK() { + return JavaSdkImpl.getMockJdk15("java 1.5"); + } +} diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletion15Test.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletion15Test.java new file mode 100644 index 000000000000..150f40a8097d --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletion15Test.java @@ -0,0 +1,300 @@ +package com.intellij.codeInsight.completion; + +import com.intellij.JavaTestUtil; +import com.intellij.codeInsight.lookup.Lookup; +import com.intellij.codeInsight.lookup.LookupManager; +import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.projectRoots.impl.JavaSdkImpl; +import com.intellij.openapi.roots.LanguageLevelProjectExtension; +import com.intellij.pom.java.LanguageLevel; +import com.intellij.psi.codeStyle.CodeStyleSettings; +import com.intellij.psi.codeStyle.CodeStyleSettingsManager; +import org.jetbrains.annotations.NonNls; + +public class SmartTypeCompletion15Test extends LightCompletionTestCase { + @NonNls private static final String BASE_PATH = "/codeInsight/completion/smartType"; + private LanguageLevel myOldLanguageLevel; + + public SmartTypeCompletion15Test() { + setType(CompletionType.SMART); + } + + @Override + protected String getTestDataPath() { + return JavaTestUtil.getJavaTestDataPath(); + } + + public void testAfterNewWithGenerics() throws Exception { + doActionTest(); + } + + public void testClassLiteral() throws Exception { + doActionTest(); + assertStringItems("String.class"); + } + public void testNoClassLiteral() throws Exception { + doActionTest(); + assertStringItems("Object.class", "getClass", "Class.forName", "Class.forName"); + } + + public void testClassLiteralInAnno2() throws Throwable { + doActionItemTest(); + } + + public void testClassLiteralInheritors() throws Throwable { + doActionItemTest(); + } + + public void testAfterNew15() throws Exception { + doActionItemTest(); + } + + public void testInsertOverride() throws Exception { + CodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(getProject()); + styleSettings.INSERT_OVERRIDE_ANNOTATION = true; + LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_6); + doActionItemTest(); + } + + public void testForeach() throws Exception { + doActionTest(); + } + + public void testIDEADEV2626() throws Exception { + doActionTest(); + } + + public void testCastWith2TypeParameters() throws Throwable { doTest(); } + + public void testAnnotation() throws Exception { + doTest(); + testByCount(8, "ElementType.ANNOTATION_TYPE", "ElementType.CONSTRUCTOR", "ElementType.FIELD", "ElementType.LOCAL_VARIABLE", + "ElementType.METHOD", "ElementType.PACKAGE", "ElementType.PARAMETER", "ElementType.TYPE"); + } + + protected void checkResultByFile(@NonNls final String filePath) throws Exception { + if (myItems != null) { + //System.out.println("items = " + Arrays.asList(myItems)); + } + super.checkResultByFile(filePath); + } + + public void testAnnotation2() throws Exception { + doTest(); + testByCount(3, "RetentionPolicy.CLASS", "RetentionPolicy.SOURCE", "RetentionPolicy.RUNTIME"); + } + public void testAnnotation2_2() throws Exception { + doTest(); + testByCount(3, "RetentionPolicy.CLASS", "RetentionPolicy.SOURCE", "RetentionPolicy.RUNTIME"); + } + + public void testAnnotation3() throws Exception { + doTest(); + } + + public void testAnnotation3_2() throws Exception { + doTest(); + } + + public void testAnnotation4() throws Exception { + doTest(); + + testByCount(2, "true","false"); + } + + public void testAnnotation5() throws Exception { + doTest(); + + testByCount(2, "CONNECTION","NO_CONNECTION"); + } + + public void testAnnotation6() throws Exception { + doTest(); + + testByCount(8, "ElementType.ANNOTATION_TYPE", "ElementType.CONSTRUCTOR", "ElementType.FIELD", "ElementType.LOCAL_VARIABLE", + "ElementType.METHOD", "ElementType.PACKAGE", "ElementType.PARAMETER", "ElementType.TYPE"); + } + + public void testArrayClone() throws Exception { + doTest(); + } + + public void testIDEADEV5150() throws Exception { + doTest(); + } + + public void testIDEADEV7835() throws Exception { + doTest(); + } + + public void testTypeArgs1() throws Exception { + doTest(); + } + + public void testTypeArgs2() throws Exception { + doTest(); + } + + public void testIDEADEV2668() throws Exception { + doTest(); + } + + public void testExcessiveTail() throws Exception { + doTest(); + } + + public void testExtendsInTypeCast() throws Exception { + doTest(); + } + + public void testIDEADEV13148() throws Exception { + configureByFile(BASE_PATH + "/IDEADEV13148.java"); + testByCount(0); + } + + public void testOverloadedMethods() throws Throwable { + doTest(); + } + + public void testEnumField() throws Throwable { + doItemTest(); + } + + public void testEnumField1() throws Exception { + doTest(); + assertEquals(4, myItems.length); + } + + public void testInsertTypeParametersOnImporting() throws Throwable { + doTest(); + } + + public void testEmptyListInReturn() throws Throwable { + doItemTest(); + } + + public void testEmptyListInReturn2() throws Throwable { + doTest(); + } + + public void testEmptyListInReturnTernary() throws Throwable { + doItemTest(); + } + + public void testEmptyListBeforeSemicolon() throws Throwable { + doItemTest(); + } + + public void testStaticallyImportedMagicMethod() throws Throwable { + doItemTest(); + } + + public void _testCallVarargArgument() throws Throwable { doTest(); } + + public void testTabToReplaceClassKeyword() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + selectItem(myItems[0], Lookup.REPLACE_SELECT_CHAR); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testNoTypeParametersForToArray() throws Throwable { + doTest(); + } + + public void testInferFromCall() throws Throwable { + doTest(); + } + + public void testInferFromCall1() throws Throwable { + doTest(); + } + + public void testCastToParameterizedType() throws Throwable { doActionTest(); } + + public void testInnerEnumInMethod() throws Throwable { + doActionItemTest(); + } + + public void testEnumAsDefaultAnnotationParam() throws Throwable { doTest(); } + + public void testFilterPrivateConstructors() throws Throwable { doTest(); } + + public void testExplicitMethodTypeParametersQualify() throws Throwable { doTest(); } + + public void testWildcardedInstanceof() throws Throwable { doTest(); } + public void testWildcardedInstanceof2() throws Throwable { doTest(); } + public void testWildcardedInstanceof3() throws Throwable { doTest(); } + + public void testTypeVariableInstanceOf() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + performAction(); + assertStringItems("Bar", "Goo"); + } + + public void testCommonPrefixWithSelection() throws Throwable { + doItemTest(); + } + + public void testInsideGenericClassLiteral() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + testByCount(3, "String.class", "StringBuffer.class", "StringBuilder.class"); + } + + public void testArrayAnnoParameter() throws Throwable { + doActionTest(); + } + + public void testCastWithGenerics() throws Throwable { + doActionTest(); + } + + + + private void doTest(boolean performAction, boolean selectItem) throws Exception { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + if (performAction) { + performAction(); + } + if (selectItem) { + selectItem(myItems[0]); + } + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + private void doTest() throws Exception { + doTest(false, false); + } + private void doActionTest() throws Exception { + doTest(true, false); + } + private void doItemTest() throws Exception { + doTest(false, true); + } + private void doActionItemTest() throws Exception { + doTest(true, true); + } + + private void performAction() { + complete(); + } + + protected void setUp() throws Exception { + super.setUp(); + myOldLanguageLevel = LanguageLevelProjectExtension.getInstance(getProject()).getLanguageLevel(); + LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_5); + CodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(getProject()).clone(); + styleSettings.INSERT_OVERRIDE_ANNOTATION = false; + CodeStyleSettingsManager.getInstance(getProject()).setTemporarySettings(styleSettings); + } + + protected void tearDown() throws Exception { + LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(myOldLanguageLevel); + LookupManager.getInstance(getProject()).hideActiveLookup(); + CodeStyleSettingsManager.getInstance(getProject()).dropTemporarySettings(); + super.tearDown(); + } + + @Override + protected Sdk getProjectJDK() { + return JavaSdkImpl.getMockJdk15("java 1.5"); + } +} diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java new file mode 100644 index 000000000000..64a154f604c6 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java @@ -0,0 +1,807 @@ +package com.intellij.codeInsight.completion; + +import com.intellij.JavaTestUtil; +import com.intellij.codeInsight.CodeInsightSettings; +import com.intellij.codeInsight.lookup.*; +import com.intellij.codeInsight.lookup.impl.TestLookupManager; +import com.intellij.codeInsight.template.SmartCompletionContextType; +import com.intellij.codeInsight.template.Template; +import com.intellij.codeInsight.template.TemplateContextType; +import com.intellij.codeInsight.template.TemplateManager; +import com.intellij.codeInsight.template.impl.TemplateImpl; +import com.intellij.codeInsight.template.impl.TemplateSettings; +import com.intellij.openapi.roots.LanguageLevelProjectExtension; +import com.intellij.openapi.util.Condition; +import com.intellij.pom.java.LanguageLevel; +import com.intellij.psi.codeStyle.CodeStyleSettings; +import com.intellij.psi.codeStyle.CodeStyleSettingsManager; +import com.intellij.util.containers.ContainerUtil; +import org.jetbrains.annotations.NonNls; + +import java.util.Arrays; + +public class SmartTypeCompletionTest extends LightCompletionTestCase { + private static final String BASE_PATH = "/codeInsight/completion/smartType"; + private LanguageLevel myPrevLanguageLevel; + + @Override + protected String getTestDataPath() { + return JavaTestUtil.getJavaTestDataPath(); + } + + public void testParenAfterCast1() throws Exception { + String path = BASE_PATH + "/parenAfterCast"; + + configureByFile(path + "/before1.java"); + checkResultByFile(path + "/after1.java"); + } + + public void testParenAfterCast2() throws Exception { + String path = BASE_PATH + "/parenAfterCast"; + + configureByFile(path + "/before2.java"); + checkResultByFile(path + "/after2.java"); + + + } + + + public void testParenAfterCast3() throws Exception { + String path = BASE_PATH + "/parenAfterCast"; + + configureByFile(path + "/before3.java"); + checkResultByFile(path + "/after3.java"); + } + + public void testParenAfterCall1() throws Exception { + String path = BASE_PATH + "/parenAfterCall"; + + configureByFile(path + "/before1.java"); + checkResultByFile(path + "/after1.java"); + } + + public void testParenAfterCall2() throws Exception { + String path = BASE_PATH + "/parenAfterCall"; + + configureByFile(path + "/before2.java"); + checkResultByFile(path + "/after2.java"); + } + + public void testParenAfterCall3() throws Exception { + String path = BASE_PATH + "/parenAfterCall"; + + configureByFile(path + "/before3.java"); + checkResultByFile(path + "/after3.java"); + } + + public void testParenAfterCall4() throws Exception { + String path = BASE_PATH + "/parenAfterCall"; + + configureByFile(path + "/before4.java"); + checkResultByFile(path + "/after4.java"); + } + + public void testParenAfterCall5() throws Exception { + String path = BASE_PATH + "/parenAfterCall"; + + configureByFile(path + "/before5.java"); + checkResultByFile(path + "/after5.java"); + } + + public void testParenAfterCall6() throws Exception { + String path = BASE_PATH + "/parenAfterCall"; + + configureByFile(path + "/before6.java"); + checkResultByFile(path + "/after6.java"); + } + + public void testParenAfterCall1_SpaceWithinMethodCallParens() throws Exception { + String path = BASE_PATH + "/parenAfterCall"; + + CodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(getProject()); + configureByFileNoComplete(path + "/before1.java"); + styleSettings.SPACE_WITHIN_METHOD_CALL_PARENTHESES = true; + try{ + complete(); + } + finally{ + styleSettings.SPACE_WITHIN_METHOD_CALL_PARENTHESES = false; + } + checkResultByFile(path + "/after1_space.java"); + } + + public void testParenAfterIf1() throws Exception { + String path = BASE_PATH + "/parenAfterIf"; + + configureByFile(path + "/before1.java"); + checkResultByFile(path + "/after1.java"); + } + + public void testParenAfterIf2() throws Exception { + String path = BASE_PATH + "/parenAfterIf"; + + configureByFile(path + "/before2.java"); + checkResultByFile(path + "/after2.java"); + } + + public void testForceLookupForAbstractClasses() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before9.java"); + checkResultByFile(path + "/after9.java"); + } + + public void testAfterNew1() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before1.java"); + select(); + checkResultByFile(path + "/after1.java"); + } + + public void testAfterNew2() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before2.java"); + select(); + checkResultByFile(path + "/after2.java"); + } + + public void testAfterNew3() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before3.java"); + select(); + checkResultByFile(path + "/after3.java"); + } + + public void testAfterNew4() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before4.java"); + select(); + checkResultByFile(path + "/after4.java"); + } + + public void testAfterNew5() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before5.java"); + select(); + checkResultByFile(path + "/after5.java"); + } + + public void testAfterNew6() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before6.java"); + select(); + checkResultByFile(path + "/after6.java"); + } + + public void testAfterNew7() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before7.java"); + select(); + checkResultByFile(path + "/after7.java"); + } + + public void testAfterNew8() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before8.java"); + select(); + checkResultByFile(path + "/after8.java"); + } + + public void testAfterNew9() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before10.java"); + select(); + checkResultByFile(path + "/after10.java"); + } + + public void testAfterNew10() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before12.java"); + //select(); + checkResultByFile(path + "/after12.java"); + } + + public void testAfterNew11() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before13.java"); + //select(); + checkResultByFile(path + "/after13.java"); + } + + public void testAfterThrowNew1() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before14.java"); + //select(); + checkResultByFile(path + "/after14.java"); + } + + public void testAfterThrowNew2() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before15.java"); + //select(); + checkResultByFile(path + "/after15.java"); + } + + public void testAfterThrowNew3() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/before16.java"); + //select(); + checkResultByFile(path + "/after16.java"); + } + + public void testAfterThrow1() throws Exception { + String path = BASE_PATH; + + configureByFile(path + "/CastInThrow.java"); + //select(); + checkResultByFile(path + "/CastInThrow-out.java"); + } + + public void testParenAfterNewWithinInnerExpr() throws Exception { + String path = BASE_PATH + "/afterNew"; + + configureByFile(path + "/LastArgInInnerNewBefore.java"); + checkResultByFile(path + "/LastArgInInnerNewAfter.java"); + + //configureByFile(path + "/LastArgInInnerNewBefore2.java"); + //performAction(); + //checkResultByFile(path + "/LastArgInInnerNewAfter2.java"); + + configureByFile(path + "/LastArgInInnerNewBefore3.java"); + checkResultByFile(path + "/LastArgInInnerNewAfter3.java"); + + configureByFile(path + "/LastArgInInnerNewBefore4.java"); + checkResultByFile(path + "/LastArgInInnerNewAfter4.java"); + } + + public void testReturn1() throws Exception{ + String path = BASE_PATH + "/return"; + configureByFile(path + "/before1.java"); + checkResultByFile(path + "/after1.java"); + } + + public void testReturn2() throws Exception{ + String path = BASE_PATH + "/return"; + + configureByFile(path + "/before2.java"); + checkResultByFile(path + "/after2.java"); + } + + public void testReturn3() throws Exception{ + String path = BASE_PATH + "/return"; + + configureByFile(path + "/before3.java"); + checkResultByFile(path + "/after3.java"); + } + + public void testGenerics1() throws Exception { + String path = BASE_PATH + "/generics"; + + configureByFile(path + "/before1.java"); + checkResultByFile(path + "/after1.java"); + } + + public void testGenerics2() throws Exception { + String path = BASE_PATH + "/generics"; + + configureByFile(path + "/before2.java"); + checkResultByFile(path + "/after2.java"); + } + + public void testGenerics3() throws Exception { + String path = BASE_PATH + "/generics"; + + configureByFile(path + "/before3.java"); + checkResultByFile(path + "/after3.java"); + } + + public void testGenerics4() throws Exception { + String path = BASE_PATH + "/generics"; + + configureByFile(path + "/before4.java"); + checkResultByFile(path + "/after4.java"); + } + + public void testGenerics5() throws Exception { + String path = BASE_PATH + "/generics"; + + configureByFile(path + "/before5.java"); + checkResultByFile(path + "/after5.java"); + } + + public void testAfterInstanceOf1() throws Exception { + String path = BASE_PATH + "/afterInstanceOf"; + + configureByFile(path + "/before1.java"); + checkResultByFile(path + "/after1.java"); + } + + public void testAfterInstanceOf2() throws Exception { + String path = BASE_PATH + "/afterInstanceOf"; + + configureByFile(path + "/before2.java"); + checkResultByFile(path + "/after2.java"); + } + + public void testInsideCatch() throws Exception { + String path = BASE_PATH; + + configureByFile(path + "/InsideCatch.java"); + checkResultByFile(path + "/InsideCatch-out.java"); + } + + + public void testGenerics6() throws Exception { + String path = BASE_PATH + "/generics"; + + configureByFile(path + "/before6.java"); + checkResultByFile(path + "/after6.java"); + } + + public void testWildcardNew1() throws Exception { + String path = BASE_PATH + "/generics"; + + configureByFile(path + "/before7.java"); + checkResultByFile(path + "/after7.java"); + } + + public void testWildcardNew2() throws Exception { + String path = BASE_PATH + "/generics"; + + configureByFile(path + "/before8.java"); + checkResultByFile(path + "/after8.java"); + } + + public void testWildcardEliminated() throws Exception { + String path = BASE_PATH + "/generics"; + + configureByFile(path + "/before9.java"); + checkResultByFile(path + "/after9.java"); + } + + public void testBug1() throws Exception { doTest(); } + + public void testQualifiedThis() throws Exception { doTest(); } + + public void testBug2() throws Exception { + configureByFile(BASE_PATH + "/Bug2.java"); + } + + + public void testSillyAssignment1() throws Exception { + configureByFile(BASE_PATH + "/Silly1.java"); + checkResultByFile(BASE_PATH + "/Silly1.java"); + } + + public void testVarargs1() throws Exception { doTest(); } + + public void testEnumConstInSwitch() throws Exception { doTest(); } + + public void testEnumConstInSwitchOutside() throws Exception { doTest(); } + + public void testIntConstInSwitch() throws Exception { doTest(); } + + public void testMethodCallInScriplet() throws Exception { + configureByFile(BASE_PATH + "/"+getTestName(false)+".jsp"); + checkResultByFile(BASE_PATH + "/"+getTestName(false) + "-out.jsp"); + } + + public void testDoubleEmptyArray() throws Exception { + configureByFile(BASE_PATH + "/"+getTestName(false)+".java"); + checkResultByFile(BASE_PATH + "/"+getTestName(false) + ".java"); + assertEquals(2, myItems.length); + } + + public void testCollectionsEmptySetInMethodCall() throws Throwable { doTest(); } + + public void testCollectionsEmptySetInTernary() throws Throwable { doTest(); } + + public void testStringConstantInAnno() throws Throwable { doTest(); } + + public void testCollectionsEmptySetInTernary2() throws Throwable { doTest(); } + + public void testConstructorOnSeparateLineInMethodCall() throws Throwable { doTest(); } + + public void testConstructorWithExistingParens() throws Throwable { doTest(); } + + public void testMethodAnnotationNamedParameter() throws Throwable { doTest(); } + + public void testInheritedClass() throws Throwable { doTest(); } + + public void testClassLiteralInAnno1() throws Throwable { doTest(); } + + public void testExplicitWildcardParam() throws Throwable { doTest(); } + + public void testExplicitWildcardArrayParam() throws Throwable { doTest(); } + + public void testCatchInAnonymous() throws Throwable { doTest(); } + + public void testThrowRuntimeException() throws Throwable { doTest(); } + + public void testParameterizedConstructor() throws Throwable { doTest(); } + + public void testNewInnerOfParameterizedClass() throws Throwable { doTest(); } + + public void testQualifiedThisInAnonymousConstructor() throws Throwable { doTest(); } + + public void testExceptionTwice() throws Throwable { doTest(); } + + public void testExceptionTwice2() throws Throwable { doTest(); } + + public void testNewInnerRunnable() throws Throwable { doTest(); } + + public void testArrayAccessIndex() throws Throwable { doTest(); } + + public void testThrowExceptionConstructor() throws Throwable { doTest(); } + + public void testJavadocThrows() throws Throwable { doTest(); } + + public void testDoNotExcludeAssignedVariable() throws Throwable { doTest(); } + + public void testArrayIndexTailType() throws Throwable { doTest(); } + + public void testHonorSelection() throws Throwable { doTest(); } + + public void testTypeParametersInheritors() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertStringItems("Foo", "Bar", "Goo"); + select(); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testVoidExpectedType() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertStringItems("notify", "notifyAll", "wait", "wait", "wait", "equals", "getClass", "hashCode", "toString"); + type('e'); + select(); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testDoubleSemicolonPenetration() throws Throwable { doTest(); } + + public void testTypeParametersInheritorsComma() throws Throwable { doTest(); } + + public void testTypeParametersInheritorsInExpression() throws Throwable { doTest(); } + + //do we need to see all Object inheritors at all? + public void _testTypeParametersObjectInheritors() throws Throwable { doTest(); } + + public void testDoubleThis() throws Throwable { + doTest(); + assertNull(myItems); + } + + public void testSmartFinish() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + select(Lookup.COMPLETE_STATEMENT_SELECT_CHAR); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testSillyAssignmentInTernary() throws Throwable { doTest(); } + + public void testSameFieldInAnotherObject() throws Throwable { doTest(); } + + public void testUnqualifiedConstantInSwitch() throws Throwable { doTest(); } + + public void testAmbiguousConstant() throws Throwable { doTest(); } + + public void testSameNamedFieldAndLocal() throws Throwable { doTest(); } + + public void testAbstractClassTwice() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + final int offset = myEditor.getCaretModel().getOffset(); + select(); + myEditor.getCaretModel().moveToOffset(offset); + assertOneElement(myItems); + } + + public void testConstantTwice() throws Throwable { doTest(); } + + public void testConstantTwice2() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertEquals(2, myItems.length); + } + + public void testNoKeyConstant() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertEquals(2, myItems.length); + assertEquals("A_KEY", myItems[0].getLookupString()); + assertEquals("Key.create", myItems[1].getLookupString()); + } + + public void testUserDataListAddAll() throws Throwable { + doTest(); + } + + public void testStaticSubclass() throws Throwable { + doTest(); + } + + public void testMethodCallDot() throws Throwable { doTest(); } + public void testNegateVariable() throws Throwable { doTest(); } + + public void testExclamationMethodFinish() throws Throwable { doTest('!'); } + public void testExclamationVariableFinish() throws Throwable { doTest('!'); } + public void testExclamationStaticFieldFinish() throws Throwable { doTest('!'); } + public void testExclamationFinishNonBoolean() throws Throwable { doTest('!'); } + + public void testExcludeDeclaredConstant() throws Throwable { doTest(); } + + public void testTabMethodInBinaryExpression() throws Throwable { doTest('\t'); } + + public void testIfConditionBinaryExpression() throws Throwable { doTest(); } + + public void testDelegationToParent() throws Throwable { doTest(); } + + public void testBeforeBinaryExpressionInMethodCall() throws Throwable { doTest(); } + + public void testAssignableToAfterCast() throws Throwable { doTest(); } + + public void testInstanceMethodParametersFromStaticContext() throws Throwable { doTest(); } + + public void testInstanceMethodParametersFromStaticContext2() throws Throwable { doTest(); } + + public void testBeforeCastToArray() throws Throwable { doTest(); } + + public void testHidingFields() throws Throwable { doTest(); } + + public void testVoidCast() throws Throwable { doAntiTest(); } + + public void testIntPlusLongNotDouble() throws Throwable { doTest(); } + + public void testNestedAssignments() throws Throwable { doTest(); } + + public void testAfterNewInTernary() throws Throwable { doTest(); } + + public void testSuggestAnythingWhenWildcardExpected() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertStringItems("X", "Y", "Z"); + } + + public void testNewVararg() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertStringItems("Foo", "Foo"); + assertEquals(0, myItems[0].as(PsiTypeLookupItem.class).getBracketsCount()); + assertEquals(1, myItems[1].as(PsiTypeLookupItem.class).getBracketsCount()); + } + + public void testInsideStringLiteral() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertNull(myItems); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + + } + + public void testDefaultAnnoParam() throws Throwable { doTest(); } + + public void testCastGenericQualifier() throws Throwable { doTest(); } + + public void testEverythingDoubles() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertStringItems("hashCode", "indexOf", "lastIndexOf", "size"); + } + + public void testNonStaticInnerClass() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertNull(myItems); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + } + + //todo 2nd completion + public void _testDefaultAnnoParam2() throws Throwable { doTest(); } + + public void testLiveTemplate() throws Throwable { + final Template template = TemplateManager.getInstance(getProject()).createTemplate("foo", "zzz"); + template.addTextSegment("FooFactory.createFoo()"); + final SmartCompletionContextType completionContextType = + ContainerUtil.findInstance(TemplateContextType.EP_NAME.getExtensions(), SmartCompletionContextType.class); + ((TemplateImpl)template).getTemplateContext().setEnabled(completionContextType, true); + TemplateSettings.getInstance().addTemplate(template); + try { + doTest(); + } + finally { + TemplateSettings.getInstance().removeTemplate(template); + } + } + + public void testInThisExpression() throws Throwable { doTest(); } + + public void testSuggestNull() throws Throwable { doTest(); } + + public void testNoNullAfterDot() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertNull(myItems); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + } + + public void testDefaultAnnoMethodValue() throws Throwable { doTest(); } + + public void testUseIntConstantsFromTargetClass() throws Throwable { doTest(); } + public void testUseIntConstantsFromTargetClassReturnValue() throws Throwable { doTest(); } + public void testUseIntConstantsFromConstructedClass() throws Throwable { doTest(); } + + public void testExtraSemicolonAfterMethodParam() throws Throwable { + CodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(getProject()); + styleSettings.SPACE_WITHIN_METHOD_CALL_PARENTHESES = true; + try{ + doTest(); + } + finally{ + styleSettings.SPACE_WITHIN_METHOD_CALL_PARENTHESES = false; + } + } + + public void testAssignFromTheSameFieldOfAnotherObject() throws Throwable { + doTest(); + } + + public void testTailAfterInstanceOf() throws Throwable { + doTest(); + } + + public void testSuggestInstanceofedValue() throws Throwable { + doTest(); + } + + public void testSuggestInstanceofedValueInTernary() throws Throwable { + doTest(); + } + + public void testSuggestInstanceofedValueInComplexIf() throws Throwable { doTest(); } + + public void testSuggestInstanceofedValueInElseNegated() throws Throwable { doTest(); } + + public void testSuggestInstanceofedValueAfterReturn() throws Throwable { doTest(); } + + public void testNoInstanceofedValueWhenBasicSuits() throws Throwable { doTest(); } + + public void testSuggestCastedValueAfterCast() throws Throwable { doTest(); } + + public void testNoInstanceofedValueInElse() throws Throwable { doAntiTest(); } + + public void testNoInstanceofedValueInThenNegated() throws Throwable { doAntiTest(); } + + public void testNoInstanceofedValueInElseWithComplexIf() throws Throwable { doAntiTest(); } + + public void testReplaceWholeReferenceChain() throws Throwable { doTest(Lookup.REPLACE_SELECT_CHAR); } + + public void testInstanceofedInsideAnonymous() throws Throwable { doTest(Lookup.REPLACE_SELECT_CHAR); } + + public void testDoubleTrueInOverloadedMethodCall() throws Throwable { doTest(Lookup.REPLACE_SELECT_CHAR); } + + public void testOneElementArray() throws Throwable { doTest(); } + + public void testCastToArray() throws Throwable { doTest(); } + + public void testDontAutoCastWhenAlreadyCasted() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertEquals("s", myItems[0].getLookupString()); + assertEquals("String.copyValueOf", myItems[1].getLookupString()); + select(); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testAutoCastWhenAlreadyCasted() throws Throwable { doTest(); } + + public void testCommaDoublePenetration() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + select(','); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testSuperMethodArguments() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + getLookup().setCurrentItem(getLookup().getItems().get(1)); + select(); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testDelegateMethodArguments() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + getLookup().setCurrentItem(getLookup().getItems().get(1)); + select(); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + public void testSuperConstructorArguments() throws Throwable { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + getLookup().setCurrentItem(getLookup().getItems().get(2)); + select(); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + + private void doAntiTest() throws Exception { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + assertNull(myItems); + checkResultByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + } + + private void doTest() throws Exception { + doTest(Lookup.NORMAL_SELECT_CHAR); + } + + private void doTest(final char c) throws Exception { + boolean old = CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_SMART_TYPE_COMPLETION; + if (c != Lookup.NORMAL_SELECT_CHAR) { + CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_SMART_TYPE_COMPLETION = false; + } + + try { + configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); + if (myItems != null && myItems.length == 1) { + select(c); + } + checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); + } + finally { + if (c != Lookup.NORMAL_SELECT_CHAR) { + CodeInsightSettings.getInstance().AUTOCOMPLETE_ON_SMART_TYPE_COMPLETION = old; + } + } + + } + + protected void checkResultByFile(@NonNls final String filePath) throws Exception { + if (myItems != null) { + System.out.println("items = " + Arrays.asList(myItems)); + } + super.checkResultByFile(filePath); + } + + public void testInnerEnum() throws Exception { + configureByFile(BASE_PATH + "/"+getTestName(false)+".java"); + + LookupManager.getActiveLookup(myEditor).setCurrentItem(ContainerUtil.find(myItems, new Condition() { + public boolean value(final LookupElement lookupItem) { + return "Fubar.Bar".equals(lookupItem.getLookupString()); + } + })); + select('\n'); + checkResultByFile(BASE_PATH + "/"+getTestName(false) + "-out.java"); + } + + protected void setUp() throws Exception { + super.setUp(); + myPrevLanguageLevel = LanguageLevelProjectExtension.getInstance(getJavaFacade().getProject()).getLanguageLevel(); + LanguageLevelProjectExtension.getInstance(getJavaFacade().getProject()).setLanguageLevel(LanguageLevel.JDK_1_5); + setType(CompletionType.SMART); + } + + protected void tearDown() throws Exception { + LookupManager.getInstance(getProject()).hideActiveLookup(); + LanguageLevelProjectExtension.getInstance(getJavaFacade().getProject()).setLanguageLevel(myPrevLanguageLevel); + super.tearDown(); + } + + private void select() { + select(Lookup.NORMAL_SELECT_CHAR); + } + + private void select(final char c) { + if (c != '\n' && c != '\t' && c != Lookup.COMPLETE_STATEMENT_SELECT_CHAR) { + type(c); + return; + } + + final TestLookupManager manager = (TestLookupManager) LookupManager.getInstance(getProject()); + final Lookup lookup = manager.getActiveLookup(); + if(lookup != null) { + manager.forceSelection(c, lookup.getCurrentItem()); + } + } +} diff --git a/java/testFramework/src/com/intellij/codeInsight/completion/CompletionTestCase.java b/java/testFramework/src/com/intellij/codeInsight/completion/CompletionTestCase.java new file mode 100644 index 000000000000..261dffe8f3b0 --- /dev/null +++ b/java/testFramework/src/com/intellij/codeInsight/completion/CompletionTestCase.java @@ -0,0 +1,88 @@ +package com.intellij.codeInsight.completion; + +import com.intellij.codeInsight.daemon.DaemonAnalyzerTestCase; +import com.intellij.codeInsight.lookup.LookupElement; +import com.intellij.codeInsight.lookup.LookupManager; +import com.intellij.codeInsight.lookup.impl.LookupImpl; +import com.intellij.psi.statistics.StatisticsManager; +import com.intellij.psi.statistics.impl.StatisticsManagerImpl; + +import java.util.Arrays; + +/** + * @author mike + */ +public abstract class CompletionTestCase extends DaemonAnalyzerTestCase { + protected String myPrefix; + protected LookupElement[] myItems; + private CompletionType myType = CompletionType.BASIC; + + @Override + protected void setUp() throws Exception { + super.setUp(); + ((StatisticsManagerImpl)StatisticsManager.getInstance()).clearStatistics(); + } + + protected void tearDown() throws Exception { + LookupManager.getInstance(myProject).hideActiveLookup(); + super.tearDown(); + myItems = null; + } + + protected void configureByFile(String filePath) throws Exception { + super.configureByFile(filePath); + + complete(); + } + + protected void configureByFileNoCompletion(String filePath) throws Exception { + super.configureByFile(filePath); + } + + protected void complete() { + new CodeCompletionHandlerBase(myType).invoke(myProject, myEditor, myFile); + + LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(myEditor); + myItems = lookup == null ? null : lookup.getItems().toArray(LookupElement.EMPTY_ARRAY); + myPrefix = lookup == null ? "" : lookup.getItems().get(0).getPrefixMatcher().getPrefix(); + } + + public void setType(CompletionType type) { + myType = type; + } + + protected void selectItem(LookupElement item, char ch) { + final LookupImpl lookup = (LookupImpl)LookupManager.getInstance(myProject).getActiveLookup(); + lookup.setCurrentItem(item); + lookup.finishLookup(ch); + } + + protected void selectItem(LookupElement item) { + selectItem(item, (char)0); + } + + protected void testByCount(int finalCount, String... values) { + int index = 0; + if (myItems == null) { + assertEquals(0, finalCount); + return; + } + for (int i = 0; i < myItems.length; i++) { + final LookupElement myItem = myItems[i]; + for (int j = 0; j < values.length; j++) { + if (values[j] == null) { + assertFalse("Unacceptable value reached", true); + } + if (values[j].equals(myItem.getLookupString())) { + index++; + break; + } + } + } + assertEquals(Arrays.toString(myItems), finalCount, index); + } + + protected LookupImpl getActiveLookup() { + return (LookupImpl)LookupManager.getActiveLookup(myEditor); + } +} diff --git a/java/testFramework/src/com/intellij/codeInsight/completion/LightCompletionTestCase.java b/java/testFramework/src/com/intellij/codeInsight/completion/LightCompletionTestCase.java new file mode 100644 index 000000000000..20eb56b37d5c --- /dev/null +++ b/java/testFramework/src/com/intellij/codeInsight/completion/LightCompletionTestCase.java @@ -0,0 +1,103 @@ +package com.intellij.codeInsight.completion; + +import com.intellij.codeInsight.lookup.LookupElement; +import com.intellij.codeInsight.lookup.LookupManager; +import com.intellij.codeInsight.lookup.impl.LookupImpl; +import com.intellij.testFramework.LightCodeInsightTestCase; +import com.intellij.psi.statistics.impl.StatisticsManagerImpl; +import com.intellij.psi.statistics.StatisticsManager; +import org.jetbrains.annotations.NonNls; + +import java.util.Arrays; + +/** + * @author mike + */ +public abstract class LightCompletionTestCase extends LightCodeInsightTestCase { + protected String myPrefix; + protected LookupElement[] myItems; + private CompletionType myType = CompletionType.BASIC; + + @Override + protected void setUp() throws Exception { + super.setUp(); + ((StatisticsManagerImpl)StatisticsManager.getInstance()).clearStatistics(); + } + + protected void tearDown() throws Exception { + LookupManager.getInstance(getProject()).hideActiveLookup(); + super.tearDown(); + } + + protected void configureByFile(String filePath) throws Exception { + super.configureByFile(filePath); + + complete(); + } + + protected void configureByFileNoComplete(String filePath) throws Exception { + super.configureByFile(filePath); + } + + protected void complete() { + complete(1); + } + + protected void complete(final int time) { + new CodeCompletionHandlerBase(myType).invokeCompletion(getProject(), getEditor(), getFile(), time); + + LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(myEditor); + myItems = lookup == null ? null : lookup.getItems().toArray(LookupElement.EMPTY_ARRAY); + myPrefix = lookup == null ? null : lookup.getItems().get(0).getPrefixMatcher().getPrefix(); + } + + public void setType(CompletionType type) { + myType = type; + } + + protected void selectItem(LookupElement item) { + selectItem(item, (char)0); + } + + protected void selectItem(LookupElement item, char completionChar) { + final LookupImpl lookup = (LookupImpl)LookupManager.getInstance(getProject()).getActiveLookup(); + lookup.setCurrentItem(item); + if (completionChar == 0 || completionChar == '\n' || completionChar == '\t') { + lookup.finishLookup(completionChar); + } else { + type(completionChar); + } + } + + protected void testByCount(int finalCount, @NonNls String... values) { + if (myItems == null) { + assertEquals(0, finalCount); + return; + } + int index = 0; + for (final LookupElement myItem : myItems) { + for (String value : values) { + if (value == null) { + assertFalse("Unacceptable value reached: " + myItem.getLookupString(), true); + } + if (value.equals(myItem.getLookupString())) { + index++; + break; + } + } + } + assertEquals(finalCount, index); + } + + protected void assertStringItems(@NonNls String... items) { + assertEquals(Arrays.asList(myItems).toString(), items.length, myItems.length); + for (int i = 0; i < myItems.length; i++) { + LookupElement item = myItems[i]; + assertEquals(items[i], item.getLookupString()); + } + } + + protected static LookupImpl getLookup() { + return (LookupImpl)LookupManager.getActiveLookup(myEditor); + } +}