incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jnee...@apache.org
Subject svn commit: r686743 [5/10] - in /incubator/imperius/trunk: imperius-javaspl/src/main/java/org/apache/imperius/javaspl/ imperius-splcore/src/main/antlr/org/apache/imperius/spl/parser/compiler/ imperius-splcore/src/main/java/org/apache/imperius/spl/datas...
Date Mon, 18 Aug 2008 12:50:42 GMT
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PostCollectExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PostCollectExpression.java?rev=686743&r1=686742&r2=686743&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PostCollectExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PostCollectExpression.java Mon Aug 18 05:50:36 2008
@@ -28,7 +28,6 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.logging.Logger;
 
 import org.apache.imperius.spl.external.Expression;
@@ -40,75 +39,59 @@
 import org.apache.imperius.spl.parser.exceptions.IllegalExpressionTypeException;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
 import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
 
-
 public class PostCollectExpression implements Expression
 {
-
 	private Expression arrExp1;
-
 	private String methodOrParam;
-	private boolean methodOrParamExists=false;
-	private boolean array2Exists=false;
-	
-	
+	private boolean methodOrParamExists = false;
+	private boolean array2Exists = false;
 	private Expression arrExp2;
-
 	private ArrayList pList;
-
 	private SPLSymbolTable symTab;
-
 	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-
-	private static final String sourceClass="PostCollectExpression";
-
-	private TypeInfo _dataType=new TypeInfo();
-
+	private static final String sourceClass = "PostCollectExpression";
+	private TypeInfo _dataType = new TypeInfo();
 	public boolean isIdentifierMethod;
-
-	public int instanceNumer=-1;
-
-	private String targetName="";
-
-	//public static final int POSTCOLLECT_IS_ARRAY = -1;
-
-//	private boolean isArray;
+	public int instanceNumer = -1;
+	private String targetName = "";
 
 	public boolean isArray()
 	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "isArray");
 
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-		return this._dataType.getIsArray();
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "isArray");
 
+		return this._dataType.getIsArray();
 	}
 
 	public void setArray(boolean isArray)
 	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArray");
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "setArray");
 		this._dataType.setIsArray(isArray);
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArray");
-
 
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "setArray");
 	}
 
 	public PostCollectExpression(Expression a1, String m, Expression a2,
 			ArrayList pList, SPLSymbolTable sTab) throws SPLException
-			{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "PostCollectExpression");
-
+	{
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "PostCollectExpression");
 
 		this.arrExp1 = a1;
 		this.arrExp2 = a2;
 		this.methodOrParam = m;
 		this.pList = pList;
 		this.symTab = sTab;
-		
-		
-
-			}
+	}
 
 	// (arrExp1 = arrayIndex[cSymTab] ( id:IDENT ( #(INDEX_OP
 	// arrExp2=expression[cSymTab]) | #(METHOD_CALL (pList = exprList[cSymTab])?
@@ -116,30 +99,24 @@
 	// [exp].ID1[exp]
 	// [exp].ID1(pList)
 	// [exp].ID1
-	public Object evaluate(List filteredTargetInstances)
-	throws SPLException
+	public Object evaluate(List filteredTargetInstances) throws SPLException
 	{
 		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
 
-
 		Object result = null;
+
 		// evaluate the array expression to get the integer index
 		Integer arrayIndex = (Integer) arrExp1.evaluate();
 		int sizeOfFilteredTargetInstances = filteredTargetInstances.size();
 		this.instanceNumer=arrayIndex.intValue();
-		//System.out.println("arrayIndex" + arrayIndex);
-		//System.out.println("sizeOfFilteredTargetInstances"   + sizeOfFilteredTargetInstances);
+		
 		// use the index to extract the corresponding object from the filtered
 		// instances
-		//System.out.println("doing post collect operation on filtered instances");
 		if ((sizeOfFilteredTargetInstances > arrayIndex.intValue())
 				&& (sizeOfFilteredTargetInstances != 0))
 		{
-			//System.out.println("filteredTargetInstances "+sizeOfFilteredTargetInstances+" "+arrayIndex.intValue() +" list:"+filteredTargetInstances);
-			
 			Object selectedInstance = filteredTargetInstances.get(arrayIndex
 					.intValue());
-			//System.out.println(selectedInstance);
 			if (!methodOrParam.equals("")) // of the form [exp].ID1 OR
 				// [exp].ID1(pList) OR
 				// [exp].ID1[exp]
@@ -156,9 +133,7 @@
 					String qualifiedPropertyNm=methodOrParam;                                                                // the symbol
 					if(!targetName.equalsIgnoreCase(""))    
 					{
-
 						qualifiedPropertyNm=targetName+"."+methodOrParam;
-
 					}
 					PropertySymbol prop = (PropertySymbol) symTab.getSymbol( qualifiedPropertyNm); // extract
 					result = prop.getValue(); // get its value
@@ -173,11 +148,13 @@
 				} // its a method invoke
 				else
 				{
-					logger.severe(
-							"Cannot invoke methods in the Declaration or Condition sections");
+					logger.severe("Cannot invoke methods in the Declaration or Condition sections");
 
 					throw new SPLException(
-					"Cannot invoke methods in the Declaration or Condition sections");
+							Messages
+									.getString(
+											"SPL_INVALID_METHOD_INVOCATION_SECTION_EXCEPTION_MSG",
+											new Object[] { "Declaration or Condition" }));
 				}
 			}
 			else
@@ -187,6 +164,7 @@
 				result = selectedInstance;
 				this._dataType.setIsArray(false);
 			}
+
 			logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
 
 			return result;
@@ -194,23 +172,22 @@
 		else
 		{
 			logger.severe(Thread.currentThread().getName()+" "+"array index is out of range");
-			throw new SPLException("array index is out of range");
-
+			
+			throw new SPLException(Messages
+					.getString("SPL_ARRAY_INDEX_OUT_OF_RANGE_EXCEPTION_MSG"));
 		}
