Class UVariableDecl

java.lang.Object
com.sun.source.util.SimpleTreeVisitor<Choice<Unifier>,Unifier>
com.google.errorprone.refaster.UTree<com.sun.tools.javac.tree.JCTree.JCStatement>
com.google.errorprone.refaster.UVariableDecl
All Implemented Interfaces:
com.google.common.base.Function<UStatement.UnifierWithUnconsumedStatements,Choice<UStatement.UnifierWithUnconsumedStatements>>, Unifiable<com.sun.source.tree.Tree>, UStatement, com.sun.source.tree.StatementTree, com.sun.source.tree.Tree, com.sun.source.tree.TreeVisitor<Choice<Unifier>,Unifier>, com.sun.source.tree.VariableTree, Serializable, Function<UStatement.UnifierWithUnconsumedStatements,Choice<UStatement.UnifierWithUnconsumedStatements>>

public abstract class UVariableDecl extends UTree<com.sun.tools.javac.tree.JCTree.JCStatement> implements com.sun.source.tree.VariableTree
A UTree representation of a local variable declaration.

A UVariableDecl can be unified with any variable declaration which has a matching type and initializer. Annotations and modifiers are preserved for the corresponding replacement, as well as the variable name. ULocalVarIdent instances are used to represent references to local variables.

As a result, we can modify variable declarations and initializations in target code while preserving variable names and other contextual information.

Author:
lowasser@google.com (Louis Wasserman)
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.sun.source.tree.Tree

    com.sun.source.tree.Tree.Kind

    Nested classes/interfaces inherited from interface com.google.errorprone.refaster.UStatement

    UStatement.UnifierWithUnconsumedStatements
  • Field Summary

    Fields inherited from class com.sun.source.util.SimpleTreeVisitor

    DEFAULT_VALUE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <R, D> R
    accept(com.sun.source.tree.TreeVisitor<R,D> visitor, D data)
     
     
    create(CharSequence identifier, UExpression type)
     
    create(CharSequence identifier, UExpression type, @Nullable UExpression initializer)
     
    abstract @Nullable UExpression
     
    com.sun.source.tree.Tree.Kind
     
    com.sun.source.tree.ModifiersTree
     
    abstract StringName
     
    com.sun.source.tree.ExpressionTree
     
    abstract UExpression
     
    com.sun.tools.javac.tree.JCTree.JCVariableDecl
    inline(Inliner inliner)
     
    com.sun.tools.javac.tree.JCTree.JCVariableDecl
     
    com.sun.tools.javac.util.List<com.sun.tools.javac.tree.JCTree.JCStatement>
     
    visitVariable(com.sun.source.tree.VariableTree decl, Unifier unifier)
     

    Methods inherited from class com.google.errorprone.refaster.UTree

    defaultAction, unify

    Methods inherited from class com.sun.source.util.SimpleTreeVisitor

    visit, visit, visitAnnotatedType, visitAnnotation, visitAnyPattern, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBinary, visitBindingPattern, visitBlock, visitBreak, visitCase, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitConstantCaseLabel, visitContinue, visitDeconstructionPattern, visitDefaultCaseLabel, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitIdentifier, visitIf, visitImport, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLambdaExpression, visitLiteral, visitMemberReference, visitMemberSelect, visitMethod, visitMethodInvocation, visitModifiers, visitModule, visitNewArray, visitNewClass, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPatternCaseLabel, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitSwitch, visitSwitchExpression, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitUses, visitWhileLoop, visitWildcard, visitYield

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.google.common.base.Function

    equals

    Methods inherited from interface java.util.function.Function

    andThen, compose