svn commit: r1818548 - in /ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences: PreferenceServices.java PreferenceWorker.java

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

svn commit: r1818548 - in /ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences: PreferenceServices.java PreferenceWorker.java

mbrohl
Author: mbrohl
Date: Mon Dec 18 10:16:05 2017
New Revision: 1818548

URL: http://svn.apache.org/viewvc?rev=1818548&view=rev
Log:
Improved: General refactoring and code improvements, package
org.apache.ofbiz.common.preferences.
(OFBIZ-9927)

Thanks Dennis Balkir for reporting and providing the patches.

Modified:
    ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceServices.java
    ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceWorker.java

Modified: ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceServices.java?rev=1818548&r1=1818547&r2=1818548&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceServices.java Mon Dec 18 10:16:05 2017
@@ -85,9 +85,6 @@ public class PreferenceServices {
             if (preference != null) {
                 userPrefMap = PreferenceWorker.createUserPrefMap(preference);
             }
-        } catch (GenericEntityException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
         } catch (GeneralException e) {
             Debug.logWarning(e.getMessage(), module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
@@ -135,9 +132,6 @@ public class PreferenceServices {
                 fieldMap.put("userLoginId", userLoginId);
                 userPrefMap.putAll(PreferenceWorker.createUserPrefMap(EntityQuery.use(delegator).from("UserPreference").where(fieldMap).cache(true).queryList()));
             }
-        } catch (GenericEntityException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
         } catch (GeneralException e) {
             Debug.logWarning(e.getMessage(), module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale));
@@ -185,9 +179,6 @@ public class PreferenceServices {
             }
             GenericValue rec = delegator.makeValidValue("UserPreference", PreferenceWorker.toFieldMap(userLoginId, userPrefTypeId, userPrefGroupTypeId, userPrefValue));
             delegator.createOrStore(rec);
-        } catch (GenericEntityException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
         } catch (GeneralException e) {
             Debug.logWarning(e.getMessage(), module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
@@ -247,9 +238,6 @@ public class PreferenceServices {
                 GenericValue rec = delegator.makeValidValue("UserPreference", PreferenceWorker.toFieldMap(userLoginId, mapEntry.getKey(), userPrefGroupTypeId, mapEntry.getValue()));
                 delegator.createOrStore(rec);
             }
-        } catch (GenericEntityException e) {
-            Debug.logWarning(e.getMessage(), module);
-            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));
         } catch (GeneralException e) {
             Debug.logWarning(e.getMessage(), module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, "setPreference.writeFailure", new Object[] { e.getMessage() }, locale));

Modified: ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceWorker.java?rev=1818548&r1=1818547&r2=1818548&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceWorker.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/common/src/main/java/org/apache/ofbiz/common/preferences/PreferenceWorker.java Mon Dec 18 10:16:05 2017
@@ -52,7 +52,7 @@ public final class PreferenceWorker {
     private static final String DEFAULT_UID = "_NA_";
 
     private PreferenceWorker () {}
-    
+
     /**
      * Add a UserPreference GenericValue to a Map.
      * @param rec GenericValue to convert