svn commit: r1763087 - in /ofbiz/branches: release13.07/framework/base/src/org/ofbiz/base/util/ release14.12/framework/base/src/org/ofbiz/base/util/ release15.12/framework/base/src/org/ofbiz/base/util/

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

svn commit: r1763087 - in /ofbiz/branches: release13.07/framework/base/src/org/ofbiz/base/util/ release14.12/framework/base/src/org/ofbiz/base/util/ release15.12/framework/base/src/org/ofbiz/base/util/

jleroux@apache.org
Author: jleroux
Date: Sun Oct  2 17:16:13 2016
New Revision: 1763087

URL: http://svn.apache.org/viewvc?rev=1763087&view=rev
Log:
"Applied fix from trunk for revision: 1763085  " (path conflict handld by hand)
------------------------------------------------------------------------
r1763085 | jleroux | 2016-10-02 19:12:37 +0200 (dim. 02 oct. 2016) | 16 lignes

Fixes: Can't find resource for bundle
(OFBIZ-8336)

When going for example to EditProductContent (Product --> Content)
the following error message appears:
2016-09-27 20:02:40,822 |http-nio-8444-exec-7 |UtilProperties |I| null
java.util.MissingResourceException: Can't find resource for bundle
org.apache.ofbiz.base.util.UtilProperties$UtilResourceBundle,
key FieldDescription.sequenceNum

jleroux: this has not been handled right from start and in several changes
later. Rather than throwing an exception in UtilProperties.getMessage() it's
better to check if the bundle contains the key and else to log info


Thanks: Ingo Wolfmayr for report and Rohit Koushal for research
------------------------------------------------------------------------

Modified:
    ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/util/UtilProperties.java
    ofbiz/branches/release14.12/framework/base/src/org/ofbiz/base/util/UtilProperties.java
    ofbiz/branches/release15.12/framework/base/src/org/ofbiz/base/util/UtilProperties.java

Modified: ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/util/UtilProperties.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/util/UtilProperties.java?rev=1763087&r1=1763086&r2=1763087&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/util/UtilProperties.java (original)
+++ ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/util/UtilProperties.java Sun Oct  2 17:16:13 2016
@@ -579,10 +579,11 @@ public class UtilProperties implements S
         if (bundle == null) return name;
 
         String value = null;
-        try {
+        if (bundle.containsKey(name)) {
             value = bundle.getString(name);
-        } catch (Exception e) {
-            //Debug.logInfo(e, module);
+        } else {
+            Debug.logInfo(name + " misses in " + resource + " for locale " + locale, module);
+            return name;
         }
         return value == null ? name : value.trim();
     }

Modified: ofbiz/branches/release14.12/framework/base/src/org/ofbiz/base/util/UtilProperties.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/framework/base/src/org/ofbiz/base/util/UtilProperties.java?rev=1763087&r1=1763086&r2=1763087&view=diff
==============================================================================
--- ofbiz/branches/release14.12/framework/base/src/org/ofbiz/base/util/UtilProperties.java (original)
+++ ofbiz/branches/release14.12/framework/base/src/org/ofbiz/base/util/UtilProperties.java Sun Oct  2 17:16:13 2016
@@ -579,10 +579,11 @@ public class UtilProperties implements S
         if (bundle == null) return name;
 
         String value = null;
-        try {
+        if (bundle.containsKey(name)) {
             value = bundle.getString(name);
-        } catch (Exception e) {
-            //Debug.logInfo(e, module);
+        } else {
+            Debug.logInfo(name + " misses in " + resource + " for locale " + locale, module);
+            return name;
         }
         return value == null ? name : value.trim();
     }

Modified: ofbiz/branches/release15.12/framework/base/src/org/ofbiz/base/util/UtilProperties.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release15.12/framework/base/src/org/ofbiz/base/util/UtilProperties.java?rev=1763087&r1=1763086&r2=1763087&view=diff
==============================================================================
--- ofbiz/branches/release15.12/framework/base/src/org/ofbiz/base/util/UtilProperties.java (original)
+++ ofbiz/branches/release15.12/framework/base/src/org/ofbiz/base/util/UtilProperties.java Sun Oct  2 17:16:13 2016
@@ -587,10 +587,11 @@ public class UtilProperties implements S
         if (bundle == null) return name;
 
         String value = null;
-        try {
+        if (bundle.containsKey(name)) {
             value = bundle.getString(name);
-        } catch (Exception e) {
-            //Debug.logInfo(e, module);
+        } else {
+            Debug.logInfo(name + " misses in " + resource + " for locale " + locale, module);
+            return name;
         }
         return value == null ? name : value.trim();
     }