package org.jetbrains.mps.samples.ParallelFor.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: ClassConcept intentions = new IntentionFactory[4]; intentions[0] = new MarkAsThreadSafe_Intention(); intentions[1] = new UnmarkAsThreadSafe_Intention(); intentions[2] = new MarkAsNonThreadSafe_Intention(); intentions[3] = new UnmarkAsNonThreadSafe_Intention(); } break; case 1: if (true) { // Concept: DotExpression intentions = new IntentionFactory[2]; intentions[0] = new MarkInstanceMethodCallAsThreadSafe_Intention(); intentions[1] = new UnmarkInstanceMethodCallAsThreadSafe_Intention(); } break; case 2: if (true) { // Concept: ForEachStatement intentions = new IntentionFactory[1]; intentions[0] = new TurnToParallelForEachStatement_Intention(); } break; case 3: if (true) { // Concept: LocalMethodCall intentions = new IntentionFactory[4]; intentions[0] = new MarkLocalStaticMethodCallAsThreadSafe_Intention(); intentions[1] = new UnmarkLocalStaticMethodCallAsThreadSafe_Intention(); intentions[2] = new UnmarkLocalInstanceMethodCallAsThreadSafe_Intention(); intentions[3] = new MarkLocalInstanceMethodCallAsThreadSafe_Intention(); } break; case 4: if (true) { // Concept: ParallelFor intentions = new IntentionFactory[2]; intentions[0] = new DetachFromThreadPool_Intention(); intentions[1] = new TurnToForEachStatement_Intention(); } break; case 5: if (true) { // Concept: StaticMethodCall intentions = new IntentionFactory[2]; intentions[0] = new MarkStaticMethodCallAsThreadSafe_Intention(); intentions[1] = new UnmarkStaticMethodCallAsThreadSafe_Intention(); } break; case 6: if (true) { // Concept: VariableDeclaration intentions = new IntentionFactory[2]; intentions[0] = new MarkVariableDeclarationAsThreadSafe_Intention(); intentions[1] = new UnmarkVariableAsThreadSafe_Intention(); } break; default: } myCached.put(concept, intentions); return Arrays.asList(intentions); } @NotNull @Override public Collection<IntentionFactory> getAllIntentions() { IntentionFactory[] rv = new IntentionFactory[17]; rv[0] = new DetachFromThreadPool_Intention(); rv[1] = new MarkAsThreadSafe_Intention(); rv[2] = new UnmarkAsThreadSafe_Intention(); rv[3] = new MarkAsNonThreadSafe_Intention(); rv[4] = new UnmarkAsNonThreadSafe_Intention(); rv[5] = new MarkVariableDeclarationAsThreadSafe_Intention(); rv[6] = new UnmarkVariableAsThreadSafe_Intention(); rv[7] = new MarkInstanceMethodCallAsThreadSafe_Intention(); rv[8] = new MarkStaticMethodCallAsThreadSafe_Intention(); rv[9] = new UnmarkStaticMethodCallAsThreadSafe_Intention(); rv[10] = new TurnToForEachStatement_Intention(); rv[11] = new TurnToParallelForEachStatement_Intention(); rv[12] = new UnmarkInstanceMethodCallAsThreadSafe_Intention(); rv[13] = new MarkLocalStaticMethodCallAsThreadSafe_Intention(); rv[14] = new UnmarkLocalStaticMethodCallAsThreadSafe_Intention(); rv[15] = new UnmarkLocalInstanceMethodCallAsThreadSafe_Intention(); rv[16] = new MarkLocalInstanceMethodCallAsThreadSafe_Intention(); return Arrays.asList(rv); } private static final ConceptSwitchIndex index_hphjzv_d0f = new ConceptSwitchIndexBuilder().put(MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x116b46a08c4L), MetaIdFactory.conceptId(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10cac65f399L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9404L), MetaIdFactory.conceptId(0xcb7388e8f1824cdaL, 0xbd839796e8634856L, 0x7bd8445d1e8770aaL), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbbebabf09L), MetaIdFactory.conceptId(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37a7f6eL)).seal(); }