-
 	}
 
 	public TypeInfo getType() throws SPLException
 	{
 		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
 
-
 		if (_dataType != null)
 			return _dataType;
 		else
 		{
-
 			validate();
+
 			logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
 
 			return _dataType;
@@ -219,103 +196,118 @@
 
 	public boolean validate(String targetClassName) throws SPLException
 	{
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "validate");
 
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-		//System.out.println("validating post collect expr "+targetClassName);
-
-		if (arrExp1 != null && (arrExp1.getType().getType() == TypeConstants.intType)) // make
-			// sure
-			// [exp]
-			// is
-			// numeric
+		if (arrExp1 != null
+				&& (arrExp1.getType().getType() == TypeConstants.intType)) // make
+		// sure
+		// [exp]
+		// is
+		// numeric
 		{
-			//System.out.println("arrExp1 != null");
-			targetName=targetClassName;
-//			String targetClassName = (String)this.symTab.getAnchorClassList().get(0);
-			if (!methodOrParam.equals(""))
+			targetName = targetClassName;
+
+			// String targetClassName =
+			// (String)this.symTab.getAnchorClassList().get(0);
+			if (!methodOrParam.equals("")) 
 			{
-				
-				methodOrParamExists=true;
-				//System.out.println("!methodOrParam.equals() "+methodOrParam);
+				methodOrParamExists = true;
+				// System.out.println("!methodOrParam.equals() "+methodOrParam);
 
-				String propName = /*targetClassName + "." +*/ methodOrParam;
+				String propName = /* targetClassName + "." + */methodOrParam;
 				boolean recurse = false; // do not go up the symbol table
 				// hierarchy
-				String qualifiedPropertyName=targetClassName+"."+propName;
-				//System.out.println("!methodOrParam.equals() "+qualifiedPropertyName);
-
-				if (symTab.symbolExists(qualifiedPropertyName, recurse)) // make sure ID1
-					// exists in the
-					// symbol table
+				String qualifiedPropertyName = targetClassName + "." + propName;
+				// System.out.println("!methodOrParam.equals()
+				// "+qualifiedPropertyName);
+
+				if (symTab.symbolExists(qualifiedPropertyName, recurse)) // make
+																			// sure
+																			// ID1
+				// exists in the
+				// symbol table
 				{
-					//System.out.println("symTab.symbolExists(propName, recurse)");
+					// System.out.println("symTab.symbolExists(propName,
+					// recurse)");
 
 					Symbol sym = symTab.getSymbol(qualifiedPropertyName);
 					_dataType.copy(sym.getType());
-					
-					if (sym instanceof MethodSymbol)
+
+					if (sym instanceof MethodSymbol) 
 					{
-						//System.out.println("sym instanceof MethodSymbol");
+						// System.out.println("sym instanceof MethodSymbol");
 
 						// ArrayList formalParams = (ArrayList)
 						// ((MethodSymbol)sym).getArgTypeList();
 						// TypeResolver.validateActualParameterTypes(formalParams,pList);
 						// dataType = sym.getType();
 						// isIdentifierMethod = true;
-						logger.severe(Thread.currentThread().getName()+" "+"Cannot invoke methods in the Declaration or Condition sections");
+						logger
+								.severe(Thread.currentThread().getName()
+										+ " "
+										+ "Cannot invoke methods in the Declaration or Condition sections");
 
 						throw new SPLException(
-						"Cannot invoke methods in the Declaration or Condition sections");
-					}
-					else if(sym instanceof PropertySymbol)
-						// sym instanceof PropertySymbol
+								Messages
+										.getString(
+												"SPL_INVALID_METHOD_INVOCATION_SECTION_EXCEPTION_MSG",
+												new Object[] { "Declaration or Condition" }));
+					} 
+					else if (sym instanceof PropertySymbol)
+					// sym instanceof PropertySymbol
 					{
-						//System.out.println("sym instanceof PropertySymbol");
-//						//System.out.println("propType "+propType.getType());
+						// System.out.println("sym instanceof PropertySymbol");
+						// //System.out.println("propType "+propType.getType());
 
 						PropertySymbol pSym = (PropertySymbol) sym;
-						if (pSym.isArray())
+						if (pSym.isArray()) 
 						{
-							array2Exists=true;
-							//System.out.println("pSym.isArray()");
+							array2Exists = true;
+							// System.out.println("pSym.isArray()");
 							_dataType.setIsArray(false);
-							
-							if(arrExp2 != null ){
-								if (arrExp2.getType().getType() != TypeConstants.intType)
+
+							if (arrExp2 != null) 
+							{
+								if (arrExp2.getType().getType() != TypeConstants.intType) 
 								{
-									logger.severe(
-											"arr index should be integer and not "
-											+ arrExp2.getType());
+									logger
+											.severe("arr index should be integer and not "
+													+ arrExp2.getType());
 
 									throw new IllegalExpressionTypeException(
-											"arr index should be integer and not "
-											+ arrExp2.getType());
+											Messages
+													.getString(
+															"SPL_POSTCOLLECT_EXP_EXCEPTION1_MSG",
+															new Object[] { arrExp2
+																	.getType() }));
 								}
 							}
-
-
 						}
 						isIdentifierMethod = false;
+					} 
+					else 
+					{
+						logger.severe(Thread.currentThread().getName() + " "
+								+ "unknown symbol type "
+								+ qualifiedPropertyName);
 						
-
-					}
-					else{
-						logger.severe(Thread.currentThread().getName()+" "+"unknown symbol type "+qualifiedPropertyName);
-						throw new SPLException("unknown symbol type "+qualifiedPropertyName);
-
+						throw new SPLException(Messages.getString(
+								"SPL_SYMBOL_DOES_NOT_EXIST_EXCEPTION_MSG",
+								new Object[] { qualifiedPropertyName }));
 					}
-
-				}
-				else{
-					logger.severe(Thread.currentThread().getName()+" "+"symbol does not exist "+qualifiedPropertyName);
-					throw new SPLException("symbol does not exist "+qualifiedPropertyName);
-
+				} 
+				else 
+				{
+					logger.severe(Thread.currentThread().getName() + " "
+							+ "symbol does not exist " + qualifiedPropertyName);
+					
+					throw new SPLException(Messages.getString(
+							"SPL_SYMBOL_DOES_NOT_EXIST_EXCEPTION_MSG",
+							new Object[] { qualifiedPropertyName }));
 				}
-			}
-			else
-			{
-				//System.out.println("method or param name is null");
+			} else {
+				// System.out.println("method or param name is null");
 				// expression of type [exp]
 				_dataType.setType(TypeConstants.referenceType);
 				_dataType.setIsArray(false);
@@ -324,171 +316,198 @@
 				// target class name in the
 				// collect
 			}
-		}
-		else
-		{
-			logger.severe(
-					"arr index should be integer and not " + arrExp1.getType());
-
-			throw new IllegalExpressionTypeException(
-					"arr index should be integer and not " + arrExp1.getType());
+		} else {
+			logger.severe("arr index should be integer and not "
+					+ arrExp1.getType());
+
+			throw new IllegalExpressionTypeException(Messages.getString(
+					"SPL_POSTCOLLECT_EXP_EXCEPTION1_MSG",
+					new Object[] { arrExp1.getType() }));
 
 		}
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-		//System.out.println("validating post collect expr done is array="+this._dataType.getIsArray());
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "validate");
 
 		return true;
 	}
 
 	public Expression getArrExp1()
 	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getArrExp1");
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "getArrExp1");
 
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getArrExp1");
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "getArrExp1");
 
 		return arrExp1;
 	}
 
 	public void setArrExp1(Expression arrExp1)
 	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArrExp1");
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "setArrExp1");
+		
 		this.arrExp1 = arrExp1;
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArrExp1");
-
 
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "setArrExp1");
 	}
 
 	public Expression getArrExp2()
 	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getArrExp2");
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "getArrExp2");
 
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getArrExp2");
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "getArrExp2");
 
 		return arrExp2;
 	}
 
 	public void setArrExp2(Expression arrExp2)
 	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setArrExp2");
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "setArrExp2");
+		
 		this.arrExp2 = arrExp2;
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setArrExp2");
-
 
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "setArrExp2");
 	}
 
 	public String getMethodOrParam()
 	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMethodOrParam");
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "getMethodOrParam");
 
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMethodOrParam");
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "getMethodOrParam");
 
 		return methodOrParam;
 	}
 
 	public void setMethodOrParam(String methodOrParam)
 	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setMethodOrParam");
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "setMethodOrParam");
 		this.methodOrParam = methodOrParam;
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setMethodOrParam");
-
 
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "setMethodOrParam");
 	}
 
 	public ArrayList getPList()
 	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getPList");
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "getPList");
 
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getPList");
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "getPList");
 
 		return pList;
 	}
 
 	public void setPList(ArrayList list)
 	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setPList");
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "setPList");
 
 		pList = list;
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setPList");
-
 
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "setPList");
 	}
 
 	public SPLSymbolTable getSymTab()
 	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "getSymTab");
 
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "getSymTab");
 
 		return symTab;
 	}
 
 	public void setSymTab(SPLSymbolTable symTab)
 	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
-
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "setSymTab");
 
 		this.symTab = symTab;
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
 
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "setSymTab");
 	}
 
 	public Object evaluate() throws SPLException
 	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
 
