incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daw...@apache.org
Subject svn commit: r820060 [2/3] - in /incubator/imperius/trunk: ./ imperius-javaspl/src/main/java/org/apache/imperius/javaspl/ imperius-splcore/ imperius-splcore/src/main/java/org/apache/imperius/spl/datastore/ imperius-splcore/src/main/java/org/apache/imper...
Date Tue, 29 Sep 2009 18:29:48 GMT
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TripleArgumentExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TripleArgumentExpression.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TripleArgumentExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TripleArgumentExpression.java Tue Sep 29 18:29:44 2009
@@ -25,7 +25,9 @@
 
 package org.apache.imperius.spl.parser.expressions;
 
+import java.util.Iterator;
 import java.util.List;
+import java.util.Vector;
 import java.util.logging.Logger;
 
 import org.apache.imperius.spl.external.Expression;
@@ -173,4 +175,38 @@
     {
     	return null;
     }
+    
+    public Iterator getSubexpressions() {
+    	Vector subexpressions = new Vector();
+    	subexpressions.add(_lhsExp);
+    	subexpressions.add(_midExp);
+    	subexpressions.add(_rhsExp);
+    	return subexpressions.iterator();
+    }
+    
+    //xiping 03/06/09 to support collection analysis
+    public Expression getLHSExpression() {
+    	return _lhsExp;
+    }
+
+    public Expression getMIDExpression() {
+    	return _midExp;
+    }
+
+    public Expression getRHSExpression() {
+    	return _rhsExp;
+    }
+
+    public void replaceLHSExpression(Expression exp) {
+    	_lhsExp = exp;
+    }
+
+    public void replaceMIDExpression(Expression exp) {
+    	_midExp = exp;
+    }
+
+    public void replaceRHSExpression(Expression exp) {
+    	_rhsExp = exp;
+    }
+
 }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Addition.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Addition.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Addition.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Addition.java Tue Sep 29 18:29:44 2009
@@ -29,6 +29,7 @@
 package org.apache.imperius.spl.parser.expressions.impl;
 
 import java.util.List;
+import java.util.Vector;
 import java.util.logging.Logger;
 
 import org.apache.imperius.spl.external.TypeConstants;
@@ -98,8 +99,68 @@
 		}
 
 	}
+    public static Number plus(Vector o) throws IllegalExpressionTypeException {
+    	Number[] operandArray = (Number[]) o.toArray(new Number[0]);
+    	return plus(operandArray);
+    }
 
-	private static Number plus(Number o1, Number o2)
+    public static Number plus(Number[] o) throws IllegalExpressionTypeException
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "plus(Number[])");
+		
+		Number[] o1 = new Number[2];
+
+		Number result = null;
+		for (int i = 0; i < o.length; i++) {
+			if (i == 0) {
+				result = o[i];
+			} else {
+				o1[0] = result;
+				o1[1] = o[i];
+				int resolvedType = TypeResolver.resolveType(o1);
+				
+				if (resolvedType == TypeConstants.doubleType)
+				{
+				    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus(Number[])");
+				    
+				    return new Double(result.doubleValue() + o[i].doubleValue());
+				}
+				else if (resolvedType == TypeConstants.floatType)
+				{
+				    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plusplus(Number[])");
+				    
+				    return new Float(result.floatValue() + o[i].floatValue());
+				}
+				else if (resolvedType == TypeConstants.longType)
+				{
+				    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plusplus(Number[])");
+				    
+				    return new Long(result.longValue() + o[i].longValue());
+				}
+				else if (resolvedType == TypeConstants.shortType)
+				{
+				    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plusplus(Number[])");
+				    
+				    return new Long(result.shortValue() + o[i].shortValue());
+				}
+				else if (resolvedType == TypeConstants.byteType)
+				{
+				    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plusplus(Number[])");
+				    
+				    return new Long(result.byteValue() + o[i].byteValue());
+				}
+				else
+				{
+				    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plusplus(Number[])");
+				    
+				    return new Integer(result.intValue() + o[i].intValue());
+				}
+			}
+		}
+		return result;
+	}
+    
+	public static Number plus(Number o1, Number o2)
 			throws IllegalExpressionTypeException 
 	{
 		logger.entering(sourceClass, Thread.currentThread().getName() + " "

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/AllInCollection.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/AllInCollection.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/AllInCollection.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/AllInCollection.java Tue Sep 29 18:29:44 2009
@@ -350,6 +350,7 @@
         Expression expression1 = (Expression) this._lhsExp;
         Expression expression2 = (Expression) this._midExp;
         Expression expression3 = (Expression) this._rhsExp;
+  //      expression3.validate();
         TypeInfo leftType = expression1.getType();
         TypeInfo middleType = expression2.getType();
         TypeInfo rightType = expression3.getType();

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/AnyInCollection.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/AnyInCollection.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/AnyInCollection.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/AnyInCollection.java Tue Sep 29 18:29:44 2009
@@ -34,6 +34,7 @@
 import org.apache.imperius.spl.external.TypeConstants;
 import org.apache.imperius.spl.parser.exceptions.IllegalParameterTypeException;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.BooleanExpression;
 import org.apache.imperius.spl.parser.expressions.TripleArgumentExpression;
 import org.apache.imperius.spl.parser.util.ExpressionUtility;
 import org.apache.imperius.spl.parser.util.TypeInfo;
@@ -42,8 +43,13 @@
 import org.apache.imperius.util.SPLLogger;
 
 
+//public class AnyInCollection extends TripleArgumentExpression implements
+//Expression
+
+//Xiping 09/15/2009
+//must implements BooleanExpression
 public class AnyInCollection extends TripleArgumentExpression implements
-        Expression
+	BooleanExpression
 {
     
     public String className = InCollection.class.toString();

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Division.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Division.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Division.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Division.java Tue Sep 29 18:29:44 2009
@@ -112,7 +112,7 @@
         }
     }
     
-    private static Number division(Number o1, Number o2) throws SPLException
+    public static Number division(Number o1, Number o2) throws SPLException
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "division");
         

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/EqCollections.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/EqCollections.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/EqCollections.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/EqCollections.java Tue Sep 29 18:29:44 2009
@@ -31,13 +31,19 @@
 import org.apache.imperius.spl.external.Expression;
 import org.apache.imperius.spl.external.TypeConstants;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.BooleanExpression;
 import org.apache.imperius.spl.parser.expressions.DoubleArgumentExpression;
 import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
 
+//public class EqCollections extends DoubleArgumentExpression implements
+//Expression
+
+//Xiping 09/15/2009
+//must implements BooleanExpression
 public class EqCollections extends DoubleArgumentExpression implements
-        Expression
+	BooleanExpression
 {
     
     // private BasicCollectionExpression basicCollection=null;

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Equal.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Equal.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Equal.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Equal.java Tue Sep 29 18:29:44 2009
@@ -150,11 +150,12 @@
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
 
-        String str = this._lhsExp.toString() + "==" + this._rhsExp.toString();
-        	
+        //Xiping 10/14/08
+        //String str = this._lhsExp.toString() + "==" + this._rhsExp.toString();
+        String str = this._lhsExp.toString() + " == " + this._rhsExp.toString();
+        
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
        
         return str;
     }
-    
 }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Greater.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Greater.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Greater.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Greater.java Tue Sep 29 18:29:44 2009
@@ -152,7 +152,9 @@
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
 
