WW-5099 Upgrades JFreeChart to version 1.5.1
diff --git a/plugins/jfreechart/pom.xml b/plugins/jfreechart/pom.xml
index f2d4d21..0ee1990 100644
--- a/plugins/jfreechart/pom.xml
+++ b/plugins/jfreechart/pom.xml
@@ -35,7 +35,7 @@
         <dependency>
             <groupId>org.jfree</groupId>
             <artifactId>jcommon</artifactId>
-            <version>1.0.23</version>
+            <version>1.0.24</version>
             <scope>provided</scope>
             <exclusions>
                 <exclusion>
@@ -47,7 +47,7 @@
         <dependency>
             <groupId>org.jfree</groupId>
             <artifactId>jfreechart</artifactId>
-            <version>1.0.19</version>
+            <version>1.5.1</version>
             <scope>provided</scope>
             <exclusions>
                 <exclusion>
diff --git a/plugins/jfreechart/src/main/java/org/apache/struts2/dispatcher/ChartResult.java b/plugins/jfreechart/src/main/java/org/apache/struts2/dispatcher/ChartResult.java
index eabd988..c7c16a3 100644
--- a/plugins/jfreechart/src/main/java/org/apache/struts2/dispatcher/ChartResult.java
+++ b/plugins/jfreechart/src/main/java/org/apache/struts2/dispatcher/ChartResult.java
@@ -18,12 +18,13 @@
  */
 package org.apache.struts2.dispatcher;
 
+import com.opensymphony.xwork2.config.ConfigurationException;
 import org.apache.struts2.ServletActionContext;
 import com.opensymphony.xwork2.ActionInvocation;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.LogManager;
 import org.apache.struts2.result.StrutsResultSupport;
-import org.jfree.chart.ChartUtilities;
+import org.jfree.chart.ChartUtils;
 import org.jfree.chart.JFreeChart;
 
 import java.io.OutputStream;
@@ -105,14 +106,16 @@
     private final static Logger LOG = LogManager.getLogger(ChartResult.class);
 
     private static final long serialVersionUID = -6484761870055986612L;
+
     private static final String DEFAULT_TYPE = "png";
     private static final String DEFAULT_VALUE = "chart";
 
     private JFreeChart chart; // the JFreeChart to render
     private boolean chartSet;
-    String height, width;
-    String type = DEFAULT_TYPE; // supported are jpg, jpeg or png, defaults to png
-    String value = DEFAULT_VALUE; // defaults to 'chart'
+    private String height;
+    private String width;
+    private String type = DEFAULT_TYPE; // supported are jpg, jpeg or png, defaults to png
+    private String value = DEFAULT_VALUE; // defaults to 'chart'
 
     // CONSTRUCTORS ----------------------------
 
@@ -200,11 +203,11 @@
             // check the type to see what kind of output we have to produce
             if ("png".equalsIgnoreCase(type)) {
                 response.setContentType("image/png");
-                ChartUtilities.writeChartAsPNG(os, chart, getIntValueFromString(width), getIntValueFromString(height));
+                ChartUtils.writeChartAsPNG(os, chart, getIntValueFromString(width), getIntValueFromString(height));
             }
             else if ("jpg".equalsIgnoreCase(type) || "jpeg".equalsIgnoreCase(type)) {
                 response.setContentType("image/jpg");
-                ChartUtilities.writeChartAsJPEG(os, chart, getIntValueFromString(width), getIntValueFromString(height));
+                ChartUtils.writeChartAsJPEG(os, chart, getIntValueFromString(width), getIntValueFromString(height));
             }
             else
                 throw new IllegalArgumentException(type + " is not a supported render type (only JPG and PNG are).");
@@ -217,9 +220,8 @@
      * Sets up result properties, parsing etc.
      *
      * @param invocation Current invocation.
-     * @throws Exception on initialization error.
      */
-    private void initializeProperties(ActionInvocation invocation) throws Exception {
+    private void initializeProperties(ActionInvocation invocation) {
 
         if (height != null) {
             height = conditionalParse(height, invocation);
@@ -238,12 +240,12 @@
         }
     }
 
-    private Integer getIntValueFromString(String value) {
+    private int getIntValueFromString(String value) {
         try {
             return Integer.parseInt(value);
         } catch (Exception e) {
             LOG.error("Specified value for width or height is not of type Integer...", e);
-            return null;
+            throw new ConfigurationException("Wrong value \"" + value + "\", expected Integer!", e);
         }
     }