-		logger.severe(Thread.currentThread().getName()+" "+"Not supported evaluate without parameters");
-
-		throw new SPLException("Not supported evaluate without parameters");
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+		
+		throw new SPLException(Messages.getString(
+				"SPL_EVALUATE_METHOD_NOT_SUPPORTED_EXCEPTION_MSG",
+				new Object[] { sourceClass }));
 
 	}
 
 	public String toString()
 	{
 		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+		
 		String str="";
-		if(this.arrExp1!=null){
+		if(this.arrExp1!=null)
+		{
 			str+=this.arrExp1.toString();
 		}
-		if(this.methodOrParam!=null){
+		if(this.methodOrParam!=null)
+		{
 			str+=this.methodOrParam.toString();
 		}
 		
-		if(this.arrExp2!=null){
+		if(this.arrExp2!=null)
+		{
 			str+=" "+this.arrExp1.toString();
 		}
-//		str+=" )";
 
 		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
 
 		return str;
 	}
 
-	public String getReferenceTypeName() throws SPLException {
+	public String getReferenceTypeName() throws SPLException 
+	{
 		// TODO Auto-generated method stub
 		return null;
 	}
 
-	public int getInstanceNumer() {
+	public int getInstanceNumer() 
+	{
 		return instanceNumer;
 	}
 
-	public void setInstanceNumer(int instanceNumer) {
+	public void setInstanceNumer(int instanceNumer) 
+	{
 		this.instanceNumer = instanceNumer;
 	}
 
-	public boolean validate() throws SPLException {
+	public boolean validate() throws SPLException 
+	{
 		// TODO Auto-generated method stub
-		throw new SPLException("validate() not supported for post collect expression");
+		throw new SPLException(Messages.getString(
+				"SPL_VALIDATE_METHOD_NOT_SUPPORTED_EXCEPTION_MSG",
+				new Object[] { sourceClass }));
 	}
 
-	public boolean isMethodOrParamExists() {
+	public boolean isMethodOrParamExists() 
+	{
 		return methodOrParamExists;
 	}
 
 	
-	public boolean Array2Exists() {
+	public boolean Array2Exists() 
+	{
 		return array2Exists;
 	}
-
-	
-
 }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PrimaryExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PrimaryExpression.java?rev=686743&r1=686742&r2=686743&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PrimaryExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/PrimaryExpression.java Mon Aug 18 05:50:36 2008
@@ -37,6 +37,7 @@
 import org.apache.imperius.spl.parser.compiler.symboltable.Symbol;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
 import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
 
@@ -72,23 +73,22 @@
 {
     
     private String _classNameOrInstanceVariableName;
-    
-    private List _identTupleList = null;
-    
-    private SPLSymbolTable _symTab;
-    
-    private Object evaluationResult=null;
-      
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
 
-    private static final String sourceClass="PrimaryExpression";
-    
-    private TypeInfo _dataType = new TypeInfo();
-    
-    private String _referenceTypeName;
+	private List _identTupleList = null;
+
+	private SPLSymbolTable _symTab;
+
+	private Object evaluationResult = null;
+
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+	private static final String sourceClass = "PrimaryExpression";
+
+	private TypeInfo _dataType = new TypeInfo();
+
+	private String _referenceTypeName;
     
-//    public boolean _isArray = false;
+	// public boolean _isArray = false;
     
    
     public PrimaryExpression(String id1, List identTupleList,
@@ -99,7 +99,6 @@
         _identTupleList = identTupleList;
         _classNameOrInstanceVariableName = id1;
       
-        //System.out.println("_classNameOrInstanceVariableName "+_classNameOrInstanceVariableName);
         this._symTab = sTab;
         if(sTab ==null)
         {
@@ -112,20 +111,16 @@
         
         else if (sTab.getSymbolTableType() == SPLSymbolTable.BASICCOLLECT)
         {
-            
-//            _isArray = true;
+        	// _isArray = true;
             this._dataType.setIsArray(true);
             validate();
         }
         if (sTab.getSymbolTableType() == SPLSymbolTable.COLLECT)
         {
-//            _isArray = true;
+        	// _isArray = true;
         	this._dataType.setIsArray(true);
-            
         }
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "PrimaryExpression");
-        
-        
     }
     
     public String getPropertyName()
@@ -144,7 +139,6 @@
     
     public String getclassNameOrInstanceVariableName()
     {
-    	
     	return _classNameOrInstanceVariableName;
     }
     
@@ -152,23 +146,16 @@
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
 
-        
-        
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
        
-      
-        
         return this._dataType.getIsArray();
     }
     
-   
-    
     public boolean validate() throws SPLException
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
         boolean isArray = false;
-        //System.out.println("PrimaryExpression id1=" + id1 + "  id2=" + id2);
-        // 
+ 
         // case 1: ident1
         // case 2: ident1.ident2
         // case 3: ident1[expr]
@@ -192,11 +179,9 @@
 	        		}
 	        		returnType = ipt.validate(referenceTypeName);
 	        	}	
-	        	
-	        	
 	        }
 	        _dataType.copy(returnType);
-//	        _isArray = returnType.getIsArray();
+	        //_isArray = returnType.getIsArray();
 	        _referenceTypeName = returnType.getReferenceTypeName();
         }
         else // local constant
@@ -206,7 +191,7 @@
             {
                 Symbol sym = _symTab.getSymbol(_classNameOrInstanceVariableName);
                 _dataType.copy(sym.getType());
-//              _isArray = sym.isArray();
+                // _isArray = sym.isArray();
                 _referenceTypeName = sym.getReferenceTypeName();
             }
             else if(_symTab.getInstance(_classNameOrInstanceVariableName)!=null)
@@ -215,14 +200,13 @@
             }
             else
             {
-                throw new SPLException("Symbol " + _classNameOrInstanceVariableName + " does not exist");
+                throw new SPLException(Messages.getString(
+						"SPL_SYMBOL_DOES_NOT_EXIST_EXCEPTION_MSG",
+						new Object[] { _classNameOrInstanceVariableName }));
             }
-            
         }
 
-
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-       
       
         return true;
     }
@@ -230,6 +214,7 @@
     public Object evaluate() throws SPLException
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+     
         int i = 0;
         Object intermediateObject = null;
         if(!_identTupleList.isEmpty())
@@ -246,12 +231,10 @@
 	        	{
 	        		intermediateObject = ipt.evaluate(intermediateObject);
 	        	}
-	        	
 	        }
         }
         else
         {
-            
              if( _symTab.symbolExists(_classNameOrInstanceVariableName,true) )
              {
                  Symbol sym = _symTab.getSymbol(_classNameOrInstanceVariableName);
@@ -261,11 +244,8 @@
              {
                  intermediateObject = _symTab.getInstance(_classNameOrInstanceVariableName);
              }
-            
-            
         }
-        
-        
+
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
         
         this.evaluationResult=intermediateObject;
@@ -276,8 +256,6 @@
     public TypeInfo getType()
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-       
       
         if (_dataType != null)
         {
@@ -292,8 +270,8 @@
             catch (SPLException e)
             {
                 logger.severe(Thread.currentThread().getName()+" "+"Exception cought");
-                e.printStackTrace();
             }
+
             logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
             
             return _dataType;
@@ -301,87 +279,57 @@
         
     }
     
-    
-    
-   
-    
     public String getClassName()
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getClassName");
 
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getClassName");
        
-      
         return _classNameOrInstanceVariableName;
     }
     
     public void setClassName(String className)
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setClassName");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "setClassName");
+		
         this._classNameOrInstanceVariableName = className;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setClassName");
-       
-      
-        
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "setClassName");
     }
     
-   
-    
-   
-    
     public SPLSymbolTable getSymTab()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "getSymTab");
 
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getSymTab");
-       
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "getSymTab");
       
         return _symTab;
     }
     
     public void setSymTab(SPLSymbolTable symTab)
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "setSymTab");
+
         this._symTab = symTab;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "setSymTab");
