jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1682964 - in /jmeter/trunk/src: components/org/apache/jmeter/assertions/gui/ components/org/apache/jmeter/control/gui/ components/org/apache/jmeter/extractor/gui/ components/org/apache/jmeter/sampler/gui/ components/org/apache/jmeter/visua...
Date Mon, 01 Jun 2015 18:01:34 GMT
Author: sebb
Date: Mon Jun  1 18:01:34 2015
New Revision: 1682964

URL: http://svn.apache.org/r1682964
Log:
Update to Java 7
JComboBox is now generic
Bugzilla Id: 57981

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/HTMLAssertionGui.java
    jmeter/trunk/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java
    jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/HtmlExtractorGui.java
    jmeter/trunk/src/components/org/apache/jmeter/sampler/gui/TestActionGui.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/MailerVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/BackendListenerGui.java
    jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/ComboStringEditor.java
    jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/EnumEditor.java
    jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
    jmeter/trunk/src/jorphan/org/apache/jorphan/gui/GuiUtils.java
    jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java
    jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/control/gui/ClassFilter.java
    jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/HttpTestSampleGui.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/AuthPanel.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
    jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPropertiesPanel.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/HTMLAssertionGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/HTMLAssertionGui.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/HTMLAssertionGui.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/HTMLAssertionGui.java Mon
Jun  1 18:01:34 2015
@@ -65,7 +65,7 @@ public class HTMLAssertionGui extends Ab
 
     private JCheckBox errorsOnly = null;
 
-    private JComboBox docTypeBox = null;
+    private JComboBox<String> docTypeBox = null;
 
     private JRadioButton htmlRadioButton = null;
 
@@ -213,7 +213,7 @@ public class HTMLAssertionGui extends Ab
 
         // doctype
         HorizontalPanel docTypePanel = new HorizontalPanel();
-        docTypeBox = new JComboBox(new String[] { "omit", "auto", "strict", "loose" });
+        docTypeBox = new JComboBox<>(new String[] { "omit", "auto", "strict", "loose"
});
         // docTypePanel.add(new
         // JLabel(JMeterUtils.getResString("duration_assertion_label"))); //$NON-NLS-1$
         docTypePanel.add(new JLabel("Doctype:"));

