7030476: Fix conflicting use of JCTree/JCExpression
authorvromero
Mon, 27 May 2013 13:44:14 +0100
changeset 17807 36cff8c58cdf
parent 17806 b694bd72f635
child 17808 846139633c68
7030476: Fix conflicting use of JCTree/JCExpression Reviewed-by: mcimadamore
langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java
langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java
langtools/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java
langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Fri May 24 11:26:17 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Mon May 27 13:44:14 2013 +0100
@@ -2002,7 +2002,7 @@
         JCStatement rethrow;
         if (target.hasInitCause()) {
             // rethrow = "throw new NoClassDefFoundError().initCause(e);
-            JCTree throwExpr =
+            JCExpression throwExpr =
                 makeCall(makeNewClass(syms.noClassDefFoundErrorType,
                                       List.<JCExpression>nil()),
                          names.initCause,
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Fri May 24 11:26:17 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Mon May 27 13:44:14 2013 +0100
@@ -700,7 +700,7 @@
         public List<JCTypeParameter> getTypeParameters() {
             return typarams;
         }
-        public JCTree getExtendsClause() { return extending; }
+        public JCExpression getExtendsClause() { return extending; }
         public List<JCExpression> getImplementsClause() {
             return implementing;
         }
@@ -1175,7 +1175,7 @@
             return v.visitTry(this, d);
         }
         @Override
-        public List<? extends JCTree> getResources() {
+        public List<JCTree> getResources() {
             return resources;
         }
         @Override
@@ -1392,8 +1392,8 @@
      */
     public static class JCThrow extends JCStatement implements ThrowTree {
         public JCExpression expr;
-        protected JCThrow(JCTree expr) {
-            this.expr = (JCExpression)expr;
+        protected JCThrow(JCExpression expr) {
+            this.expr = expr;
         }
         @Override
         public void accept(Visitor v) { v.visitThrow(this); }
@@ -2466,7 +2466,7 @@
         JCBreak Break(Name label);
         JCContinue Continue(Name label);
         JCReturn Return(JCExpression expr);
-        JCThrow Throw(JCTree expr);
+        JCThrow Throw(JCExpression expr);
         JCAssert Assert(JCExpression cond, JCExpression detail);
         JCMethodInvocation Apply(List<JCExpression> typeargs,
                     JCExpression fn,
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Fri May 24 11:26:17 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Mon May 27 13:44:14 2013 +0100
@@ -340,7 +340,7 @@
 
     public JCTree visitThrow(ThrowTree node, P p) {
         JCThrow t = (JCThrow) node;
-        JCTree expr = copy(t.expr, p);
+        JCExpression expr = copy(t.expr, p);
         return M.at(t.pos).Throw(expr);
     }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Fri May 24 11:26:17 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Mon May 27 13:44:14 2013 +0100
@@ -332,7 +332,7 @@
         return tree;
     }
 
-    public JCThrow Throw(JCTree expr) {
+    public JCThrow Throw(JCExpression expr) {
         JCThrow tree = new JCThrow(expr);
         tree.pos = pos;
         return tree;