-        String str = this._lhsExp.toString() + ">" + this._rhsExp.toString() +")";
+        //Xiping 10/14/08
+        //String str = this._lhsExp.toString() + ">" + this._rhsExp.toString() +")";
+        String str = this._lhsExp.toString() + " > " + this._rhsExp.toString();
         	
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
        

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/GreaterOrEqual.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/GreaterOrEqual.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/GreaterOrEqual.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/GreaterOrEqual.java Tue Sep 29 18:29:44 2009
@@ -148,7 +148,9 @@
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
 
-        String str = this._lhsExp.toString() + ">=" + this._rhsExp.toString() +")";
+        //Xiping 10/14/08
+        //String str = this._lhsExp.toString() + ">=" + this._rhsExp.toString() +")";
+        String str = this._lhsExp.toString() + " >= " + this._rhsExp.toString();
         	
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
        

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/InCollection.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/InCollection.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/InCollection.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/InCollection.java Tue Sep 29 18:29:44 2009
@@ -24,23 +24,28 @@
  */
 package org.apache.imperius.spl.parser.expressions.impl;
 
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.ArrayList;
 import java.util.logging.Logger;
 
 import org.apache.imperius.spl.external.Expression;
 import org.apache.imperius.spl.external.TypeConstants;
 import org.apache.imperius.spl.parser.exceptions.IllegalParameterTypeException;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.BooleanExpression;
 import org.apache.imperius.spl.parser.expressions.DoubleArgumentExpression;
 import org.apache.imperius.spl.parser.util.ExpressionUtility;
 import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
 
+//public class InCollection extends DoubleArgumentExpression implements
+//        Expression
+
+//Xiping 03/19/2009
 public class InCollection extends DoubleArgumentExpression implements
-        Expression
+        BooleanExpression
 {
     
     public String className = InCollection.class.toString();

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Less.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Less.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Less.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Less.java Tue Sep 29 18:29:44 2009
@@ -142,11 +142,14 @@
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
 
-        String str = this._lhsExp.toString() + "<" + this._rhsExp.toString();
+        //xiping 10/14/08
+        //String str = this._lhsExp.toString() + "<" + this._rhsExp.toString();
+        String str = this._lhsExp.toString() + " < " + this._rhsExp.toString();
         	
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
        
         return str;
     }
+
     
 }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LessOrEqual.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LessOrEqual.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LessOrEqual.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LessOrEqual.java Tue Sep 29 18:29:44 2009
@@ -138,7 +138,9 @@
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
 
-        String str = this._lhsExp.toString() + "<=" + this._rhsExp.toString();
+        //Xiping 10/14/08
+        //String str = this._lhsExp.toString() + "<=" + this._rhsExp.toString();
+        String str = this._lhsExp.toString() + " <= " + this._rhsExp.toString();
         	
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
        

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalAnd.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalAnd.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalAnd.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalAnd.java Tue Sep 29 18:29:44 2009
@@ -118,10 +118,14 @@
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
 
-        String str = this._lhsExp.toString() + "&&" + this._rhsExp.toString();
+        //Xiping 10/14/08
+        //String str = this._lhsExp.toString() + "&&" + this._rhsExp.toString();
+        
+        String str = "(" + this._lhsExp.toString() + " && " + this._rhsExp.toString() + ")";
         	
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
        
         return str;
     }
+
 }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalNot.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalNot.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalNot.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalNot.java Tue Sep 29 18:29:44 2009
@@ -125,12 +125,13 @@
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
 
-        String str = "LogicalNot("+this._exp.toString() + ")";
-        	
+        //Xiping 03/19/2009
+        //String str = "LogicalNot("+this._exp.toString() + ")";
+        String str = "!("+this._exp.toString() + ")";
+        
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
        
         return str;
     }
-
     
 }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalOr.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalOr.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalOr.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalOr.java Tue Sep 29 18:29:44 2009
@@ -118,16 +118,16 @@
      
         return false;
     }
-    
+
+    //Xiping 10/14/08
     public String toString()
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
 
-        String str = this._lhsExp.toString() + " || " + this._rhsExp.toString();
+        String str = "(" + this._lhsExp.toString() + " || " + this._rhsExp.toString() + ")";
         	
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
        
         return str;
     }
-
 }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalXor.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalXor.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalXor.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalXor.java Tue Sep 29 18:29:44 2009
@@ -124,8 +124,11 @@
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
 
-        String str = "LogicalXor("+this._lhsExp.toString() + "," + this._rhsExp.toString() + ")";
+        //String str = "LogicalXor("+this._lhsExp.toString() + "," + this._rhsExp.toString() + ")";
         	
+        //Xiping 10/14/08
+        String str = "(" + this._lhsExp.toString() + " ^ " + this._rhsExp.toString() + ")";
+        
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
        
         return str;

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Product.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Product.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Product.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Product.java Tue Sep 29 18:29:44 2009
@@ -25,6 +25,7 @@
 package org.apache.imperius.spl.parser.expressions.impl;
 
 import java.util.List;
+import java.util.Vector;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -177,6 +178,100 @@
 //            throw new SPLException("operand is null  LHS="+o1+" RHS="+o2);
 //        }
 //    }
