incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daw...@apache.org
Subject svn commit: r945345 - /incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/EvaluationResults.java
Date Mon, 17 May 2010 20:23:46 GMT
Author: dawood
Date: Mon May 17 20:23:45 2010
New Revision: 945345

URL: http://svn.apache.org/viewvc?rev=945345&view=rev
Log:
Better performance in addNewStatusCode().

Modified:
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/EvaluationResults.java

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/EvaluationResults.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/EvaluationResults.java?rev=945345&r1=945344&r2=945345&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/EvaluationResults.java
(original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/statements/EvaluationResults.java
Mon May 17 20:23:45 2010
@@ -104,24 +104,32 @@ public class EvaluationResults {
 	 */
 	public List getNestedResults() { return evaluationResults; }
 	
+//	private void addNewStatusCode(int newStatus) {
+//		switch (newStatus) {
+//			case SPLPolicy.POLICY_EVALUATION_FAILED:
+//				statusCode = SPLPolicy.POLICY_EVALUATION_FAILED;
+//				break;
+//			case SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY:
+//				switch (statusCode) {
+//					case SPLPolicy.POLICY_EVALUATION_FAILED:			break;
+//					case SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY:		break;
+//					case SPLPolicy.POLICY_NOT_EVALUATED: statusCode = SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY;
+//				}
+//				break;
+//			case SPLPolicy.POLICY_NOT_EVALUATED:
+//				break;
+//			default:
+//				throw new RuntimeException("Illegal status " + newStatus);
+//				
+//		}
+//
+//	}
 	private void addNewStatusCode(int newStatus) {
-		switch (newStatus) {
-			case SPLPolicy.POLICY_EVALUATION_FAILED:
-				statusCode = SPLPolicy.POLICY_EVALUATION_FAILED;
-				break;
-			case SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY:
-				switch (statusCode) {
-					case SPLPolicy.POLICY_EVALUATION_FAILED:			break;
-					case SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY:		break;
-					case SPLPolicy.POLICY_NOT_EVALUATED: statusCode = SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY;
-				}
-				break;
-			case SPLPolicy.POLICY_NOT_EVALUATED:
-				break;
-			default:
-				throw new RuntimeException("Illegal status " + newStatus);
-				
-		}
+		if (newStatus == SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY 
+			&& statusCode == SPLPolicy.POLICY_NOT_EVALUATED)
+			statusCode = SPLPolicy.POLICY_EVALUATED_SUCCESSFULLY;
+		else if (newStatus == SPLPolicy.POLICY_EVALUATION_FAILED)
+			statusCode = SPLPolicy.POLICY_EVALUATION_FAILED;
 
 	}
 



Mime
View raw message