src/share/classes/com/sun/tools/javac/api/JavacTrees.java

changeset 1327
fabfd2710057
parent 1280
5c0b3faeb0b0
child 1357
c75be5bc5283
     1.1 --- a/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Thu Sep 13 14:29:36 2012 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Fri Sep 14 09:21:55 2012 -0700
     1.3 @@ -117,7 +117,7 @@
     1.4          return instance;
     1.5      }
     1.6  
     1.7 -    private JavacTrees(Context context) {
     1.8 +    protected JavacTrees(Context context) {
     1.9          context.put(JavacTrees.class, this);
    1.10          init(context);
    1.11      }
    1.12 @@ -286,7 +286,7 @@
    1.13  
    1.14  
    1.15          JCCompilationUnit unit = (JCCompilationUnit) path.getCompilationUnit();
    1.16 -        Copier copier = new Copier(treeMaker.forToplevel(unit));
    1.17 +        Copier copier = createCopier(treeMaker.forToplevel(unit));
    1.18  
    1.19          Env<AttrContext> env = null;
    1.20          JCMethodDecl method = null;
    1.21 @@ -372,10 +372,10 @@
    1.22      /**
    1.23       * Makes a copy of a tree, noting the value resulting from copying a particular leaf.
    1.24       **/
    1.25 -    static class Copier extends TreeCopier<JCTree> {
    1.26 +    protected static class Copier extends TreeCopier<JCTree> {
    1.27          JCTree leafCopy = null;
    1.28  
    1.29 -        Copier(TreeMaker M) {
    1.30 +        protected Copier(TreeMaker M) {
    1.31              super(M);
    1.32          }
    1.33  
    1.34 @@ -388,6 +388,10 @@
    1.35          }
    1.36      }
    1.37  
    1.38 +    protected Copier createCopier(TreeMaker maker) {
    1.39 +        return new Copier(maker);
    1.40 +    }
    1.41 +
    1.42      /**
    1.43       * Gets the original type from the ErrorType object.
    1.44       * @param errorType The errorType for which we want to get the original type.

mercurial