+
+    public static Number product(Vector o) {
+    	Number[] operandArray = (Number[]) o.toArray(new Number[0]);
+    	return product(operandArray);
+    }
+
+    public static Number product(Number[] o)
+    {
+        logger.entering(sourceClass, "product(Number[])");
+        
+        Number result = null;
+        for (int i = 0; i < o.length; i++) {
+        	if (i == 0) {
+        		result = o[i];
+        	} else {
+        		result = new Double(result.doubleValue() * o[i].doubleValue());
+        	}
+        }
+
+        logger.exiting(sourceClass, "product(Number[])");
+
+        return result;
+    }
+
+    public static Number product(Number o1, Number o2) throws SPLException
+    {
+        logger.entering(sourceClass, "evaluate");
+        
+        Number[] o = new Number[2];
+        o[0] = o1;
+        o[1] = o2;
+        
+        if((o1!=null)&&(o2!=null))
+        {
+            
+            //if (resolvedType == TypeConstants.doubleType)
+            //{
+            
+            
+            Double result=new Double(o1.doubleValue() * o2.doubleValue());
+            if(logger.isLoggable(Level.FINE))
+                logger.fine("result "+result);
+            logger.exiting(sourceClass, "evaluate");
+            
+            return result;
+            /* }
+            else if (resolvedType == TypeConstants.floatType)
+            {
+                logger.exiting(sourceClass, "evaluate");
+                
+                Float result=new Float(o1.floatValue() * o2.floatValue());
+                if(logger.isLoggable(Level.FINE))
+                    logger.fine("result "+result);
+                
+                return result;
+            }
+            else if (resolvedType == TypeConstants.longType)
+            {
+                logger.exiting(sourceClass, "evaluate");
+                
+                Long result=new Long(o1.longValue() * o2.longValue());
+                if(logger.isLoggable(Level.FINE))
+                    logger.fine("result "+result);
+                
+                return result;
+            }
+            else if (resolvedType == TypeConstants.intType)
+            {
+                logger.exiting(sourceClass, "evaluate");
+                
+                Long result=new Long(o1.intValue() * o2.intValue());
+                if(logger.isLoggable(Level.FINE))
+                    logger.fine("result "+result);
+                
+                return result;
+            }
+            else
+            {
+                logger.exiting(sourceClass, "evaluate");
+                
+                Integer result=new Integer(o1.byteValue() * o2.byteValue());
+                if(logger.isLoggable(Level.FINE))
+                    logger.fine("result "+result);
+                
+                return result;
+            }*/
+        }
+        else
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"operand is null  LHS="+o1+" RHS="+o2);
+            
+            throw new SPLException("operand is null  LHS="+o1+" RHS="+o2);
+        }
+    }
     
     public boolean validate() throws SPLException
     {

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/StringConstant.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/StringConstant.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/StringConstant.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/StringConstant.java Tue Sep 29 18:29:44 2009
@@ -29,12 +29,14 @@
 import org.apache.imperius.spl.external.TypeConstants;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
 import org.apache.imperius.spl.parser.expressions.ConstantExpression;
+import org.apache.imperius.spl.parser.expressions.StringExpression;
 import org.apache.imperius.spl.parser.util.TypeInfo;
 import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
-
-public class StringConstant extends ConstantExpression
+//Xiping 06/13/08
+//public class StringConstant extends ConstantExpression
+public class StringConstant extends ConstantExpression implements StringExpression
 {
     
     private String stringValue;
@@ -104,7 +106,9 @@
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
         
-        String str=this.stringValue;
+        //xiping 03/18/2009
+        //String str=this.stringValue;
+        String str = "\"" + this.stringValue + "\"";
         
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
        

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/SubCollection.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/SubCollection.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/SubCollection.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/SubCollection.java Tue Sep 29 18:29:44 2009
@@ -31,14 +31,20 @@
 import org.apache.imperius.spl.external.Expression;
 import org.apache.imperius.spl.external.TypeConstants;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.BooleanExpression;
 import org.apache.imperius.spl.parser.expressions.DoubleArgumentExpression;
 import org.apache.imperius.spl.parser.util.TypeResolver;
 import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
 
+//public class SubCollection extends DoubleArgumentExpression implements
+//        Expression
+
+// Xiping 09/15/2009
+// must implements BooleanExpression
 public class SubCollection extends DoubleArgumentExpression implements
-        Expression
+	BooleanExpression
 {
     
     // private BasicCollectionExpression basicCollection=null;

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Subtraction.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Subtraction.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Subtraction.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Subtraction.java Tue Sep 29 18:29:44 2009
@@ -93,8 +93,46 @@
 
         }
     }
+    public static Number minus(Number o1) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "minus(Number)");
+        
+        Number[] o = new Number[1];
+        o[0] = o1;
+        
+        int resolvedType = TypeResolver.resolveType(o);
+        
+        if (resolvedType == TypeConstants.doubleType)
+        {
+            double result = o1.doubleValue() * (-1);
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
+            
+            return new Double(result);
+        }
+        else if (resolvedType == TypeConstants.floatType)
+        {
+            float result = o1.floatValue() * (-1);
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
+            
+            return new Float(result);
+        }
+        else if (resolvedType == TypeConstants.longType)
+        {
+            long result = o1.longValue() * (-1);
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
+            
+            return new Long(result);
+        }
+        else
+        {
+            int result = o1.intValue() * (-1);
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
+            
+            return new Integer(result);
+        }
+    }
     
-    private static Number minus(Number o1, Number o2) throws SPLException
+    public static Number minus(Number o1, Number o2) throws SPLException
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "minus");
 

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/factory/BuitInOperationExpressionFactory.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/factory/BuitInOperationExpressionFactory.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/factory/BuitInOperationExpressionFactory.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/factory/BuitInOperationExpressionFactory.java Tue Sep 29 18:29:44 2009
@@ -238,7 +238,10 @@
 
 			if (symTab.symbolExists(id1, recurse)) 
 			{
-				Symbol symbol = symTab.getSymbol(id1);
+//				TODO xiping
+//				Collection c = symTab.getSymbol(id1);
+				Symbol symbol = (Symbol)symTab.getSymbol(id1);
+//				Symbol symbol = null;
 				if (symbol instanceof MacroSymbol) 
 				{
 					returnExpr = new MacroExpression((MacroSymbol) symbol,

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/factory/ExpressionFactory.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/factory/ExpressionFactory.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/factory/ExpressionFactory.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/factory/ExpressionFactory.java Tue Sep 29 18:29:44 2009
@@ -33,7 +33,11 @@
 import org.apache.imperius.spl.parser.compiler.SPLTreeParserTokenTypes;
 import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.expression.primary.*;
+import org.apache.imperius.spl.parser.expression.primary.BasicCollectionExpression;
+import org.apache.imperius.spl.parser.expression.primary.CollectOperation;
+import org.apache.imperius.spl.parser.expression.primary.PostCollectExpression;
+import org.apache.imperius.spl.parser.expression.primary.PrimaryExpression;
+import org.apache.imperius.spl.parser.expression.primary.SelfExpression;
 import org.apache.imperius.spl.parser.expressions.impl.Addition;
 import org.apache.imperius.spl.parser.expressions.impl.AssignmentExpression;
 import org.apache.imperius.spl.parser.expressions.impl.BooleanConstant;
@@ -50,6 +54,7 @@
 import org.apache.imperius.spl.parser.expressions.impl.Less;
 import org.apache.imperius.spl.parser.expressions.impl.LessOrEqual;
 import org.apache.imperius.spl.parser.expressions.impl.LogicalAnd;
+import org.apache.imperius.spl.parser.expressions.impl.LogicalNot;
 import org.apache.imperius.spl.parser.expressions.impl.LogicalOr;
 import org.apache.imperius.spl.parser.expressions.impl.LogicalXor;
 import org.apache.imperius.spl.parser.expressions.impl.LongConstant;
@@ -59,7 +64,6 @@
 import org.apache.imperius.spl.parser.expressions.impl.StringConstant;
 import org.apache.imperius.spl.parser.expressions.impl.Subtraction;
 import org.apache.imperius.spl.parser.expressions.impl.UnaryMinusExpression;
-import org.apache.imperius.spl.parser.expressions.impl.UnaryNotExpression;
 import org.apache.imperius.spl.parser.expressions.impl.UnaryPlusExpression;
 import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
@@ -88,7 +92,7 @@
 		// System.out.println("creating expression " + e1.getClass() + " "+
 		// e2.getClass() + " " + type);
 		Expression returnExpr = null;
-		List exprList = new ArrayList();
+		List exprList = new ArrayList(2);	// DAW
 
 		exprList.add(e1);
 		exprList.add(e2);
@@ -176,7 +180,7 @@
 
 		Expression returnExpr = null;
 
-		List exprList = new ArrayList();
+		List exprList = new ArrayList(1);	// DAW
 		exprList.add(e1);
 		boolean validateExpr = true;
 		if (sTab.getSymbolTableType() == SPLSymbolTable.COLLECT) 
@@ -194,7 +198,9 @@
 			break;
 
 		case SPLTreeParserTokenTypes.UNARY_NOT:
-			returnExpr = new UnaryNotExpression(exprList, validateExpr);
+			//Xiping 06/12/08
+			//returnExpr = new UnaryNotExpression(exprList, validateExpr);
+			returnExpr = new LogicalNot(exprList, validateExpr);
 
 		}
 

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/AnchorMethodInvokeAction.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/AnchorMethodInvokeAction.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/AnchorMethodInvokeAction.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/AnchorMethodInvokeAction.java Tue Sep 29 18:29:44 2009
@@ -25,6 +25,7 @@
 package org.apache.imperius.spl.parser.statements.actions.impl;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 import java.util.logging.Logger;
@@ -104,25 +105,170 @@
         }
     }
 