-       
-      
-        
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "setSymTab");
     }
     
     public String toString()
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-//        String str=id1;
-//        if(id2!=null && !id2.equalsIgnoreCase("")){
-//            str+="."+id2;
-//        }
-//        
-        
-        
-       /*String retStr=_classNameOrInstanceVariableName;
-       
-       if(this._dataType.getIsArray()){
-    	   retStr+="[ ";
-    	   if(this._dataType.getType()==TypeConstants.referenceType){
-    		   retStr+=this._referenceTypeName;
-        	   
-    	   }
-    	   else{
-    		   List params=this._identTupleList;
-    		   Iterator it=params.iterator();
-    		   while(it.hasNext()){
-    			   Object ob=it.next();
-    			   retStr+=ob.toString();
-    		   }
-    	   }
-    	   retStr+=" ]";
-       }    */ 
+
         String retStr=" "+this.getPropertyString() +"( ";
         
-        if(this.evaluationResult!=null){
+        if(this.evaluationResult!=null)
+        {
         	retStr+=this.evaluationResult.toString();
-            
         }
         
         retStr+=" )";
@@ -412,11 +360,8 @@
     		propName=propName.substring(0, (length-2));
         		
     	}
-    	//System.out.println("returning property name "+propName);
+
     	return propName;
     }
 	
-	
-}
-
-
+}
\ No newline at end of file

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/SelfExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/SelfExpression.java?rev=686743&r1=686742&r2=686743&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/SelfExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expression/primary/SelfExpression.java Mon Aug 18 05:50:36 2008
@@ -35,100 +35,110 @@
 import org.apache.imperius.spl.parser.exceptions.SPLException;
 import org.apache.imperius.spl.parser.expressions.ReferenceExpression;
 import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
-
-
-
 public class SelfExpression implements Expression, ReferenceExpression
 {
     
     private SPLSymbolTable sTab;
-    private TypeInfo _dataType = null; 
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
 
-    private static final String sourceClass="SelfExpression";
+    private TypeInfo _dataType = null;
+
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+	private static final String sourceClass = "SelfExpression";
     
     
     public SelfExpression(SPLSymbolTable symTab)throws SPLException
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "SelfExpression");
-       //System.out.println("evaluating Self expression");
-        
-        sTab = symTab;
-        
-        if (!validate())
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"validation error: " + sourceClass
-                    + " has wrong data type passed in.");
-            
-            throw new SPLException("validation error: " + sourceClass
-                    + " has wrong data type passed in.");
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ sourceClass);
-        
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "SelfExpression");
+
+		sTab = symTab;
+
+		if (!validate()) 
+		{
+			logger.severe(Thread.currentThread().getName() + " "
+					+ "validation error: " + sourceClass
+					+ " has wrong data type passed in.");
+
+			throw new SPLException(Messages.getString(
+					"SPL_VALIDATION_ERROR_MSG", new Object[] { sourceClass }));
+		}
+		
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ sourceClass);
     }
     
     public String getReferenceTypeName()
     {
-    	 logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-         //System.out.println("evaluating Self expression");
-    	 String referenceTypeName = null;
-         
-          SPLSymbolTable symbtab=sTab;
-          while(sTab.getParentSymbolTable() != null && sTab.getParentSymbolTable().getSymbolTableType() == SPLSymbolTable.COLLECT){
-          	symbtab=sTab.getParentSymbolTable();
-          }
-          
-          
-          if (symbtab.getParentSymbolTable() != null && symbtab.getParentSymbolTable().getSymbolTableType() != SPLSymbolTable.COLLECT )
-          {	
-              SPLSymbolTable parentSymTab = symbtab.getParentSymbolTable();
-              List anchorClassList = parentSymTab.getAnchorClassList();
-              Iterator anchorClassListIt = anchorClassList.iterator();
-             
-             	referenceTypeName = (String)anchorClassListIt.next();
-             
-             
-          }
-          else{
-//          	throw new SPLException("non collect Parent SymbolTable not found in Self Expression");
-        	  logger.severe("non collect Parent SymbolTable not found in Self Expression");
-        	  
-          }
-          logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-          return referenceTypeName;
+    	logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "evaluate");
+
+		String referenceTypeName = null;
+		SPLSymbolTable symbtab = sTab;
+		while (sTab.getParentSymbolTable() != null
+				&& sTab.getParentSymbolTable().getSymbolTableType() == SPLSymbolTable.COLLECT) 
+		{
+			symbtab = sTab.getParentSymbolTable();
+		}
+
+		if (symbtab.getParentSymbolTable() != null
+				&& symbtab.getParentSymbolTable().getSymbolTableType() != SPLSymbolTable.COLLECT) 
+		{
+			SPLSymbolTable parentSymTab = symbtab.getParentSymbolTable();
+			List anchorClassList = parentSymTab.getAnchorClassList();
+			Iterator anchorClassListIt = anchorClassList.iterator();
+
+			referenceTypeName = (String) anchorClassListIt.next();
+
+		} 
+		else 
+		{
+			logger
+					.severe("non collect Parent SymbolTable not found in Self Expression");
+		}
+		
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "evaluate");
+		
+		return referenceTypeName;
     }
     
     public Object evaluate() throws SPLException
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-       //System.out.println("evaluating Self expression");
-        Object ins = null;
-        SPLSymbolTable symbtab=sTab;
-        while(sTab.getParentSymbolTable() != null && sTab.getParentSymbolTable().getSymbolTableType() == SPLSymbolTable.COLLECT){
-        	symbtab=sTab.getParentSymbolTable();
-        }
-        
-        
-        if (symbtab.getParentSymbolTable() != null && symbtab.getParentSymbolTable().getSymbolTableType() != SPLSymbolTable.COLLECT )
-        {	
-            SPLSymbolTable parentSymTab = symbtab.getParentSymbolTable();
-            String referenceTypeName = null;
-            List anchorClassList = parentSymTab.getAnchorClassList();
-            Iterator anchorClassListIt = anchorClassList.iterator();
-           
-           	referenceTypeName = (String)anchorClassListIt.next();
-           
-            ins = parentSymTab.getInstance(referenceTypeName);
-        }
-        else{
-        	throw new SPLException("non collect Parent SymbolTable not found in Self Expression");
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-        
-        return ins;
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "evaluate");
+
+		Object ins = null;
+		SPLSymbolTable symbtab = sTab;
+		while (sTab.getParentSymbolTable() != null
+				&& sTab.getParentSymbolTable().getSymbolTableType() == SPLSymbolTable.COLLECT) 
+		{
+			symbtab = sTab.getParentSymbolTable();
+		}
+
+		if (symbtab.getParentSymbolTable() != null
+				&& symbtab.getParentSymbolTable().getSymbolTableType() != SPLSymbolTable.COLLECT) 
+		{
+			SPLSymbolTable parentSymTab = symbtab.getParentSymbolTable();
+			String referenceTypeName = null;
+			List anchorClassList = parentSymTab.getAnchorClassList();
+			Iterator anchorClassListIt = anchorClassList.iterator();
+
+			referenceTypeName = (String) anchorClassListIt.next();
+
+			ins = parentSymTab.getInstance(referenceTypeName);
+		} 
+		else 
+		{
+			throw new SPLException(Messages.getString("SPL_SELF_EXPRESSION_EXCEPTION_MSG"));
+		}
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "evaluate");
+
+		return ins;
     }
     
     public TypeInfo getType()
@@ -136,15 +146,21 @@
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
         
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+      
         return _dataType;
     }
     
     public boolean validate() throws SPLException
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-        _dataType = new TypeInfo(TypeConstants.referenceType,null,false);
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-        return true;
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "validate");
+		
+        _dataType = new TypeInfo(TypeConstants.referenceType, null, false);
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "validate");
+		
+		return true;
     }
     
     public boolean isArray()
