Improved: Clean up commented out code in Java source for Common component.
(OFBIZ-8037) Thanks: Harsh for the contribution. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761237 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -275,14 +275,6 @@ public class CommonServices {
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "CommonEntityTestFailure", locale));
|
||||
}
|
||||
|
||||
/*
|
||||
try {
|
||||
newEntity.remove();
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logError(e, module);
|
||||
}
|
||||
*/
|
||||
|
||||
return ServiceUtil.returnSuccess();
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,6 @@ public class FindServices {
|
||||
// Contained in the associated entity.
|
||||
// Those extra fields will be ignored in the second half of this method.
|
||||
Map<String, Map<String, Map<String, Object>>> normalizedFields = new LinkedHashMap<String, Map<String, Map<String, Object>>>();
|
||||
//StringBuffer queryStringBuf = new StringBuffer();
|
||||
for (String fieldNameRaw: inputFields.keySet()) { // The name as it appeas in the HTML form
|
||||
String fieldNameRoot = null; // The entity field name. Everything to the left of the first "_" if
|
||||
// it exists, or the whole word, if not.
|
||||
@@ -130,7 +129,6 @@ public class FindServices {
|
||||
continue;
|
||||
}
|
||||
|
||||
//queryStringBuffer.append(fieldNameRaw + "=" + fieldValue);
|
||||
queryStringMap.put(fieldNameRaw, fieldValue);
|
||||
iPos = fieldNameRaw.indexOf("_"); // Look for suffix
|
||||
|
||||
|
||||
-1
@@ -62,7 +62,6 @@ public class JsLanguageFileMappingCreator {
|
||||
String jsFilePostFix = ".js";
|
||||
String dateJsLocalePrefix = "date-";
|
||||
String validateLocalePrefix = "messages_";
|
||||
//String validateMethLocalePrefix = "methods__";
|
||||
String jqueryUiLocalePrefix = "jquery.ui.datepicker-";
|
||||
String dateTimePickerPrefix = "jquery-ui-timepicker-";
|
||||
String defaultLocaleDateJs = "en-US";
|
||||
|
||||
@@ -59,7 +59,6 @@ public final class KeywordSearchUtil {
|
||||
private KeywordSearchUtil () {}
|
||||
|
||||
public static String getSeparators() {
|
||||
// String separators = ";: ,.!?\t\"\'\r\n\\/()[]{}*%<>-+_";
|
||||
String seps = UtilProperties.getPropertyValue("keywordsearch", "index.keyword.separators", ";: ,.!?\t\"\'\r\n\\/()[]{}*%<>-+_");
|
||||
return seps;
|
||||
}
|
||||
@@ -157,9 +156,7 @@ public final class KeywordSearchUtil {
|
||||
// replace all %% with %
|
||||
int dblPercIdx = -1;
|
||||
while ((dblPercIdx = strSb.indexOf("%%")) >= 0) {
|
||||
//Debug.logInfo("before strSb: " + strSb, module);
|
||||
strSb.replace(dblPercIdx, dblPercIdx+2, "%");
|
||||
//Debug.logInfo("after strSb: " + strSb, module);
|
||||
}
|
||||
token = strSb.toString();
|
||||
}
|
||||
|
||||
@@ -525,17 +525,6 @@ public class EmailServices {
|
||||
screenContextAtt.putAll(bodyParameters);
|
||||
screensAtt.render(xslfoAttachScreenLocation);
|
||||
|
||||
/*
|
||||
try { // save generated fo file for debugging
|
||||
String buf = writer.toString();
|
||||
java.io.FileWriter fw = new java.io.FileWriter(new java.io.File("/tmp/file1.xml"));
|
||||
fw.write(buf.toString());
|
||||
fw.close();
|
||||
} catch (IOException e) {
|
||||
Debug.logError(e, "Couldn't save xsl-fo xml debug file: " + e.toString(), module);
|
||||
}
|
||||
*/
|
||||
|
||||
// create the input stream for the generation
|
||||
StreamSource src = new StreamSource(new StringReader(writer.toString()));
|
||||
|
||||
|
||||
@@ -59,8 +59,6 @@ public final class GeoWorker {
|
||||
return UtilMisc.toList(geo);
|
||||
}
|
||||
|
||||
//Debug.logInfo("Expanding geo : " + geo, module);
|
||||
|
||||
List<GenericValue> geoList = new LinkedList<GenericValue>();
|
||||
List<GenericValue> thisGeoAssoc = null;
|
||||
try {
|
||||
@@ -78,12 +76,7 @@ public final class GeoWorker {
|
||||
}
|
||||
geoList.addAll(expandGeoGroup(nextGeo));
|
||||
}
|
||||
} else {
|
||||
//Debug.logInfo("No associated geos with this group", module);
|
||||
}
|
||||
|
||||
//Debug.logInfo("Expanded to : " + geoList, module);
|
||||
|
||||
}
|
||||
return geoList;
|
||||
}
|
||||
|
||||
@@ -125,7 +118,6 @@ public final class GeoWorker {
|
||||
if (geoList == null || geo == null) {
|
||||
return false;
|
||||
}
|
||||
//Debug.logInfo("Contains Geo : " + geoList.contains(geo));
|
||||
return geoList.contains(geo);
|
||||
}
|
||||
|
||||
|
||||
@@ -242,8 +242,6 @@ public class LoginServices {
|
||||
result.put("userLogin", userLogin);
|
||||
result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
|
||||
} else {
|
||||
//Debug.logInfo("Entered password [" + encodedPassword + "], Entered password OldFunnyHexEncode [" + encodedPasswordOldFunnyHexEncode + "], db password [" + userLogin.getString("currentPassword") + "]", module);
|
||||
|
||||
// password is incorrect, but this may be the result of a stale cache entry,
|
||||
// so lets clear the cache and try again if this is the first pass
|
||||
// but only if authFatalError is not true; this would mean the single authenticator failed
|
||||
@@ -327,7 +325,6 @@ public class LoginServices {
|
||||
ulhCreateMap.put("passwordUsed", password);
|
||||
}
|
||||
|
||||
//Debug.logInfo(new Exception(), "=================== Creating new UserLoginHistory at " + UtilDateTime.nowTimestamp(), module);
|
||||
delegator.create("UserLoginHistory", ulhCreateMap);
|
||||
}
|
||||
}
|
||||
@@ -712,7 +709,6 @@ public class LoginServices {
|
||||
}
|
||||
}
|
||||
|
||||
//result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
|
||||
result.put("updatedUserLogin", userLoginToUpdate);
|
||||
return result;
|
||||
}
|
||||
@@ -730,8 +726,6 @@ public class LoginServices {
|
||||
List<String> errorMessageList = new LinkedList<String>();
|
||||
Locale locale = (Locale) context.get("locale");
|
||||
|
||||
//boolean useEncryption = "true".equals(UtilProperties.getPropertyValue("security", "password.encrypt"));
|
||||
|
||||
String userLoginId = (String) context.get("userLoginId");
|
||||
String errMsg = null;
|
||||
|
||||
@@ -746,13 +740,6 @@ public class LoginServices {
|
||||
// security: don't create a user login if the specified partyId (if not empty) already exists
|
||||
// unless the logged in user has permission to do so (same partyId or PARTYMGR_CREATE)
|
||||
if (UtilValidate.isNotEmpty(partyId)) {
|
||||
//GenericValue party = null;
|
||||
//try {
|
||||
// party = EntityQuery.use(delegator).from("Party").where("partyId", partyId).queryOne();
|
||||
//} catch (GenericEntityException e) {
|
||||
// Debug.logWarning(e, "", module);
|
||||
//}
|
||||
|
||||
if (!loggedInUserLogin.isEmpty()) {
|
||||
// security check: userLogin partyId must equal partyId, or must have PARTYMGR_CREATE permission
|
||||
if (!partyId.equals(loggedInUserLogin.getString("partyId"))) {
|
||||
|
||||
-1
@@ -201,7 +201,6 @@ public class PreferenceServices {
|
||||
|
||||
String userLoginId = PreferenceWorker.getUserLoginId(context, false);
|
||||
String userPrefTypeId = (String) context.get("userPrefTypeId");
|
||||
//Debug.logError("In removeUserPreference userLoginId=" + userLoginId + ", userPrefTypeId=" + userPrefTypeId, module);
|
||||
if (UtilValidate.isEmpty(userLoginId) || UtilValidate.isEmpty(userPrefTypeId)) {
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.invalidArgument", locale));
|
||||
}
|
||||
|
||||
@@ -181,7 +181,6 @@ public class QRCodeServices {
|
||||
}
|
||||
|
||||
if (UtilValidate.isNotEmpty(verifyOutput) && verifyOutput.booleanValue()) {
|
||||
// Debug.logInfo("Original Message:[" + message + "]", module);
|
||||
Decoder decoder = new Decoder();
|
||||
Map<DecodeHintType, Object> decodeHints = new EnumMap<>(DecodeHintType.class);
|
||||
decodeHints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
|
||||
@@ -202,11 +201,9 @@ public class QRCodeServices {
|
||||
} catch (NotFoundException e) {
|
||||
// do nothing
|
||||
}
|
||||
// Debug.logInfo("Text in QR Code with logo:[" + result.getText() + "]", module);
|
||||
if (UtilValidate.isNotEmpty(result) && !result.getText().equals(message)) {
|
||||
detectorResult = new Detector(bitMatrix).detect(decodeHints);
|
||||
result = decoder.decode(detectorResult.getBits(), decodeHints);
|
||||
// Debug.logInfo("Text in QR Code without logo:[" + result.getText() + "]", module);
|
||||
if (!result.getText().equals(message)) {
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage("QRCodeUiLabels", "GeneratedTextNotMatchOriginal", new Object[]{result.getText(), message}, locale));
|
||||
}
|
||||
@@ -216,7 +213,6 @@ public class QRCodeServices {
|
||||
} else {
|
||||
detectorResult = new Detector(bitMatrix).detect(decodeHints);
|
||||
DecoderResult result = decoder.decode(detectorResult.getBits(), decodeHints);
|
||||
// Debug.logInfo("Text in QR Code:[" + result.getText() + "]", module);
|
||||
if (!result.getText().equals(message)) {
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage("QRCodeUiLabels", "GeneratedTextNotMatchOriginal", new Object[]{result.getText(), message}, locale));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user