+//    public static void validateActualParameters(SPLSymbolTable symTab,
+//        String classNameOrVariableName, String methodName, List pList)
+//        throws SPLException 
+//    {
+//	        
+//    	// xiping's addition to support Java overloading, 06/19/09
+//    	Collection c = symTab.getSymbol(classNameOrVariableName + "." + methodName);
+//    	MethodSymbol methodSym = null;
+//    	for (Iterator it = c.iterator(); it.hasNext();) {
+//    		methodSym = (MethodSymbol) it.next();
+//    		List argTypeList = methodSym.getArgumentList();
+//    		
+//    		if (argTypeList.size() != pList.size()) {
+//    			continue;
+//    		}
+//    		
+//			boolean notEqual = false;
+//			for (int i = 0; i < argTypeList.size(); i++) {
+//				Expression exp = (Expression)pList.get(i);
+//				Argument arg = (Argument)argTypeList.get(i);
+//				TypeInfo expDataType = exp.getType();
+//				TypeInfo argDataType = arg.getType();
+////				if (expDataType.getIsArray() != argDataType.getIsArray() ||
+////						expDataType.getType() != argDataType.getType()) {
+//				if (expDataType.getType() != argDataType.getType()) {
+//					notEqual = true;
+//					break;
+//				}
+//			}
+//			
+//			if (notEqual) {
+//				continue;
+//			}
+//
+//			break;
+//    	}
+//    	
+//		if (methodSym == null) {
+//			throw new SPLException("actual parameter validation failed: " + methodName + "does not exit");
+//		}
+//    	// end	        	
+//
+//        //Xiping 05/30/09 commented the original code below
+//		List argTypeList = methodSym.getArgumentList();
+//		
+//        Iterator formalParamTypeIt = argTypeList.iterator();
+//        Iterator actualParamIt = pList.iterator();
+//        if (argTypeList.size() == pList.size()) 
+//        {
+//            while (formalParamTypeIt.hasNext() && actualParamIt.hasNext()) 
+//            {
+//                Argument formalArg = (Argument) formalParamTypeIt.next();
+//                Expression actualParam = (Expression) actualParamIt.next();
+//                if (!TypeResolver.isTypeAssignableForEquality(formalArg
+//                        .getType(), actualParam.getType())
+//                        /* || formalArg.getIsArray() != actualParam.isArray() */) 
+//                
+//                {
+//                    throw new SPLException(
+//							Messages
+//									.getString("SPL_METHOD_PASSED_ARGUMENTS_EXCEPTION_MSG")
+//									+ " " + methodName);
+//                }
+//
+//            }
+//        } 
+//        else 
+//        {
+//            System.err
+//                    .println("Number of Formal and passed parameters don't match for method "
+//                            + methodName);
+//            //          throw new SPLException("Number of Formal and passed parameters don't match for method "
+//            //          + methodName);
+//        }
+//
+//    }
+
     public static void validateActualParameters(SPLSymbolTable symTab,
             String classNameOrVariableName, String methodName, List pList)
             throws SPLException 
     {
-        MethodSymbol methodSym = (MethodSymbol) symTab
-                .getSymbol(classNameOrVariableName + "." + methodName);
+
+    	// xiping's addition to support Java overloading, 06/19/09
+    	Collection c = (Collection)symTab.getSymbol(classNameOrVariableName + "." + methodName);
+    	MethodSymbol methodSym = null;
+    	for (Iterator it = c.iterator(); it.hasNext();) {
+    		methodSym = (MethodSymbol) it.next();
+    		List argTypeList = methodSym.getArgumentList();
+    		
+    		if (argTypeList.size() != pList.size()) {
+    			continue;
+    		}
+    		
+			boolean typeNotEqual = false;
+			for (int i = 0; i < argTypeList.size(); i++) {
+				Expression exp = (Expression)pList.get(i);
+				Argument arg = (Argument)argTypeList.get(i);
+				TypeInfo expDataType = exp.getType();
+				TypeInfo argDataType = arg.getType();
+//				if (expDataType.getIsArray() != argDataType.getIsArray() ||
+//						expDataType.getType() != argDataType.getType()) {
+				if (expDataType.getType() != argDataType.getType()) {
+					typeNotEqual = true;
+					break;
+				}
+			}
+			
+			if (typeNotEqual) {
+				continue;
+			}
+
+			break;
+    	}
+    	
+		if (methodSym == null) {
+			throw new SPLException("actual parameter validation failed: " + methodName + "does not exit");
+		}
+    	// end	       
+    	
         List argTypeList = methodSym.getArgumentList();
 
         Iterator formalParamTypeIt = argTypeList.iterator();
         Iterator actualParamIt = pList.iterator();
+
+        //Xiping 05/30/09
+        //1) argTypeList.size() will be different from pList.size()
+        //if there are overloaded methods in an anchor class.
+        //
+        //2) formalArg.getIsArray() is different from actualParam.isArray()
+        //if an argument passed in is of array return type as SPL does not
+        //carry return type info correctly except for collection expressions.
+        if (true)
+        {
+            while (formalParamTypeIt.hasNext() && actualParamIt.hasNext())
+            {
+                Argument formalArg = (Argument) formalParamTypeIt.next();
+                Expression actualParam = (Expression) actualParamIt.next();
+                
+                if (!TypeResolver.isTypeAssignableForEquality(formalArg
+                        .getType(), actualParam.getType())) 
+                {
+                    throw new SPLException(
+							Messages
+									.getString("SPL_METHOD_PASSED_ARGUMENTS_EXCEPTION_MSG")
+									+ " " + methodName);
+                }
+
+            }
+        } 
+
+
+        //Xiping 05/30/09 commented the original code below
+/*
         if (argTypeList.size() == pList.size()) 
         {
             while (formalParamTypeIt.hasNext() && actualParamIt.hasNext()) 
             {
                 Argument formalArg = (Argument) formalParamTypeIt.next();
                 Expression actualParam = (Expression) actualParamIt.next();
+
                 if (!TypeResolver.isTypeAssignableForEquality(formalArg
                         .getType(), actualParam.getType())
                         || formalArg.getIsArray() != actualParam.isArray()) 
+                
                 {
                     throw new SPLException(
 							Messages
@@ -132,6 +278,7 @@
 
             }
         } 
+*/
         else 
         {
             System.err
@@ -258,6 +405,7 @@
         return false;
     }
 
+	// xiping's addition to support Java overloading, 06/19/09
     public static Object invokeClassMethod(SPLSymbolTable symTab,
             String className, String qualifier, String methodName,
             List paramList, Object targetObject) throws SPLException
@@ -265,8 +413,39 @@
         List parameterObjects = new ArrayList();
         try 
         {
-            MethodSymbol methodSym = (MethodSymbol) symTab.getSymbol(className
-                    + "." + methodName);
+        	MethodSymbol methodSym = null;
+        	Collection c = (Collection)symTab.getSymbol(className + "." + methodName);
+    		for (Iterator it = c.iterator(); it.hasNext();) {
+        		methodSym = (MethodSymbol) it.next();
+        		List argTypeList = methodSym.getArgumentList();
+        		
+        		if (argTypeList.size() != paramList.size()) {
+        			continue;
+        		}
+    			boolean typeNotEqual = false;
+    			for (int i = 0; i < argTypeList.size(); i++) {
+    				Expression exp = (Expression)paramList.get(i);
+    				ArgumentImpl arg = (ArgumentImpl)argTypeList.get(i);
+    				TypeInfo expDataType = exp.getType();
+    				TypeInfo argDataType = arg.getType();
+//    				if (expDataType.getIsArray() != argDataType.getIsArray() ||
+//    						expDataType.getType() != argDataType.getType()) {
+    				if (expDataType.getType() != argDataType.getType()) {
+    					typeNotEqual = true;
+    					break;
+    				}
+    			}
+    			if (typeNotEqual) {
+    				continue;
+    			} 
+        		
+    			break;
+        	}
+
+    		if (methodSym == null) {
+    			throw new SPLException("invokeClassMethod failed: " + methodName + "does not exit");
+    		}
+
             List argTypeList = methodSym.getArgumentList();
 
             for (int i = 0; i < paramList.size(); i++) 
@@ -370,8 +549,16 @@
                     } 
                     if(!isArgCreated)
                     {
-	                    Argument arg = new ArgumentImpl(exp.getType().getType(),
-	                            null, exp.isArray(), null);
+                    	//Xiping 05/29/09
+                    	//get isArray flag from the formal argument list if available
+                    	boolean flag = exp.isArray();
+                    	if(argTypeList != null && i < argTypeList.size()) {
+							flag = ((Argument)argTypeList.get(i)).getType().getIsArray();
+						}
+//                    	
+                    	Argument arg = new ArgumentImpl(exp.getType().getType(),
+//	                            null, exp.isArray(), null);
+	                            null, flag, null);
 	                    arg.setValue(result);
 	                    parameterObjects.add(arg);
                     }
@@ -405,4 +592,189 @@
         }
     }
 
