Local variable type annotation. See
{@link com.github.drinkjava2.asm5_0_3.MethodVisitor#visitTryCatchAnnotation}.
760920
public Printer visitLocalVariableAnnotation(final int typeRef,
            final TypePath typePath, final Label[] start, final Label[] end,
            final int[] index, final String desc, final boolean visible) {
        throw new RuntimeException("Must be overriden");
    }
125672
protected String getInvalidWritableVariableAccessMessage(XVariableDeclaration variable, XAbstractFeatureCall featureCall, IResolvedTypes resolvedTypes) {
		// TODO this should be part of a separate validation service
		XClosure containingClosure = EcoreUtil2.getContainerOfType(featureCall, XClosure.class);
		if (containingClosure != null && !EcoreUtil.isAncestor(containingClosure, variable)) {
			return String.format("Cannot %srefer to the non-final variable %s inside a lambda expression", getImplicitlyMessagePart(featureCall), variable.getSimpleName());
		}
		return null;
	}
605669
@Override
    public void visitCode() {
        if (injectedTraceAnnotationVisitor == null && classAdapter.isInjectedTraceAnnotationRequired()) {
            AnnotationVisitor av = visitAnnotation(INJECTED_TRACE_TYPE.getDescriptor(), true);
            av.visitEnd();
        }

        super.visitCode();

        // Label the entry to the method so we can update the local var
        // debug data and indicate that we're referencing them during
        // method entry
        methodEntryLabel = new Label();
        visitLabel(methodEntryLabel);

        if (!waitingForSuper) {
            // This must be done before all instruction callbacks, but it must
            // also be done before the visitLabel() callback, which might have
            // an associated UNINITIALIZED entry in the stack map frame that is
            // supposed to be pointing at a NEW opcode.
            processMethodEntry();
        }
    }
1044537
protected void createValueLocal(LocalIndices localIndices, MethodVisitor mv, Field f) {
        visitGetter(mv, f);
        localIndices.incrementAndSetOriginalLocalIndex();

        mv.visitVarInsn(storeOpCode(f.getType()), localIndices.getLocalIndex());
        mv.visitVarInsn(loadOpCode(f.getType()), localIndices.getLocalIndex());
        AsmValidators.processWideLocal(f.getType(), localIndices);

        if (f.getType() == String.class) return;
        if (f.getType().isPrimitive()) {
            localIndices.setOriginalPrimitive(true);

            mv.visitMethodInsn(INVOKESTATIC, p(String.class), "valueOf", sig(String.class, f.getType()), false);

            localIndices.incrementAndSetStringLocalIndex();

            mv.visitVarInsn(ASTORE, localIndices.getLocalIndex());
            mv.visitVarInsn(ALOAD, localIndices.getLocalIndex());
            return;
        }

    }
971434
public void traverse(JavacASTVisitor visitor) {
		switch (this.getKind()) {
		case COMPILATION_UNIT:
			visitor.visitCompilationUnit(this, (JCCompilationUnit) get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitCompilationUnit(this, (JCCompilationUnit) get());
			break;
		case TYPE:
			visitor.visitType(this, (JCClassDecl) get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitType(this, (JCClassDecl) get());
			break;
		case FIELD:
			visitor.visitField(this, (JCVariableDecl) get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitField(this, (JCVariableDecl) get());
			break;
		case METHOD:
			visitor.visitMethod(this, (JCMethodDecl) get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitMethod(this, (JCMethodDecl) get());
			break;
		case INITIALIZER:
			visitor.visitInitializer(this, (JCBlock) get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitInitializer(this, (JCBlock) get());
			break;
		case ARGUMENT:
			JCMethodDecl parentMethod = (JCMethodDecl) up().get();
			visitor.visitMethodArgument(this, (JCVariableDecl) get(), parentMethod);
			ast.traverseChildren(visitor, this);
			visitor.endVisitMethodArgument(this, (JCVariableDecl) get(), parentMethod);
			break;
		case LOCAL:
			visitor.visitLocal(this, (JCVariableDecl) get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitLocal(this, (JCVariableDecl) get());
			break;
		case STATEMENT:
			visitor.visitStatement(this, get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitStatement(this, get());
			break;
		case ANNOTATION:
			switch (up().getKind()) {
			case TYPE:
				visitor.visitAnnotationOnType((JCClassDecl) up().get(), this, (JCAnnotation) get());
				break;
			case FIELD:
				visitor.visitAnnotationOnField((JCVariableDecl) up().get(), this, (JCAnnotation) get());
				break;
			case METHOD:
				visitor.visitAnnotationOnMethod((JCMethodDecl) up().get(), this, (JCAnnotation) get());
				break;
			case ARGUMENT:
				JCVariableDecl argument = (JCVariableDecl) up().get();
				JCMethodDecl method = (JCMethodDecl) up().up().get();
				visitor.visitAnnotationOnMethodArgument(argument, method, this, (JCAnnotation) get());
				break;
			case LOCAL:
				visitor.visitAnnotationOnLocal((JCVariableDecl) up().get(), this, (JCAnnotation) get());
				break;
			case TYPE_USE:
				visitor.visitAnnotationOnTypeUse(up().get(), this, (JCAnnotation) get());
				break;
			default:
				throw new AssertionError("Annotion not expected as child of a " + up().getKind());
			}
			break;
		case TYPE_USE:
			visitor.visitTypeUse(this, get());
			ast.traverseChildren(visitor, this);
			visitor.endVisitTypeUse(this, get());
			break;
		default:
			throw new AssertionError("Unexpected kind during node traversal: " + getKind());
		}
	}
78091
public void tableEntry(CodeBuilder mv) {
    mv.visitLocalVariable(
        variableName(),
        resultType().getDescriptor(),
        null, // no generic signature
        start(),
        end(),
        index());
  }
1102688
@Override
  protected void visitLetValueNode(LetValueNode node) {

    String generatedVarName = node.getUniqueVarName();

    // Generate code to define the local var.
    Expression value = translateExpr(node.getExpr());
    jsCodeBuilder.append(VariableDeclaration.builder(generatedVarName).setRhs(value).build());

    // Add a mapping for generating future references to this local var.
    templateTranslationContext
        .soyToJsVariableMappings()
        .put(node.getVarName(), id(generatedVarName));
  }
1362659
private static IVarDef asVarDef( String varName, String varType, Annotated groupAnnotations, JsonObject json)
    {
    try
      {
      validIdentifier( varName);

      AbstractVarDef varDef =
        json.containsKey( MEMBERS_KEY)
        ? new VarSet( varName)
        : new VarDef( varName);

      varDef.setType( varType);
    
      // Get annotations for this variable
      Optional.ofNullable( json.getJsonObject( HAS_KEY))
        .ifPresent( has -> has.keySet().stream().forEach( key -> varDef.setAnnotation( key, has.getString( key))));
    
      // Get the condition for this variable
      Optional.ofNullable( json.getJsonObject( WHEN_KEY))
        .ifPresent( object -> varDef.setCondition( asValidCondition( object)));

      if( json.containsKey( MEMBERS_KEY))
        {
        VarSet varSet = (VarSet) varDef;
        getVarDefs( varType, json.getJsonObject( MEMBERS_KEY))
          .forEach( member -> varSet.addMember( member));

        if( !varSet.getMembers().hasNext())
          {
          throw new SystemInputException( String.format( "No members defined for VarSet=%s", varName));
          }
        }
      else
        {
        VarDef var = (VarDef) varDef;
        getValueDefs( json.getJsonObject( VALUES_KEY))
          .forEach( valueDef -> var.addValue( valueDef));

        if( !var.getValidValues().hasNext())
          {
          throw new SystemInputException( String.format( "No valid values defined for Var=%s", varName));
          }
        }

      // Add any group annotations
      varDef.addAnnotations( groupAnnotations);

      return varDef;
      }
    catch( SystemInputException e)
      {
      throw new SystemInputException( String.format( "Error defining variable=%s", varName), e);
      }
    }
723158
public static Matcher<ExpressionTree> isVariable() {
    return new Matcher<ExpressionTree>() {
      @Override
      public boolean matches(ExpressionTree expressionTree, VisitorState state) {
        Symbol symbol = ASTHelpers.getSymbol(expressionTree);
        if (symbol == null) {
          return false;
        }
        return symbol.getKind() == ElementKind.LOCAL_VARIABLE
            || symbol.getKind() == ElementKind.PARAMETER;
      }
    };
  }
369115
@Override
	public Void visitAnnotation(AnnotationMirror a, String p) {
		if (AnnotationAttributeType.INDEXES.getValue().equals(p)) {
			inTasks = true;
		}

		if (inTasks) {
			currentValue = new Pair<List<String>, Boolean>(new ArrayList<String>(), false);
			for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : a.getElementValues().entrySet()) {
				String key = entry.getKey().getSimpleName().toString();
				entry.getValue().accept(this, key);
			}
			indexes.add(currentValue);
		}

		if (AnnotationAttributeType.INDEXES.getValue().equals(p)) {
			inTasks = false;
		}

		return null;
	}
508865
function inferrableVariableVisitor(node) {
            if (!node.id) {
                return;
            }
            reportInferrableType(node, node.id.typeAnnotation, node.init);
        }
841357
private void findLocalComponentsForComponent(LocalComponents localComponents,
      TypeElement componentTypeElement) {
    Component componentAnnotation = componentTypeElement.getAnnotation(Component.class);
    if (componentAnnotation == null) {
      return;
    }

    processLocalComponentClass(localComponents, componentTypeElement);
    getComponentLocalComponents(elements, componentTypeElement)
        .stream()
        .map(DeclaredType.class::cast)
        .map(DeclaredType::asElement)
        .map(TypeElement.class::cast)
        .forEach(childTypeElement -> processLocalComponentClass(localComponents,
            childTypeElement));

    getSuperComponentType(componentTypeElement)
        .ifPresent(superComponentType -> findLocalComponentsForComponent(
            localComponents,
            superComponentType));
  }
1106783
@SuppressWarnings( "unchecked" )
    private FieldMetadata processVariableDeclaration( SingleVariableDeclaration singleVariableDeclaration,
                                                      Type type ) {

        Variable variable;
        if (type.isPrimitiveType()) {
            FieldMetadata primitiveFieldMetadata = FieldMetadata.primitiveType(((PrimitiveType)type).getPrimitiveTypeCode().toString());
            variable = new Variable();
            variable.setName(JavaMetadataUtil.getName(singleVariableDeclaration.getName()));
            primitiveFieldMetadata.setName(variable.getName());

            primitiveFieldMetadata.getVariables().add(variable);
            for (IExtendedModifier extendedModifier : (List<IExtendedModifier>)singleVariableDeclaration.modifiers()) {
                if (extendedModifier.isAnnotation()) {
                    primitiveFieldMetadata.getAnnotations().add(createAnnotationMetadataFor((Annotation)extendedModifier));
                } else {
                    Modifier modifier = (Modifier)extendedModifier;
                    primitiveFieldMetadata.getModifiers().add(new ModifierMetadata(modifier.getKeyword().toString()));
                }
            }
            return primitiveFieldMetadata;
        }
        if (type.isSimpleType()) {
            SimpleType simpleType = (SimpleType)type;
            FieldMetadata simpleTypeFieldMetadata = FieldMetadata.simpleType(JavaMetadataUtil.getName(simpleType.getName()));
            variable = new Variable();
            variable.setName(JavaMetadataUtil.getName(singleVariableDeclaration.getName()));
            simpleTypeFieldMetadata.setName(variable.getName());
            simpleTypeFieldMetadata.getVariables().add(variable);
            for (IExtendedModifier simpleTypeExtendedModifier : (List<IExtendedModifier>)singleVariableDeclaration.modifiers()) {
                if (simpleTypeExtendedModifier.isAnnotation()) {
                    simpleTypeFieldMetadata.getAnnotations().add(createAnnotationMetadataFor((Annotation)simpleTypeExtendedModifier));
                } else {
                    Modifier modifier = (Modifier)simpleTypeExtendedModifier;
                    simpleTypeFieldMetadata.getModifiers().add(new ModifierMetadata(modifier.getKeyword().toString()));
                }
            }
            return simpleTypeFieldMetadata;
        }
        if (type.isParameterizedType()) {
            ParameterizedType parameterizedType = (ParameterizedType)type;
            FieldMetadata parameterizedTypeFieldMetadata = FieldMetadata.parametrizedType(getTypeName(parameterizedType));

            variable = new Variable();
            variable.setName(JavaMetadataUtil.getName(singleVariableDeclaration.getName()));
            parameterizedTypeFieldMetadata.setName(variable.getName());
            parameterizedTypeFieldMetadata.getVariables().add(variable);
            for (IExtendedModifier parameterizedExtendedModifier : (List<IExtendedModifier>)singleVariableDeclaration.modifiers()) {
                if (parameterizedExtendedModifier.isAnnotation()) {
                    parameterizedTypeFieldMetadata.getAnnotations().add(createAnnotationMetadataFor((Annotation)parameterizedExtendedModifier));
                } else {
                    Modifier modifier = (Modifier)parameterizedExtendedModifier;
                    parameterizedTypeFieldMetadata.getModifiers().add(new ModifierMetadata(modifier.getKeyword().toString()));
                }
            }
            return parameterizedTypeFieldMetadata;
        }
        if (type.isArrayType()) {
            ArrayType arrayType = (ArrayType)type;
            FieldMetadata arrayTypeFieldMetadata = FieldMetadata.arrayType(getTypeName(arrayType));

            variable = new Variable();
            variable.setName(JavaMetadataUtil.getName(singleVariableDeclaration.getName()));
            arrayTypeFieldMetadata.setName(variable.getName());
            arrayTypeFieldMetadata.getVariables().add(variable);

            for (IExtendedModifier arrayTypeExtendedModifier : (List<IExtendedModifier>)singleVariableDeclaration.modifiers()) {
                if (arrayTypeExtendedModifier.isAnnotation()) {
                    arrayTypeFieldMetadata.getAnnotations().add(createAnnotationMetadataFor((Annotation)arrayTypeExtendedModifier));
                } else {
                    Modifier modifier = (Modifier)arrayTypeExtendedModifier;
                    arrayTypeFieldMetadata.getModifiers().add(new ModifierMetadata(modifier.getKeyword().toString()));
                }
            }
            return arrayTypeFieldMetadata;
        }
        return null;
    }
143758
public static TypeAnnotationPosition
        methodTypeParameterBound(final List<TypePathEntry> location,
                                 final int parameter_index,
                                 final int bound_index) {
        return methodTypeParameterBound(location, null, parameter_index,
                                        bound_index, -1);
    }
469790
@Override
    public VariableExpression visitBuiltInType(BuiltInTypeContext ctx) {
        String text;
        if (asBoolean(ctx.VOID())) {
            text = ctx.VOID().getText();
        } else if (asBoolean(ctx.BuiltInPrimitiveType())) {
            text = ctx.BuiltInPrimitiveType().getText();
        } else {
            throw createParsingFailedException("Unsupported built-in type: " + ctx, ctx);
        }

        return configureAST(new VariableExpression(text), ctx);
    }
1300238
public void accept(final MethodVisitor mv) {
        mv.visitTryCatchBlock(start.getLabel(), end.getLabel(),
                handler == null ? null : handler.getLabel(), type);
        int n = visibleTypeAnnotations == null ? 0 : visibleTypeAnnotations
                .size();
        for (int i = 0; i < n; ++i) {
            TypeAnnotationNode an = visibleTypeAnnotations.get(i);
            an.accept(mv.visitTryCatchAnnotation(an.typeRef, an.typePath,
                    an.desc, true));
        }
        n = invisibleTypeAnnotations == null ? 0 : invisibleTypeAnnotations
                .size();
        for (int i = 0; i < n; ++i) {
            TypeAnnotationNode an = invisibleTypeAnnotations.get(i);
            an.accept(mv.visitTryCatchAnnotation(an.typeRef, an.typePath,
                    an.desc, false));
        }
    }
658132
private JMFType findVariantChildByName(JSVariant var, String name) {
    for (int i = 0; i < var.getCaseCount(); i++) {
      JMFType theCase = getEffectiveType(var.getCase(i));
      String caseName = theCase.getFeatureName();
      if (caseName != null && caseName.equals(name))
        return theCase;
    }
    return null;
  }