You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2016/12/24 14:32:27 UTC

svn commit: r1775968 - in /jmeter/trunk/src/components/org/apache/jmeter/visualizers: RespTimeGraphVisualizer.java StatGraphProperties.java StatGraphVisualizer.java

Author: pmouawad
Date: Sat Dec 24 14:32:27 2016
New Revision: 1775968

URL: http://svn.apache.org/viewvc?rev=1775968&view=rev
Log:
Sonar : Fix errors, vulnerabilities

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphProperties.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java?rev=1775968&r1=1775967&r2=1775968&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java Sat Dec 24 14:32:27 2016
@@ -165,6 +165,14 @@ public class RespTimeGraphVisualizer ext
 
     public static final int DEFAULT_LEGEND_STYLE = 0; // default: normal
 
+    private static final int DEFAULT_WIDTH = 400;
+
+    private static final int DEFAULT_HEIGTH = 300;
+
+    private static final String Y_AXIS_LABEL = JMeterUtils.getResString("aggregate_graph_response_time");//$NON-NLS-1$
+
+    private static final String Y_AXIS_TITLE = JMeterUtils.getResString("aggregate_graph_ms"); //$NON-NLS-1$
+
     /**
      * Lock used to protect list update
      */
@@ -174,19 +182,11 @@ public class RespTimeGraphVisualizer ext
      */
     private final transient Object lockInterval = new Object();
 
-    private static final String Y_AXIS_LABEL = JMeterUtils.getResString("aggregate_graph_response_time");//$NON-NLS-1$
-
-    private static final String Y_AXIS_TITLE = JMeterUtils.getResString("aggregate_graph_ms"); //$NON-NLS-1$
-
     private RespTimeGraphChart graphPanel = null;
 
     private final JTabbedPane tabbedGraph = new JTabbedPane(SwingConstants.TOP);
     
     private boolean saveGraphToFile = false;
-
-    private static final int DEFAULT_WIDTH = 400;
-
-    private static final int DEFAULT_HEIGTH = 300;
     
     private int intervalValue = DEFAULT_INTERVAL;
 
@@ -213,13 +213,13 @@ public class RespTimeGraphVisualizer ext
 
     private final JComboBox<String> titleFontNameList = new JComboBox<>(StatGraphProperties.getFontNameMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private final JComboBox<String> titleFontSizeList = new JComboBox<>(StatGraphProperties.fontSize);
+    private final JComboBox<String> titleFontSizeList = new JComboBox<>(StatGraphProperties.FONT_SIZE);
 
     private final JComboBox<String> titleFontStyleList = new JComboBox<>(StatGraphProperties.getFontStyleMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
     private final JComboBox<String> fontNameList = new JComboBox<>(StatGraphProperties.getFontNameMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private final JComboBox<String> fontSizeList = new JComboBox<>(StatGraphProperties.fontSize);
+    private final JComboBox<String> fontSizeList = new JComboBox<>(StatGraphProperties.FONT_SIZE);
 
     private final JComboBox<String> fontStyleList = new JComboBox<>(StatGraphProperties.getFontStyleMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
@@ -227,7 +227,7 @@ public class RespTimeGraphVisualizer ext
     
     private final JComboBox<String> pointShapeLine = new JComboBox<>(StatGraphProperties.getPointShapeMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private final JComboBox<String> strokeWidthList = new JComboBox<>(StatGraphProperties.strokeWidth);
+    private final JComboBox<String> strokeWidthList = new JComboBox<>(StatGraphProperties.STROKE_WIDTH);
 
     private final JCheckBox numberShowGrouping = new JCheckBox(JMeterUtils.getResString("aggregate_graph_number_grouping"), // $NON-NLS-1$
             DEFAULT_NUMBER_SHOW_GROUPING); // Default checked
@@ -819,7 +819,7 @@ public class RespTimeGraphVisualizer ext
         titleFontNameList.setSelectedIndex(DEFAULT_TITLE_FONT_NAME);
         titleStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_size"), //$NON-NLS-1$
                 titleFontSizeList));
-        titleFontSizeList.setSelectedItem(StatGraphProperties.fontSize[DEFAULT_TITLE_FONT_SIZE]);
+        titleFontSizeList.setSelectedItem(StatGraphProperties.FONT_SIZE[DEFAULT_TITLE_FONT_SIZE]);
         titleStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_style"), //$NON-NLS-1$
                 titleFontStyleList));
         titleFontStyleList.setSelectedIndex(DEFAULT_TITLE_FONT_STYLE);
@@ -840,7 +840,7 @@ public class RespTimeGraphVisualizer ext
                 JMeterUtils.getResString("graph_resp_time_settings_line"))); // $NON-NLS-1$
         lineStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("graph_resp_time_stroke_width"), //$NON-NLS-1$
                 strokeWidthList));
-        strokeWidthList.setSelectedItem(StatGraphProperties.strokeWidth[DEFAULT_STROKE_WIDTH_LIST]);
+        strokeWidthList.setSelectedItem(StatGraphProperties.STROKE_WIDTH[DEFAULT_STROKE_WIDTH_LIST]);
         lineStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("graph_resp_time_shape_label"), //$NON-NLS-1$
                 pointShapeLine));
         pointShapeLine.setSelectedIndex(DEFAULT_LINE_SHAPE_POINT);
