From 4bfbeadb37e2e819a9a0838d7e7ebc6de324233a Mon Sep 17 00:00:00 2001 From: Erwin Vervaet Date: Sat, 30 Dec 2006 14:33:18 +0000 Subject: [PATCH] Code polishing after analysis. --- .../engine/impl/RequestControlContextImpl.java | 4 ++-- .../webflow/executor/jsf/FlowPhaseListener.java | 4 ---- .../webflow/executor/jsf/FlowPropertyResolver.java | 2 +- .../org/springframework/webflow/util/RandomGuid.java | 12 +++++------- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/RequestControlContextImpl.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/RequestControlContextImpl.java index 4416d637..e4e423e6 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/RequestControlContextImpl.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/RequestControlContextImpl.java @@ -46,8 +46,8 @@ import org.springframework.webflow.execution.ViewSelection; * three classes work together to form a complete flow execution implementation * based on a finite state machine. * - * @see org.springframework.webflow.engine.machine.FlowExecutionImpl - * @see org.springframework.webflow.engine.machine.FlowSessionImpl + * @see FlowExecutionImpl + * @see FlowSessionImpl * * @author Keith Donald * @author Erwin Vervaet diff --git a/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowPhaseListener.java b/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowPhaseListener.java index eead27e7..f1dff58a 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowPhaseListener.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowPhaseListener.java @@ -242,10 +242,6 @@ public class FlowPhaseListener implements PhaseListener { UIViewRoot viewRoot = facesContext.getViewRoot(); if (viewRoot == null || hasViewChanged(viewRoot, viewId)) { // create the specified view so that it can be rendered - if (logger.isDebugEnabled()) { - logger.debug("Creating new view with id '" + viewId + "' from previous view with id '" - + viewRoot.getViewId() + "'"); - } ViewHandler handler = facesContext.getApplication().getViewHandler(); UIViewRoot view = handler.createView(facesContext, viewId); facesContext.setViewRoot(view); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowPropertyResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowPropertyResolver.java index c7d8b23b..7f44537d 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowPropertyResolver.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowPropertyResolver.java @@ -149,7 +149,7 @@ public class FlowPropertyResolver extends PropertyResolver { return; } if (property == null || !(property instanceof String) - || (property instanceof String && ((String)property).length() == 0)) { + || ((String)property).length() == 0) { throw new PropertyNotFoundException( "Attempt to set Flow attribute with null name, empty name, or non-String name"); } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/util/RandomGuid.java b/spring-webflow/src/main/java/org/springframework/webflow/util/RandomGuid.java index 73e53945..a16c53ce 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/util/RandomGuid.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/util/RandomGuid.java @@ -103,7 +103,7 @@ import java.util.Random; * @version 1.2.1 11/05/02 * @author Marc A. Mnich */ -public class RandomGuid extends Object { +public class RandomGuid { private static Random random; @@ -111,9 +111,7 @@ public class RandomGuid extends Object { private static String id; - private String valueBeforeMD5 = ""; - - private String valueAfterMD5 = ""; + private String guid; /* * Static block to take care of one time secureRandom seed. It takes a few @@ -187,7 +185,7 @@ public class RandomGuid extends Object { sbValueBeforeMD5.append(":"); sbValueBeforeMD5.append(Long.toString(rand)); - valueBeforeMD5 = sbValueBeforeMD5.toString(); + String valueBeforeMD5 = sbValueBeforeMD5.toString(); md5.update(valueBeforeMD5.getBytes()); byte[] array = md5.digest(); @@ -198,7 +196,7 @@ public class RandomGuid extends Object { sb.append('0'); sb.append(Integer.toHexString(b)); } - valueAfterMD5 = sb.toString(); + guid = sb.toString(); } /** @@ -207,7 +205,7 @@ public class RandomGuid extends Object { * Example: "C2FEEEAC-CFCD-11D1-8B05-00600806D9B6". */ public String toString() { - String raw = valueAfterMD5.toUpperCase(); + String raw = guid.toUpperCase(); StringBuffer sb = new StringBuffer(); sb.append(raw.substring(0, 8)); sb.append("-");