View | Details | Raw Unified | Return to bug 57981
Collapse All | Expand All

(-)a/src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java (-3 / +3 lines)
Lines 216-224 public final class RemoteJMeterEngineImpl extends java.rmi.server.UnicastRemoteO Link Here
216
        if(remotelySetProperties != null) {
216
        if(remotelySetProperties != null) {
217
            Properties jmeterProperties = JMeterUtils.getJMeterProperties();
217
            Properties jmeterProperties = JMeterUtils.getJMeterProperties();
218
            log.info("Cleaning previously set properties "+remotelySetProperties);
218
            log.info("Cleaning previously set properties "+remotelySetProperties);
219
            for (Iterator<?> iterator = remotelySetProperties.keySet().iterator(); iterator.hasNext();) {
219
            for (Object key : remotelySetProperties.keySet()) {
220
                String key = (String) iterator.next();
220
                String k = (String) key; // TODO: is casting to String necessary?
221
                jmeterProperties.remove(key);
221
                jmeterProperties.remove(k);
222
            }
222
            }
223
        }
223
        }
224
        backingEngine.setProperties(p);
224
        backingEngine.setProperties(p);
(-)a/src/core/org/apache/jmeter/gui/JMeterFileFilter.java (-2 / +2 lines)
Lines 92-99 public class JMeterFileFilter extends javax.swing.filechooser.FileFilter impleme Link Here
92
            return true;
92
            return true;
93
        }
93
        }
94
94
95
        for (int i = 0; i < exts.length; i++) {
95
        for (String ext : exts) {
96
            if (filename.endsWith(exts[i])) {
96
            if (filename.endsWith(ext)) {
97
                return true;
97
                return true;
98
            }
98
            }
99
        }
99
        }
(-)a/src/core/org/apache/jmeter/gui/SavePropertyDialog.java (-7 / +7 lines)
Lines 83-92 public class SavePropertyDialog extends JDialog implements ActionListener { Link Here
83
        initDialog();
83
        initDialog();
84
    }
84
    }
