package jetbrains.mps.baseLanguage.intentions; /*Generated by MPS */ import jetbrains.mps.intentions.AbstractIntentionAspectDescriptor; import jetbrains.mps.openapi.intentions.IntentionFactory; import java.util.Map; import org.jetbrains.mps.openapi.language.SAbstractConcept; import java.util.HashMap; import org.jetbrains.annotations.Nullable; import java.util.Collection; import org.jetbrains.annotations.NotNull; import java.util.Arrays; import jetbrains.mps.lang.smodel.ConceptSwitchIndex; import jetbrains.mps.lang.smodel.ConceptSwitchIndexBuilder; import jetbrains.mps.smodel.adapter.ids.MetaIdFactory; public final class IntentionsDescriptor extends AbstractIntentionAspectDescriptor { private static final IntentionFactory[] EMPTY_ARRAY = new IntentionFactory[0]; private Map<SAbstractConcept, IntentionFactory[]> myCached = new HashMap<SAbstractConcept, IntentionFactory[]>(); public IntentionsDescriptor() { } @Nullable public Collection<IntentionFactory> getIntentions(@NotNull SAbstractConcept concept) { if (myCached.containsKey(concept)) { return Arrays.asList(myCached.get(concept)); } IntentionFactory[] intentions = EMPTY_ARRAY; SAbstractConcept cncpt_d0f = concept; switch (index_hphjzv_d0f.index(cncpt_d0f)) { case 0: if (true) { // Concept: AnonymousClass intentions = new IntentionFactory[2]; intentions[0] = new ConvertToClosure_Intention(); intentions[1] = new RemoveTVDInAnonymousClass_Intention(); } break; case 1: if (true) { // Concept: ArrayType intentions = new IntentionFactory[1]; intentions[0] = new RemoveArrayType_Intention(); } break; case 2: if (true) { // Concept: AssertStatement intentions = new IntentionFactory[1]; intentions[0] = new ReplaceAssertWithIf_Intention(); } break; case 3: if (true) { // Concept: BaseMethodDeclaration intentions = new IntentionFactory[5]; intentions[0] = new MakeGeneric_Intention(); intentions[1] = new AddThrows_Intention(); intentions[2] = new MakeMethodFinal_Intention(); intentions[3] = new MakeSynchronized_Intention(); intentions[4] = new AddModifiers_Intention(); } break; case 4: if (true) { // Concept: BinaryOperation intentions = new IntentionFactory[2]; intentions[0] = new FlipBinaryOperation_Intention(); intentions[1] = new OrToAndAndBack_Intention(); } break; case 5: if (true) { // Concept: BlockStatement intentions = new IntentionFactory[1]; intentions[0] = new ReplaceBlockWithItsContent_Intention(); } break; case 6: if (true) { // Concept: ClassConcept intentions = new IntentionFactory[2]; intentions[0] = new MakeClassAbstract_Intention(); intentions[1] = new MakeClassFinal_Intention(); } break; case 7: if (true) { // Concept: ClassCreator intentions = new IntentionFactory[1]; intentions[0] = new ConvertClassCreatorToAnonimous_Intention(); } break; case 8: if (true) { // Concept: Classifier intentions = new IntentionFactory[2]; intentions[0] = new ChangeStaticInInner_Intention(); intentions[1] = new AutoSpacing_Intention(); } break; case 9: if (true) { // Concept: ElsifClause intentions = new IntentionFactory[2]; intentions[0] = new ElsifSwapWithMain_Intention(); intentions[1] = new ConvertElsifToNewIfStatement_Intention(); } break; case 10: if (true) { // Concept: EqualsExpression intentions = new IntentionFactory[1]; intentions[0] = new ReplaceEqualityWithEquals_Intention(); } break; case 11: if (true) { // Concept: Expression intentions = new IntentionFactory[8]; intentions[0] = new SurroundWithParenthesis_Intention(); intentions[1] = new SurroundWithTypeCast_Intention(); intentions[2] = new SurroundWithNegation_Intention(); intentions[3] = new SurroundWithIfClause_Intention(); intentions[4] = new SurroundWithIfElseClause_Intention(); intentions[5] = new CleanUnmatchedParentheses_Intention(); intentions[6] = new ComputeWholeExpressionValue_Intention(); intentions[7] = new ComputeExpressionValue_Intention(); } break; case 12: if (true) { // Concept: ExpressionStatement intentions = new IntentionFactory[2]; intentions[0] = new IterateOverIterable_Intention(); intentions[1] = new ConvertToReturnStatement_Intention(); } break; case 13: if (true) { // Concept: FieldDeclaration intentions = new IntentionFactory[4]; intentions[0] = new MoveInitializerToConstructor_Intention(); intentions[1] = new MakeFieldVolatile_Intention(); intentions[2] = new MakeFieldTransient_Intention(); intentions[3] = new AddStaticFieldModifier_Intention(); } break; case 14: if (true) { // Concept: ForStatement intentions = new IntentionFactory[1]; intentions[0] = new ReplaceForLoopWithWhileLoop_Intention(); } break; case 15: if (true) { // Concept: ForeachStatement intentions = new IntentionFactory[1]; intentions[0] = new ReplaceForEachLoopWithIndexedLoop_Intention(); } break; case 16: if (true) { // Concept: GetAccessor intentions = new IntentionFactory[1]; intentions[0] = new CreateSetAccessor_Intention(); } break; case 17: if (true) { // Concept: HasAnnotation intentions = new IntentionFactory[1]; intentions[0] = new AddAnnotation_Intention(); } break; case 18: if (true) { // Concept: IBLDeprecatable intentions = new IntentionFactory[1]; intentions[0] = new MakeDeprecated_Intention(); } break; case 19: if (true) { // Concept: IContainsStatementList intentions = new IntentionFactory[1]; intentions[0] = new AlterStatementListContainer_Intention(); } break; case 20: if (true) { // Concept: IMethodCall intentions = new IntentionFactory[1]; intentions[0] = new AddTypeParameters_Intention(); } break; case 21: if (true) { // Concept: ITryCatchStatement intentions = new IntentionFactory[1]; intentions[0] = new UnwrapTryCatch_Intention(); } break; case 22: if (true) { // Concept: IfStatement intentions = new IntentionFactory[12]; intentions[0] = new AddCastStatement_Intention(); intentions[1] = new InvertIfCondition_Intention(); intentions[2] = new AddElsifClause_Intention(); intentions[3] = new ElsifTransform_Intention(); intentions[4] = new ConvertElseToElseIf_Intention(); intentions[5] = new MakeOneLiner_Intention(); intentions[6] = new MakeMultiLiner_Intention(); intentions[7] = new UsedefaultLayout_Intention(); intentions[8] = new UnwrapIfThenBlock_Intention(); intentions[9] = new SplitIf_Intention(); intentions[10] = new ConvertIfConditionToTernaryOperator_Intention(); intentions[11] = new UnwrapUnnecessaryElse_Intention(); } break; case 23: if (true) { // Concept: InstanceMethodCallOperation intentions = new IntentionFactory[2]; intentions[0] = new ReplaceEqualsWithEquality_Intention(); intentions[1] = new FilpEqualsIntention_Intention(); } break; case 24: if (true) { // Concept: InstanceMethodDeclaration intentions = new IntentionFactory[3]; intentions[0] = new MakeMethodAbstract_Intention(); intentions[1] = new MakeClassAbstractFromMethod_Intention(); intentions[2] = new AddOverrideAnnotation_Intention(); } break; case 25: if (true) { // Concept: LocalMethodCall intentions = new IntentionFactory[1]; intentions[0] = new SpecifyClass_Intention(); } break; case 26: if (true) { // Concept: LocalVariableDeclaration intentions = new IntentionFactory[1]; intentions[0] = new SplitIntoDeclarationAndAssignment_Intention(); } break; case 27: if (true) { // Concept: MethodDeclaration intentions = new IntentionFactory[1]; intentions[0] = new MakeMethodStatic_Intention(); } break; case 28: if (true) { // Concept: ParameterDeclaration intentions = new IntentionFactory[1]; intentions[0] = new AddFieldForUnUsedParameter_Intention(); } break; case 29: if (true) { // Concept: PlusExpression intentions = new IntentionFactory[1]; intentions[0] = new MergeStringConcatenation_Intention(); } break; case 30: if (true) { // Concept: Property intentions = new IntentionFactory[3]; intentions[0] = new SwitchToCustomPropertyImplementation_Intention(); intentions[1] = new SwitchToDefaultPropertyImplementation_Intention(); intentions[2] = new SwitchToCustomConstructorPropertyImplementation_Intention(); } break; case 31: if (true) { // Concept: Statement intentions = new IntentionFactory[13]; intentions[0] = new CreateInternalLabel_Intention(); intentions[1] = new SurroundWithIf_Intention(); intentions[2] = new SurroundWithIfElse_Intention(); intentions[3] = new SurroundWithWhile_Intention(); intentions[4] = new SurroundWithDoWhile_Intention(); intentions[5] = new SurroundWithFor_Intention(); intentions[6] = new SurroundStatementsWithForEach_Intention(); intentions[7] = new SuroundWithTryCatch_Intention(); intentions[8] = new SurroundWithTryFinally_Intention(); intentions[9] = new TryCatchFinally_Intention(); intentions[10] = new SurroundWithSynchronized_Intention(); intentions[11] = new SurroundWithBrackets_Intention(); intentions[12] = new JoinVariableDeclarationAndInitializer_Intention(); } break; case 32: if (true) { // Concept: StaticFieldDeclaration intentions = new IntentionFactory[3]; intentions[0] = new RemoveStaticFieldModifier_Intention(); intentions[1] = new MakeStaticFieldVolatile_Intention(); intentions[2] = new MakeStaticFieldTransient_Intention(); } break; case 33: if (true) { // Concept: StringLiteral intentions = new IntentionFactory[1]; intentions[0] = new SplitStringIntoConcatenation_Intention(); } break; case 34: if (true) { // Concept: TernaryOperatorExpression intentions = new IntentionFactory[2]; intentions[0] = new ReplaceConditionalWithIf_Intention(); intentions[1] = new SwapTernaryBranches_Intention(); } break; case 35: if (true) { // Concept: ThisExpression intentions = new IntentionFactory[1]; intentions[0] = new CreateReferenceOnClass_Intention(); } break; case 36: if (true) { // Concept: ThrowStatement intentions = new IntentionFactory[1]; intentions[0] = new AddRuntimeExceptionToMethodSignature_Intention(); } break; case 37: if (true) { // Concept: Type intentions = new IntentionFactory[1]; intentions[0] = new ConvertToArrayType_Intention(); } break; case 38: if (true) { // Concept: VariableDeclaration intentions = new IntentionFactory[1]; intentions[0] = new AddFinalModifierToAny_Intention(); } break; case 39: if (true) { // Concept: VariableReference intentions = new IntentionFactory[3]; intentions[0] = new ExpandBoolean_Intention(); intentions[1] = new ConvertAssignmentToVariableDeclaration_Intention(); intentions[2] = new MakeParameterFinal_Intention(); } break; case 40: if (true) { // Concept: WhileStatement intentions = new IntentionFactory[1]; intentions[0] = new ExtractWhileConditionToInternalIfStatement_Intention(); } break; default: } myCached.put(concept, intentions); return Arrays.asList(intentions); } @NotNull @Override public Collection<IntentionFactory> getAllIntentions() { IntentionFactory[] rv = new IntentionFactory[94]; rv[0] = new AddCastStatement_Intention(); rv[1] = new SplitStringIntoConcatenation_Intention(); rv[2] = new SplitIntoDeclarationAndAssignment_Intention(); rv[3] = new AddAnnotation_Intention(); rv[4] = new FlipBinaryOperation_Intention(); rv[5] = new InvertIfCondition_Intention(); rv[6] = new ReplaceEqualityWithEquals_Intention(); rv[7] = new ReplaceEqualsWithEquality_Intention(); rv[8] = new ReplaceConditionalWithIf_Intention(); rv[9] = new ExtractWhileConditionToInternalIfStatement_Intention(); rv[10] = new ReplaceAssertWithIf_Intention(); rv[11] = new ReplaceForLoopWithWhileLoop_Intention(); rv[12] = new FilpEqualsIntention_Intention(); rv[13] = new ReplaceForEachLoopWithIndexedLoop_Intention(); rv[14] = new ExpandBoolean_Intention(); rv[15] = new AddRuntimeExceptionToMethodSignature_Intention(); rv[16] = new ReplaceBlockWithItsContent_Intention(); rv[17] = new MoveInitializerToConstructor_Intention(); rv[18] = new MergeStringConcatenation_Intention(); rv[19] = new CreateSetAccessor_Intention(); rv[20] = new MakeGeneric_Intention(); rv[21] = new AddFinalModifierToAny_Intention(); rv[22] = new AddElsifClause_Intention(); rv[23] = new ElsifTransform_Intention(); rv[24] = new ElsifSwapWithMain_Intention(); rv[25] = new ConvertClassCreatorToAnonimous_Intention(); rv[26] = new CreateReferenceOnClass_Intention(); rv[27] = new ConvertElseToElseIf_Intention(); rv[28] = new ConvertAssignmentToVariableDeclaration_Intention(); rv[29] = new MakeDeprecated_Intention(); rv[30] = new AddFieldForUnUsedParameter_Intention(); rv[31] = new ConvertToArrayType_Intention(); rv[32] = new RemoveArrayType_Intention(); rv[33] = new MakeClassAbstract_Intention(); rv[34] = new SpecifyClass_Intention(); rv[35] = new AddThrows_Intention(); rv[36] = new MakeMethodAbstract_Intention(); rv[37] = new IterateOverIterable_Intention(); rv[38] = new MakeMethodFinal_Intention(); rv[39] = new MakeFieldVolatile_Intention(); rv[40] = new MakeClassAbstractFromMethod_Intention(); rv[41] = new ChangeStaticInInner_Intention(); rv[42] = new MakeClassFinal_Intention(); rv[43] = new MakeParameterFinal_Intention(); rv[44] = new ConvertToReturnStatement_Intention(); rv[45] = new ConvertElsifToNewIfStatement_Intention(); rv[46] = new CreateInternalLabel_Intention(); rv[47] = new MakeOneLiner_Intention(); rv[48] = new MakeMultiLiner_Intention(); rv[49] = new UsedefaultLayout_Intention(); rv[50] = new SurroundWithIf_Intention(); rv[51] = new SurroundWithIfElse_Intention(); rv[52] = new SurroundWithWhile_Intention(); rv[53] = new SurroundWithDoWhile_Intention(); rv[54] = new SurroundWithFor_Intention(); rv[55] = new SurroundStatementsWithForEach_Intention(); rv[56] = new SuroundWithTryCatch_Intention(); rv[57] = new SurroundWithTryFinally_Intention(); rv[58] = new TryCatchFinally_Intention(); rv[59] = new SurroundWithSynchronized_Intention(); rv[60] = new SurroundWithBrackets_Intention(); rv[61] = new MakeFieldTransient_Intention(); rv[62] = new SurroundWithParenthesis_Intention(); rv[63] = new SurroundWithTypeCast_Intention(); rv[64] = new SurroundWithNegation_Intention(); rv[65] = new SurroundWithIfClause_Intention(); rv[66] = new SurroundWithIfElseClause_Intention(); rv[67] = new AddTypeParameters_Intention(); rv[68] = new MakeSynchronized_Intention(); rv[69] = new ConvertToClosure_Intention(); rv[70] = new UnwrapIfThenBlock_Intention(); rv[71] = new UnwrapTryCatch_Intention(); rv[72] = new RemoveTVDInAnonymousClass_Intention(); rv[73] = new SplitIf_Intention(); rv[74] = new ConvertIfConditionToTernaryOperator_Intention(); rv[75] = new AddModifiers_Intention(); rv[76] = new AddOverrideAnnotation_Intention(); rv[77] = new AlterStatementListContainer_Intention(); rv[78] = new RemoveStaticFieldModifier_Intention(); rv[79] = new AddStaticFieldModifier_Intention(); rv[80] = new MakeMethodStatic_Intention(); rv[81] = new MakeStaticFieldVolatile_Intention(); rv[82] = new MakeStaticFieldTransient_Intention(); rv[83] = new OrToAndAndBack_Intention(); rv[84] = new SwapTernaryBranches_Intention(); rv[85] = new SwitchToCustomPropertyImplementation_Intention(); rv[86] = new SwitchToDefaultPropertyImplementation_Intention(); rv[87] = new SwitchToCustomConstructorPropertyImplementation_Intention(); rv[88] = new CleanUnmatchedParentheses_Intention(); rv[89] = new ComputeWholeExpressionValue_Intention(); rv[90] = new ComputeExpressionValue_Intention(); rv[91] = new JoinVariableDeclarationAndInitializer_Intention(); rv[92] = new AutoSpacing_Intention(); rv[93] = new UnwrapUnnecessaryElse_Intention(); return Arrays.asList(rv); } private static final ConceptSwitchIndex index_hphjzv_d0f = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x1107e0cb103L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf940d819f7L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10e50ecba3dL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfc092b6b77L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11a59b0fbceL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x118ceceb41aL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b210L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37f506fL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b213L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca68L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10a698082feL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10a6933ce33L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x117b9245fc5L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x114a6be947aL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11d2ea8a339L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x120237c2cebL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x3399756d2c03d422L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b217L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x118154a6332L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b21dL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9404L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7efL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9408L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e94L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7fbL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x117b744dafeL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b215L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93c84351fL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d565d10L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10ef01239c9L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf93d4da00cL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x10f3ee082d8L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37f506dL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37a7f6eL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e98L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfaa4bf0f2fL)).seal(); }