@@ -152,13 +168,14 @@
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
         
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-        // TODO Auto-generated method stub
+        
         return false;
     }
     
     public String toString()
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+        
         String str=" self ";
                          
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/DoubleArgumentExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/DoubleArgumentExpression.java?rev=686743&r1=686742&r2=686743&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/DoubleArgumentExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/DoubleArgumentExpression.java Mon Aug 18 05:50:36 2008
@@ -31,88 +31,87 @@
 import org.apache.imperius.spl.external.Expression;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
 import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
-
-
 public abstract class DoubleArgumentExpression implements Expression
 {
     
     protected Expression _lhsExp;
-    
-    protected Expression _rhsExp;
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
 
-    private final String sourceClass="DoubleArgumentExpression";
-    
-   // protected boolean _isArray = false;
-    
-    protected TypeInfo _dataType = new TypeInfo();
+	protected Expression _rhsExp;
+
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+	private final String sourceClass = "DoubleArgumentExpression";
+
+	// protected boolean _isArray = false;
+
+	protected TypeInfo _dataType = new TypeInfo();
     
     public DoubleArgumentExpression(List exprList)
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "DoubleArgumentExpression");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "DoubleArgumentExpression");
 
-    
-        if (exprList != null)
-        {
-            
-            if (exprList.size() == 2)
-            {
-                Expression l = (Expression) exprList.get(0);
-                Expression r = (Expression) exprList.get(1);
-                
-                if (l == null)
-                {
-                    logger.severe(
-                    "left hand side expression passed in is null.");
-                    throw new IllegalArgumentException(
-                            "left hand side expression passed in is null.");
-                }
-                else
-                {
-                    // //System.out.println("DoubleArgumentExpression::LHS
-                    // "+l.getClass()+l.toString());
-                }
-                
-                if (r == null)
-                {
-                    logger.severe(
-                    "right hand side expression passed in is null.");
-                    throw new IllegalArgumentException(
-                            "right hand side expression passed in is null.");
-                }
-                else
-                {
-                    // //System.out.println("DoubleArgumentExpression::RHS
-                    // "+r.getClass()+r.toString());
-                }
-                
-                this._lhsExp = l;
-                this._rhsExp = r;
-                
-            }
-            else
-            {
-                logger.severe(
-                        "No of arguments should be 2, but is "
-                        + exprList.size());
-                
-                throw new IllegalArgumentException(
-                        "No of arguments should be 2, but is "
-                                + exprList.size());
-            }
-        }
-        else
-        {
-            logger.severe(
-            "No of arguments passed required number of arguments is 2");
-            throw new IllegalArgumentException(
-                    "No of arguments passed required number of arguments is 2");
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "DoubleArgumentExpression");
-        
+		if (exprList != null) 
+		{
+			if (exprList.size() == 2) 
+			{
+				Expression l = (Expression) exprList.get(0);
+				Expression r = (Expression) exprList.get(1);
+
+				if (l == null) 
+				{
+					logger
+							.severe("left hand side expression passed in is null.");
+					throw new IllegalArgumentException(Messages.getString(
+							"SPL_PASSED_EXPRESSION_ERROR_MSG",
+							new Object[] { "left" }));
+				} 
+				else 
+				{
+					// //System.out.println("DoubleArgumentExpression::LHS
+					// "+l.getClass()+l.toString());
+				}
+
+				if (r == null) 
+				{
+					logger
+							.severe("right hand side expression passed in is null.");
+					throw new IllegalArgumentException(Messages.getString(
+							"SPL_PASSED_EXPRESSION_ERROR_MSG",
+							new Object[] { "right" }));
+				} 
+				else 
+				{
+					// //System.out.println("DoubleArgumentExpression::RHS
+					// "+r.getClass()+r.toString());
+				}
+				this._lhsExp = l;
+				this._rhsExp = r;
+			} 
+			else 
+			{
+				logger.severe("No of arguments should be 2, but is "
+						+ exprList.size());
+
+				throw new IllegalArgumentException(Messages.getString(
+						"SPL_NO_OF_ARGUMENTS_PASSED_ERROR_MSG", new Object[] {
+								"2", exprList.size() + "" }));
+			}
+		} 
+		else 
+		{
+			logger
+					.severe("No of arguments passed required number of arguments is 2");
+
+			throw new IllegalArgumentException(Messages.getString(
+					"SPL_NO_OF_ARGUMENTS_PASSED_ERROR_MSG", new Object[] {
+							"2", "blank" }));
+		}
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "DoubleArgumentExpression");
     }
     
     public abstract Object evaluate() throws SPLException;
@@ -137,14 +136,22 @@
     
     public String toString()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( "+this._lhsExp.toString()+" , "+this._rhsExp.toString()+" )";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+        String className = this.getClass().getName();
+
+		String str = className.substring(className.lastIndexOf(".") + 1,
+				className.length())
+				+ "( "
+				+ this._lhsExp.toString()
+				+ " , "
+				+ this._rhsExp.toString() + " )";
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		return str;
     }
     
     public abstract boolean validate() throws SPLException;

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MethodExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MethodExpression.java?rev=686743&r1=686742&r2=686743&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MethodExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MethodExpression.java Mon Aug 18 05:50:36 2008
@@ -40,26 +40,27 @@
 {
     
     private TypeInfo returnType = new TypeInfo();
-    
-    private ArrayList passedParams;
-    
-//    private SPLSymbolTable symTab;
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private final String sourceClass="MethodExpression";
-    
+
+	private ArrayList passedParams;
+
+	// private SPLSymbolTable symTab;
+
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+	private final String sourceClass = "MethodExpression";
     
     public MethodExpression(MethodSymbol ms, ArrayList pList,
             SPLSymbolTable symTab)
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "MethodExpression");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "MethodExpression");
+
+		returnType = ms.getType();
+		passedParams = pList;
+		// this.symTab = symTab;
 
-        
-        returnType = ms.getType();
-        passedParams = pList;
-//        this.symTab = symTab;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "MethodExpression");
-        
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "MethodExpression");
     }
     
     public Object evaluate()
@@ -68,7 +69,6 @@
 
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
        
-        // TODO Auto-generated method stub
         return null;
     }
     
@@ -78,7 +78,6 @@
 
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
        
-        // TODO Auto-generated method stub
         return returnType;
     }
     
@@ -88,7 +87,6 @@
 
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
        
-        // TODO Auto-generated method stub
         return true;
     }
     
@@ -98,25 +96,28 @@
 
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
        
-        // TODO Auto-generated method stub
         return false;
     }
     
     public String toString()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-        String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"[ "+ this.passedParams.toString()+" ]";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		String className = this.getClass().getName();
+
+		String str = className.substring(className.lastIndexOf(".") + 1,
+				className.length())
+				+ "[ " + this.passedParams.toString() + " ]";
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		return str;
     }
 
-	public String getReferenceTypeName() throws SPLException {
-		// TODO Auto-generated method stub
+	public String getReferenceTypeName() throws SPLException 
+	{
 		return null;
 	}
     

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MultipleArgumentExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MultipleArgumentExpression.java?rev=686743&r1=686742&r2=686743&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MultipleArgumentExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MultipleArgumentExpression.java Mon Aug 18 05:50:36 2008
@@ -32,6 +32,7 @@
 import org.apache.imperius.spl.external.Expression;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
 import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
 
@@ -39,64 +40,67 @@
 {
     
     protected List _expressions;
-    
-    // protected Expression rhsExp;
-    
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private final String sourceClass="MultipleArgumentExpression";
-    
-    
-    protected TypeInfo _dataType =  new TypeInfo();
+
+	// protected Expression rhsExp;
+
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+	private final String sourceClass = "MultipleArgumentExpression";
+
+	protected TypeInfo _dataType = new TypeInfo();
     
     public MultipleArgumentExpression(List exprList)
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "MultipleArgumentExpression");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "MultipleArgumentExpression");
 