85
85
86
    private int countMethods(Method[] m) {
86
    private int countMethods(Method[] methods) {
87
        int count = 0;
87
        int count = 0;
88
        for (int i = 0; i < m.length; i++) {
88
        for (Method method : methods) {
89
            if (m[i].getName().startsWith(NAME_SAVE_PFX)) {
89
            if (method.getName().startsWith(NAME_SAVE_PFX)) {
90
                count++;
90
                count++;
91
            }
91
            }
92
        }
92
        }
Lines 99-112 public class SavePropertyDialog extends JDialog implements ActionListener { Link Here
99
        int x = (countMethods(methods) / 3) + 1;
99
        int x = (countMethods(methods) / 3) + 1;
100
        log.debug("grid panel is " + 3 + " by " + x);
100
        log.debug("grid panel is " + 3 + " by " + x);
101
        JPanel checkPanel = new JPanel(new GridLayout(x, 3));
101
        JPanel checkPanel = new JPanel(new GridLayout(x, 3));
102
        for (int i = 0; i < methods.length; i++) {
102
        for (Method method : methods) {
103
            String name = methods[i].getName();
103
            String name = method.getName();
104
            if (name.startsWith(NAME_SAVE_PFX) && methods[i].getParameterTypes().length == 0) {
104
            if (name.startsWith(NAME_SAVE_PFX) && method.getParameterTypes().length == 0) {
105
                try {
105
                try {
106
                    name = name.substring(NAME_SAVE_PFX_LEN);
106
                    name = name.substring(NAME_SAVE_PFX_LEN);
107
                    JCheckBox check = new JCheckBox(
107
                    JCheckBox check = new JCheckBox(
108
                            JMeterUtils.getResString(RESOURCE_PREFIX + name)
108
                            JMeterUtils.getResString(RESOURCE_PREFIX + name)
109
                            ,((Boolean) methods[i].invoke(saveConfig, new Object[0])).booleanValue());
109
                            , ((Boolean) method.invoke(saveConfig, new Object[0])).booleanValue());
110
                    checkPanel.add(check, BorderLayout.NORTH);
110
                    checkPanel.add(check, BorderLayout.NORTH);
111
                    check.addActionListener(this);
111
                    check.addActionListener(this);
112
                    String actionCommand = NAME_SET_PREFIX + name; // $NON-NLS-1$
112
                    String actionCommand = NAME_SET_PREFIX + name; // $NON-NLS-1$
(-)a/src/core/org/apache/jmeter/gui/action/EnableComponent.java (-4 / +4 lines)
Lines 70-79 public class EnableComponent implements Command { Link Here
70
70
71
    private void toggleComponents(JMeterTreeNode[] nodes) {
71
    private void toggleComponents(JMeterTreeNode[] nodes) {
72
        GuiPackage pack = GuiPackage.getInstance();
72
        GuiPackage pack = GuiPackage.getInstance();
73
        for (int i = 0; i < nodes.length; i++) {
73
        for (JMeterTreeNode node : nodes) {
74
            boolean enable = !nodes[i].isEnabled();
74
            boolean enable = !node.isEnabled();
75
            nodes[i].setEnabled(enable);
75
            node.setEnabled(enable);
76
            pack.getGui(nodes[i].getTestElement()).setEnabled(enable);
76
            pack.getGui(node.getTestElement()).setEnabled(enable);
77
        }
77
        }
78
    }
78
    }
79
79
(-)a/src/core/org/apache/jmeter/gui/action/LookAndFeelCommand.java (-2 / +2 lines)
Lines 56-63 public class LookAndFeelCommand implements Command { Link Here
56
56
57
    static {
57
    static {
58
        UIManager.LookAndFeelInfo[] lfs = JMeterMenuBar.getAllLAFs();
58
        UIManager.LookAndFeelInfo[] lfs = JMeterMenuBar.getAllLAFs();
59
        for (int i = 0; i < lfs.length; i++) {
59
        for (UIManager.LookAndFeelInfo lf : lfs) {
60
            commands.add(ActionNames.LAF_PREFIX + lfs[i].getClassName());
60
            commands.add(ActionNames.LAF_PREFIX + lf.getClassName());
61
        }
61
        }
62
        String jMeterLaf = getJMeterLaf();
62
        String jMeterLaf = getJMeterLaf();
63
        if (log.isInfoEnabled()) {
63
        if (log.isInfoEnabled()) {
(-)a/src/core/org/apache/jmeter/gui/action/Save.java (-5 / +5 lines)
Lines 147-156 public class Save implements Command { Link Here
147
                TestElement element = GuiPackage.getInstance().createTestElement(TestFragmentControllerGui.class.getName());
147
                TestElement element = GuiPackage.getInstance().createTestElement(TestFragmentControllerGui.class.getName());
148
                HashTree hashTree = new ListedHashTree();
148
                HashTree hashTree = new ListedHashTree();
149
                HashTree tfTree = hashTree.add(new JMeterTreeNode(element, null));
149
                HashTree tfTree = hashTree.add(new JMeterTreeNode(element, null));
150
                for (int i = 0; i < nodes.length; i++) {
150
                for (JMeterTreeNode node : nodes) {
151
                    // Clone deeply current node
151
                    // Clone deeply current node
152
                    TreeCloner cloner = new TreeCloner(false);
152
                    TreeCloner cloner = new TreeCloner(false);
153
                    GuiPackage.getInstance().getTreeModel().getCurrentSubTree(nodes[i]).traverse(cloner);
153
                    GuiPackage.getInstance().getTreeModel().getCurrentSubTree(node).traverse(cloner);
154
                    // Add clone to tfTree
154
                    // Add clone to tfTree
155
                    tfTree.add(cloner.getClonedTree());
155
                    tfTree.add(cloner.getClonedTree());
156
                }
156
                }
Lines 398-406 public class Save implements Command { Link Here
398
     * @param nodes
398
     * @param nodes
399
     */
399
     */
400
    private static final boolean checkAcceptableForTestFragment(JMeterTreeNode[] nodes) {
400
    private static final boolean checkAcceptableForTestFragment(JMeterTreeNode[] nodes) {
401
        for (int i = 0; i < nodes.length; i++) {
401
        for (JMeterTreeNode node : nodes) {
402
            Object userObject = nodes[i].getUserObject();
402
            Object userObject = node.getUserObject();
403
            if(userObject instanceof org.apache.jmeter.threads.ThreadGroup ||
403
            if (userObject instanceof org.apache.jmeter.threads.ThreadGroup ||
404
                    userObject instanceof TestPlan) {
404
                    userObject instanceof TestPlan) {
405
                return false;
405
                return false;
406
            }
406
            }
(-)a/src/core/org/apache/jmeter/gui/action/SearchTreeDialog.java (-2 / +1 lines)
Lines 216-223 public class SearchTreeDialog extends JDialog implements ActionListener { Link Here
216
        GuiPackage guiInstance = GuiPackage.getInstance();
216
        GuiPackage guiInstance = GuiPackage.getInstance();
217
        JTree jTree = guiInstance.getMainFrame().getTree();
217
        JTree jTree = guiInstance.getMainFrame().getTree();
218
218
219
        for (Iterator<JMeterTreeNode> iterator = nodes.iterator(); iterator.hasNext();) {
219
        for (JMeterTreeNode jMeterTreeNode : nodes) {
220
            JMeterTreeNode jMeterTreeNode = iterator.next();
221
            jMeterTreeNode.setMarkedBySearch(true);
220
            jMeterTreeNode.setMarkedBySearch(true);
222
            if (expand) {
221
            if (expand) {
223
                jTree.expandPath(new TreePath(jMeterTreeNode.getPath()));
222
                jTree.expandPath(new TreePath(jMeterTreeNode.getPath()));
(-)a/src/core/org/apache/jmeter/plugin/PluginManager.java (-8 / +8 lines)
Lines 52-70 public final class PluginManager { Link Here
52
        String[][] icons = plugin.getIconMappings();
52
        String[][] icons = plugin.getIconMappings();
53
        ClassLoader classloader = plugin.getClass().getClassLoader();
53
        ClassLoader classloader = plugin.getClass().getClassLoader();
54
54
55
        for (int i = 0; i < icons.length; i++) {
55
        for (String[] icon : icons) {
56
            URL resource = classloader.getResource(icons[i][1].trim());
56
            URL resource = classloader.getResource(icon[1].trim());
57
57
58
            if (resource == null) {
58
            if (resource == null) {
59
                log.warn("Can't find icon for " + icons[i][0] + " - " + icons[i][1]);
59
                log.warn("Can't find icon for " + icon[0] + " - " + icon[1]);
60
            } else {
60
            } else {
61
                GUIFactory.registerIcon(icons[i][0], new ImageIcon(resource));
61
                GUIFactory.registerIcon(icon[0], new ImageIcon(resource));
62
                if (icons[i].length > 2 && icons[i][2] != null) {
62
                if (icon.length > 2 && icon[2] != null) {
63
                    URL resource2 = classloader.getResource(icons[i][2].trim());
63
                    URL resource2 = classloader.getResource(icon[2].trim());
64
                    if (resource2 == null) {
64
                    if (resource2 == null) {
65
                        log.info("Can't find disabled icon for " + icons[i][0] + " - " + icons[i][2]);
65
                        log.info("Can't find disabled icon for " + icon[0] + " - " + icon[2]);
66
                    } else {
66
                    } else {
67
                        GUIFactory.registerDisabledIcon(icons[i][0], new ImageIcon(resource2));
67
                        GUIFactory.registerDisabledIcon(icon[0], new ImageIcon(resource2));
68
                    }
68
                    }
69
                }
69
                }
70
            }
70
            }
(-)a/src/core/org/apache/jmeter/reporters/FileReporter.java (-31 / +15 lines)
Lines 180-193 private static class GraphPanel extends JPanel { Link Here
180
    public float getMax() {
180
    public float getMax() {
181
        float maxValue = 0;
181
        float maxValue = 0;
182
182
183
        for (int t = 0; t < keys.size(); t++) {
183
        for (String key : keys) {
184
            String key = keys.get(t);
184
            for (Integer i : data.get(key)) {
185
            List<Integer> temp = data.get(key);
185
                maxValue = Math.max(i, maxValue);
186
187
            for (int j = 0; j < temp.size(); j++) {
188
                float f = temp.get(j).intValue();
189
190
                maxValue = Math.max(f, maxValue);
191
            }
186
            }
192
        }
187
        }
193
        return (float) (maxValue + maxValue * 0.1);
188
        return (float) (maxValue + maxValue * 0.1);
Lines 201-214 private static class GraphPanel extends JPanel { Link Here
201
    public float getMin() {
196
    public float getMin() {
202
        float minValue = 9999999;
197
        float minValue = 9999999;
203
198
204
        for (int t = 0; t < keys.size(); t++) {
199
        for (String key : keys) {
205
            String key = keys.get(t);
200
            for (Integer i : data.get(key)) {
206
            List<Integer> temp = data.get(key);
201
                minValue = Math.min(i, minValue);
207
208
            for (int j = 0; j < temp.size(); j++) {
209
                float f = temp.get(j).intValue();
210
211
                minValue = Math.min(f, minValue);
212
            }
202
            }
213
        }
203
        }
214
        return (float) (minValue - minValue * 0.1);
204
        return (float) (minValue - minValue * 0.1);
Lines 261-276 private static class GraphPanel extends JPanel { Link Here
261
        float maxValue = 0;
251
        float maxValue = 0;
262
        float minValue = 999999;
252
        float minValue = 999999;
263
253
264
        for (int t = 0; t < keys.size(); t++) {
254
        for (String key : keys) {
265
            String key = keys.get(t);
255
            for (Integer i : data.get(key)) {
266
            List<Integer> temp = data.get(key);
256
                minValue = Math.min(i, minValue);
267
257
                maxValue = Math.max(i, maxValue);
268
            for (int j = 0; j < temp.size(); j++) {
258
                totalValue += i;
269
                float f = temp.get(j).intValue();
270
271
                minValue = Math.min(f, minValue);
272
                maxValue = Math.max(f, maxValue);
273
                totalValue += f;
274
                total++;
259
                total++;
275
            }
260
            }
276
        }
261
        }
Lines 319-331 private static class GraphPanel extends JPanel { Link Here
319
     * @return the max size of all lists for all key
304
     * @return the max size of all lists for all key
320
     */
305
     */
321
    public int getDataWidth() {
306
    public int getDataWidth() {
322
        int size = 0;
307
        int maxSize = 0;
323
308
324
        for (int t = 0; t < keys.size(); t++) {
309
        for (String key : keys) {
325
            String key = keys.get(t);
310
            maxSize = Math.max(maxSize, data.get(key).size());
326
            size = Math.max(size, data.get(key).size());
327
        }
311
        }
328
        return size;
312
        return maxSize;
329
    }
313
    }
330
314
331
    /**
315
    /**
(-)a/src/core/org/apache/jmeter/reporters/ResultSaver.java (-4 / +3 lines)
Lines 148-157 public class ResultSaver extends AbstractTestElement implements Serializable, Sa Link Here
148
    */
148
    */
149
   private void processSample(SampleResult s, Counter c) {
149
   private void processSample(SampleResult s, Counter c) {
150
        saveSample(s, c.num++);
150
        saveSample(s, c.num++);
151
        SampleResult[] sr = s.getSubResults();
151
       for (SampleResult sr : s.getSubResults()) {
152
        for (int i = 0; i < sr.length; i++) {
152
           processSample(sr, c);
153
            processSample(sr[i], c);
153
       }
154
        }
155
    }
154
    }
156
155
157
    /**
156
    /**
(-)a/src/core/org/apache/jmeter/samplers/SampleResult.java (-2 / +2 lines)
Lines 846-853 public class SampleResult implements Serializable, Cloneable { Link Here
846
                return false;
846
                return false;
847
            }
847
            }
848
        }
848
        }
849
        for (int i = 0; i < BINARY_TYPES.length; i++){
849
        for (String binaryType : BINARY_TYPES) {
850
            if (ct.startsWith(BINARY_TYPES[i])){
850
            if (ct.startsWith(binaryType)) {
851
                return true;
851
                return true;
852
            }
852
            }
853
        }
853
        }
(-)a/src/core/org/apache/jmeter/save/CSVSaveService.java (-7 / +6 lines)
Lines 595-607 public final class CSVSaveService { Link Here
595
        SampleSaveConfiguration saveConfig = new SampleSaveConfiguration(false);
595
        SampleSaveConfiguration saveConfig = new SampleSaveConfiguration(false);
596
596
597
        int varCount = 0;
597
        int varCount = 0;
598
        for (int i = 0; i < parts.length; i++) {
598
        for (String label : parts) {
599
            String label = parts[i];
600
            if (isVariableName(label)) {
599
            if (isVariableName(label)) {
601
                varCount++;
600
                varCount++;
602
            } else {
601
            } else {
603
                Functor set = (Functor) headerLabelMethods.get(label);
602
                Functor set = (Functor) headerLabelMethods.get(label);
604
                set.invoke(saveConfig, new Boolean[] { Boolean.TRUE });
603
                set.invoke(saveConfig, new Boolean[]{Boolean.TRUE});
605
            }
604
            }
606
        }
605
        }
607
606
Lines 701-708 public final class CSVSaveService { Link Here
701
            }
700
            }
702
            writer.write(LINE_SEP);
701
            writer.write(LINE_SEP);
703
        }
702
        }
704
        for (int idx = 0; idx < data.size(); idx++) {
703
        for (Object d : data) {
705
            List<?> row = (List<?>) data.get(idx);
704
            List<?> row = (List<?>) d;
706
            for (int idy = 0; idy < row.size(); idy++) {
705
            for (int idy = 0; idy < row.size(); idy++) {
707
                if (idy > 0) {
706
                if (idy > 0) {
708
                    writer.write(DELIM);
707
                    writer.write(DELIM);
Lines 905-912 public final class CSVSaveService { Link Here
905
904
906
            if (results != null) {
905
            if (results != null) {
907
                // Find the first non-null message
906
                // Find the first non-null message
908
                for (int i = 0; i < results.length; i++) {
907
                for (AssertionResult result : results) {
909
                    message = results[i].getFailureMessage();
908
                    message = result.getFailureMessage();
910
                    if (message != null) {
909
                    if (message != null) {
911
                        break;
910
                        break;
912
                    }
911
                    }
(-)a/src/core/org/apache/jmeter/save/OldSaveService.java (-57 / +57 lines)
Lines 127-144 public final class OldSaveService { Link Here
127
        result.setResponseData(getBinaryData(config.getChild(BINARY)));
127
        result.setResponseData(getBinaryData(config.getChild(BINARY)));
128
        Configuration[] subResults = config.getChildren(SAMPLE_RESULT_TAG_NAME);
128
        Configuration[] subResults = config.getChildren(SAMPLE_RESULT_TAG_NAME);
129
129
130
        for (int i = 0; i < subResults.length; i++) {
130
        for (Configuration subResult : subResults) {
131
            result.storeSubResult(getSampleResult(subResults[i]));
131
            result.storeSubResult(getSampleResult(subResult));
132
        }
132
        }
133
        Configuration[] assResults = config.getChildren(ASSERTION_RESULT_TAG_NAME);
133
        Configuration[] assResults = config.getChildren(ASSERTION_RESULT_TAG_NAME);
134
134
135
        for (int i = 0; i < assResults.length; i++) {
135
        for (Configuration assResult : assResults) {
136
            result.addAssertionResult(getAssertionResult(assResults[i]));
136
            result.addAssertionResult(getAssertionResult(assResult));
137
        }
137
        }
138
138
139
        Configuration[] samplerData = config.getChildren("property"); // $NON-NLS-1$
139
        Configuration[] samplerData = config.getChildren("property"); // $NON-NLS-1$
140
        for (int i = 0; i < samplerData.length; i++) {
140
        for (Configuration aSamplerData : samplerData) {
141
            result.setSamplerData(samplerData[i].getValue("")); // $NON-NLS-1$
141
            result.setSamplerData(aSamplerData.getValue("")); // $NON-NLS-1$
142
        }
142
        }
143
        return result;
143
        return result;
144
    }
144
    }
Lines 338-347 public final class OldSaveService { Link Here
338
338
339
        String gui_class=""; // $NON-NLS-1$
339
        String gui_class=""; // $NON-NLS-1$
340
        Configuration[] children = config.getChildren();
340
        Configuration[] children = config.getChildren();
341
        for (int i = 0; i < children.length; i++) {
341
        for (Configuration child : children) {
342
            if (children[i].getName().equals("property")) { // $NON-NLS-1$
342
            if (child.getName().equals("property")) { // $NON-NLS-1$
343
                if (children[i].getAttribute("name").equals(TestElement.GUI_CLASS)){ // $NON-NLS-1$
343
                if (child.getAttribute("name").equals(TestElement.GUI_CLASS)) { // $NON-NLS-1$
344
                    gui_class=children[i].getValue();
344
                    gui_class = child.getValue();
345
                }
345
                }
346
            }
346
            }
347
        }
347
        }
Lines 350-375 public final class OldSaveService { Link Here
350
350
351
        element = (TestElement) Class.forName(newClass).newInstance();
351
        element = (TestElement) Class.forName(newClass).newInstance();
352
352
353
        for (int i = 0; i < children.length; i++) {
353
        for (Configuration child : children) {
354
            if (children[i].getName().equals("property")) { // $NON-NLS-1$
354
            if (child.getName().equals("property")) { // $NON-NLS-1$
355
                try {
355
                try {
356
                    JMeterProperty prop = createProperty(children[i], newClass);
356
                    JMeterProperty prop = createProperty(child, newClass);
357
                    if (prop!=null) {
357
                    if (prop != null) {
358
                        element.setProperty(prop);
358
                        element.setProperty(prop);
359
                    }
359
                    }
360
                } catch (Exception ex) {
360
                } catch (Exception ex) {
361
                    log.error("Problem loading property", ex);
361
                    log.error("Problem loading property", ex);
362
                    element.setProperty(children[i].getAttribute("name"), ""); // $NON-NLS-1$ // $NON-NLS-2$
362
                    element.setProperty(child.getAttribute("name"), ""); // $NON-NLS-1$ // $NON-NLS-2$
363
                }
363
                }
364
            } else if (children[i].getName().equals("testelement")) { // $NON-NLS-1$
364
            } else if (child.getName().equals("testelement")) { // $NON-NLS-1$
365
                element.setProperty(new TestElementProperty(children[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
365
                element.setProperty(new TestElementProperty(child.getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
366
                        createTestElement(children[i])));
366
                        createTestElement(child)));
367
            } else if (children[i].getName().equals("collection")) { // $NON-NLS-1$
367
            } else if (child.getName().equals("collection")) { // $NON-NLS-1$
368
                element.setProperty(new CollectionProperty(children[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
368
                element.setProperty(new CollectionProperty(child.getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
369
                        createCollection(children[i], newClass)));
369
                        createCollection(child, newClass)));
370
            } else if (children[i].getName().equals("map")) { // $NON-NLS-1$
370
            } else if (child.getName().equals("map")) { // $NON-NLS-1$
371
                element.setProperty(new MapProperty(children[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
371
                element.setProperty(new MapProperty(child.getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
372
                        createMap(children[i],newClass)));
372
                        createMap(child, newClass)));
373
            }
373
            }
374
        }
374
        }
375
        return element;
375
        return element;
Lines 381-404 public final class OldSaveService { Link Here
381
        Collection<JMeterProperty> coll = (Collection<JMeterProperty>) Class.forName(config.getAttribute("class")).newInstance(); // $NON-NLS-1$
381
        Collection<JMeterProperty> coll = (Collection<JMeterProperty>) Class.forName(config.getAttribute("class")).newInstance(); // $NON-NLS-1$
382
        Configuration[] items = config.getChildren();
382
        Configuration[] items = config.getChildren();
383
383
384
        for (int i = 0; i < items.length; i++) {
384
        for (Configuration item : items) {
385
            if (items[i].getName().equals("property")) { // $NON-NLS-1$
385
            if (item.getName().equals("property")) { // $NON-NLS-1$
386
                JMeterProperty prop = createProperty(items[i], testClass);
386
                JMeterProperty prop = createProperty(item, testClass);
387
                if (prop!=null) {
387
                if (prop != null) {
388
                    coll.add(prop);
388
                    coll.add(prop);
389
                }
389
                }
390
            } else if (items[i].getName().equals("testelement")) { // $NON-NLS-1$
390
            } else if (item.getName().equals("testelement")) { // $NON-NLS-1$
391
                coll.add(new TestElementProperty(items[i].getAttribute("name", ""), createTestElement(items[i]))); // $NON-NLS-1$ // $NON-NLS-2$
391
                coll.add(new TestElementProperty(item.getAttribute("name", ""), createTestElement(item))); // $NON-NLS-1$ // $NON-NLS-2$
392
            } else if (items[i].getName().equals("collection")) { // $NON-NLS-1$
392
            } else if (item.getName().equals("collection")) { // $NON-NLS-1$
393
                coll.add(new CollectionProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
393
                coll.add(new CollectionProperty(item.getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
394
                        createCollection(items[i], testClass)));
394
                        createCollection(item, testClass)));
395
            } else if (items[i].getName().equals("string")) { // $NON-NLS-1$
395
            } else if (item.getName().equals("string")) { // $NON-NLS-1$
396
                JMeterProperty prop = createProperty(items[i], testClass);
396
                JMeterProperty prop = createProperty(item, testClass);
397
                if (prop!=null) {
397
                if (prop != null) {
398
                    coll.add(prop);
398
                    coll.add(prop);
399
                }
399
                }
400
            } else if (items[i].getName().equals("map")) { // $NON-NLS-1$
400
            } else if (item.getName().equals("map")) { // $NON-NLS-1$
401
                coll.add(new MapProperty(items[i].getAttribute("name", ""), createMap(items[i], testClass))); // $NON-NLS-1$ // $NON-NLS-2$
401
                coll.add(new MapProperty(item.getAttribute("name", ""), createMap(item, testClass))); // $NON-NLS-1$ // $NON-NLS-2$
402
            }
402
            }
403
        }
403
        }
404
        return coll;
404
        return coll;
Lines 440-462 public final class OldSaveService { Link Here
440
        Map<String, JMeterProperty> map = (Map<String, JMeterProperty>) Class.forName(config.getAttribute("class")).newInstance();
440
        Map<String, JMeterProperty> map = (Map<String, JMeterProperty>) Class.forName(config.getAttribute("class")).newInstance();
441
        Configuration[] items = config.getChildren();
441
        Configuration[] items = config.getChildren();
442
442
443
        for (int i = 0; i < items.length; i++) {
443
        for (Configuration item : items) {
444
            if (items[i].getName().equals("property")) { // $NON-NLS-1$
444
            if (item.getName().equals("property")) { // $NON-NLS-1$
445
                JMeterProperty prop = createProperty(items[i], testClass);
445
                JMeterProperty prop = createProperty(item, testClass);
446
                if (prop!=null) {
446
                if (prop != null) {
447
                    map.put(prop.getName(), prop);
447
                    map.put(prop.getName(), prop);
448
                }
448
                }
449
            } else if (items[i].getName().equals("testelement")) { // $NON-NLS-1$
449
            } else if (item.getName().equals("testelement")) { // $NON-NLS-1$
450
                map.put(items[i].getAttribute("name", ""), new TestElementProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
450
                map.put(item.getAttribute("name", ""), new TestElementProperty(item.getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
451
                        createTestElement(items[i])));
451
                        createTestElement(item)));
452
            } else if (items[i].getName().equals("collection")) { // $NON-NLS-1$
452
            } else if (item.getName().equals("collection")) { // $NON-NLS-1$
453
                map.put(items[i].getAttribute("name"),  // $NON-NLS-1$
453
                map.put(item.getAttribute("name"),  // $NON-NLS-1$
454
                        new CollectionProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
454
                        new CollectionProperty(item.getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
455
                        createCollection(items[i], testClass)));
455
                                createCollection(item, testClass)));
456
            } else if (items[i].getName().equals("map")) { // $NON-NLS-1$
456
            } else if (item.getName().equals("map")) { // $NON-NLS-1$
457
                map.put(items[i].getAttribute("name", ""),  // $NON-NLS-1$ // $NON-NLS-2$
457
                map.put(item.getAttribute("name", ""),  // $NON-NLS-1$ // $NON-NLS-2$
458
                        new MapProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
458
                        new MapProperty(item.getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
459
                        createMap(items[i], testClass)));
459
                                createMap(item, testClass)));
460
            }
460
            }
461
        }
461
        }
462
        return map;
462
        return map;
Lines 474-481 public final class OldSaveService { Link Here
474
        HashTree subTree = new ListedHashTree(element);
474
        HashTree subTree = new ListedHashTree(element);
475
        Configuration[] subNodes = config.getChildren("node"); // $NON-NLS-1$
475
        Configuration[] subNodes = config.getChildren("node"); // $NON-NLS-1$
476
476
477
        for (int i = 0; i < subNodes.length; i++) {
477
        for (Configuration subNode : subNodes) {
478
            HashTree t = generateNode(subNodes[i]);
478
            HashTree t = generateNode(subNode);
479
479
480
            if (t != null) {
480
            if (t != null) {
481
                subTree.add(element, t);
481
                subTree.add(element, t);
Lines 493-500 public final class OldSaveService { Link Here
493
        Configuration[] samples = savedSamples.getChildren();
493
        Configuration[] samples = savedSamples.getChildren();
494
        final boolean errorsOnly = rc.isErrorLogging();
494
        final boolean errorsOnly = rc.isErrorLogging();
495
        final boolean successOnly = rc.isSuccessOnlyLogging();
495
        final boolean successOnly = rc.isSuccessOnlyLogging();
496
        for (int i = 0; i < samples.length; i++) {
496
        for (Configuration sample : samples) {
497
            SampleResult result = OldSaveService.getSampleResult(samples[i]);
497
            SampleResult result = OldSaveService.getSampleResult(sample);
498
            if (ResultCollector.isSampleWanted(result.isSuccessful(), errorsOnly, successOnly)) {
498
            if (ResultCollector.isSampleWanted(result.isSuccessful(), errorsOnly, successOnly)) {
499
                visualizer.add(result);
499
                visualizer.add(result);
500
            }
500
            }
(-)a/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java (-5 / +5 lines)
Lines 241-249 public class SampleResultConverter extends AbstractCollectionConverter { Link Here
241
            SampleSaveConfiguration save) {
241
            SampleSaveConfiguration save) {
242
        if (save.saveSubresults()) {
242
        if (save.saveSubresults()) {
243
            SampleResult[] subResults = res.getSubResults();
243
            SampleResult[] subResults = res.getSubResults();
244
            for (int i = 0; i < subResults.length; i++) {
244
            for (SampleResult subResult : subResults) {
245
                subResults[i].setSaveConfig(save);
245
                subResult.setSaveConfig(save);
246
                writeItem(subResults[i], context, writer);
246
                writeItem(subResult, context, writer);
247
            }
247
            }
248
        }
248
        }
249
    }
249
    }
Lines 264-271 public class SampleResultConverter extends AbstractCollectionConverter { Link Here
264
            SampleSaveConfiguration save) {
264
            SampleSaveConfiguration save) {
265
        if (save.saveAssertions()) {
265
        if (save.saveAssertions()) {
266
            AssertionResult[] assertionResults = res.getAssertionResults();
266
            AssertionResult[] assertionResults = res.getAssertionResults();
267
            for (int i = 0; i < assertionResults.length; i++) {
267
            for (AssertionResult assertionResult : assertionResults) {
268
                writeItem(assertionResults[i], context, writer);
268
                writeItem(assertionResult, context, writer);
269
            }
269
            }
270
        }
270
        }
271
    }
271
    }
(-)a/src/core/org/apache/jmeter/testbeans/gui/WrapperEditor.java (-2 / +2 lines)
Lines 177-184 class WrapperEditor extends PropertyEditorSupport implements PropertyChangeListe Link Here
177
        if (tags == null) {
177
        if (tags == null) {
178
            return false;
178
            return false;
179
        }
179
        }
180
        for (int i = 0; i < tags.length; i++) {
180
        for (String tag : tags) {
181
            if (tags[i].equals(text)) {
181
            if (tag.equals(text)) {
182
                return true;
182
                return true;
183
            }
183
            }
184
        }
184
        }
(-)a/src/core/org/apache/jmeter/testelement/TestPlan.java (-3 / +3 lines)
Lines 256-264 public class TestPlan extends AbstractTestElement implements Serializable, TestS Link Here
256
        }
256
        }
257
        // we set the classpath
257
        // we set the classpath
258
        String[] paths = this.getTestPlanClasspathArray();
258
        String[] paths = this.getTestPlanClasspathArray();
259
        for (int idx=0; idx < paths.length; idx++) {
259
        for (String path : paths) {
260
            NewDriver.addURL(paths[idx]);
260
            NewDriver.addURL(path);
261
            log.info("add " + paths[idx] + " to classpath");
261
            log.info("add " + path + " to classpath");
262
        }
262
        }
263
    }
263
    }
264
264
(-)a/src/core/org/apache/jmeter/threads/JMeterThread.java (-7 / +5 lines)
Lines 341-350 public class JMeterThread implements Runnable, Interruptible { Link Here
341
        List<Controller> controllersToReinit = pathToRootTraverser.getControllersToRoot();
341
        List<Controller> controllersToReinit = pathToRootTraverser.getControllersToRoot();
342
342
343
        // Trigger end of loop condition on all parent controllers of current sampler
343
        // Trigger end of loop condition on all parent controllers of current sampler
344
        for (Iterator<Controller> iterator = controllersToReinit
344
        for (Controller parentController : controllersToReinit) {
345
                .iterator(); iterator.hasNext();) {
345
            if (parentController instanceof AbstractThreadGroup) {
346
            Controller parentController =  iterator.next();
347
            if(parentController instanceof AbstractThreadGroup) {
348
                AbstractThreadGroup tg = (AbstractThreadGroup) parentController;
346
                AbstractThreadGroup tg = (AbstractThreadGroup) parentController;
349
                tg.startNextLoop();
347
                tg.startNextLoop();
350
            } else {
348
            } else {
Lines 692-700 public class JMeterThread implements Runnable, Interruptible { Link Here
692
                if (scopedAssertion.isScopeChildren(scope) || scopedAssertion.isScopeAll(scope)){
690
                if (scopedAssertion.isScopeChildren(scope) || scopedAssertion.isScopeAll(scope)){
693
                    SampleResult children[] = parent.getSubResults();
691
                    SampleResult children[] = parent.getSubResults();
694
                    boolean childError = false;
692
                    boolean childError = false;
695
                    for (int i=0;i <children.length; i++){
693
                    for (SampleResult child : children) {
696
                        processAssertion(children[i], assertion);
694
                        processAssertion(child, assertion);
697
                        if (!children[i].isSuccessful()){
695
                        if (!child.isSuccessful()) {
698
                            childError = true;
696
                            childError = true;
699
                        }
697
                        }
700
                    }
698
                    }
(-)a/src/core/org/apache/jmeter/threads/JMeterVariables.java (-6 / +4 lines)
Lines 49-59 public class JMeterVariables { Link Here
49
    }
49
    }
50
50
51
    private void preloadVariables(){
51
    private void preloadVariables(){
52
        for (int i = 0; i < PRE_LOAD.length; i++){
52
        for (String property : PRE_LOAD) {
53
            String property=PRE_LOAD[i];
53
            String value = JMeterUtils.getProperty(property);
54
            String value=JMeterUtils.getProperty(property);
54
            if (value != null) {
55
            if (value != null){
55
                variables.put(property, value);
56
                variables.put(property,value);
57
            }
56
            }
58
        }
57
        }
59
    }
58
    }
60
- 

Return to bug 57981