Code polishing after analysis.

This commit is contained in:
Erwin Vervaet
2006-12-30 14:33:18 +00:00
parent 5e08f39c06
commit 4bfbeadb37
4 changed files with 8 additions and 14 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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");
}

View File

@@ -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("-");