Home » openjdk-7 » com.sun.tools » javac » comp » [javadoc | source]
com.sun.tools.javac.comp
public class: TransTypes [javadoc | source]
java.lang.Object
   com.sun.tools.javac.tree.JCTree.Visitor
      com.sun.tools.javac.tree.TreeTranslator
         com.sun.tools.javac.comp.TransTypes
This pass translates Generic Java to conventional Java.

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Nested Class Summary:
class  TransTypes.NeedsOverridBridgeFilter   
Field Summary
protected static final  Key<TransTypes> transTypesKey    The context key for the TransTypes phase. 
 Map<MethodSymbol, MethodSymbol> overridden    A hashtable mapping bridge methods to the methods they override after type erasure. 
 Filter<Symbol> overrideBridgeFilter     
 JCMethodDecl currentMethod     
Fields inherited from com.sun.tools.javac.tree.TreeTranslator:
result
Constructor:
 protected TransTypes(Context context) 
Method from com.sun.tools.javac.comp.TransTypes Summary:
addBridge,   addBridgeIfNeeded,   addBridges,   addBridges,   cast,   coerce,   instance,   retype,   translate,   translate,   translateArgs,   translateClass,   translateTopLevelClass,   visitAnnotation,   visitApply,   visitAssert,   visitAssign,   visitAssignop,   visitBinary,   visitCase,   visitClassDef,   visitConditional,   visitDoLoop,   visitExec,   visitForLoop,   visitForeachLoop,   visitIdent,   visitIf,   visitIndexed,   visitMethodDef,   visitNewArray,   visitNewClass,   visitParens,   visitReturn,   visitSelect,   visitSwitch,   visitSynchronized,   visitThrow,   visitTry,   visitTypeApply,   visitTypeArray,   visitTypeCast,   visitTypeTest,   visitUnary,   visitVarDef,   visitWhileLoop
Methods from com.sun.tools.javac.tree.TreeTranslator:
translate,   translate,   translateAnnotations,   translateCases,   translateCatchers,   translateTypeParams,   translateVarDefs,   visitAnnotation,   visitApply,   visitAssert,   visitAssign,   visitAssignop,   visitBinary,   visitBlock,   visitBreak,   visitCase,   visitCatch,   visitClassDef,   visitConditional,   visitContinue,   visitDoLoop,   visitErroneous,   visitExec,   visitForLoop,   visitForeachLoop,   visitIdent,   visitIf,   visitImport,   visitIndexed,   visitLabelled,   visitLetExpr,   visitLiteral,   visitMethodDef,   visitModifiers,   visitNewArray,   visitNewClass,   visitParens,   visitReturn,   visitSelect,   visitSkip,   visitSwitch,   visitSynchronized,   visitThrow,   visitTopLevel,   visitTree,   visitTry,   visitTypeApply,   visitTypeArray,   visitTypeBoundKind,   visitTypeCast,   visitTypeIdent,   visitTypeParameter,   visitTypeTest,   visitTypeUnion,   visitUnary,   visitVarDef,   visitWhileLoop,   visitWildcard
Methods from com.sun.tools.javac.tree.JCTree$Visitor:
visitAnnotation,   visitApply,   visitAssert,   visitAssign,   visitAssignop,   visitBinary,   visitBlock,   visitBreak,   visitCase,   visitCatch,   visitClassDef,   visitConditional,   visitContinue,   visitDoLoop,   visitErroneous,   visitExec,   visitForLoop,   visitForeachLoop,   visitIdent,   visitIf,   visitImport,   visitIndexed,   visitLabelled,   visitLetExpr,   visitLiteral,   visitMethodDef,   visitModifiers,   visitNewArray,   visitNewClass,   visitParens,   visitReturn,   visitSelect,   visitSkip,   visitSwitch,   visitSynchronized,   visitThrow,   visitTopLevel,   visitTree,   visitTry,   visitTypeApply,   visitTypeArray,   visitTypeBoundKind,   visitTypeCast,   visitTypeIdent,   visitTypeParameter,   visitTypeTest,   visitTypeUnion,   visitUnary,   visitVarDef,   visitWhileLoop,   visitWildcard
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.tools.javac.comp.TransTypes Detail:
  void addBridge(DiagnosticPosition pos,
    MethodSymbol meth,
    MethodSymbol impl,
    ClassSymbol origin,
    boolean hypothetical,
    ListBuffer<JCTree> bridges) 
    Add a bridge definition and enter corresponding method symbol in local scope of origin.
  void addBridgeIfNeeded(DiagnosticPosition pos,
    Symbol sym,
    ClassSymbol origin,
    ListBuffer<JCTree> bridges) 
    Add bridge if given symbol is a non-private, non-static member of the given class, which is either defined in the class or non-final inherited, and one of the two following conditions holds: 1. The method's type changes in the given class, as compared to the class where the symbol was defined, (in this case we have extended a parameterized class with non-trivial parameters). 2. The method has an implementation with a different erased return type. (in this case we have used co-variant returns). If a bridge already exists in some other class, no new bridge is added. Instead, it is checked that the bridge symbol overrides the method symbol. (Spec ???). todo: what about bridges for privates???
  void addBridges(DiagnosticPosition pos,
    ClassSymbol origin,
    ListBuffer<JCTree> bridges) 
    Add all necessary bridges to some class appending them to list buffer.
  void addBridges(DiagnosticPosition pos,
    TypeSymbol i,
    ClassSymbol origin,
    ListBuffer<JCTree> bridges) 
 JCExpression cast(JCExpression tree,
    Type target) 
    Construct an attributed tree for a cast of expression to target type, unless it already has precisely that type.
 JCExpression coerce(JCExpression tree,
    Type target) 
    Construct an attributed tree to coerce an expression to some erased target type, unless the expression is already assignable to that type. If target type is a constant type, use its base type instead.
 public static TransTypes instance(Context context) 
    Get the instance for this context.
 JCExpression retype(JCExpression tree,
    Type erasedType,
    Type target) 
 public T translate(T tree,
    Type pt) 
    Visitor method: perform a type translation on tree.
 public List<T> translate(List<T> trees,
    Type pt) 
    Visitor method: perform a type translation on list of trees.
 List<T> translateArgs(List<T> _args,
    List<Type> parameters,
    Type varargsElement) 
    Translate method argument list, casting each argument to its corresponding type in a list of target types.
  void translateClass(ClassSymbol c) 
 public JCTree translateTopLevelClass(JCTree cdef,
    TreeMaker make) 
    Translate a toplevel class definition.
 public  void visitAnnotation(JCAnnotation tree) 
 public  void visitApply(JCMethodInvocation tree) 
 public  void visitAssert(JCAssert tree) 
 public  void visitAssign(JCAssign tree) 
 public  void visitAssignop(JCAssignOp tree) 
 public  void visitBinary(JCBinary tree) 
 public  void visitCase(JCCase tree) 
 public  void visitClassDef(JCClassDecl tree) 
 public  void visitConditional(JCConditional tree) 
 public  void visitDoLoop(JCDoWhileLoop tree) 
 public  void visitExec(JCExpressionStatement tree) 
 public  void visitForLoop(JCForLoop tree) 
 public  void visitForeachLoop(JCEnhancedForLoop tree) 
 public  void visitIdent(JCIdent tree) 
 public  void visitIf(JCIf tree) 
 public  void visitIndexed(JCArrayAccess tree) 
 public  void visitMethodDef(JCMethodDecl tree) 
 public  void visitNewArray(JCNewArray tree) 
 public  void visitNewClass(JCNewClass tree) 
 public  void visitParens(JCParens tree) 
 public  void visitReturn(JCReturn tree) 
 public  void visitSelect(JCFieldAccess tree) 
 public  void visitSwitch(JCSwitch tree) 
 public  void visitSynchronized(JCSynchronized tree) 
 public  void visitThrow(JCThrow tree) 
 public  void visitTry(JCTry tree) 
 public  void visitTypeApply(JCTypeApply tree) 
    Visitor method for parameterized types.
 public  void visitTypeArray(JCArrayTypeTree tree) 
 public  void visitTypeCast(JCTypeCast tree) 
 public  void visitTypeTest(JCInstanceOf tree) 
 public  void visitUnary(JCUnary tree) 
 public  void visitVarDef(JCVariableDecl tree) 
 public  void visitWhileLoop(JCWhileLoop tree)