Le 19/08/2012 13:11, [email protected] a ecrit :
Author: pmouawad
Date: Sun Aug 19 13:11:09 2012
New Revision: 1374750
URL: http://svn.apache.org/viewvc?rev=1374750&view=rev
Log:
Removed useless @SuppressWarnings
Used HashMap instead of LinkedHashMap
Gave Map capacity
put strokeWidth at top of class
Modified:
jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphProperties.java
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=1374750&r1=1374749&r2=1374750&view=diff
==============================================================================
---
jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphProperties.java
(original)
+++
jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphProperties.java
Sun Aug 19 13:11:09 2012
@@ -22,7 +22,6 @@ package org.apache.jmeter.visualizers;
import java.awt.Font;
import java.awt.Shape;
import java.util.HashMap;
-import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.jmeter.util.JMeterUtils;
@@ -33,8 +32,10 @@ public class StatGraphProperties {
public static final String[] fontSize = { "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"};
+
public static Map<String, String> getFontNameMap() {
- Map<String, String> fontNameMap = new HashMap<String, String>();
+ Map<String, String> fontNameMap = new HashMap<String, String>(2);
fontNameMap.put(JMeterUtils.getResString("font.sansserif"),
"SansSerif");
fontNameMap.put(JMeterUtils.getResString("font.serif"), "Serif");
return fontNameMap;
@@ -42,7 +43,7 @@ public class StatGraphProperties {
@SuppressWarnings("boxing")
public static Map<String, Integer> getFontStyleMap() {
- Map<String, Integer> fontStyleMap = new HashMap<String, Integer>();
+ Map<String, Integer> fontStyleMap = new HashMap<String, Integer>(3);
fontStyleMap.put(JMeterUtils.getResString("fontstyle.normal"),
Font.PLAIN);
fontStyleMap.put(JMeterUtils.getResString("fontstyle.bold"),
Font.BOLD);
fontStyleMap.put(JMeterUtils.getResString("fontstyle.italic"),
Font.ITALIC);
@@ -51,7 +52,7 @@ public class StatGraphProperties {
@SuppressWarnings("boxing")
public static Map<String, Integer> getPlacementNameMap() {
- Map<String, Integer> placementNameMap = new HashMap<String,
Integer>();
+ Map<String, Integer> placementNameMap = new HashMap<String,
Integer>(4);
placementNameMap.put(JMeterUtils.getResString("aggregate_graph_legend.placement.bottom"),
LegendAreaProperties.BOTTOM);
placementNameMap.put(JMeterUtils.getResString("aggregate_graph_legend.placement.right"),
LegendAreaProperties.RIGHT);
placementNameMap.put(JMeterUtils.getResString("aggregate_graph_legend.placement.left"),
LegendAreaProperties.LEFT);
@@ -59,9 +60,8 @@ public class StatGraphProperties {
return placementNameMap;
}
- @SuppressWarnings("boxing")
public static Map<String, Shape> getPointShapeMap() {
- Map<String, Shape> pointShapeMap = new LinkedHashMap<String, Shape>();
+ Map<String, Shape> pointShapeMap = new HashMap<String, Shape>(5);
Please keep LinkedHashMap, we need to keep insert order for the default
value (circle) in the GUI. (HashMap not guarantee the order).
pointShapeMap.put(JMeterUtils.getResString("graph_pointshape_circle"),
PointChartProperties.SHAPE_CIRCLE);
pointShapeMap.put(JMeterUtils.getResString("graph_pointshape_diamond"),
PointChartProperties.SHAPE_DIAMOND);
pointShapeMap.put(JMeterUtils.getResString("graph_pointshape_square"),
PointChartProperties.SHAPE_SQUARE);
@@ -69,6 +69,4 @@ public class StatGraphProperties {
pointShapeMap.put(JMeterUtils.getResString("graph_pointshape_none"),
null);
return pointShapeMap;
}
-
- 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"};
-}
+}
\ No newline at end of file