+//    public static Object invokeClassMethod(SPLSymbolTable symTab,
+//            String className, String qualifier, String methodName,
+//            List paramList, Object targetObject) throws SPLException
+//    {
+//
+//    	// xiping's addition to support Java overloading, 06/19/09
+//    	// start
+//    	MethodSymbol methodSym = null;
+//    	Collection c = (Collection)symTab.getSymbol(className + "." + methodName);
+//		for (Iterator it = c.iterator(); it.hasNext();) {
+//    		methodSym = (MethodSymbol) it.next();
+//    		List argTypeList = methodSym.getArgumentList();
+//    		
+//    		if (argTypeList.size() != paramList.size()) {
+//    			continue;
+//    		}
+//			boolean typeNotEqual = false;
+//			for (int i = 0; i < argTypeList.size(); i++) {
+//				Expression exp = (Expression)paramList.get(i);
+//				ArgumentImpl arg = (ArgumentImpl)argTypeList.get(i);
+//				TypeInfo expDataType = exp.getType();
+//				TypeInfo argDataType = arg.getType();
+////				if (expDataType.getIsArray() != argDataType.getIsArray() ||
+////						expDataType.getType() != argDataType.getType()) {
+//				if (expDataType.getType() != argDataType.getType()) {
+//					typeNotEqual = true;
+//					break;
+//				}
+//			}
+//			if (typeNotEqual) {
+//				continue;
+//			} 
+//    		
+//			break;
+//    	}
+//	    	
+//    	if (methodSym == null) {
+//			throw new SPLException("invokeClassMethod failed: " + methodName + "does not exit");
+//		}
+//    	// end
+//    	
+//        List parameterObjects = new ArrayList();
+//        try 
+//        {
+//            List argTypeList = methodSym.getArgumentList();
+//
+//            for (int i = 0; i < paramList.size(); i++) 
+//            {
+//                Expression exp = (Expression) paramList.get(i);
+//
+//                if (exp instanceof AssignmentExpression) {
+//                    //System.out.println("assignment Expression");
+//                    Expression lhsExpression = null;
+//                    Expression rhsExpression = null;
+//
+//                    AssignmentExpression assignmentExpression = (AssignmentExpression) exp;
+//                    if (assignmentExpression.getLHSExpression() instanceof org.apache.imperius.spl.external.Expression) 
+//                    {
+//                        lhsExpression = (Expression) assignmentExpression
+//                                .getLHSExpression();
+//                    }
+//                    if (assignmentExpression.getRHSExpression() instanceof org.apache.imperius.spl.external.Expression) {
+//                        rhsExpression = (Expression) assignmentExpression
+//                                .getRHSExpression();
+//                    }
+//                    if ((lhsExpression == null) || (rhsExpression == null)) 
+//                    {
+//                        logger
+//                                .severe("LHS or RHS or argument in method call is null : "
+//                                        + lhsExpression.toString()
+//                                        + " "
+//                                        + rhsExpression);
+//
+//                        throw new SPLException(Messages.getString(
+//								"SPL_ASSIGNMENT_EXP_EXCEPTION_MSG",
+//								new Object[] { lhsExpression, rhsExpression }));
+//                    }
+//                    //System.out.println("lhsExpression class "+ lhsExpression.getClass());
+//                    //System.out.println("lhsExpression getPropertyName() "+ ((PrimaryExpression) lhsExpression).getPropertyName());
+//                    // ((PrimaryExpression)lhsExpression).getPropertyName();
+//
+//                    String keyName = ((PrimaryExpression) lhsExpression)
+//                            .getclassNameOrInstanceVariableName();
+//                    //System.out.println("argument name= " + keyName);
+//
+//                    Object keyValue = rhsExpression.evaluate();
+//                    //System.out.println("argument value= " + keyValue);
+//
+//                    String referenceTypeName = "";
+//
+//                    if (TypeResolver.isReference(rhsExpression.getType())) 
+//                    {
+//
+//                        referenceTypeName = rhsExpression.getType()
+//                                .getReferenceTypeName();
+//                        
+//                    }
+//
+//                    if (keyValue != null) 
+//                    {
+//                        Argument arg = new ArgumentImpl(rhsExpression.getType()
+//                                .getType(), keyName, rhsExpression.isArray(),
+//                                referenceTypeName);
+//                        arg.setValue(keyValue);
+//
+//                        //System.out.println("created new arg :"+keyName+" "+keyValue.toString());
+//                        /*
+//                         * Expression expression=(Expression)pList.get(i); String
+//                         * nameAndValue=(String)expression.evaluate(); Key
+//                         */
+//                        parameterObjects.add(arg);
+//                    }
+//
+//                } 
+//                else 
+//                {
+//                    Object result = exp.evaluate();
+//                    boolean isArgCreated = false;
+//                    if(argTypeList != null && argTypeList.size() > 0)
+//                    {
+//                    	Argument tempArg = null;
+//	                    if(i < argTypeList.size())
+//	                    {
+//	                    	tempArg = (Argument)argTypeList.get(i);
+//	                    	if(TypeResolver.isReference(tempArg.getType()))
+//	                    	{
+//	                    		if (TypeResolver.OBJECT_STRING.equals(tempArg
+//										.getType().getReferenceTypeName())
+//										&& TypeResolver.isString(exp.getType())) 
+//	                    		{
+//									Argument arg = new ArgumentImpl(tempArg
+//											.getType().getType(), null, tempArg
+//											.getType().getIsArray(),
+//											TypeResolver.OBJECT_STRING);
+//									arg.setValue(result);
+//									parameterObjects.add(arg);
+//									isArgCreated = true;
+//								}
+//	                    	}
+//	                    }
+//	                    else
+//	                    {
+//	                    	// throw exception
+//	                    }
+//                    } 
+//                    if(!isArgCreated)
+//                    {
+//                    	//Xiping 05/29/09
+//                    	Argument arg = new ArgumentImpl(exp.getType().getType(),
+//                    			//null, exp.isArray(), null);
+//	                            null, result.getClass().isArray(), null);
+//	                    arg.setValue(result);
+//
+//	                    parameterObjects.add(arg);
+//                    }
+//                }
+//            }
+//
+//            Actuator ac = ActuatorFactory.getActuator();
+//
+//            Object result = ac.invokeMethod(className, qualifier, targetObject,
+//                    methodName, parameterObjects);
+//
+//            //System.out.println("method invokation complete : "+className+" "+qualifier+" "+methodName+" "+targetObject);
+//            //System.out.println("method invokation result of invokation : "+result);
+//
+//            // TO DO COMPARE RESULT WITH CONSTANT
+//
+//            if (result == null)
+//                result = "";
+//
+//            return result;
+//        } 
+//        catch (SPLException e) 
+//        {
+//            logger.severe(e.getMessage());
+//
+//            logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+//                    + "execute");
+//
+//          //  return null;
+//            throw e;
+//        }
+//    }
+
 }