@@ -916,7 +916,7 @@ public class RespTimeGraphVisualizer ext
         fontNameList.setSelectedIndex(DEFAULT_LEGEND_FONT);
         legendPanel.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_size"), //$NON-NLS-1$
                 fontSizeList));
-        fontSizeList.setSelectedItem(StatGraphProperties.fontSize[DEFAULT_LEGEND_SIZE]);
+        fontSizeList.setSelectedItem(StatGraphProperties.FONT_SIZE[DEFAULT_LEGEND_SIZE]);
         legendPanel.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_style"), //$NON-NLS-1$
                 fontStyleList));
         fontStyleList.setSelectedIndex(DEFAULT_LEGEND_STYLE);

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphProperties.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphProperties.java?rev=1775968&r1=1775967&r2=1775968&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphProperties.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphProperties.java Sat Dec 24 14:32:27 2016
@@ -30,9 +30,9 @@ import org.jCharts.properties.PointChart
 
 public class StatGraphProperties {
 
-    public static final String[] fontSize = { "8", "9", "10", "11", "12", "14", "16", "18", "20", "24", "28", "32"};
+    static final String[] FONT_SIZE = { "8", "9", "10", "11", "12", "14", "16", "18", "20", "24", "28", "32"};
 
-    public static final String[] strokeWidth = { "1.0f", "1.5f", "2.0f", "2.5f", "3.0f", "3.5f", "4.0f", "4.5f", "5.0f", "5.5f", "6.0f", "6.5f"};
+    static final String[] STROKE_WIDTH = { "1.0f", "1.5f", "2.0f", "2.5f", "3.0f", "3.5f", "4.0f", "4.5f", "5.0f", "5.5f", "6.0f", "6.5f"};
 
     public static Map<String, String> getFontNameMap() {
         Map<String, String> fontNameMap = new LinkedHashMap<>(2);

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java?rev=1775968&r1=1775967&r2=1775968&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java Sat Dec 24 14:32:27 2016
@@ -238,19 +238,19 @@ public class StatGraphVisualizer extends
 
     private JComboBox<String> titleFontNameList = new JComboBox<>(StatGraphProperties.getFontNameMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private JComboBox<String> titleFontSizeList = new JComboBox<>(StatGraphProperties.fontSize);
+    private JComboBox<String> titleFontSizeList = new JComboBox<>(StatGraphProperties.FONT_SIZE);
 
     private JComboBox<String> titleFontStyleList = new JComboBox<>(StatGraphProperties.getFontStyleMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
     private JComboBox<String> valueFontNameList = new JComboBox<>(StatGraphProperties.getFontNameMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private JComboBox<String> valueFontSizeList = new JComboBox<>(StatGraphProperties.fontSize);
+    private JComboBox<String> valueFontSizeList = new JComboBox<>(StatGraphProperties.FONT_SIZE);
 
     private JComboBox<String> valueFontStyleList = new JComboBox<>(StatGraphProperties.getFontStyleMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
     private JComboBox<String> fontNameList = new JComboBox<>(StatGraphProperties.getFontNameMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private JComboBox<String> fontSizeList = new JComboBox<>(StatGraphProperties.fontSize);
+    private JComboBox<String> fontSizeList = new JComboBox<>(StatGraphProperties.FONT_SIZE);
 
     private JComboBox<String> fontStyleList = new JComboBox<>(StatGraphProperties.getFontStyleMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
@@ -867,7 +867,7 @@ public class StatGraphVisualizer extends
         titleFontNameList.setSelectedIndex(0); // default: sans serif
         titleStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_size"), //$NON-NLS-1$
                 titleFontSizeList));
-        titleFontSizeList.setSelectedItem(StatGraphProperties.fontSize[6]); // default: 16
+        titleFontSizeList.setSelectedItem(StatGraphProperties.FONT_SIZE[6]); // default: 16
         titleStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_style"), //$NON-NLS-1$
                 titleFontStyleList));
         titleFontStyleList.setSelectedItem(JMeterUtils.getResString("fontstyle.bold"));  // $NON-NLS-1$ // default: bold
@@ -888,7 +888,7 @@ public class StatGraphVisualizer extends
         valueFontNameList.setSelectedIndex(0); // default: sans serif
         fontValueStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_size"), //$NON-NLS-1$
                 valueFontSizeList));
-        valueFontSizeList.setSelectedItem(StatGraphProperties.fontSize[2]); // default: 10
+        valueFontSizeList.setSelectedItem(StatGraphProperties.FONT_SIZE[2]); // default: 10
         fontValueStylePane.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_style"), //$NON-NLS-1$
                 valueFontStyleList));
         valueFontStyleList.setSelectedItem(JMeterUtils.getResString("fontstyle.normal")); // default: normal //$NON-NLS-1$
@@ -962,7 +962,7 @@ public class StatGraphVisualizer extends
         fontNameList.setSelectedIndex(0); // default: sans serif
         legendPanel.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_size"), //$NON-NLS-1$
                 fontSizeList));
-        fontSizeList.setSelectedItem(StatGraphProperties.fontSize[2]); // default: 10
+        fontSizeList.setSelectedItem(StatGraphProperties.FONT_SIZE[2]); // default: 10
         legendPanel.add(GuiUtils.createLabelCombo(JMeterUtils.getResString("aggregate_graph_style"), //$NON-NLS-1$
                 fontStyleList));
         fontStyleList.setSelectedItem(JMeterUtils.getResString("fontstyle.normal"));  // $NON-NLS-1$ // default: normal