-        
-        if (exprList != null)
-        {
-            
-            if (exprList.size() != 0)
-            {
-                this._expressions = new ArrayList();
-                for (int i = 0; i < exprList.size(); i++)
-                {
-                    
-                    Expression l = (Expression) exprList.get(i);
-                    
-                    if (l == null)
-                    {
-                        logger.severe( "expression passed in is null.");
-                        
-                        throw new IllegalArgumentException(
-                                "expression passed in is null.");
-                    }
-                    else
-                    {
-                        this._expressions.add(l);
-                        
-                    }
-                }
-            }
-            else
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"No of arguments should be > 0, but is "
-                        + exprList.size());
-                
-                throw new IllegalArgumentException(
-                        "No of arguments should be > 0, but is "
-                                + exprList.size());
-            }
-        }
-        else
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"No of arguments passed required number of arguments is 2");
-            
-            throw new IllegalArgumentException(
-                    "No of arguments passed required number of arguments is 2");
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "MultipleArgumentExpression");
+		if (exprList != null) 
+		{
+			if (exprList.size() != 0) 
+			{
+				this._expressions = new ArrayList();
+				for (int i = 0; i < exprList.size(); i++) 
+				{
+					Expression l = (Expression) exprList.get(i);
+					if (l == null) 
+					{
+						logger.severe("expression passed in is null.");
+
+						throw new IllegalArgumentException(Messages.getString(
+								"SPL_BLANK_EXPRESSION_PASSED_ERROR_MSG",
+								new Object[] { "" }));
+					} 
+					else 
+					{
+						this._expressions.add(l);
+					}
+				}
+			} 
+			else 
+			{
+				logger.severe(Thread.currentThread().getName() + " "
+						+ "No of arguments should be > 0, but is "
+						+ exprList.size());
+				
+				throw new IllegalArgumentException(Messages.getString(
+						"SPL_NO_ARGUMENTS_PASSED_ERROR_MSG", new Object[] {
+								">0", "" + exprList.size() }));
+			}
+		} 
+		else 
+		{
+			logger
+					.severe(Thread.currentThread().getName()
+							+ " "
+							+ "No of arguments passed required number of arguments is 2");
+
+			throw new IllegalArgumentException(Messages.getString(
+					"SPL_NO_ARGUMENTS_PASSED_ERROR_MSG", new Object[] {
+							">0", "blank"}));
+		}
+		
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "MultipleArgumentExpression");
         
     }
     
@@ -104,67 +108,72 @@
     
     public TypeInfo getType()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "getType");
 
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-       
-        return _dataType;
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "getType");
+
+		return _dataType;
     }
     
     public boolean isArray()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "isArray");
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "isArray");
 
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-       
-        return this._dataType.getIsArray();
+		return this._dataType.getIsArray();
     }
     
     public String toString()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-        String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( ";
-        
-        if (this._expressions.size() != 0)
-        {
-            
-            for (int i = 0; i < this._expressions.size(); i++)
-            {
-                
-                Expression l = (Expression) this._expressions.get(i);
-                
-                if (l == null)
-                {
-                    logger.severe( "expression passed in is null.");
-                    
-                    throw new IllegalArgumentException(
-                            "expression passed in is null.");
-                }
-                else
-                {
-                    str+=l.toString();
-                    
-                }
-                if(i != this._expressions.size() -1){
-                    str+=" , ";
-                }
-            }
-            str+=" )";
-        }
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		String className = this.getClass().getName();
+
+		String str = className.substring(className.lastIndexOf(".") + 1,
+				className.length())
+				+ "( ";
+
+		if (this._expressions.size() != 0) 
+		{
+			for (int i = 0; i < this._expressions.size(); i++) 
+			{
+				Expression l = (Expression) this._expressions.get(i);
+				if (l == null) 
+				{
+					logger.severe("expression passed in is null.");
+
+					throw new IllegalArgumentException(Messages.getString(
+							"SPL_BLANK_EXPRESSION_PASSED_ERROR_MSG",
+							new Object[] { "" }));
+				} 
+				else 
+				{
+					str += l.toString();
+				}
+				if (i != this._expressions.size() - 1) 
+				{
+					str += " , ";
+				}
+			}
+			str += " )";
+		}
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		return str;
     }
     
     public abstract boolean validate() throws SPLException;
     
     public String getReferenceTypeName() throws SPLException
     {
-    	//throw new SPLException("Expression not of Reference type");
     	return null;
     }
 }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/QuadrupleArgumentExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/QuadrupleArgumentExpression.java?rev=686743&r1=686742&r2=686743&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/QuadrupleArgumentExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/QuadrupleArgumentExpression.java Mon Aug 18 05:50:36 2008
@@ -30,104 +30,104 @@
 import org.apache.imperius.spl.external.Expression;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
 import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
-
-
 public abstract class QuadrupleArgumentExpression implements Expression
 {
-    
     protected Expression _exp1;
-    
-    protected Expression _exp2;
-    
-    protected Expression _exp3;
-    
-    protected Expression _exp4;
-    
-   
-    
-    protected TypeInfo _dataType = new TypeInfo();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="class";
-    
-    
+
+	protected Expression _exp2;
+
+	protected Expression _exp3;
+
+	protected Expression _exp4;
+
+	protected TypeInfo _dataType = new TypeInfo();
+
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+	private static final String sourceClass = "class";
     
     public boolean isArray()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "isArray");
 
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-     
-        
-        return _dataType.getIsArray();
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "isArray");
+
+		return _dataType.getIsArray();
     }
     
- 
-    
     public QuadrupleArgumentExpression(List exprList)
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "QuadrupleArgumentExpression");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "QuadrupleArgumentExpression");
 