\ No newline at end of file

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/ArrowActionBlock.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/ArrowActionBlock.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/ArrowActionBlock.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/ArrowActionBlock.java Tue Sep 29 18:29:44 2009
@@ -57,6 +57,7 @@
      * whole block returns failure. If the first block succeeds, the second
      * block is evaluated and the whole block returns whatever the second block
      * returns.
+     * @throws SPLException 
      */
     public boolean execute(Actuator ac) throws SPLException
     {

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/ConcurrentActionBlock.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/ConcurrentActionBlock.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/ConcurrentActionBlock.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/ConcurrentActionBlock.java Tue Sep 29 18:29:44 2009
@@ -53,6 +53,7 @@
      * If the block is of the form &lt;action block&gt; || &lt;action block&gt;, both blocks
      * are evaluated concurrently and the whole block succeeds as soon as one of
      * the two internal blocks succeeds.
+     * @throws SPLException 
      */
     public boolean execute(Actuator ac) throws SPLException
     {

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/ExtrinsicMethodInvokeAction.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/ExtrinsicMethodInvokeAction.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/ExtrinsicMethodInvokeAction.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/ExtrinsicMethodInvokeAction.java Tue Sep 29 18:29:44 2009
@@ -59,4 +59,8 @@
 //		return false;
 	}
 
+	//Xiping 06/13/08
+	public Expression getActionExpression() {
+		return _actionExpression;
+	}
 }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/LogicalAndActionBlock.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/LogicalAndActionBlock.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/LogicalAndActionBlock.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/LogicalAndActionBlock.java Tue Sep 29 18:29:44 2009
@@ -55,6 +55,7 @@
      * If the block is of the form &lt;action block&gt; && &lt;action block&gt;, both blocks
      * may be evaluated concurrently and the whole block succeeds if both
      * internal blocks return success.
+     * @throws SPLException 
      */
     public boolean execute(Actuator ac) throws SPLException
     {

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/LogicalOrActionBlock.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/LogicalOrActionBlock.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/LogicalOrActionBlock.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/LogicalOrActionBlock.java Tue Sep 29 18:29:44 2009
@@ -57,6 +57,7 @@
      * second block is not evaluated. If the first block fails, the second block
      * is evaluated and the whole block returns whatever the second block
      * returns.
+     * @throws SPLException 
      */
     public boolean execute(Actuator ac) throws SPLException
     {

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/DeclarationStatement.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/DeclarationStatement.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/DeclarationStatement.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/DeclarationStatement.java Tue Sep 29 18:29:44 2009
@@ -113,10 +113,15 @@
 		{
 			ConstantDefinition cd = (ConstantDefinition)constantList.get(i);
 			Expression e=cd.getInitExpr();
-			logger.fine(Thread.currentThread().getName()+ "constant expression "+e.toString());
+			if(logger.isLoggable(Level.FINE))
+				logger.fine(Thread.currentThread().getName()+ "constant expression "+e.toString());
             Object result = e.evaluate();
 			String constantSymbol = cd.getIdent();
+			// xiping's modification, 06/23/09
 			PropertySymbol constantSym = (PropertySymbol)symTab.getSymbol(constantSymbol);
+//			Collection c = symTab.getSymbol(constantSymbol);
+//			Iterator it = c.iterator();
+//			PropertySymbol constantSym = (PropertySymbol)it.next();
             if(logger.isLoggable(Level.FINE))
                 logger.fine(Thread.currentThread().getName()+"constantSym name"+ constantSym.getName()+" current value:"+constantSym.getValue()+" setting value to:"+result.toString());
             

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ImportStatement.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ImportStatement.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ImportStatement.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/ImportStatement.java Tue Sep 29 18:29:44 2009
@@ -72,19 +72,20 @@
 		this._anchorClassName = anchorClassName;
 		this._expr = e;
 		this._symTab = symTab;
-		_importInstanceInfoList=new ArrayList();
-		Iterator it=importInstanceInfoList.iterator();
-		while(it.hasNext())
-		{
-			InstanceInfo iinfo=(InstanceInfo)it.next();
-			//NRJ
-			//if(!iinfo.isCollectInstance())
-			{
-				this._importInstanceInfoList.add(iinfo);
-			}
-			
-			
-		}
+		_importInstanceInfoList=new ArrayList(importInstanceInfoList);
+// DAW 12/30/2008
+//		Iterator it=importInstanceInfoList.iterator();
+//		while(it.hasNext())
+//		{
+//			InstanceInfo iinfo=(InstanceInfo)it.next();
+//			//NRJ
+//			//if(!iinfo.isCollectInstance())
+//			{
+//				this._importInstanceInfoList.add(iinfo);
+//			}
+//			
+//			
+//		}
 		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "ImportStatement");
         
 	}

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/PolicyDefinition.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/PolicyDefinition.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/PolicyDefinition.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/PolicyDefinition.java Tue Sep 29 18:29:44 2009
@@ -195,9 +195,9 @@
                 		"evaluating condition of Policy Definition");
             }    
             conditionResult = (Boolean)_condition.evaluate();
-            System.out.println("     "+"policy :"+_condition.toString());
+//            System.out.println("     "+"policy :"+_condition.toString());
             auditloggerString+="     "+"policy :"+_condition.toString()+"\n";
-            System.out.println("     "+"result :"+conditionResult);
+//            System.out.println("     "+"result :"+conditionResult);
             auditloggerString+="     "+"result :"+conditionResult+"\n";
             
 			

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/SPLPolicy.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/SPLPolicy.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/SPLPolicy.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/impl/SPLPolicy.java Tue Sep 29 18:29:44 2009
@@ -39,7 +39,6 @@
 import org.apache.imperius.spl.parser.exceptions.SPLException;
 import org.apache.imperius.spl.parser.statements.EvaluationResults;
 import org.apache.imperius.spl.parser.statements.PolicyStatement;
-import org.apache.imperius.spl.parser.statements.PolicyStatementResult;
 import org.apache.imperius.util.SPLLogger;
 
 
@@ -77,26 +76,50 @@
 
 	}
 
-	private ArrayList sortPoliciesByPriority(ArrayList list) 
+//	private ArrayList sortPoliciesByPriority(ArrayList list) 
+//	{
+//		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "sortPoliciesByPriority");
+//		
+//		for(int i=0; i<list.size(); i++)
+//		{
+//			for(int j=i+1; j<list.size()-1; j++)
+//			{
+//				PolicyStatement pStatement = (PolicyStatement)list.get(i);
+//				PolicyStatement pStatementNext = (PolicyStatement)list.get(j);
+//				if(pStatement.getPriority() < pStatementNext.getPriority())
+//				{
+//					PolicyStatement temp = pStatement;
+//					pStatement = pStatementNext;
+//					pStatementNext = temp;
+//				}
+//			}
+//		}
+//		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "sortPoliciesByPriority");
+//		return list;
+//	}
+
+	//Changed by Xiping to comply with the CIM-SPL specification
+	private ArrayList sortPoliciesByPriority(ArrayList al) 
 	{
 		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "sortPoliciesByPriority");
 