Modified: jmeter/trunk/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java
Mon Jun  1 18:01:34 2015
@@ -38,7 +38,7 @@ import org.apache.jorphan.gui.layout.Ver
 public class ThroughputControllerGui extends AbstractControllerGui {
     private static final long serialVersionUID = 240L;
 
-    private JComboBox styleBox;
+    private JComboBox<String> styleBox;
 
     private int style;
 
@@ -128,10 +128,10 @@ public class ThroughputControllerGui ext
         setBorder(makeBorder());
         add(makeTitlePanel());
 
-        DefaultComboBoxModel styleModel = new DefaultComboBoxModel();
+        DefaultComboBoxModel<String> styleModel = new DefaultComboBoxModel<>();
         styleModel.addElement(BYNUMBER_LABEL);
         styleModel.addElement(BYPERCENT_LABEL);
-        styleBox = new JComboBox(styleModel);
+        styleBox = new JComboBox<>(styleModel);
         styleBox.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {

Modified: jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/HtmlExtractorGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/HtmlExtractorGui.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/HtmlExtractorGui.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/extractor/gui/HtmlExtractorGui.java Mon
Jun  1 18:01:34 2015
@@ -62,7 +62,7 @@ public class HtmlExtractorGui extends Ab
 
     private JLabeledTextField refNameField;
 
-    private JComboBox extractorImplName;
+    private JComboBox<String> extractorImplName;
 
 
     public HtmlExtractorGui() {
@@ -157,12 +157,12 @@ public class HtmlExtractorGui extends Ab
         JPanel panel = new HorizontalPanel();
         panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("html_extractor_type")));
//$NON-NLS-1$
         
-        DefaultComboBoxModel m = new DefaultComboBoxModel();
+        DefaultComboBoxModel<String> m = new DefaultComboBoxModel<>();
         for (String s : HtmlExtractor.getImplementations()){
             m.addElement(s);
         }
         m.addElement(USE_DEFAULT_EXTRACTOR_IMPL);
-        extractorImplName = new JComboBox(m);
+        extractorImplName = new JComboBox<>(m);
         extractorImplName.setSelectedItem(HtmlExtractor.DEFAULT_EXTRACTOR);
         JLabel label2 = new JLabel(JMeterUtils.getResString("html_extractor_type")); // $NON-NLS-1$
         label2.setLabelFor(extractorImplName);

Modified: jmeter/trunk/src/components/org/apache/jmeter/sampler/gui/TestActionGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/sampler/gui/TestActionGui.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/sampler/gui/TestActionGui.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/sampler/gui/TestActionGui.java Mon Jun 
1 18:01:34 2015
@@ -41,7 +41,7 @@ public class TestActionGui extends Abstr
     private static final long serialVersionUID = 240L;
 
     // Gui components
-    private JComboBox targetBox;
+    private JComboBox<String> targetBox;
 
     // private ButtonGroup actionButtons;
     private JRadioButton pauseButton;
@@ -163,10 +163,10 @@ public class TestActionGui extends Abstr
         // Target
         HorizontalPanel targetPanel = new HorizontalPanel();
         targetPanel.add(new JLabel(targetLabel));
-        DefaultComboBoxModel targetModel = new DefaultComboBoxModel();
+        DefaultComboBoxModel<String> targetModel = new DefaultComboBoxModel<>();
         targetModel.addElement(threadTarget);
         targetModel.addElement(testTarget);
-        targetBox = new JComboBox(targetModel);
+        targetBox = new JComboBox<>(targetModel);
         targetBox.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/MailerVisualizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/MailerVisualizer.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/MailerVisualizer.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/MailerVisualizer.java Mon Jun
 1 18:01:34 2015
@@ -91,7 +91,7 @@ public class MailerVisualizer extends Ab
 
     private JTextField smtpPasswordField;
 
-    private JComboBox authTypeCombo;
+    private JComboBox<String> authTypeCombo;
 
     /**
      * Constructs the MailerVisualizer and initializes its GUI.
@@ -281,7 +281,7 @@ public class MailerVisualizer extends Ab
 
         JPanel authTypePane = new JPanel(new BorderLayout());
         authTypePane.add(new JLabel(JMeterUtils.getResString("mailer_connection_security")),
BorderLayout.WEST); // $NON-NLS-1$
-        authTypeCombo = new JComboBox(new Object[] { 
+        authTypeCombo = new JComboBox<>(new String[] { 
                 MailerModel.MailAuthType.NONE.toString(), 
                 MailerModel.MailAuthType.SSL.toString(),
                 MailerModel.MailAuthType.TLS.toString()});

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=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java
Mon Jun  1 18:01:34 2015
@@ -56,6 +56,7 @@ import javax.swing.border.EmptyBorder;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.jmeter.gui.action.ActionNames;
 import org.apache.jmeter.gui.action.ActionRouter;
 import org.apache.jmeter.gui.action.SaveGraphics;
@@ -207,23 +208,23 @@ public class RespTimeGraphVisualizer ext
 
     private final JCheckBox regexpChkBox = new JCheckBox(JMeterUtils.getResString("search_text_chkbox_regexp"),
true); // $NON-NLS-1$
 
-    private final JComboBox titleFontNameList = new JComboBox(StatGraphProperties.getFontNameMap().keySet().toArray());
+    private final JComboBox<String> titleFontNameList = new JComboBox<>(StatGraphProperties.getFontNameMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private final JComboBox titleFontSizeList = new JComboBox(StatGraphProperties.fontSize);
+    private final JComboBox<String> titleFontSizeList = new JComboBox<>(StatGraphProperties.fontSize);
 
-    private final JComboBox titleFontStyleList = new JComboBox(StatGraphProperties.getFontStyleMap().keySet().toArray());
+    private final JComboBox<String> titleFontStyleList = new JComboBox<>(StatGraphProperties.getFontStyleMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private final JComboBox fontNameList = new JComboBox(StatGraphProperties.getFontNameMap().keySet().toArray());
+    private final JComboBox<String> fontNameList = new JComboBox<>(StatGraphProperties.getFontNameMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private final JComboBox fontSizeList = new JComboBox(StatGraphProperties.fontSize);
+    private final JComboBox<String> fontSizeList = new JComboBox<>(StatGraphProperties.fontSize);
 
-    private final JComboBox fontStyleList = new JComboBox(StatGraphProperties.getFontStyleMap().keySet().toArray());
+    private final JComboBox<String> fontStyleList = new JComboBox<>(StatGraphProperties.getFontStyleMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private final JComboBox legendPlacementList = new JComboBox(StatGraphProperties.getPlacementNameMap().keySet().toArray());
+    private final JComboBox<String> legendPlacementList = new JComboBox<>(StatGraphProperties.getPlacementNameMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
     
-    private final JComboBox pointShapeLine = new JComboBox(StatGraphProperties.getPointShapeMap().keySet().toArray());
+    private final JComboBox<String> pointShapeLine = new JComboBox<>(StatGraphProperties.getPointShapeMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private final JComboBox strokeWidthList = new JComboBox(StatGraphProperties.strokeWidth);
+    private final JComboBox<String> strokeWidthList = new JComboBox<>(StatGraphProperties.strokeWidth);
 
     private final JCheckBox numberShowGrouping = new JCheckBox(JMeterUtils.getResString("aggregate_graph_number_grouping"),
// $NON-NLS-1$
             DEFAULT_NUMBER_SHOW_GROUPING); // Default checked

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=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java Mon
Jun  1 18:01:34 2015
@@ -63,6 +63,7 @@ import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.table.TableCellRenderer;
 
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.jmeter.gui.action.ActionNames;
 import org.apache.jmeter.gui.action.ActionRouter;
 import org.apache.jmeter.gui.action.SaveGraphics;
@@ -217,7 +218,7 @@ public class StatGraphVisualizer extends
 
     private int defaultHeight = 300;
 
-    private JComboBox columnsList = new JComboBox(GRAPH_COLUMNS);
+    private JComboBox<String> columnsList = new JComboBox<>(GRAPH_COLUMNS);
 
     private List<BarGraph> eltList = new ArrayList<BarGraph>();
 
@@ -231,25 +232,25 @@ public class StatGraphVisualizer extends
 
     private JCheckBox regexpChkBox = new JCheckBox(JMeterUtils.getResString("search_text_chkbox_regexp"),
true); // $NON-NLS-1$
 
-    private JComboBox titleFontNameList = new JComboBox(StatGraphProperties.getFontNameMap().keySet().toArray());
+    private JComboBox<String> titleFontNameList = new JComboBox<>(StatGraphProperties.getFontNameMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private JComboBox titleFontSizeList = new JComboBox(StatGraphProperties.fontSize);
+    private JComboBox<String> titleFontSizeList = new JComboBox<>(StatGraphProperties.fontSize);
 
-    private JComboBox titleFontStyleList = new JComboBox(StatGraphProperties.getFontStyleMap().keySet().toArray());
+    private JComboBox<String> titleFontStyleList = new JComboBox<>(StatGraphProperties.getFontStyleMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private JComboBox valueFontNameList = new JComboBox(StatGraphProperties.getFontNameMap().keySet().toArray());
+    private JComboBox<String> valueFontNameList = new JComboBox<>(StatGraphProperties.getFontNameMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private JComboBox valueFontSizeList = new JComboBox(StatGraphProperties.fontSize);
+    private JComboBox<String> valueFontSizeList = new JComboBox<>(StatGraphProperties.fontSize);
 
-    private JComboBox valueFontStyleList = new JComboBox(StatGraphProperties.getFontStyleMap().keySet().toArray());
+    private JComboBox<String> valueFontStyleList = new JComboBox<>(StatGraphProperties.getFontStyleMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private JComboBox fontNameList = new JComboBox(StatGraphProperties.getFontNameMap().keySet().toArray());
+    private JComboBox<String> fontNameList = new JComboBox<>(StatGraphProperties.getFontNameMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private JComboBox fontSizeList = new JComboBox(StatGraphProperties.fontSize);
+    private JComboBox<String> fontSizeList = new JComboBox<>(StatGraphProperties.fontSize);
 
-    private JComboBox fontStyleList = new JComboBox(StatGraphProperties.getFontStyleMap().keySet().toArray());
+    private JComboBox<String> fontStyleList = new JComboBox<>(StatGraphProperties.getFontStyleMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
-    private JComboBox legendPlacementList = new JComboBox(StatGraphProperties.getPlacementNameMap().keySet().toArray());
+    private JComboBox<String> legendPlacementList = new JComboBox<>(StatGraphProperties.getPlacementNameMap().keySet().toArray(ArrayUtils.EMPTY_STRING_ARRAY));
 
     private JCheckBox drawOutlinesBar = new JCheckBox(JMeterUtils.getResString("aggregate_graph_draw_outlines"),
true); // Default checked // $NON-NLS-1$
 

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java
Mon Jun  1 18:01:34 2015
@@ -92,7 +92,7 @@ implements ActionListener, TreeSelection
 
     private JTabbedPane rightSide;
 
-    private JComboBox selectRenderPanel;
+    private JComboBox<ResultRenderer> selectRenderPanel;
 
     private int selectedTab;
 
@@ -307,9 +307,9 @@ implements ActionListener, TreeSelection
      * @return List of all render (implement ResultsRender)
      */
     private Component createComboRender() {
-        ComboBoxModel nodesModel = new DefaultComboBoxModel();
+        ComboBoxModel<ResultRenderer> nodesModel = new DefaultComboBoxModel<>();
         // drop-down list for renderer
-        selectRenderPanel = new JComboBox(nodesModel);
+        selectRenderPanel = new JComboBox<>(nodesModel);
         selectRenderPanel.setActionCommand(COMBO_CHANGE_COMMAND);
         selectRenderPanel.addActionListener(this);
 
@@ -364,7 +364,7 @@ implements ActionListener, TreeSelection
     public void actionPerformed(ActionEvent event) {
         String command = event.getActionCommand();
         if (COMBO_CHANGE_COMMAND.equals(command)) {
-            JComboBox jcb = (JComboBox) event.getSource();
+            JComboBox<?> jcb = (JComboBox<?>) event.getSource();
 
             if (jcb != null) {
                 resultsRender = (ResultRenderer) jcb.getSelectedItem();

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/BackendListenerGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/BackendListenerGui.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/BackendListenerGui.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/BackendListenerGui.java
Mon Jun  1 18:01:34 2015
@@ -33,6 +33,7 @@ import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JTextField;
 
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.jmeter.config.Argument;
 import org.apache.jmeter.config.Arguments;
 import org.apache.jmeter.config.gui.ArgumentsPanel;
@@ -61,7 +62,7 @@ public class BackendListenerGui extends
     private static final Logger LOGGER = LoggingManager.getLoggerForClass();
 
     /** A combo box allowing the user to choose a backend class. */
-    private JComboBox classnameCombo;
+    private JComboBox<String> classnameCombo;
     
     /**
      * A field allowing the user to specify the size of Queue
@@ -127,7 +128,7 @@ public class BackendListenerGui extends
 
         JLabel label = new JLabel(JMeterUtils.getResString("backend_listener_classname"));
// $NON-NLS-1$
 
-        classnameCombo = new JComboBox(possibleClasses.toArray());
+        classnameCombo = new JComboBox<>(possibleClasses.toArray(ArrayUtils.EMPTY_STRING_ARRAY));
         classnameCombo.addActionListener(this);
         classnameCombo.setEditable(false);
         label.setLabelFor(classnameCombo);
@@ -241,7 +242,7 @@ public class BackendListenerGui extends
      * @param className String class name
      * @return boolean true if model contains className
      */
-    private static final boolean checkContainsClassName(ComboBoxModel model, String className)
{
+    private static final boolean checkContainsClassName(ComboBoxModel<?> model, String
className) {
         int size = model.getSize();
         Set<String> set = new HashSet<String>(size);
         for (int i = 0; i < size; i++) {

Modified: jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/ComboStringEditor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/ComboStringEditor.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/ComboStringEditor.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/ComboStringEditor.java Mon Jun 
1 18:01:34 2015
@@ -60,9 +60,10 @@ class ComboStringEditor extends Property
      */
     private String initialEditValue;
 
-    private final JComboBox combo;
+    // Cannot use <String> here because combo can contain EDIT and UNDEFINED
+    private final JComboBox<Object> combo;
 
-    private final DefaultComboBoxModel model;
+    private final DefaultComboBoxModel<Object> model;
 
     /*
      * Map of translations for tags; only created if there is at least
@@ -109,7 +110,7 @@ class ComboStringEditor extends Property
 
         tags = pTags == null ? ArrayUtils.EMPTY_STRING_ARRAY : pTags.clone();
 
-        model = new DefaultComboBoxModel();
+        model = new DefaultComboBoxModel<>();
 
         if (rb != null && tags.length > 0) {
             validTranslations=new HashMap<String, String>();
@@ -137,7 +138,7 @@ class ComboStringEditor extends Property
             model.addElement(EDIT);
         }
 
-        combo = new JComboBox(model);
+        combo = new JComboBox<>(model);
         combo.addItemListener(this);
         combo.setEditable(false);
     }

Modified: jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/EnumEditor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/EnumEditor.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/EnumEditor.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/EnumEditor.java Mon Jun  1 18:01:34
2015
@@ -36,18 +36,18 @@ import org.apache.jmeter.gui.ClearGui;
  */
 class EnumEditor extends PropertyEditorSupport implements ClearGui {
 
-    private final JComboBox combo;
+    private final JComboBox<String> combo;
 
-    private final DefaultComboBoxModel model;
+    private final DefaultComboBoxModel<String> model;
 
     private final int defaultIndex;
 
     public EnumEditor(final PropertyDescriptor descriptor, final Class<? extends Enum<?>>
enumClazz, final ResourceBundle rb) {
-        model = new DefaultComboBoxModel();
-        combo = new JComboBox(model);
+        model = new DefaultComboBoxModel<>();
+        combo = new JComboBox<>(model);
         combo.setEditable(false);
         for(Enum<?> e : enumClazz.getEnumConstants()) {
-            model.addElement(rb.getObject(e.toString()));
+            model.addElement((String) rb.getObject(e.toString()));
         }
         Object def = descriptor.getValue(GenericTestBeanCustomizer.DEFAULT);
         if (def instanceof Integer) {

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java Mon Jun  1 18:01:34 2015
@@ -916,7 +916,7 @@ public class JMeterUtils implements Unit
      * @param namVec List of names, which are displayed in <code>combo</code>
      * @param name Name, that is to be selected. It has to be in <code>namVec</code>
      */
-    public static void selJComboBoxItem(Properties properties, JComboBox combo, Vector<?>
namVec, String name) {
+    public static void selJComboBoxItem(Properties properties, JComboBox<?> combo,
Vector<?> namVec, String name) {
         int idx = namVec.indexOf(name);
         combo.setSelectedIndex(idx);
         // Redisplay.

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/gui/GuiUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/GuiUtils.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/gui/GuiUtils.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/gui/GuiUtils.java Mon Jun  1 18:01:34 2015
@@ -89,7 +89,7 @@ public final class GuiUtils {
      * @param comboBox the combo box
      * @return the JComponent (margin+JLabel+margin+JComboBox)
      */
-    public static JComponent createLabelCombo(String label, JComboBox comboBox) {
+    public static JComponent createLabelCombo(String label, JComboBox<?> comboBox)
{
         JPanel labelCombo = new JPanel();
         labelCombo.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
         JLabel caption = new JLabel(label);

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java Mon Jun  1 18:01:34
2015
@@ -40,7 +40,7 @@ public class JLabeledChoice extends JPan
 
     private final JLabel mLabel = new JLabel();
 
-    private final JComboBox choiceList;
+    private final JComboBox<String> choiceList;
 
     // Maybe move to vector if MT problems occur
     private final ArrayList<ChangeListener> mChangeListeners = new ArrayList<ChangeListener>(3);
@@ -52,13 +52,13 @@ public class JLabeledChoice extends JPan
      */
     public JLabeledChoice() {
         super();
-        choiceList = new JComboBox();
+        choiceList = new JComboBox<>();
         init();
     }
 
     public JLabeledChoice(String pLabel, boolean editable) {
         super();
-        choiceList = new JComboBox();
+        choiceList = new JComboBox<>();
         mLabel.setText(pLabel);
         choiceList.setEditable(editable);
         init();
@@ -85,7 +85,7 @@ public class JLabeledChoice extends JPan
     public JLabeledChoice(String pLabel, String[] items, boolean editable) {
         super();
         mLabel.setText(pLabel);
-        choiceList = new JComboBox(items);
+        choiceList = new JComboBox<>(items);
         choiceList.setEditable(editable);
         init();
     }
@@ -285,7 +285,7 @@ public String getToolTipText() {
     private class AddListener implements ActionListener {
         @Override
         public void actionPerformed(ActionEvent e) {
-            Object item = choiceList.getSelectedItem();
+            String item = (String) choiceList.getSelectedItem();
             int index = choiceList.getSelectedIndex();
             if (!item.equals(choiceList.getItemAt(index))) {
                 choiceList.addItem(item);

Modified: jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/control/gui/ClassFilter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/control/gui/ClassFilter.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/control/gui/ClassFilter.java (original)
+++ jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/control/gui/ClassFilter.java Mon
Jun  1 18:01:34 2015
@@ -20,6 +20,8 @@ package org.apache.jmeter.protocol.java.
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.commons.lang3.ArrayUtils;
+
 class ClassFilter {
 
     private String[] pkgs = new String[0];
@@ -44,17 +46,17 @@ class ClassFilter {
         return inc;
     }
 
-    Object[] filterArray(List<String> items) {
-        ArrayList<Object> newlist = new ArrayList<Object>();
+    String[] filterArray(List<String> items) {
+        ArrayList<String> newlist = new ArrayList<>();
         for (String item : items) {
             if (include(item)) {
                 newlist.add(item);
             }
         }
         if (newlist.size() > 0) {
-            return newlist.toArray();
+            return newlist.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
         } else {
-            return new Object[0];
+            return ArrayUtils.EMPTY_STRING_ARRAY;
         }
     }
 

Modified: jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java
(original)
+++ jmeter/trunk/src/junit/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java
Mon Jun  1 18:01:34 2015
@@ -132,8 +132,8 @@ implements ChangeListener, ActionListene
     private JCheckBox createInstancePerSample = new JCheckBox(JMeterUtils.getResString("junit_create_instance_per_sample"));
//$NON-NLS-1$
 
     /** A combo box allowing the user to choose a test class. */
-    private JComboBox classnameCombo;
-    private JComboBox methodName;
+    private JComboBox<String> classnameCombo;
+    private JComboBox<String> methodName;
 
     private final transient ClassLoader contextClassLoader =
         Thread.currentThread().getContextClassLoader(); // Potentially expensive; do it once
@@ -184,7 +184,7 @@ implements ChangeListener, ActionListene
             ClassFilter filter = new ClassFilter();
             filter.setPackges(JOrphanUtils.split(filterpkg.getText(),",")); //$NON-NLS-1$
             // change the classname drop down
-            Object[] clist = filter.filterArray(classList);
+            String[] clist = filter.filterArray(classList);
             for (int idx=0; idx < clist.length; idx++) {
                 classnameCombo.addItem(clist[idx]);
             }
@@ -200,12 +200,12 @@ implements ChangeListener, ActionListene
         JLabel label =
             new JLabel(JMeterUtils.getResString("protocol_java_classname")); //$NON-NLS-1$
 
-        classnameCombo = new JComboBox();
+        classnameCombo = new JComboBox<>();
         classnameCombo.addActionListener(this);
         classnameCombo.setEditable(false);
         label.setLabelFor(classnameCombo);
 
-        methodName = new JComboBox();
+        methodName = new JComboBox<>();
         methodName.addActionListener(this);
         methodLabel.setLabelFor(methodName);
 

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/HttpTestSampleGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/HttpTestSampleGui.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/HttpTestSampleGui.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/HttpTestSampleGui.java
Mon Jun  1 18:01:34 2015
@@ -71,7 +71,7 @@ public class HttpTestSampleGui extends A
 
     private JTextField sourceIpAddr; // does not apply to Java implementation
     
-    private JComboBox sourceIpType = new JComboBox(HTTPSamplerBase.getSourceTypeList());
+    private JComboBox<String> sourceIpType = new JComboBox<>(HTTPSamplerBase.getSourceTypeList());
 
     private final boolean isAJP;
     

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/AuthPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/AuthPanel.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/AuthPanel.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/AuthPanel.java Mon
Jun  1 18:01:34 2015
@@ -428,7 +428,7 @@ public class AuthPanel extends AbstractC
         private static final long serialVersionUID = 6085773573067229265L;
         
         public MechanismCellEditor() {
-            super(new JComboBox(Mechanism.values()));
+            super(new JComboBox<>(Mechanism.values()));
         }
     }
 

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java Mon
Jun  1 18:01:34 2015
@@ -89,7 +89,7 @@ public class CookiePanel extends Abstrac
 
     private JCheckBox clearEachIteration;
 
-    private JComboBox selectHandlerPanel;
+    private JComboBox<String> selectHandlerPanel;
 
     private HashMap<String, String> handlerMap = new HashMap<String, String>();
 
@@ -398,10 +398,10 @@ public class CookiePanel extends Abstrac
      * Create the drop-down list to changer render
      * @return List of all render (implement ResultsRender)
      */
-    private JComboBox createComboHandler() {
-        ComboBoxModel nodesModel = new DefaultComboBoxModel();
+    private JComboBox<String> createComboHandler() {
+        ComboBoxModel<String> nodesModel = new DefaultComboBoxModel<>();
         // drop-down list for renderer
-        selectHandlerPanel = new JComboBox(nodesModel);
+        selectHandlerPanel = new JComboBox<String>(nodesModel);
         selectHandlerPanel.setActionCommand(HANDLER_COMMAND);
         selectHandlerPanel.addActionListener(this);
 

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
Mon Jun  1 18:01:34 2015
@@ -113,7 +113,7 @@ public class ProxyControlGui extends Log
      * Whether to group requests together based on inactivity separation periods --
      * and how to handle such grouping afterwards.
      */
-    private JComboBox groupingMode;
+    private JComboBox<String> groupingMode;
 
     /**
      * Add an Assertion to the first sample of each set
@@ -133,7 +133,7 @@ public class ProxyControlGui extends Log
     /**
      * The list of sampler type names to choose from
      */
-    private JComboBox samplerTypeName;
+    private JComboBox<String> samplerTypeName;
 
     /**
      * Set/clear the Redirect automatically box on the samplers (default is false)
@@ -163,14 +163,14 @@ public class ProxyControlGui extends Log
     /**
      * List of available target controllers
      */
-    private JComboBox targetNodes;
+    private JComboBox<Object> targetNodes;
     
     /**
      * Notify child Listener of Filtered Samplers
      */
     private JCheckBox notifyChildSamplerListenerOfFilteredSamplersCB;
 
-    private DefaultComboBoxModel targetNodesModel;
+    private DefaultComboBoxModel<Object> targetNodesModel;
 
     private ProxyControl model;
 
@@ -707,12 +707,12 @@ public class ProxyControlGui extends Log
     }
 
     private JPanel createHTTPSamplerPanel() {
-        DefaultComboBoxModel m = new DefaultComboBoxModel();
+        DefaultComboBoxModel<String> m = new DefaultComboBoxModel<>();
         for (String s : HTTPSamplerFactory.getImplementations()){
             m.addElement(s);
         }
         m.addElement(USE_DEFAULT_HTTP_IMPL);
-        samplerTypeName = new JComboBox(m);
+        samplerTypeName = new JComboBox<>(m);
         samplerTypeName.setPreferredSize(new Dimension(150, 20));
         samplerTypeName.setSelectedItem(USE_DEFAULT_HTTP_IMPL);
         samplerTypeName.addItemListener(this);
@@ -753,8 +753,8 @@ public class ProxyControlGui extends Log
     }
 
     private JPanel createTargetPanel() {
-        targetNodesModel = new DefaultComboBoxModel();
-        targetNodes = new JComboBox(targetNodesModel);
+        targetNodesModel = new DefaultComboBoxModel<>();
+        targetNodes = new JComboBox<>(targetNodesModel);
         targetNodes.setPrototypeDisplayValue(""); // $NON-NLS-1$ // Bug 56303 fixed the width
of combo list
         JPopupMenu popup = (JPopupMenu) targetNodes.getUI().getAccessibleChild(targetNodes,
0); // get popup element
         JScrollPane scrollPane = findScrollPane(popup);
@@ -786,7 +786,7 @@ public class ProxyControlGui extends Log
     }
 
     private JPanel createGroupingPanel() {
-        DefaultComboBoxModel m = new DefaultComboBoxModel();
+        DefaultComboBoxModel<String> m = new DefaultComboBoxModel<>();
         // Note: position of these elements in the menu *must* match the
         // corresponding ProxyControl.GROUPING_* values.
         m.addElement(JMeterUtils.getResString("grouping_no_groups")); // $NON-NLS-1$
@@ -794,7 +794,7 @@ public class ProxyControlGui extends Log
         m.addElement(JMeterUtils.getResString("grouping_in_controllers")); // $NON-NLS-1$
         m.addElement(JMeterUtils.getResString("grouping_store_first_only")); // $NON-NLS-1$
         m.addElement(JMeterUtils.getResString("grouping_in_transaction_controllers")); //
$NON-NLS-1$
-        groupingMode = new JComboBox(m);
+        groupingMode = new JComboBox<>(m);
         groupingMode.setPreferredSize(new Dimension(150, 20));
         groupingMode.setSelectedIndex(0);
         groupingMode.addItemListener(this);

Modified: jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
(original)
+++ jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java
Mon Jun  1 18:01:34 2015
@@ -32,6 +32,7 @@ import javax.swing.JComboBox;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.jmeter.config.Argument;
 import org.apache.jmeter.config.Arguments;
 import org.apache.jmeter.config.gui.AbstractConfigGui;
@@ -59,7 +60,7 @@ public class JavaConfigGui extends Abstr
     private static final Logger log = LoggingManager.getLoggerForClass();
 
     /** A combo box allowing the user to choose a test class. */
-    private JComboBox classnameCombo;
+    private JComboBox<String> classnameCombo;
 
     /**
      * Indicates whether or not the name of this component should be displayed
@@ -141,7 +142,7 @@ public class JavaConfigGui extends Abstr
 
         JLabel label = new JLabel(JMeterUtils.getResString("protocol_java_classname")); //
$NON-NLS-1$
 
-        classnameCombo = new JComboBox(possibleClasses.toArray());
+        classnameCombo = new JComboBox<>(possibleClasses.toArray(ArrayUtils.EMPTY_STRING_ARRAY));
         classnameCombo.addActionListener(this);
         classnameCombo.setEditable(false);
         label.setLabelFor(classnameCombo);
@@ -242,11 +243,11 @@ public class JavaConfigGui extends Abstr
      * @param className String class name
      * @return boolean
      */
-    private static final boolean checkContainsClassName(ComboBoxModel model, String className)
{
+    private static final boolean checkContainsClassName(ComboBoxModel<String> model,
String className) {
         int size = model.getSize();
         Set<String> set = new HashSet<String>(size);
         for (int i = 0; i < size; i++) {
-            set.add((String)model.getElementAt(i));
+            set.add(model.getElementAt(i));
         }
         return set.contains(className);
     }

Modified: jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPropertiesPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPropertiesPanel.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPropertiesPanel.java
(original)
+++ jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPropertiesPanel.java
Mon Jun  1 18:01:34 2015
@@ -342,7 +342,7 @@ public class JMSPropertiesPanel extends
         private static final long serialVersionUID = 1L;
 
         public TypeCellEditor() {
-            super(new JComboBox(new Object[]{
+            super(new JComboBox<>(new Object[]{
                     Boolean.class.getName(),
                     Byte.class.getName(),
                     Short.class.getName(),

Modified: jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java?rev=1682964&r1=1682963&r2=1682964&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java
(original)
+++ jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java
Mon Jun  1 18:01:34 2015
@@ -99,7 +99,7 @@ public class JMSSamplerGui extends Abstr
         queueConnectionFactory.setText(""); // $NON-NLS-1$
         sendQueue.setText(""); // $NON-NLS-1$
         receiveQueue.setText(""); // $NON-NLS-1$
-        ((JComboBox) oneWay.getComponentList().get(1)).setSelectedItem(JMeterUtils.getResString("jms_request"));
//$NON-NLS-1$
+        ((JComboBox<?>) oneWay.getComponentList().get(1)).setSelectedItem(JMeterUtils.getResString("jms_request"));
//$NON-NLS-1$
         timeout.setText("");  // $NON-NLS-1$
         expiration.setText("");  // $NON-NLS-1$
         priority.setText("");  // $NON-NLS-1$
@@ -167,7 +167,7 @@ public class JMSSamplerGui extends Abstr
         sendQueue.setText(sampler.getSendQueue());
         receiveQueue.setText(sampler.getReceiveQueue());
 
-        JComboBox box = (JComboBox) oneWay.getComponentList().get(1);
+        JComboBox<?> box = (JComboBox<?>) oneWay.getComponentList().get(1);
         String selected = null;
         if (sampler.isOneway()) {
             selected = JMeterUtils.getResString("jms_request"); //$NON-NLS-1$



Mime
View raw message