-        if (exprList != null)
-        {
-            if (exprList.size() == 4)
-            {
-                Expression e1 = (Expression) exprList.get(0);
-                Expression e2 = (Expression) exprList.get(1);
-                Expression e3 = (Expression) exprList.get(2);
-                Expression e4 = (Expression) exprList.get(3);
-                if (e1 == null)
-                {
-                    logger.severe(
-                    "first expression passed in is null.");
-                    
-                    throw new IllegalArgumentException(
-                            "first expression passed in is null.");
-                }
-                
-                if (e2 == null)
-                {
-                    logger.severe(
-                    "second expression passed in is null.");
-                    
-                    throw new IllegalArgumentException(
-                            "second expression passed in is null.");
-                }
-                
-                if (e3 == null)
-                {
-                    logger.severe(
-                    "third expression passed in is null.");
-                    
-                    throw new IllegalArgumentException(
-                            "third expression passed in is null.");
-                }
-                
-                if (e4 == null)
-                {
-                    logger.severe(
-                    "fourth expression passed in is null.");
-                    
-                    throw new IllegalArgumentException(
-                            "fourth expression passed in is null.");
-                }
-                
-                this._exp1 = e1;
-                this._exp2 = e2;
-                this._exp3 = e3;
-                this._exp4 = e4;
-                
-            }
-            else
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"number of parameters not 4");
-                
-                throw new IllegalArgumentException("number of parameters not 4");
-            }
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "QuadrupleArgumentExpression");
+		if (exprList != null) 
+		{
+			if (exprList.size() == 4) 
+			{
+				Expression e1 = (Expression) exprList.get(0);
+				Expression e2 = (Expression) exprList.get(1);
+				Expression e3 = (Expression) exprList.get(2);
+				Expression e4 = (Expression) exprList.get(3);
+				
+				if (e1 == null) 
+				{
+					logger.severe("first expression passed in is null.");
+
+					throw new IllegalArgumentException(Messages.getString(
+							"SPL_BLANK_EXPRESSION_PASSED_ERROR_MSG",
+							new Object[] { "first" }));
+				}
+
+				if (e2 == null) 
+				{
+					logger.severe("second expression passed in is null.");
+
+					throw new IllegalArgumentException(Messages.getString(
+							"SPL_BLANK_EXPRESSION_PASSED_ERROR_MSG",
+							new Object[] { "second" }));
+				}
+
+				if (e3 == null) 
+				{
+					logger.severe("third expression passed in is null.");
+
+					throw new IllegalArgumentException(Messages.getString(
+							"SPL_BLANK_EXPRESSION_PASSED_ERROR_MSG",
+							new Object[] { "third" }));
+				}
+
+				if (e4 == null) 
+				{
+					logger.severe("fourth expression passed in is null.");
+
+					throw new IllegalArgumentException(Messages.getString(
+							"SPL_BLANK_EXPRESSION_PASSED_ERROR_MSG",
+							new Object[] { "fourth" }));
+				}
+
+				this._exp1 = e1;
+				this._exp2 = e2;
+				this._exp3 = e3;
+				this._exp4 = e4;
+
+			} 
+			else 
+			{
+				logger.severe(Thread.currentThread().getName() + " "
+						+ "number of parameters not 4");
+
+				throw new IllegalArgumentException(Messages.getString(
+						"SPL_NO_OF_ARGUMENTS_PASSED_ERROR_MSG", new Object[] {
+								"4", "" + exprList.size() }));
+			}
+		}
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "QuadrupleArgumentExpression");
         
     }
     
@@ -135,11 +135,13 @@
     
     public TypeInfo getType()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "getType");
 
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-     
-        return _dataType;
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "getType");
+
+		return _dataType;
     }
     
     public abstract boolean validate() throws SPLException;
@@ -147,7 +149,5 @@
     public String getReferenceTypeName() throws SPLException
     {
     	return null;
-    	//throw new SPLException("ReferenceTypeName not supported");
     }
-    
 }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/SingleArgumentExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/SingleArgumentExpression.java?rev=686743&r1=686742&r2=686743&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/SingleArgumentExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/SingleArgumentExpression.java Mon Aug 18 05:50:36 2008
@@ -31,6 +31,7 @@
 import org.apache.imperius.spl.external.Expression;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
 import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
 
@@ -44,8 +45,6 @@
         
     protected TypeInfo _dataType =  new TypeInfo();; 
     
-   
-    
     public boolean isArray()
     {
         return _dataType.getIsArray();
@@ -63,25 +62,26 @@
                 if (e == null)
                 {
                     logger.severe(Thread.currentThread().getName()+" "+"expression passed in is null.");
-                    throw new IllegalArgumentException(
-                            "expression passed in is null.");
+                    throw new IllegalArgumentException(Messages.getString(
+							"SPL_BLANK_EXPRESSION_PASSED_ERROR_MSG",
+							new Object[] { "" }));
                 }
-                
                 this._exp = e;
-                
             }
             else
             {
                 logger.severe(  "expression List size is not equal to one.");
-                throw new IllegalArgumentException(
-                        "expression List size is not equal to one.");
+                throw new IllegalArgumentException(Messages.getString(
+						"SPL_NO_OF_ARGUMENTS_PASSED_ERROR_MSG",
+						new Object[] { "1", ""+exprList.size() }));
             }
         }
         else
         {
             logger.severe( "expression List passed in is null.");
-            throw new IllegalArgumentException(
-                    "expression List passed in is null.");
+            throw new IllegalArgumentException(Messages.getString(
+					"SPL_NO_OF_ARGUMENTS_PASSED_ERROR_MSG",
+					new Object[] { "1", "null" }));
         }
 
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "SingleArgumentExpression");
@@ -92,31 +92,36 @@
     
     public TypeInfo getType()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "getType");
 
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-       
-        return _dataType;
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "getType");
+
+		return _dataType;
     }
     
     public String toString()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-        String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( "+ this._exp.toString()+" )";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		String className = this.getClass().getName();
+
+		String str = className.substring(className.lastIndexOf(".") + 1,
+				className.length())
+				+ "( " + this._exp.toString() + " )";
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		return str;
     }
     
     public abstract boolean validate() throws SPLException;
     
     public String getReferenceTypeName() throws SPLException
     {
-    	//throw new SPLException("Expression not a referenceExpression");
     	return null;
     }
     

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TimeZoneExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TimeZoneExpression.java?rev=686743&r1=686742&r2=686743&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TimeZoneExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TimeZoneExpression.java Mon Aug 18 05:50:36 2008
@@ -36,6 +36,7 @@
 import org.apache.imperius.spl.parser.expressions.impl.StringConstant;
 import org.apache.imperius.spl.parser.util.TypeInfo;
 import org.apache.imperius.spl.parser.util.TypeResolver;
+import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
 
@@ -44,55 +45,54 @@
 {
     
     public static final String className = TimeZoneExpression.class.getName();
-    
-    
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    
-    private static final String sourceClass="TimeZoneExpression";
+
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+	private static final String sourceClass = "TimeZoneExpression";
     
     
     public boolean isArray()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "isArray");
 
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-       
-       
-        return _dataType.getIsArray();
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "isArray");
+
+		return _dataType.getIsArray();
     }
     
     public TimeZoneExpression(List exprList, boolean validateExpression)
             throws SPLException
     {
-            
         super(exprList);
-        
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "TimeZoneExpression");
 
-        if (validateExpression)
-        {
-            if (!validate())
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
-                        + " has wrong data type passed in.");
-                
-                throw new SPLException("validation error: " + className
-                        + " has wrong data type passed in.");
-            }
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "TimeZoneExpression");
+		logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "TimeZoneExpression");
+
+		if (validateExpression) 
+		{
+			if (!validate()) 
+			{
+				logger.severe(Thread.currentThread().getName() + " "
+						+ "validation error: " + className
+						+ " has wrong data type passed in.");
+
+				throw new SPLException(Messages.getString(
+						"SPL_VALIDATION_ERROR_MSG", new Object[] { className }));
+			}
+		}
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "TimeZoneExpression");
         
     }
     
     public Object evaluate() throws SPLException
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
        
         try
         {
-
             logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
            
             return this._exp.evaluate();
@@ -100,7 +100,9 @@
         catch (Exception e)
         {
             logger.severe(Thread.currentThread().getName()+" "+"evaluation errro: " + e.toString());
-            throw new SPLException("evaluation errro: " + e.toString());
+
+            throw new SPLException(Messages.getString(
+					"SPL_EVALUATION_ERROR_MSG", new Object[] { className + " : " + e.getLocalizedMessage() }));
         }
 
     }
@@ -110,7 +112,6 @@
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
 
-       
         Expression e = new StringConstant(tzid);
         List aList = new ArrayList();
         aList.add(e);
@@ -129,19 +130,15 @@
     {
         logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
 
-               
         TypeInfo eType = _exp.getType();
-        
         _dataType = new TypeInfo(TypeConstants.stringType,null,false);
         if (TypeResolver.isString(eType))
         {
-
             logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
            
             return true;
         }
         
-
         logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
        
         return false;
@@ -149,20 +146,23 @@
     
     public String toString()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( "+ this._exp.toString()+" )";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		String className = this.getClass().getName();
+
+		String str = className.substring(className.lastIndexOf(".") + 1,
+				className.length())
+				+ "( " + this._exp.toString() + " )";
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		return str;
     }
 