-		for(int i=0; i<list.size(); i++)
-		{
-			for(int j=i+1; j<list.size()-1; j++)
-			{
-				PolicyStatement pStatement = (PolicyStatement)list.get(i);
+		ArrayList list = (ArrayList) al.clone(); 
+		ArrayList result = new ArrayList();
+		while (list.size() > 0) {
+			int index = 0;
+			for(int j = 1; j < list.size(); j++) {
+				PolicyStatement pStatement = (PolicyStatement)list.get(0);
 				PolicyStatement pStatementNext = (PolicyStatement)list.get(j);
-				if(pStatement.getPriority() < pStatementNext.getPriority())
-				{
-					PolicyStatement temp = pStatement;
-					pStatement = pStatementNext;
-					pStatementNext = temp;
+				if(pStatement.getPriority() > pStatementNext.getPriority()) {
+					index = j;
 				}
 			}
+			result.add(list.remove(index));
 		}
+		
 		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "sortPoliciesByPriority");
-		return list;
+		
+		return result;
 	}
 
 	
@@ -111,7 +134,7 @@
 		// Iterate over the List of maps
 		EvaluationResults result = new EvaluationResults();
 		Iterator instanceMapKeyIt = instanceMap.keySet().iterator();
-		System.out.println("Iterating over all instances of Anchor class");
+//		System.out.println("Iterating over all instances of Anchor class");
 
 		while(instanceMapKeyIt.hasNext())
 		{
@@ -326,7 +349,7 @@
 		while(it.hasNext()){
 			Object inst=it.next();
 			//InstanceInfo iinfo=new InstanceInfo(targetclassnm,inst);
-			List instanceInfoList=new ArrayList();
+//			List instanceInfoList=new ArrayList();
 			//instanceInfoList.add(iinfo);
 
 			Map objMap=new HashMap();
@@ -444,7 +467,7 @@
                             }
                             else
                             {
-                                List instanceInfoList = new ArrayList();
+                                List instanceInfoList = new ArrayList(1);	// DAW
                                 instanceInfoList.add(instanceInfo);
                                 instMap.put(anchorClassName, instanceInfoList);
                                 

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/KeyStringToMapConvertor.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/KeyStringToMapConvertor.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/KeyStringToMapConvertor.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/KeyStringToMapConvertor.java Tue Sep 29 18:29:44 2009
@@ -44,9 +44,8 @@
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMapOfKeys");
         
         String keyString = keyValues;
-        
-        logger.fine(Thread.currentThread().getName() + "keyString :  "
-				+ keyString);
+        if(logger.isLoggable(Level.FINE))
+            logger.fine(Thread.currentThread().getName()+"keyString "+keyString);
         
         //System.out.println("keyValues " + keyValues);
         keyString = keyString.substring(keyString.indexOf('.') + 1);
@@ -84,8 +83,8 @@
             }
             //System.out.println(" keyString keyName keyValue " + keyString + " "+ keyName + " " + keyValue);
             //System.out.println("CIMObjectInstance  keyName: "+ keyName.toLowerCase() + "  keyValue : " + keyValue);
-            logger.fine(Thread.currentThread().getName() + "keyName, keyValue "
-					+ keyName + " , " + keyValue);
+            if(logger.isLoggable(Level.FINE))
+                logger.fine(Thread.currentThread().getName()+"keyName, keyValue "+keyName+ " , "+ keyValue);
             
             keysMap.put(keyName, keyValue);
         }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/TypeResolver.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/TypeResolver.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/TypeResolver.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/TypeResolver.java Tue Sep 29 18:29:44 2009
@@ -277,7 +277,13 @@
         		if (isString(rightType) && isAssignableFromString(leftType)) 
         		{
         			res = true;
-        		} 
+        		}
+        		
+        		// xiping's test 09-24-09
+        		else if (isNumeric(rightType) && isAssignableFromNumeric(leftType)) {
+        			res = true;
+        		}
+        		//
         		else if(isReference(rightType))
         		{
         			res = true;
@@ -303,6 +309,29 @@
 		return false;
 		
 	}    
