summaryrefslogtreecommitdiff
path: root/sources/scalac/ast/Tree.java.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/ast/Tree.java.tmpl')
-rw-r--r--sources/scalac/ast/Tree.java.tmpl8
1 files changed, 4 insertions, 4 deletions
diff --git a/sources/scalac/ast/Tree.java.tmpl b/sources/scalac/ast/Tree.java.tmpl
index e7e23e54a5..0b130451fe 100644
--- a/sources/scalac/ast/Tree.java.tmpl
+++ b/sources/scalac/ast/Tree.java.tmpl
@@ -119,10 +119,7 @@ public class Tree {
//########################################################################
// Public Methods - duplication
- public static Transformer duplicator =
- new Transformer(
- Global.instance, Global.instance.make,
- new StrictTreeCopier(Global.instance.make));
+ public static Transformer duplicator;
/** Returns a shallow copy of the given array. */
public static Tree[] cloneArray(Tree[] array) {
@@ -168,6 +165,9 @@ public class Tree {
}
public Tree duplicate() {
+ if (duplicator == null) duplicator =new Transformer(
+ Global.instance, Global.instance.make,
+ new StrictTreeCopier(Global.instance.make));
return duplicator.transform(this);
}