-	public String getReferenceTypeName() throws SPLException {
-		// TODO Auto-generated method stub
+	public String getReferenceTypeName() throws SPLException 
+	{
 		return null;
 	}
-    
 }

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=686743&r1=686742&r2=686743&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 Mon Aug 18 05:50:36 2008
@@ -31,6 +31,7 @@
 import org.apache.imperius.spl.external.Expression;
 import org.apache.imperius.spl.parser.exceptions.SPLException;
 import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.Messages;
 import org.apache.imperius.util.SPLLogger;
 
 
@@ -38,82 +39,94 @@
 {
     
     protected Expression _lhsExp;
-    
-    protected Expression _midExp;
-    
-    protected Expression _rhsExp;
-    
-    protected TypeInfo _dataType = new TypeInfo();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    
-    private final String sourceClass="TripleArgumentExpression";
-    
-   
+
+	protected Expression _midExp;
+
+	protected Expression _rhsExp;
+
+	protected TypeInfo _dataType = new TypeInfo();
+
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+	private final String sourceClass = "TripleArgumentExpression";
     
     public boolean isArray()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "isArray");
 
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-       
-        
-        return _dataType.getIsArray();
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "isArray");
+
+		return _dataType.getIsArray();
     }
     
-  
-    
     public TripleArgumentExpression(List exprList) throws SPLException
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "TripleArgumentExpression");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "TripleArgumentExpression");
 
-       
-        if (exprList != null)
-        {
-            if (exprList.size() == 3)
-            {
-                Expression l = (Expression) exprList.get(0);
-                Expression m = (Expression) exprList.get(1);
-                Expression r = (Expression) exprList.get(2);
-                if (l == null)
-                {
-                    logger.severe(Thread.currentThread().getName()+" "+"left hand side expression passed in is null.");
-                    throw new IllegalArgumentException(
-                            "left hand side expression passed in is null.");
-                }
-                
-                if (m == null)
-                {
-                    logger.severe(Thread.currentThread().getName()+" "+"middle expression passed in is null.");
-                    throw new IllegalArgumentException(
-                            "middle expression passed in is null.");
-                }
-                
-                if (r == null)
-                {
-                    logger.severe(Thread.currentThread().getName()+" "+"right hand side expression passed in is null.");
-                    throw new IllegalArgumentException(
-                            "right hand side expression passed in is null.");
-                }
-                
-                this._lhsExp = l;
-                this._midExp = m;
-                this._rhsExp = r;
-                
-            }
-            else
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"number of parameters passed is not 3.");
-                throw new IllegalArgumentException(
-                        "number of parameters passed is not 3.");
-            }
-        }
-        else
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"parameters passed are null.");
-            throw new IllegalArgumentException("parameters passed are null.");
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "TripleArgumentExpression");
+		if (exprList != null) 
+		{
+			if (exprList.size() == 3) 
+			{
+				Expression l = (Expression) exprList.get(0);
+				Expression m = (Expression) exprList.get(1);
+				Expression r = (Expression) exprList.get(2);
+				
+				if (l == null) 
+				{
+					logger.severe(Thread.currentThread().getName() + " "
+							+ "left hand side expression passed in is null.");
+					throw new IllegalArgumentException(Messages.getString(
+							"SPL_PASSED_EXPRESSION_ERROR_MSG",
+							new Object[] { "left" }));
+				}
+
+				if (m == null) 
+				{
+					logger.severe(Thread.currentThread().getName() + " "
+							+ "middle expression passed in is null.");
+					throw new IllegalArgumentException(Messages.getString(
+							"SPL_PASSED_EXPRESSION_ERROR_MSG",
+							new Object[] { "middle" }));
+				}
+
+				if (r == null) 
+				{
+					logger.severe(Thread.currentThread().getName() + " "
+							+ "right hand side expression passed in is null.");
+					throw new IllegalArgumentException(Messages.getString(
+							"SPL_PASSED_EXPRESSION_ERROR_MSG",
+							new Object[] { "right" }));
+				}
+
+				this._lhsExp = l;
+				this._midExp = m;
+				this._rhsExp = r;
+
+			} 
+			else 
+			{
+				logger.severe(Thread.currentThread().getName() + " "
+						+ "number of parameters passed is not 3.");
+				throw new IllegalArgumentException(Messages.getString(
+						"SPL_NO_OF_ARGUMENTS_PASSED_ERROR_MSG", new Object[] {
+								"3", "" + exprList.size() }));
+			}
+		} 
+		else 
+		{
+			logger.severe(Thread.currentThread().getName() + " "
+					+ "parameters passed are null.");
+
+			throw new IllegalArgumentException(Messages.getString(
+					"SPL_NO_OF_ARGUMENTS_PASSED_ERROR_MSG", new Object[] {
+							"3", "empty"}));
+		}
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "TripleArgumentExpression");
         
     }
     
@@ -121,24 +134,36 @@
     
     public TypeInfo getType()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "getType");
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "getType");
 
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-       
-        return _dataType;
+		return _dataType;
     }
     
     public String toString()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-        String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( "+this._lhsExp.toString()+" , "+this._midExp.toString()+" , "+this._rhsExp.toString()+" )";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		String className = this.getClass().getName();
+
+		String str = className.substring(className.lastIndexOf(".") + 1,
+				className.length())
+				+ "( "
+				+ this._lhsExp.toString()
+				+ " , "
+				+ this._midExp.toString()
+				+ " , "
+				+ this._rhsExp.toString()
+				+ " )";
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		return str;
     }
  
     
@@ -146,7 +171,6 @@
     
     public String getReferenceTypeName() throws SPLException
     {
-    	//throw new SPLException("Expression is not of type reference");
     	return null;
     }
 }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ZeroArgumentExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ZeroArgumentExpression.java?rev=686743&r1=686742&r2=686743&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ZeroArgumentExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ZeroArgumentExpression.java Mon Aug 18 05:50:36 2008
@@ -37,12 +37,10 @@
 public abstract class ZeroArgumentExpression implements Expression
 {
     private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    
-    private final String sourceClass="ZeroArgumentExpression";
-        
-    protected TypeInfo _dataType = new TypeInfo();
-    
-   
+
+	private final String sourceClass = "ZeroArgumentExpression";
+
+	protected TypeInfo _dataType = new TypeInfo();
     
     public boolean isArray()
     {
@@ -51,15 +49,17 @@
     
     public ZeroArgumentExpression(List exprList)
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "ZeroArgumentExpression");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "ZeroArgumentExpression");
 
-        /*if (exprList != null)
-        {        throw new IllegalArgumentException(
-                            "ZeroArgumentExpression expression should not be passed arguments");
-         
-        }*/
+		/*
+		 * if (exprList != null) { throw new IllegalArgumentException(
+		 * "ZeroArgumentExpression expression should not be passed arguments");
+		 *  }
+		 */
 
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "ZeroArgumentExpression");
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "ZeroArgumentExpression");
        
     }
     
@@ -67,31 +67,36 @@
     
     public TypeInfo getType()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "getType");
 
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-       
-        return _dataType;
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "getType");
+
+		return _dataType;
     }
     
     public String toString()
     {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-        String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"()";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
+        logger.entering(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		String className = this.getClass().getName();
+
+		String str = className.substring(className.lastIndexOf(".") + 1,
+				className.length())
+				+ "()";
+
+		logger.exiting(sourceClass, Thread.currentThread().getName() + " "
+				+ "toString");
+
+		return str;
     }
     
     public abstract boolean validate() throws SPLException;
     
     public String getReferenceTypeName() throws SPLException
     {
-    	//throw new SPLException("This expression is not of reference type");
     	return null;
     }
     



Mime
View raw message