Skip to main content

[el-spec commits] [el-spec~source-code:80] Remove assignValue. Use setValue instead.

  • From: kchung@...
  • To: commits@...
  • Subject: [el-spec commits] [el-spec~source-code:80] Remove assignValue. Use setValue instead.
  • Date: Mon, 16 Apr 2012 21:15:03 +0000

Project:    el-spec
Repository: source-code
Revision:   80
Author:     kchung
Date:       2012-04-16 21:15:02 UTC
Link:       

Log Message:
------------
Remove assignValue.  Use setValue instead.



Revisions:
----------
80


Modified Paths:
---------------
trunk/impl/src/main/java/com/sun/el/parser/AstDeferredExpression.java
trunk/impl/src/main/java/com/sun/el/parser/AstSemiColon.java
trunk/impl/src/main/java/com/sun/el/parser/AstDynamicExpression.java
trunk/impl/src/main/java/com/sun/el/parser/SimpleNode.java
trunk/impl/src/main/java/com/sun/el/parser/AstAssign.java
trunk/impl/src/main/java/com/sun/el/parser/AstValue.java
trunk/impl/src/main/java/com/sun/el/parser/Node.java
trunk/impl/src/main/java/com/sun/el/parser/AstIdentifier.java


Diffs:
------
Index: trunk/impl/src/main/java/com/sun/el/parser/SimpleNode.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/parser/SimpleNode.java  (revision 79)
+++ trunk/impl/src/main/java/com/sun/el/parser/SimpleNode.java  (revision 80)
@@ -168,11 +168,6 @@
         throw new 
PropertyNotWritableException(MessageFactory.get("error.syntax.set"));
     }
 
-    public void assignValue(EvaluationContext ctx, Object value)
-            throws ELException {
-        throw new 
PropertyNotWritableException(MessageFactory.get("error.syntax.assign"));
-    }
-
     public void accept(NodeVisitor visitor) throws ELException {
         visitor.visit(this);
         if (this.children != null && this.children.length > 0) {
Index: trunk/impl/src/main/java/com/sun/el/parser/AstSemiColon.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/parser/AstSemiColon.java        
(revision 79)
+++ trunk/impl/src/main/java/com/sun/el/parser/AstSemiColon.java        
(revision 80)
@@ -63,10 +63,4 @@
         this.children[0].getValue(ctx);
         this.children[1].setValue(ctx, value);
     }
-
-    public void assignValue(EvaluationContext ctx, Object value)
-            throws ELException {
-        this.children[0].getValue(ctx);
-        this.children[1].assignValue(ctx, value);
-    }
 }
Index: trunk/impl/src/main/java/com/sun/el/parser/AstDynamicExpression.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/parser/AstDynamicExpression.java      
  (revision 79)
+++ trunk/impl/src/main/java/com/sun/el/parser/AstDynamicExpression.java      
  (revision 80)
@@ -72,9 +72,4 @@
             throws ELException {
         this.children[0].setValue(ctx, value);
     }
-
-    public void assignValue(EvaluationContext ctx, Object value)
-            throws ELException {
-        this.children[0].assignValue(ctx, value);
-    }
 }
Index: trunk/impl/src/main/java/com/sun/el/parser/Node.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/parser/Node.java        (revision 79)
+++ trunk/impl/src/main/java/com/sun/el/parser/Node.java        (revision 80)
@@ -84,7 +84,6 @@
   
   public Object getValue(EvaluationContext ctx) throws ELException;
   public void setValue(EvaluationContext ctx, Object value) throws 
ELException;
-  public void assignValue(EvaluationContext ctx, Object value) throws 
ELException;
   public Class getType(EvaluationContext ctx) throws ELException;
   public ValueReference getValueReference(EvaluationContext ctx)
              throws ELException;
Index: trunk/impl/src/main/java/com/sun/el/parser/AstIdentifier.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/parser/AstIdentifier.java       
(revision 79)
+++ trunk/impl/src/main/java/com/sun/el/parser/AstIdentifier.java       
(revision 80)
@@ -168,34 +168,6 @@
         }
     }
 
-    public void assignValue(EvaluationContext ctx, Object value)
-            throws ELException {
-        // First check if this is a lambda argument
-        Object argValue = ctx.getELContext().getLambdaArgument(this.image);
-        if (argValue != null) {
-            // Lambda arguments are read only
-            return;
-        }
-        VariableMapper varMapper = ctx.getVariableMapper();
-        if (varMapper != null) {
-            ValueExpression expr = varMapper.resolveVariable(this.image);
-            if (expr != null) {
-                expr.setValue(ctx.getELContext(), value);
-                return;
-            }
-        }
-        ctx.setPropertyResolved(false);
-        ELResolver elResolver = ctx.getELResolver();
-        if (value != null) {
-            value = ELSupport.coerceToType(value,
-                        elResolver.getType(ctx, null, this.image));
-        }
-        elResolver.assignValue(ctx, null, this.image, value);
-        if (! ctx.isPropertyResolved()) {
-            ELSupport.throwUnhandled(null, this.image);
-        }
-    }
-
     private final Object invokeTarget(EvaluationContext ctx, Object target,
             Object[] paramValues) throws ELException {
         if (target instanceof MethodExpression) {
Index: trunk/impl/src/main/java/com/sun/el/parser/AstDeferredExpression.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/parser/AstDeferredExpression.java     
  (revision 79)
+++ trunk/impl/src/main/java/com/sun/el/parser/AstDeferredExpression.java     
  (revision 80)
@@ -72,9 +72,4 @@
             throws ELException {
         this.children[0].setValue(ctx, value);
     }
-
-    public void assignValue(EvaluationContext ctx, Object value)
-            throws ELException {
-        this.children[0].assignValue(ctx, value);
-    }
 }
Index: trunk/impl/src/main/java/com/sun/el/parser/AstValue.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/parser/AstValue.java    (revision 79)
+++ trunk/impl/src/main/java/com/sun/el/parser/AstValue.java    (revision 80)
@@ -220,26 +220,6 @@
         }
     }
 
-    public void assignValue(EvaluationContext ctx, Object value)
-            throws ELException {
-        Target t = getTarget(ctx);
-        if (t.isMethodCall()) {
-            throw new PropertyNotWritableException(
-                        MessageFactory.get("error.syntax.set"));
-        }
-        Object property = t.suffixNode.getValue(ctx);
-        ctx.setPropertyResolved(false);
-        ELResolver elResolver = ctx.getELResolver();
-        if (value != null) {
-            value = ELSupport.coerceToType(value,
-                        elResolver.getType(ctx, t.base, property));
-        }
-        elResolver.assignValue(ctx, t.base, property, value);
-        if (! ctx.isPropertyResolved()) {
-            ELSupport.throwUnhandled(t.base, property);
-        }
-    }
-
     public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] 
paramTypes)
             throws ELException {
         Target t = getTarget(ctx);
Index: trunk/impl/src/main/java/com/sun/el/parser/AstAssign.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/parser/AstAssign.java   (revision 79)
+++ trunk/impl/src/main/java/com/sun/el/parser/AstAssign.java   (revision 80)
@@ -55,7 +55,7 @@
             throws ELException {
 
         Object value = children[1].getValue(ctx);
-        children[0].assignValue(ctx, value);
+        children[0].setValue(ctx, value);
         return value;
     }
 }





[el-spec commits] [el-spec~source-code:80] Remove assignValue. Use setValue instead.

kchung 04/16/2012
 
 
Close
loading
Please Confirm
Close