+
+    // xiping 09-24-09
+    private static boolean isAssignableFromNumeric(TypeInfo type) {
+		String typeName = type.getReferenceTypeName();
+		if (typeName != null) {
+			try {
+				Class clazz = type.getClass().forName(typeName);
+				return clazz.isAssignableFrom(Byte.class) ||
+					clazz.isAssignableFrom(Short.class) ||
+					clazz.isAssignableFrom(Integer.class) ||
+					clazz.isAssignableFrom(Long.class) ||
+					clazz.isAssignableFrom(Float.class) ||
+					clazz.isAssignableFrom(Double.class);
+			} catch (ClassNotFoundException e) {
+				;
+			}
+		}
+		return false;
+		
+	}    
+
+    //
+    
     public static boolean isTypeAssignableForRelation(TypeInfo leftType,
             TypeInfo rightType)
     {

Modified: incubator/imperius/trunk/imperius-splcore/src/test/java/org/apache/imperius/spl/tests/StringExpressionTest.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/test/java/org/apache/imperius/spl/tests/StringExpressionTest.java?rev=820060&r1=820059&r2=820060&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/test/java/org/apache/imperius/spl/tests/StringExpressionTest.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/test/java/org/apache/imperius/spl/tests/StringExpressionTest.java Tue Sep 29 18:29:44 2009
@@ -794,17 +794,17 @@
 			s3 = s3.substring(1, s3.length()-1);
 
 			assertTrue(
-					new Integer(s1.length()).compareTo(e1.evaluate()) == 0);
+					new Integer(s1.length()).compareTo((Integer)e1.evaluate()) == 0);
 			assertTrue(
-					new Integer(s2.length()).compareTo(e2.evaluate()) == 0);
+					new Integer(s2.length()).compareTo((Integer)e2.evaluate()) == 0);
 			assertTrue(
-					new Integer(s3.length()).compareTo(e3.evaluate()) == 0);
+					new Integer(s3.length()).compareTo((Integer)e3.evaluate()) == 0);
 			assertTrue(
-					new Integer(s1.length()).compareTo(eps1.evaluate()) == 0);
+					new Integer(s1.length()).compareTo((Integer)eps1.evaluate()) == 0);
 			assertTrue(
-					new Integer(s2.length()).compareTo(eps2.evaluate()) == 0);
+					new Integer(s2.length()).compareTo((Integer)eps2.evaluate()) == 0);
 			assertTrue(
-					new Integer(s3.length()).compareTo(eps3.evaluate()) == 0);
+					new Integer(s3.length()).compareTo((Integer)eps3.evaluate()) == 0);
 		} catch (SPLException e) {
 			fail("Received evaluation exception " + e.getMessage());
 		} catch (Exception e) {
@@ -841,8 +841,8 @@
 			v.add(propertySensor3);
 			Expression eps1 = new ReplaceSubstring(v,true);
 			s4 = s4.substring(1, s4.length()-1);
-			assertTrue(s4.compareTo(e1.evaluate()) == 0);
-			assertTrue(s4.compareTo(eps1.evaluate()) == 0);
+			assertTrue(s4.compareTo((String)e1.evaluate()) == 0);
+			assertTrue(s4.compareTo((String)eps1.evaluate()) == 0);
 		} catch (SPLException e) {
 			fail("Received evaluation exception " + e.getMessage());
 		} catch (Exception e) {

Added: incubator/imperius/trunk/javaspl-samples/PolicyStorage.DAT
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/PolicyStorage.DAT?rev=820060&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/imperius/trunk/javaspl-samples/PolicyStorage.DAT
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/imperius/trunk/javaspl-samples/SPL.log.lck
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/SPL.log.lck?rev=820060&view=auto
==============================================================================
    (empty)

Added: incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius20.spl
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius20.spl?rev=820060&view=auto
==============================================================================
--- incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius20.spl (added)
+++ incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius20.spl Tue Sep 29 18:29:44 2009
@@ -0,0 +1,13 @@
+Import Class java.lang.StringBuilder:stringBuilder;
+Strategy Execute_All_Applicable;
+Policy 
+{
+	Condition 
+	{ 
+	     4 == 4
+	}
+	Decision 
+	{ 
+		stringBuilder.append("O1")
+	}
+}:2;

Added: incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius22.spl
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius22.spl?rev=820060&view=auto
==============================================================================
--- incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius22.spl (added)
+++ incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius22.spl Tue Sep 29 18:29:44 2009
@@ -0,0 +1,20 @@
+Import Class java.util.List:list1;
+Import Class java.util.Properties:props;
+Strategy Execute_All_Applicable;
+Policy 
+{
+	Declaration {
+		list = ["1", "2"];
+	}
+	Condition 
+	{ 	
+		// this is not correct syntax of SPL
+		// use BasicCollection as defined above instead of list1.
+		// inCollection("1", list1)
+		inCollection("1", list)
+	}
+	Decision 
+	{ 
+		props.get("foo")
+	}
+}:1;
\ No newline at end of file

Added: incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius23.spl
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius23.spl?rev=820060&view=auto
==============================================================================
--- incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius23.spl (added)
+++ incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius23.spl Tue Sep 29 18:29:44 2009
@@ -0,0 +1,13 @@
+Import Class java.util.Properties:props;
+Strategy Execute_All_Applicable;
+Policy
+{
+	Condition
+	{
+		props.getProperty("bar") == "abc" && props.getProperty("foo","bar") == "def"
+	}
+	Decision 
+	{
+		props.getProperty("foo")
+	}
+}:1;
\ No newline at end of file

Added: incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius24.spl
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius24.spl?rev=820060&view=auto
==============================================================================
--- incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius24.spl (added)
+++ incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius24.spl Tue Sep 29 18:29:44 2009
@@ -0,0 +1,15 @@
+Import Class java.util.Properties : props;
+Import Class org.apache.imperius.javaspl.samples.bugfix.SimpleBean1 : b1;
+Import Class org.apache.imperius.javaspl.samples.bugfix.SimpleBean2 : b2;
+Strategy Execute_All_Applicable;
+Policy
+{
+	Condition
+	{
+		props.getProperty("bar") == "abc" && props.getProperty("foo","bar") == "def"
+	}
+	Decision
+	{ 
+		b2.print(b1.id)
+	}
+}:1;
\ No newline at end of file

Added: incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius25.spl
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius25.spl?rev=820060&view=auto
==============================================================================
--- incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius25.spl (added)
+++ incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius25.spl Tue Sep 29 18:29:44 2009
@@ -0,0 +1,13 @@
+Import Class org.apache.imperius.javaspl.samples.bugfix.MyList:list1;
+Strategy Execute_All_Applicable;
+Policy
+{
+	Condition
+	{
+		list1.toString() == "something" 
+	}
+	Decision
+	{
+		list1.toString()
+	}
+}:1; 

Added: incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius26.spl
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius26.spl?rev=820060&view=auto
==============================================================================
--- incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius26.spl (added)
+++ incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius26.spl Tue Sep 29 18:29:44 2009
@@ -0,0 +1,13 @@
+Import Class java.util.Properties:list1; 
+Strategy Execute_All_Applicable; 
+Policy 
+{ 
+	Condition 
+	{ 
+		list1.get("Foo").toString() == "something" 
+	} 
+	Decision 
+	{ 
+		list1.toString() 
+	} 
+}:1; 

Added: incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius28.spl
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius28.spl?rev=820060&view=auto
==============================================================================
--- incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius28.spl (added)
+++ incubator/imperius/trunk/javaspl-samples/resources/samples/bugfix/policies/Imperius28.spl Tue Sep 29 18:29:44 2009
@@ -0,0 +1,12 @@
+Import Class org.apache.imperius.javaspl.samples.bugfix.ByteArrayFactory:baf;
+Strategy Execute_All_Applicable;
+Policy 
+{
+	Condition
+	{
+		baf.takeByteArray(baf.getByteArray())
+	}
+	Decision  {
+		baf.getByteArray(1, 2)
+	}
+}:1;

Added: incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/bugfix/Bar.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/bugfix/Bar.java?rev=820060&view=auto
==============================================================================
--- incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/bugfix/Bar.java (added)
+++ incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/bugfix/Bar.java Tue Sep 29 18:29:44 2009
@@ -0,0 +1,7 @@
+package org.apache.imperius.javaspl.samples.bugfix;
+
+public class Bar {
+	public String toString() {
+		return "something";
+	}
+}

Added: incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/bugfix/ByteArrayFactory.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/bugfix/ByteArrayFactory.java?rev=820060&view=auto
==============================================================================
--- incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/bugfix/ByteArrayFactory.java (added)
+++ incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/bugfix/ByteArrayFactory.java Tue Sep 29 18:29:44 2009
@@ -0,0 +1,64 @@
+package org.apache.imperius.javaspl.samples.bugfix;
+
+public class ByteArrayFactory {
+	private byte x[];
+	private int y;
+	
+	public ByteArrayFactory(byte[] array) {
+		x = array;
+	}
+	
+	public int getByteArray(int b) {
+		return b;
+	}
+	
+	public boolean takeByteArray(int barray) {
+		return (barray > 0 ? true : false);
+	}
+
+	public byte[] getByteArray() {
+		return x;
+	}
+
+	public byte[] getByteArray(int a1, int a2) {
+		x[0] = (byte)a1;
+		x[1] = (byte)a2;
+		return x;
+	}
+	
+	public boolean takeByteArray(byte[] barray) {
+		return (barray[0] + barray[1] > 0 ? true : false);
+	}
+
+	public String getByteArray(String s) {
+		return s;
+	}
+
+	public boolean takeByteArray(String s) {
+		return (s.equals("test") ? true : false);
+	}
+
+	public boolean takeByteArray(int[] barray) {
+		return (barray[0] + barray[1] > 0 ? true : false);
+	}
+
+	public int[] getByteArray(double var) {
+		int[] xx = new int[2];
+		xx[0] = x[0];
+		xx[1] = x[1];
+		
+		return xx;
+	}
+
+	public void setValueY(int value) {
+		y = value;
+	}
+}
+
+//public interface ByteArrayFactory {
+//	
+//	public byte[] getByteArray();
+//	
+//	public boolean takeByteArray(byte[] barray);
+//
+//}

Added: incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/bugfix/MyList.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/bugfix/MyList.java?rev=820060&view=auto
==============================================================================
--- incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/bugfix/MyList.java (added)
+++ incubator/imperius/trunk/javaspl-samples/src/main/java/org/apache/imperius/javaspl/samples/bugfix/MyList.java Tue Sep 29 18:29:44 2009
@@ -0,0 +1,14 @@
+package org.apache.imperius.javaspl.samples.bugfix;
+
+import java.util.ArrayList;
+
+/**
+ * 
+ * @author xwang
+ *
+ */
+public class MyList extends ArrayList {
+	public String toString(){
+		return "something";
+	}
+}



Mime
View raw message