incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jnee...@apache.org
Subject svn commit: r695918 - in /incubator/imperius/trunk: imperius-javaspl/src/main/java/org/apache/imperius/javaspl/ imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/ imperius-splcore/src/main/java/org/apache/imperius/spl/parser/excepti...
Date Tue, 16 Sep 2008 14:39:34 GMT
Author: jneeraj
Date: Tue Sep 16 07:39:33 2008
New Revision: 695918

URL: http://svn.apache.org/viewvc?rev=695918&view=rev
Log:
IMPERIUS-18: catch and rethrow exceptions for consumption by caller - patches by Reza

Modified:
    incubator/imperius/trunk/imperius-javaspl/src/main/java/org/apache/imperius/javaspl/JavaActuatorImpl.java
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/PolicyEvaluatorImpl.java
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/SPLException.java
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Equal.java
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Greater.java
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/GreaterOrEqual.java
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Less.java
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LessOrEqual.java
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/actions/impl/AnchorMethodInvokeAction.java

Modified: incubator/imperius/trunk/imperius-javaspl/src/main/java/org/apache/imperius/javaspl/JavaActuatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-javaspl/src/main/java/org/apache/imperius/javaspl/JavaActuatorImpl.java?rev=695918&r1=695917&r2=695918&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-javaspl/src/main/java/org/apache/imperius/javaspl/JavaActuatorImpl.java
(original)
+++ incubator/imperius/trunk/imperius-javaspl/src/main/java/org/apache/imperius/javaspl/JavaActuatorImpl.java
Tue Sep 16 07:39:33 2008
@@ -108,17 +108,17 @@
                 result = method.invoke(instance, arrayOfParameters);
             }
         } catch (ClassNotFoundException e) {
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         } catch (SecurityException e) {
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         } catch (NoSuchMethodException e) {
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         } catch (IllegalArgumentException e) {
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         } catch (IllegalAccessException e) {
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         } catch (InvocationTargetException e) {
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         }
         return result;
     }
@@ -182,17 +182,17 @@
                 }
             }
         } catch (ClassNotFoundException e) {
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         } catch (SecurityException e) {
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         } catch(NoSuchMethodException e) {
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         } catch(InvocationTargetException e) {
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         } catch (IllegalArgumentException e) {
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         } catch (IllegalAccessException e) {
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         }
 
     }
@@ -226,8 +226,7 @@
                 paramTypeArray[i++] = c;
             }
         } catch (ClassNotFoundException e) {
-            e.printStackTrace();
-            throw new SPLException(e.getMessage());
+            throw new SPLException(e);
         }
         return paramTypeArray;
     }

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/PolicyEvaluatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/PolicyEvaluatorImpl.java?rev=695918&r1=695917&r2=695918&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/PolicyEvaluatorImpl.java
(original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/PolicyEvaluatorImpl.java
Tue Sep 16 07:39:33 2008
@@ -146,10 +146,13 @@
 		{
 			logger.log(Level.SEVERE, Messages.SPLOF0008E, new Object[] { e1
 					.getMessage() });
+			throw e1;
 		} 
 		catch (Exception e) 
 		{
 			logger.log(Level.SEVERE, Messages.SPLOF0008E, new Object[]{e.getMessage()});
+			if (e instanceof RuntimeException)
+			    throw (RuntimeException)e;
 		}
 		return null;
 	}

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/SPLException.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/SPLException.java?rev=695918&r1=695917&r2=695918&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/SPLException.java
(original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/exceptions/SPLException.java
Tue Sep 16 07:39:33 2008
@@ -40,4 +40,14 @@
     {
         super(s);
     }
+	
+	public SPLException(Throwable t)
+	{
+	  super(t);
+	}
+	   
+	public SPLException(String s, Throwable t)
+	{
+	      super(s,t);
+	}
 }

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=695918&r1=695917&r2=695918&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 16 07:39:33 2008
@@ -110,7 +110,7 @@
             
             throw new SPLException(Messages.getString(
 					"SPL_EVALUATION_ERROR_MSG", new Object[] { e
-							.getLocalizedMessage() }));
+							.getLocalizedMessage() }), e);
 
         }
     }

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=695918&r1=695917&r2=695918&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 16 07:39:33 2008
@@ -101,7 +101,7 @@
             
             throw new SPLException(Messages.getString(
 					"SPL_EVALUATION_ERROR_MSG", new Object[] { e
-							.getLocalizedMessage() }));
+							.getLocalizedMessage() }),e);
 
         }
     }

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=695918&r1=695917&r2=695918&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 16 07:39:33 2008
@@ -101,7 +101,7 @@
             
             throw new SPLException(Messages.getString(
 					"SPL_EVALUATION_ERROR_MSG", new Object[] { e
-							.getLocalizedMessage() }));
+							.getLocalizedMessage() }),e);
 
         }
     }

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=695918&r1=695917&r2=695918&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 16 07:39:33 2008
@@ -101,7 +101,7 @@
             
             throw new SPLException(Messages.getString(
 					"SPL_EVALUATION_ERROR_MSG", new Object[] { e
-							.getLocalizedMessage() }));
+							.getLocalizedMessage() }),e);
 
         }
     }

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=695918&r1=695917&r2=695918&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 16 07:39:33 2008
@@ -98,7 +98,7 @@
             
             throw new SPLException(Messages.getString(
 					"SPL_EVALUATION_ERROR_MSG", new Object[] { e
-							.getLocalizedMessage() }));
+							.getLocalizedMessage() }),e);
 
         }
     }

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=695918&r1=695917&r2=695918&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 16 07:39:33 2008
@@ -259,7 +259,7 @@
 
     public static Object invokeClassMethod(SPLSymbolTable symTab,
             String className, String qualifier, String methodName,
-            List paramList, Object targetObject) 
+            List paramList, Object targetObject) throws SPLException
     {
         List parameterObjects = new ArrayList();
         try 
@@ -399,7 +399,8 @@
             logger.exiting(sourceClass, Thread.currentThread().getName() + " "
                     + "execute");
 
-            return null;
+          //  return null;
+            throw e;
         }
     }
 



Mime
View raw message