svn commit: r1761237 - in /ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common: ./ email/ geo/ login/ preferences/ qrcode/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1761237 - in /ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common: ./ email/ geo/ login/ preferences/ qrcode/

ashish-18
Author: ashish
Date: Sat Sep 17 13:52:40 2016
New Revision: 1761237

URL: http://svn.apache.org/viewvc?rev=1761237&view=rev
Log:
Improved: Clean up commented out code in Java source for Common component.
(OFBIZ-8037)
Thanks: Harsh for the contribution.

Modified:
    ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonServices.java
    ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java
    ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/JsLanguageFileMappingCreator.java
    ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/KeywordSearchUtil.java
    ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java
    ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/geo/GeoWorker.java
    ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java
    ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceServices.java
    ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeServices.java

Modified: ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonServices.java?rev=1761237&r1=1761236&r2=1761237&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonServices.java (original)
+++ ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/CommonServices.java Sat Sep 17 13:52:40 2016
@@ -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();
     }
 

Modified: ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java?rev=1761237&r1=1761236&r2=1761237&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java (original)
+++ ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java Sat Sep 17 13:52:40 2016
@@ -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
 

Modified: ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/JsLanguageFileMappingCreator.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/JsLanguageFileMappingCreator.java?rev=1761237&r1=1761236&r2=1761237&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/JsLanguageFileMappingCreator.java (original)
+++ ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/JsLanguageFileMappingCreator.java Sat Sep 17 13:52:40 2016
@@ -62,7 +62,6 @@ public class JsLanguageFileMappingCreato
         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";

Modified: ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/KeywordSearchUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/KeywordSearchUtil.java?rev=1761237&r1=1761236&r2=1761237&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/KeywordSearchUtil.java (original)
+++ ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/KeywordSearchUtil.java Sat Sep 17 13:52:40 2016
@@ -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();
             }

Modified: ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java?rev=1761237&r1=1761236&r2=1761237&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java (original)
+++ ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java Sat Sep 17 13:52:40 2016
@@ -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()));
 

Modified: ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/geo/GeoWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/geo/GeoWorker.java?rev=1761237&r1=1761236&r2=1761237&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/geo/GeoWorker.java (original)
+++ ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/geo/GeoWorker.java Sat Sep 17 13:52:40 2016
@@ -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);
     }
 

Modified: ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java?rev=1761237&r1=1761236&r2=1761237&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java (original)
+++ ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java Sat Sep 17 13:52:40 2016
@@ -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"))) {

Modified: ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceServices.java?rev=1761237&r1=1761236&r2=1761237&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceServices.java (original)
+++ ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceServices.java Sat Sep 17 13:52:40 2016
@@ -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));
         }

Modified: ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeServices.java?rev=1761237&r1=1761236&r2=1761237&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeServices.java (original)
+++ ofbiz/trunk/framework/common/src/main/java/org/apache/ofbiz/common/qrcode/QRCodeServices.java Sat Sep 17 13:52:40 2016
@@ -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));
                     }