svn commit: r1813067 - /ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java

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

svn commit: r1813067 - /ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java

jleroux@apache.org
Author: jleroux
Date: Mon Oct 23 19:28:32 2017
New Revision: 1813067

URL: http://svn.apache.org/viewvc?rev=1813067&view=rev
Log:
Fixed: Not setting VIEW_INDEX for IterateSectionWidget.renderWidgetString causes
rendering error
(OFBIZ-9889)

A bug was introduced in OFBIZ-9710, that created a catch block for a
RuntimeException that would be thrown again. Unfortunately the code block relied
on catching a NumberFormatException in case VIEW_INDEX was not set, which in the
original code was not intuitively recognisable, because only Exception was caught.

In the provided patch I removed the catch block for the RTE und changed Exception
to NumberFormatException, since it is the only Exception that is expected.

Thanks: Tobias Laufkötter

Modified:
    ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java

Modified: ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java?rev=1813067&r1=1813066&r2=1813067&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java Mon Oct 23 19:28:32 2017
@@ -152,9 +152,7 @@ public class IterateSectionWidget extend
                 String viewSizeString = params.get("VIEW_SIZE" + "_" + WidgetWorker.getPaginatorNumber(context));
                 viewIndex = Integer.parseInt(viewIndexString);
                 locViewSize = Integer.parseInt(viewSizeString);
-            } catch (RuntimeException e) {
-                throw e;
-            } catch (Exception e) {
+            } catch (NumberFormatException e) {
                 try {
                     viewIndex = ((Integer) context.get("viewIndex")).intValue();
                 } catch (Exception e2) {