Code polishing after analysis.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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("-");
|
||||
|
||||
Reference in New Issue
Block a user