changeset 169:dbe9ae2813ac

Bug 3197: Add a validation of reftree_fontsize Reviewed-by: yasuenag GitHub: https://github.com/HeapStats/heapstats/pull/42
author KUBOTA Yuji <kubota.yuji@lab.ntt.co.jp>
date Wed, 19 Oct 2016 16:39:08 +0900
parents b3f6e49a5c7a
children 387a6530ff43
files ChangeLog analyzer/fx/src/main/java/jp/co/ntt/oss/heapstats/utils/HeapStatsUtils.java
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Oct 12 21:25:38 2016 +0900
+++ b/ChangeLog	Wed Oct 19 16:39:08 2016 +0900
@@ -1,3 +1,7 @@
+2016-10-19  KUBOTA Yuji <kubota.yuji@lab.ntt.co.jp>
+
+	* Bug 3197: Add a validation of reftree_fontsize
+
 2016-10-12  Yasumasa Suenaga <yasuenag@gmail.com>
 
 	* Bug 3195: Add property for tick marker on X axis
--- a/analyzer/fx/src/main/java/jp/co/ntt/oss/heapstats/utils/HeapStatsUtils.java	Wed Oct 12 21:25:38 2016 +0900
+++ b/analyzer/fx/src/main/java/jp/co/ntt/oss/heapstats/utils/HeapStatsUtils.java	Wed Oct 19 16:39:08 2016 +0900
@@ -181,8 +181,14 @@
         String fontsize = prop.getProperty("reftree_fontsize");
         if (fontsize == null) {
             prop.setProperty("reftree_fontsize", "11");
+        } else {
+            try {
+                Integer.decode(fontsize);
+            } catch (NumberFormatException e) {
+                throw new HeapStatsConfigException(resource.getString("invalid.option") + " reftree_fontsize=" + fontsize, e);
+            }
         }
-        
+
         /* Tick marker on X axis */
         if (prop.getProperty("tickmarker") == null) {
             prop.setProperty("tickmarker", "false");