Use UtilValidate.isNotEmpty methods instead of (obj != null) || (obj.length > 0) and (obj != null) || (obj.size > 0)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@883549 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -32,6 +32,8 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.ofbiz.base.util.UtilValidate;
|
||||
|
||||
/**
|
||||
* Control Applet - Client applet for page pushing and (future) chat
|
||||
*/
|
||||
@@ -86,11 +88,11 @@ public class ControlApplet extends Applet implements Runnable {
|
||||
boolean visitOkay = false;
|
||||
boolean pageOkay = false;
|
||||
|
||||
if (sessionId != null && sessionId.length() > 0)
|
||||
if (UtilValidate.isNotEmpty(sessionId))
|
||||
sessionOkay = true;
|
||||
if (visitId != null && visitId.length() > 0)
|
||||
if (UtilValidate.isNotEmpty(visitId))
|
||||
visitOkay = true;
|
||||
if (currentPage != null && currentPage.length() > 0)
|
||||
if (UtilValidate.isNotEmpty(currentPage))
|
||||
pageOkay = true;
|
||||
|
||||
if (sessionOkay && visitOkay && pageOkay) {
|
||||
@@ -146,7 +148,7 @@ public class ControlApplet extends Applet implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
if (pullResp != null && pullResp.length() > 0) {
|
||||
if (UtilValidate.isNotEmpty(pullResp)) {
|
||||
URL docUrl = null;
|
||||
try {
|
||||
docUrl = new URL(pullResp);
|
||||
@@ -217,7 +219,7 @@ public class ControlApplet extends Applet implements Runnable {
|
||||
valueStr = value.toString();
|
||||
}
|
||||
|
||||
if (valueStr != null && valueStr.length() > 0) {
|
||||
if (UtilValidate.isNotEmpty(valueStr)) {
|
||||
if (buf.length() > 0) buf.append('&');
|
||||
try {
|
||||
buf.append(URLEncoder.encode(name, "UTF-8"));
|
||||
|
||||
Reference in New Issue
Block a user