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

(-)a/src/components/org/apache/jmeter/assertions/CompareAssertion.java (-1 / +1 lines)
Lines 157-163 public class CompareAssertion extends AbstractTestElement implements Assertion, Link Here
157
157
158
    @Override
158
    @Override
159
    public void iterationStart(LoopIterationEvent iterEvent) {
159
    public void iterationStart(LoopIterationEvent iterEvent) {
160
        responses = new LinkedList<SampleResult>();
160
        responses = new LinkedList<>();
161
    }
161
    }
162
162
163
    public void iterationEnd(LoopIterationEvent iterEvent) {
163
    public void iterationEnd(LoopIterationEvent iterEvent) {
(-)a/src/components/org/apache/jmeter/assertions/CompareAssertionBeanInfo.java (-1 / +1 lines)
Lines 48-54 public class CompareAssertionBeanInfo extends BeanInfoSupport { Link Here
48
        p.setValue(TableEditor.OBJECT_PROPERTIES, // These are the names of the get/set methods
48
        p.setValue(TableEditor.OBJECT_PROPERTIES, // These are the names of the get/set methods
49
                new String[]{SubstitutionElement.REGEX, SubstitutionElement.SUBSTITUTE});
49
                new String[]{SubstitutionElement.REGEX, SubstitutionElement.SUBSTITUTE});
50
        p.setValue(NOT_UNDEFINED,Boolean.TRUE);
50
        p.setValue(NOT_UNDEFINED,Boolean.TRUE);
51
        p.setValue(DEFAULT,new ArrayList<Object>());
51
        p.setValue(DEFAULT, new ArrayList<>());
52
        p.setValue(MULTILINE,Boolean.TRUE);
52
        p.setValue(MULTILINE,Boolean.TRUE);
53
53
54
    }
54
    }
(-)a/src/components/org/apache/jmeter/assertions/SMIMEAssertion.java (-1 / +1 lines)
Lines 321-327 class SMIMEAssertion { Link Here
321
     */
321
     */
322
    private static List<String> getEmailFromCert(X509Certificate cert)
322
    private static List<String> getEmailFromCert(X509Certificate cert)
323
            throws CertificateException {
323
            throws CertificateException {
324
        List<String> res = new ArrayList<String>();
324
        List<String> res = new ArrayList<>();
325
325
326
        X509Principal subject = PrincipalUtil.getSubjectX509Principal(cert);
326
        X509Principal subject = PrincipalUtil.getSubjectX509Principal(cert);
327
        Iterator<?> addressIt = subject.getValues(X509Name.EmailAddress).iterator();
327
        Iterator<?> addressIt = subject.getValues(X509Name.EmailAddress).iterator();
(-)a/src/components/org/apache/jmeter/control/CriticalSectionController.java (-1 / +1 lines)
Lines 70-76 public class CriticalSectionController extends GenericController implements Link Here
70
70
71
    private static final String LOCK_NAME = "CriticalSectionController.lockName"; //$NON-NLS-1$
71
    private static final String LOCK_NAME = "CriticalSectionController.lockName"; //$NON-NLS-1$
72
72
73
    private static final ConcurrentHashMap<String, ReentrantLock> LOCK_MAP = new ConcurrentHashMap<String, ReentrantLock>();
73
    private static final ConcurrentHashMap<String, ReentrantLock> LOCK_MAP = new ConcurrentHashMap<>();
74
74
75
    private transient volatile ReentrantLock currentLock;
75
    private transient volatile ReentrantLock currentLock;
76
76
(-)a/src/components/org/apache/jmeter/control/IncludeController.java (-2 / +2 lines)
Lines 173-179 public class IncludeController extends GenericController implements ReplaceableC Link Here
173
     * @return HashTree Subset within Test Fragment or Empty HashTree
173
     * @return HashTree Subset within Test Fragment or Empty HashTree
174
     */
174
     */
175
    private HashTree getProperBranch(HashTree tree) {
175
    private HashTree getProperBranch(HashTree tree) {
176
        Iterator<Object> iter = new LinkedList<Object>(tree.list()).iterator();
176
        Iterator<Object> iter = new LinkedList<>(tree.list()).iterator();
177
        while (iter.hasNext()) {
177
        while (iter.hasNext()) {
178
            TestElement item = (TestElement) iter.next();
178
            TestElement item = (TestElement) iter.next();
179
179
Lines 194-200 public class IncludeController extends GenericController implements ReplaceableC Link Here
194
194
195
195
196
    private void removeDisabledItems(HashTree tree) {
196
    private void removeDisabledItems(HashTree tree) {
197
        Iterator<Object> iter = new LinkedList<Object>(tree.list()).iterator();
197
        Iterator<Object> iter = new LinkedList<>(tree.list()).iterator();
198
        while (iter.hasNext()) {
198
        while (iter.hasNext()) {
199
            TestElement item = (TestElement) iter.next();
199
            TestElement item = (TestElement) iter.next();
200
            if (!item.isEnabled()) {
200
            if (!item.isEnabled()) {
(-)a/src/components/org/apache/jmeter/control/ModuleController.java (-1 / +1 lines)
Lines 100-106 public class ModuleController extends GenericController implements ReplaceableCo Link Here
100
    }
100
    }
101
101
102
    private void setNodePath() {
102
    private void setNodePath() {
103
        List<String> nodePath = new ArrayList<String>();
103
        List<String> nodePath = new ArrayList<>();
104
        if (selectedNode != null) {
104
        if (selectedNode != null) {
105
            TreeNode[] path = selectedNode.getPath();
105
            TreeNode[] path = selectedNode.getPath();
106
            for (TreeNode node : path) {
106
            for (TreeNode node : path) {
(-)a/src/components/org/apache/jmeter/control/RandomOrderController.java (-1 / +1 lines)
Lines 62-68 public class RandomOrderController extends GenericController implements Serializ Link Here
62
        int numElements = this.subControllersAndSamplers.size();
62
        int numElements = this.subControllersAndSamplers.size();
63
63
64
        // Create a new list containing numElements null elements.
64
        // Create a new list containing numElements null elements.
65
        List<TestElement> reordered = new ArrayList<TestElement>(this.subControllersAndSamplers.size());
65
        List<TestElement> reordered = new ArrayList<>(this.subControllersAndSamplers.size());
66
        for (int i = 0; i < numElements; i++) {
66
        for (int i = 0; i < numElements; i++) {
67
            reordered.add(null);
67
            reordered.add(null);
68
        }
68
        }
(-)a/src/components/org/apache/jmeter/extractor/DebugPostProcessor.java (-2 / +2 lines)
Lines 94-100 public class DebugPostProcessor extends AbstractTestElement implements PostProce Link Here
94
    }
94
    }
95
95
96
    private void formatPropertyIterator(StringBuilder sb, PropertyIterator iter) {
96
    private void formatPropertyIterator(StringBuilder sb, PropertyIterator iter) {
97
        Map<String, String> map = new HashMap<String, String>();
97
        Map<String, String> map = new HashMap<>();
98
        while (iter.hasNext()) {
98
        while (iter.hasNext()) {
99
            JMeterProperty item = iter.next();
99
            JMeterProperty item = iter.next();
100
            map.put(item.getName(), item.getStringValue());
100
            map.put(item.getName(), item.getStringValue());
Lines 104-110 public class DebugPostProcessor extends AbstractTestElement implements PostProce Link Here
104
104
105
    private void formatSet(StringBuilder sb, @SuppressWarnings("rawtypes") Set s) {
105
    private void formatSet(StringBuilder sb, @SuppressWarnings("rawtypes") Set s) {
106
        @SuppressWarnings("unchecked")
106
        @SuppressWarnings("unchecked")
107
        ArrayList<Map.Entry<Object, Object>> al = new ArrayList<Map.Entry<Object, Object>>(s);
107
        ArrayList<Map.Entry<Object, Object>> al = new ArrayList<>(s);
108
        Collections.sort(al, new Comparator<Map.Entry<Object, Object>>(){
108
        Collections.sort(al, new Comparator<Map.Entry<Object, Object>>(){
109
            @Override
109
            @Override
110
            public int compare(Map.Entry<Object, Object> o1, Map.Entry<Object, Object> o2) {
110
            public int compare(Map.Entry<Object, Object> o1, Map.Entry<Object, Object> o2) {
(-)a/src/components/org/apache/jmeter/extractor/HtmlExtractor.java (-1 / +1 lines)
Lines 177-183 public class HtmlExtractor extends AbstractScopedTestElement implements PostProc Link Here
177
            String expression, String attribute, int matchNumber,
177
            String expression, String attribute, int matchNumber,
178
            SampleResult previousResult) {
178
            SampleResult previousResult) {
179
        int found = 0;
179
        int found = 0;
180
        List<String> result = new ArrayList<String>();
180
        List<String> result = new ArrayList<>();
181
        if (isScopeVariable()){
181
        if (isScopeVariable()){
182
            String inputString=vars.get(getVariableName());
182
            String inputString=vars.get(getVariableName());
183
            if(!StringUtils.isEmpty(inputString)) {
183
            if(!StringUtils.isEmpty(inputString)) {
(-)a/src/components/org/apache/jmeter/extractor/RegexExtractor.java (-2 / +2 lines)
Lines 192-198 public class RegexExtractor extends AbstractScopedTestElement implements PostPro Link Here
192
        }
192
        }
193
193
194
        Perl5Matcher matcher = JMeterUtils.getMatcher();
194
        Perl5Matcher matcher = JMeterUtils.getMatcher();
195
        List<MatchResult> matches = new ArrayList<MatchResult>();
195
        List<MatchResult> matches = new ArrayList<>();
196
        int found = 0;
196
        int found = 0;
197
197
198
        if (isScopeVariable()){
198
        if (isScopeVariable()){
Lines 315-321 public class RegexExtractor extends AbstractScopedTestElement implements PostPro Link Here
315
            return;
315
            return;
316
        }
316
        }
317
        // Contains Strings and Integers
317
        // Contains Strings and Integers
318
        List<Object> combined = new ArrayList<Object>();
318
        List<Object> combined = new ArrayList<>();
319
        String rawTemplate = getTemplate();
319
        String rawTemplate = getTemplate();
320
        PatternMatcher matcher = JMeterUtils.getMatcher();
320
        PatternMatcher matcher = JMeterUtils.getMatcher();
321
        Pattern templatePattern = JMeterUtils.getPatternCache().getPattern("\\$(\\d+)\\$"  // $NON-NLS-1$
321
        Pattern templatePattern = JMeterUtils.getPatternCache().getPattern("\\$(\\d+)\\$"  // $NON-NLS-1$
(-)a/src/components/org/apache/jmeter/extractor/XPathExtractor.java (-1 / +1 lines)
Lines 124-130 public class XPathExtractor extends AbstractScopedTestElement implements Link Here
124
        vars.put(matchNR, "0"); // In case parse fails // $NON-NLS-1$
124
        vars.put(matchNR, "0"); // In case parse fails // $NON-NLS-1$
125
        vars.remove(concat(refName,"1")); // In case parse fails // $NON-NLS-1$
125
        vars.remove(concat(refName,"1")); // In case parse fails // $NON-NLS-1$
126
126
127
        List<String> matches = new ArrayList<String>();
127
        List<String> matches = new ArrayList<>();
128
        try{
128
        try{
129
            if (isScopeVariable()){
129
            if (isScopeVariable()){
130
                String inputString=vars.get(getVariableName());
130
                String inputString=vars.get(getVariableName());
(-)a/src/components/org/apache/jmeter/modifiers/UserParameters.java (-1 / +1 lines)
Lines 123-129 public class UserParameters extends AbstractTestElement implements Serializable, Link Here
123
        if (threadValues.size() > 0) {
123
        if (threadValues.size() > 0) {
124
            return (CollectionProperty) threadValues.get(getThreadContext().getThreadNum() % threadValues.size());
124
            return (CollectionProperty) threadValues.get(getThreadContext().getThreadNum() % threadValues.size());
125
        }
125
        }
126
        return new CollectionProperty("noname", new LinkedList<Object>());
126
        return new CollectionProperty("noname", new LinkedList<>());
127
    }
127
    }
128
128
129
    public boolean isPerIteration() {
129
    public boolean isPerIteration() {
(-)a/src/components/org/apache/jmeter/modifiers/gui/UserParametersGui.java (-1 / +1 lines)
Lines 131-137 public class UserParametersGui extends AbstractPreProcessorGui { Link Here
131
        GuiUtils.stopTableEditing(paramTable);
131
        GuiUtils.stopTableEditing(paramTable);
132
        UserParameters userParams = ((UserParameters) params);
132
        UserParameters userParams = ((UserParameters) params);
133
        userParams.setNames(new CollectionProperty(UserParameters.NAMES, tableModel.getColumnData(NAME_COL_RESOURCE)));
133
        userParams.setNames(new CollectionProperty(UserParameters.NAMES, tableModel.getColumnData(NAME_COL_RESOURCE)));
134
        CollectionProperty threadLists = new CollectionProperty(UserParameters.THREAD_VALUES, new ArrayList<Object>());
134
        CollectionProperty threadLists = new CollectionProperty(UserParameters.THREAD_VALUES, new ArrayList<>());
135
        log.debug("making threadlists from gui");
135
        log.debug("making threadlists from gui");
136
        for (int col = 1; col < tableModel.getColumnCount(); col++) {
136
        for (int col = 1; col < tableModel.getColumnCount(); col++) {
137
            threadLists.addItem(tableModel.getColumnData(getUserColName(col)));
137
            threadLists.addItem(tableModel.getColumnData(getUserColName(col)));
(-)a/src/components/org/apache/jmeter/reporters/MailerModel.java (-1 / +1 lines)
Lines 152-158 public class MailerModel extends AbstractTestElement implements Serializable { Link Here
152
     */
152
     */
153
    public List<String> getAddressList() {
153
    public List<String> getAddressList() {
154
        String addressees = getToAddress();
154
        String addressees = getToAddress();
155
        List<String> addressList = new ArrayList<String>();
155
        List<String> addressList = new ArrayList<>();
156
156
157
        if (addressees != null) {
157
        if (addressees != null) {
158
158
(-)a/src/components/org/apache/jmeter/sampler/DebugSampler.java (-2 / +2 lines)
Lines 43-49 public class DebugSampler extends AbstractSampler implements TestBean { Link Here
43
43
44
    private static final long serialVersionUID = 232L;
44
    private static final long serialVersionUID = 232L;
45
45
46
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
46
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<>(
47
            Arrays.asList(new String[]{
47
            Arrays.asList(new String[]{
48
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
48
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
49
49
Lines 91-97 public class DebugSampler extends AbstractSampler implements TestBean { Link Here
91
91
92
    private void formatSet(StringBuilder sb, @SuppressWarnings("rawtypes") Set s) {
92
    private void formatSet(StringBuilder sb, @SuppressWarnings("rawtypes") Set s) {
93
        @SuppressWarnings("unchecked")
93
        @SuppressWarnings("unchecked")
94
        ArrayList<Map.Entry<Object, Object>> al = new ArrayList<Map.Entry<Object, Object>>(s);
94
        ArrayList<Map.Entry<Object, Object>> al = new ArrayList<>(s);
95
        Collections.sort(al, new Comparator<Map.Entry<Object, Object>>(){
95
        Collections.sort(al, new Comparator<Map.Entry<Object, Object>>(){
96
            @Override
96
            @Override
97
            public int compare(Map.Entry<Object, Object> o1, Map.Entry<Object, Object> o2) {
97
            public int compare(Map.Entry<Object, Object> o1, Map.Entry<Object, Object> o2) {
(-)a/src/components/org/apache/jmeter/sampler/TestAction.java (-1 / +1 lines)
Lines 46-52 public class TestAction extends AbstractSampler implements Interruptible { Link Here
46
46
47
    private static final long serialVersionUID = 240L;
47
    private static final long serialVersionUID = 240L;
48
48
49
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
49
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<>(
50
            Arrays.asList(new String[]{
50
            Arrays.asList(new String[]{
51
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
51
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
52
52
(-)a/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java (-1 / +1 lines)
Lines 98-104 public class ConstantThroughputTimer extends AbstractTestElement implements Time Link Here
98
98
99
    //For holding the ThrougputInfo objects for all ThreadGroups. Keyed by AbstractThreadGroup objects
99
    //For holding the ThrougputInfo objects for all ThreadGroups. Keyed by AbstractThreadGroup objects
100
    private static final ConcurrentMap<AbstractThreadGroup, ThroughputInfo> threadGroupsInfoMap =
100
    private static final ConcurrentMap<AbstractThreadGroup, ThroughputInfo> threadGroupsInfoMap =
101
        new ConcurrentHashMap<AbstractThreadGroup, ThroughputInfo>();
101
            new ConcurrentHashMap<>();
102
102
103
103
104
    /**
104
    /**
(-)a/src/components/org/apache/jmeter/visualizers/PropertyControlGui.java (-1 / +1 lines)
Lines 149-155 public class PropertyControlGui extends AbstractConfigGui implements Link Here
149
            return;
149
            return;
150
        }
150
        }
151
        Set<Map.Entry<Object, Object>> s = p.entrySet();
151
        Set<Map.Entry<Object, Object>> s = p.entrySet();
152
        ArrayList<Map.Entry<Object, Object>> al = new ArrayList<Map.Entry<Object, Object>>(s);
152
        ArrayList<Map.Entry<Object, Object>> al = new ArrayList<>(s);
153
        Collections.sort(al, new Comparator<Map.Entry<Object, Object>>(){
153
        Collections.sort(al, new Comparator<Map.Entry<Object, Object>>(){
154
            @Override
154
            @Override
155
            public int compare(Map.Entry<Object, Object> o1, Map.Entry<Object, Object> o2) {
155
            public int compare(Map.Entry<Object, Object> o1, Map.Entry<Object, Object> o2) {
(-)a/src/components/org/apache/jmeter/visualizers/RenderAsCssJQuery.java (-1 / +1 lines)
Lines 123-129 public class RenderAsCssJQuery implements ResultRenderer, ActionListener { Link Here
123
123
124
    private String process(String textToParse) {
124
    private String process(String textToParse) {
125
        try {
125
        try {
126
            List<String> result = new ArrayList<String>();
126
            List<String> result = new ArrayList<>();
127
            Extractor extractor = HtmlExtractor.getExtractorImpl(cssJqueryLabeledChoice.getText());
127
            Extractor extractor = HtmlExtractor.getExtractorImpl(cssJqueryLabeledChoice.getText());
128
            final int nbFound = extractor.extract(
128
            final int nbFound = extractor.extract(
129
                    cssJqueryField.getText(), attributeField.getText(), -1, textToParse, result, 0, null);
129
                    cssJqueryField.getText(), attributeField.getText(), -1, textToParse, result, 0, null);
(-)a/src/components/org/apache/jmeter/visualizers/RenderAsRegexp.java (-1 / +1 lines)
Lines 126-132 public class RenderAsRegexp implements ResultRenderer, ActionListener { Link Here
126
        } catch (MalformedCachePatternException e) {
126
        } catch (MalformedCachePatternException e) {
127
            return e.toString();
127
            return e.toString();
128
        }
128
        }
129
        List<MatchResult> matches = new LinkedList<MatchResult>();
129
        List<MatchResult> matches = new LinkedList<>();
130
        while (matcher.contains(input, pattern)) {
130
        while (matcher.contains(input, pattern)) {
131
            matches.add(matcher.getMatch());
131
            matches.add(matcher.getMatch());
132
        }
132
        }
(-)a/src/components/org/apache/jmeter/visualizers/RenderAsXPath.java (-1 / +1 lines)
Lines 135-141 public class RenderAsXPath implements ResultRenderer, ActionListener { Link Here
135
    private String process(String textToParse, XPathExtractor extractor) {
135
    private String process(String textToParse, XPathExtractor extractor) {
136
        try {
136
        try {
137
            Document doc = parseResponse(textToParse, extractor);
137
            Document doc = parseResponse(textToParse, extractor);
138
            List<String> matchStrings = new ArrayList<String>();
138
            List<String> matchStrings = new ArrayList<>();
139
            XPathUtil.putValuesForXPathInList(doc, xpathExpressionField.getText(),
139
            XPathUtil.putValuesForXPathInList(doc, xpathExpressionField.getText(),
140
                    matchStrings, extractor.getFragment());
140
                    matchStrings, extractor.getFragment());
141
            StringBuilder builder = new StringBuilder();
141
            StringBuilder builder = new StringBuilder();
(-)a/src/components/org/apache/jmeter/visualizers/RequestPanel.java (-1 / +1 lines)
Lines 51-57 public class RequestPanel { Link Here
51
     * and Create Request Panel
51
     * and Create Request Panel
52
     */
52
     */
53
    public RequestPanel() {
53
    public RequestPanel() {
54
        listRequestView = new LinkedList<RequestView>();
54
        listRequestView = new LinkedList<>();
55
        List<String> classesToAdd = Collections.<String> emptyList();
55
        List<String> classesToAdd = Collections.<String> emptyList();
56
        try {
56
        try {
57
            classesToAdd = JMeterUtils.findClassesThatExtend(RequestView.class);
57
            classesToAdd = JMeterUtils.findClassesThatExtend(RequestView.class);
(-)a/src/components/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java (-6 / +6 lines)
Lines 261-272 public class RespTimeGraphVisualizer extends AbstractVisualizer implements Actio Link Here
261
    /**
261
    /**
262
     * We want to retain insertion order, so LinkedHashMap is necessary
262
     * We want to retain insertion order, so LinkedHashMap is necessary
263
     */
263
     */
264
    private final Map<String, RespTimeGraphLineBean> seriesNames = new LinkedHashMap<String, RespTimeGraphLineBean>();
264
    private final Map<String, RespTimeGraphLineBean> seriesNames = new LinkedHashMap<>();
265
265
266
    /**
266
    /**
267
     * We want to retain insertion order, so LinkedHashMap is necessary
267
     * We want to retain insertion order, so LinkedHashMap is necessary
268
     */
268
     */
269
    private final Map<String, Map<Long, StatCalculatorLong>> pList = new LinkedHashMap<String, Map<Long, StatCalculatorLong>>();
269
    private final Map<String, Map<Long, StatCalculatorLong>> pList = new LinkedHashMap<>();
270
270
271
    private long durationTest = 0;
271
    private long durationTest = 0;
272
    
272
    
Lines 278-284 public class RespTimeGraphVisualizer extends AbstractVisualizer implements Actio Link Here
278
278
279
    private final List<Color> listColors = Colors.getColors();
279
    private final List<Color> listColors = Colors.getColors();
280
280
281
    private final List<RespTimeGraphDataBean> internalList = new ArrayList<RespTimeGraphDataBean>(); // internal list of all results
281
    private final List<RespTimeGraphDataBean> internalList = new ArrayList<>(); // internal list of all results
282
282
283
    public RespTimeGraphVisualizer() {
283
    public RespTimeGraphVisualizer() {
284
        init();
284
        init();
Lines 331-337 public class RespTimeGraphVisualizer extends AbstractVisualizer implements Actio Link Here
331
                            value.addValue(respTime, 1);
331
                            value.addValue(respTime, 1);
332
                        } else {
332
                        } else {
333
                            // We want to retain insertion order, so LinkedHashMap is necessary
333
                            // We want to retain insertion order, so LinkedHashMap is necessary
334
                            Map<Long, StatCalculatorLong> newSubList = new LinkedHashMap<Long, StatCalculatorLong>(5);
334
                            Map<Long, StatCalculatorLong> newSubList = new LinkedHashMap<>(5);
335
                            StatCalculatorLong helper = new StatCalculatorLong();
335
                            StatCalculatorLong helper = new StatCalculatorLong();
336
                            helper.addValue(Long.valueOf(sampleResult.getTime()),1);
336
                            helper.addValue(Long.valueOf(sampleResult.getTime()),1);
337
                            newSubList.put(startTimeIntervalLong,  helper);
337
                            newSubList.put(startTimeIntervalLong,  helper);
Lines 403-409 public class RespTimeGraphVisualizer extends AbstractVisualizer implements Actio Link Here
403
403
404
        double nanLast = 0;
404
        double nanLast = 0;
405
        double nanBegin = 0;
405
        double nanBegin = 0;
406
        List<Double> nanList = new ArrayList<Double>();
406
        List<Double> nanList = new ArrayList<>();
407
        int s = 0;
407
        int s = 0;
408
        for (Map<Long, StatCalculatorLong> subList : pList.values()) {
408
        for (Map<Long, StatCalculatorLong> subList : pList.values()) {
409
            int idx = 0;
409
            int idx = 0;
Lines 557-563 public class RespTimeGraphVisualizer extends AbstractVisualizer implements Actio Link Here
557
                // Reload data form internal list of results
557
                // Reload data form internal list of results
558
                synchronized (lockInterval) {
558
                synchronized (lockInterval) {
559
                    if (internalList.size() >= 2) {
559
                    if (internalList.size() >= 2) {
560
                        List<RespTimeGraphDataBean> tempList = new ArrayList<RespTimeGraphDataBean>();
560
                        List<RespTimeGraphDataBean> tempList = new ArrayList<>();
561
                        tempList.addAll(internalList);
561
                        tempList.addAll(internalList);
562
                        this.clearData();
562
                        this.clearData();
563
                        for (RespTimeGraphDataBean data : tempList) {
563
                        for (RespTimeGraphDataBean data : tempList) {
(-)a/src/components/org/apache/jmeter/visualizers/StatGraphProperties.java (-4 / +4 lines)
Lines 35-41 public class StatGraphProperties { Link Here
35
    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"};
35
    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"};
36
36
37
    public static Map<String, String> getFontNameMap() {
37
    public static Map<String, String> getFontNameMap() {
38
        Map<String, String> fontNameMap = new LinkedHashMap<String, String>(2);
38
        Map<String, String> fontNameMap = new LinkedHashMap<>(2);
39
        fontNameMap.put(JMeterUtils.getResString("font.sansserif"), "SansSerif"); //$NON-NLS-1$ //$NON-NLS-1$
39
        fontNameMap.put(JMeterUtils.getResString("font.sansserif"), "SansSerif"); //$NON-NLS-1$ //$NON-NLS-1$
40
        fontNameMap.put(JMeterUtils.getResString("font.serif"), "Serif"); //$NON-NLS-1$
40
        fontNameMap.put(JMeterUtils.getResString("font.serif"), "Serif"); //$NON-NLS-1$
41
        return fontNameMap;
41
        return fontNameMap;
Lines 43-49 public class StatGraphProperties { Link Here
43
43
44
    @SuppressWarnings("boxing")
44
    @SuppressWarnings("boxing")
45
    public static Map<String, Integer> getFontStyleMap() {
45
    public static Map<String, Integer> getFontStyleMap() {
46
        Map<String, Integer> fontStyleMap = new LinkedHashMap<String, Integer>(3);
46
        Map<String, Integer> fontStyleMap = new LinkedHashMap<>(3);
47
        fontStyleMap.put(JMeterUtils.getResString("fontstyle.normal"), Font.PLAIN); //$NON-NLS-1$
47
        fontStyleMap.put(JMeterUtils.getResString("fontstyle.normal"), Font.PLAIN); //$NON-NLS-1$
48
        fontStyleMap.put(JMeterUtils.getResString("fontstyle.bold"), Font.BOLD); //$NON-NLS-1$
48
        fontStyleMap.put(JMeterUtils.getResString("fontstyle.bold"), Font.BOLD); //$NON-NLS-1$
49
        fontStyleMap.put(JMeterUtils.getResString("fontstyle.italic"), Font.ITALIC); //$NON-NLS-1$
49
        fontStyleMap.put(JMeterUtils.getResString("fontstyle.italic"), Font.ITALIC); //$NON-NLS-1$
Lines 52-58 public class StatGraphProperties { Link Here
52
52
53
    @SuppressWarnings("boxing")
53
    @SuppressWarnings("boxing")
54
    public static Map<String, Integer> getPlacementNameMap() {
54
    public static Map<String, Integer> getPlacementNameMap() {
55
        Map<String, Integer> placementNameMap = new LinkedHashMap<String, Integer>(4);
55
        Map<String, Integer> placementNameMap = new LinkedHashMap<>(4);
56
        placementNameMap.put(JMeterUtils.getResString("aggregate_graph_legend.placement.bottom"), LegendAreaProperties.BOTTOM); //$NON-NLS-1$
56
        placementNameMap.put(JMeterUtils.getResString("aggregate_graph_legend.placement.bottom"), LegendAreaProperties.BOTTOM); //$NON-NLS-1$
57
        placementNameMap.put(JMeterUtils.getResString("aggregate_graph_legend.placement.right"), LegendAreaProperties.RIGHT); //$NON-NLS-1$
57
        placementNameMap.put(JMeterUtils.getResString("aggregate_graph_legend.placement.right"), LegendAreaProperties.RIGHT); //$NON-NLS-1$
58
        placementNameMap.put(JMeterUtils.getResString("aggregate_graph_legend.placement.left"), LegendAreaProperties.LEFT); //$NON-NLS-1$
58
        placementNameMap.put(JMeterUtils.getResString("aggregate_graph_legend.placement.left"), LegendAreaProperties.LEFT); //$NON-NLS-1$
Lines 62-68 public class StatGraphProperties { Link Here
62
    
62
    
63
    public static Map<String, Shape> getPointShapeMap() {
63
    public static Map<String, Shape> getPointShapeMap() {
64
        // We want to retain insertion order, so LinkedHashMap is necessary
64
        // We want to retain insertion order, so LinkedHashMap is necessary
65
        Map<String, Shape> pointShapeMap = new LinkedHashMap<String, Shape>(5);
65
        Map<String, Shape> pointShapeMap = new LinkedHashMap<>(5);
66
        pointShapeMap.put(JMeterUtils.getResString("graph_pointshape_circle"), PointChartProperties.SHAPE_CIRCLE); //$NON-NLS-1$
66
        pointShapeMap.put(JMeterUtils.getResString("graph_pointshape_circle"), PointChartProperties.SHAPE_CIRCLE); //$NON-NLS-1$
67
        pointShapeMap.put(JMeterUtils.getResString("graph_pointshape_diamond"), PointChartProperties.SHAPE_DIAMOND); //$NON-NLS-1$
67
        pointShapeMap.put(JMeterUtils.getResString("graph_pointshape_diamond"), PointChartProperties.SHAPE_DIAMOND); //$NON-NLS-1$
68
        pointShapeMap.put(JMeterUtils.getResString("graph_pointshape_square"), PointChartProperties.SHAPE_SQUARE); //$NON-NLS-1$
68
        pointShapeMap.put(JMeterUtils.getResString("graph_pointshape_square"), PointChartProperties.SHAPE_SQUARE); //$NON-NLS-1$
(-)a/src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java (-5 / +4 lines)
Lines 157-164 public class StatGraphVisualizer extends AbstractVisualizer implements Clearable Link Here
157
     */
157
     */
158
    private final transient Object lock = new Object();
158
    private final transient Object lock = new Object();
159
    
159
    
160
    private final Map<String, SamplingStatCalculator> tableRows =
160
    private final Map<String, SamplingStatCalculator> tableRows = new ConcurrentHashMap<>();
161
        new ConcurrentHashMap<String, SamplingStatCalculator>();
162
161
163
    private AxisGraph graphPanel = null;
162
    private AxisGraph graphPanel = null;
164
163
Lines 219-225 public class StatGraphVisualizer extends AbstractVisualizer implements Clearable Link Here
219
218
220
    private JComboBox<String> columnsList = new JComboBox<>(GRAPH_COLUMNS);
219
    private JComboBox<String> columnsList = new JComboBox<>(GRAPH_COLUMNS);
221
220
222
    private List<BarGraph> eltList = new ArrayList<BarGraph>();
221
    private List<BarGraph> eltList = new ArrayList<>();
223
222
224
    private JCheckBox columnSelection = new JCheckBox(JMeterUtils.getResString("aggregate_graph_column_selection"), false); //$NON-NLS-1$
223
    private JCheckBox columnSelection = new JCheckBox(JMeterUtils.getResString("aggregate_graph_column_selection"), false); //$NON-NLS-1$
225
224
Lines 597-607 public class StatGraphVisualizer extends AbstractVisualizer implements Clearable Link Here
597
     * @return the data from the model
596
     * @return the data from the model
598
     */
597
     */
599
    public static List<List<Object>> getAllTableData(ObjectTableModel model, Format[] formats) {
598
    public static List<List<Object>> getAllTableData(ObjectTableModel model, Format[] formats) {
600
        List<List<Object>> data = new ArrayList<List<Object>>();
599
        List<List<Object>> data = new ArrayList<>();
601
        if (model.getRowCount() > 0) {
600
        if (model.getRowCount() > 0) {
602
            for (int rw=0; rw < model.getRowCount(); rw++) {
601
            for (int rw=0; rw < model.getRowCount(); rw++) {
603
                int cols = model.getColumnCount();
602
                int cols = model.getColumnCount();
604
                List<Object> column = new ArrayList<Object>();
603
                List<Object> column = new ArrayList<>();
605
                data.add(column);
604
                data.add(column);
606
                for (int idx=0; idx < cols; idx++) {
605
                for (int idx=0; idx < cols; idx++) {
607
                    Object val = model.getValueAt(rw,idx);
606
                    Object val = model.getValueAt(rw,idx);
(-)a/src/components/org/apache/jmeter/visualizers/StatVisualizer.java (-2 / +1 lines)
Lines 88-95 public class StatVisualizer extends AbstractVisualizer implements Clearable, Act Link Here
88
     */
88
     */
89
    private final transient Object lock = new Object();
89
    private final transient Object lock = new Object();
90
90
91
    private final Map<String, SamplingStatCalculator> tableRows =
91
    private final Map<String, SamplingStatCalculator> tableRows = new ConcurrentHashMap<>();
92
        new ConcurrentHashMap<String, SamplingStatCalculator>();
93
92
94
    public StatVisualizer() {
93
    public StatVisualizer() {
95
        super();
94
        super();
(-)a/src/components/org/apache/jmeter/visualizers/SummaryReport.java (-2 / +1 lines)
Lines 104-111 public class SummaryReport extends AbstractVisualizer implements Clearable, Acti Link Here
104
     */
104
     */
105
    private final transient Object lock = new Object();
105
    private final transient Object lock = new Object();
106
106
107
    private final Map<String, Calculator> tableRows =
107
    private final Map<String, Calculator> tableRows = new ConcurrentHashMap<>();
108
        new ConcurrentHashMap<String, Calculator>();
109
108
110
    // Column renderers
109
    // Column renderers
111
    private static final TableCellRenderer[] RENDERERS =
110
    private static final TableCellRenderer[] RENDERERS =
(-)a/src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java (-1 / +1 lines)
Lines 322-328 implements ActionListener, TreeSelectionListener, Clearable, ItemListener { Link Here
322
        }
322
        }
323
        String textRenderer = JMeterUtils.getResString("view_results_render_text"); // $NON-NLS-1$
323
        String textRenderer = JMeterUtils.getResString("view_results_render_text"); // $NON-NLS-1$
324
        Object textObject = null;
324
        Object textObject = null;
325
        Map<String, ResultRenderer> map = new HashMap<String, ResultRenderer>(classesToAdd.size());
325
        Map<String, ResultRenderer> map = new HashMap<>(classesToAdd.size());
326
        for (String clazz : classesToAdd) {
326
        for (String clazz : classesToAdd) {
327
            try {
327
            try {
328
                // Instantiate render classes
328
                // Instantiate render classes
(-)a/src/components/org/apache/jmeter/visualizers/backend/AbstractBackendListenerClient.java (-1 / +1 lines)
Lines 56-62 public abstract class AbstractBackendListenerClient implements BackendListenerCl Link Here
56
    private static final Logger LOGGER = LoggingManager.getLoggerForClass();
56
    private static final Logger LOGGER = LoggingManager.getLoggerForClass();
57
    private UserMetric userMetrics = new UserMetric();
57
    private UserMetric userMetrics = new UserMetric();
58
    
58
    
59
    private ConcurrentHashMap<String, SamplerMetric> metricsPerSampler = new ConcurrentHashMap<String, SamplerMetric>();
59
    private ConcurrentHashMap<String, SamplerMetric> metricsPerSampler = new ConcurrentHashMap<>();
60
60
61
    /* Implements BackendListenerClient.setupTest(BackendListenerContext) */
61
    /* Implements BackendListenerClient.setupTest(BackendListenerContext) */
62
    @Override
62
    @Override
(-)a/src/components/org/apache/jmeter/visualizers/backend/BackendListener.java (-4 / +4 lines)
Lines 111-118 public class BackendListener extends AbstractTestElement Link Here
111
     * per server. But we need the total to be shared.
111
     * per server. But we need the total to be shared.
112
     */
112
     */
113
    //@GuardedBy("LOCK") - needed to ensure consistency between this and instanceCount
113
    //@GuardedBy("LOCK") - needed to ensure consistency between this and instanceCount
114
    private static final Map<String, ListenerClientData> queuesByTestElementName = 
114
    private static final Map<String, ListenerClientData> queuesByTestElementName =
115
            new ConcurrentHashMap<String, ListenerClientData>();
115
            new ConcurrentHashMap<>();
116
116
117
    /**
117
    /**
118
     * Create a BackendListener.
118
     * Create a BackendListener.
Lines 208-214 public class BackendListener extends AbstractTestElement Link Here
208
        @Override
208
        @Override
209
        public void run() {
209
        public void run() {
210
            boolean isDebugEnabled = LOGGER.isDebugEnabled();
210
            boolean isDebugEnabled = LOGGER.isDebugEnabled();
211
            List<SampleResult> sampleResults = new ArrayList<SampleResult>(listenerClientData.queue.size());
211
            List<SampleResult> sampleResults = new ArrayList<>(listenerClientData.queue.size());
212
            try {
212
            try {
213
                try {
213
                try {
214
214
Lines 322-328 public class BackendListener extends AbstractTestElement Link Here
322
                BackendListenerContext context = new BackendListenerContext((Arguments)getArguments().clone());
322
                BackendListenerContext context = new BackendListenerContext((Arguments)getArguments().clone());
323
323
324
                listenerClientData = new ListenerClientData();
324
                listenerClientData = new ListenerClientData();
325
                listenerClientData.queue = new ArrayBlockingQueue<SampleResult>(queueSize); 
325
                listenerClientData.queue = new ArrayBlockingQueue<>(queueSize);
326
                listenerClientData.queueWaits = new AtomicLong(0L);
326
                listenerClientData.queueWaits = new AtomicLong(0L);
327
                listenerClientData.queueWaitTime = new AtomicLong(0L);
327
                listenerClientData.queueWaitTime = new AtomicLong(0L);
328
                listenerClientData.latch = new CountDownLatch(1);
328
                listenerClientData.latch = new CountDownLatch(1);
(-)a/src/components/org/apache/jmeter/visualizers/backend/BackendListenerGui.java (-2 / +2 lines)
Lines 110-116 public class BackendListenerGui extends AbstractListenerGui implements ActionLis Link Here
110
     * @return a panel containing the relevant components
110
     * @return a panel containing the relevant components
111
     */
111
     */
112
    private JPanel createClassnamePanel() {
112
    private JPanel createClassnamePanel() {
113
        List<String> possibleClasses = new ArrayList<String>();
113
        List<String> possibleClasses = new ArrayList<>();
114
114
115
        try {
115
        try {
116
            // Find all the classes which implement the BackendListenerClient
116
            // Find all the classes which implement the BackendListenerClient
Lines 244-250 public class BackendListenerGui extends AbstractListenerGui implements ActionLis Link Here
244
     */
244
     */
245
    private static final boolean checkContainsClassName(ComboBoxModel<?> model, String className) {
245
    private static final boolean checkContainsClassName(ComboBoxModel<?> model, String className) {
246
        int size = model.getSize();
246
        int size = model.getSize();
247
        Set<String> set = new HashSet<String>(size);
247
        Set<String> set = new HashSet<>(size);
248
        for (int i = 0; i < size; i++) {
248
        for (int i = 0; i < size; i++) {
249
            set.add((String)model.getElementAt(i));
249
            set.add((String)model.getElementAt(i));
250
        }
250
        }
(-)a/src/components/org/apache/jmeter/visualizers/backend/graphite/AbstractGraphiteMetricsSender.java (-1 / +1 lines)
Lines 47-53 abstract class AbstractGraphiteMetricsSender implements GraphiteMetricsSender { Link Here
47
        config.setMinEvictableIdleTimeMillis(TimeUnit.MINUTES.toMillis(3));
47
        config.setMinEvictableIdleTimeMillis(TimeUnit.MINUTES.toMillis(3));
48
        config.setTimeBetweenEvictionRunsMillis(TimeUnit.MINUTES.toMillis(3));
48
        config.setTimeBetweenEvictionRunsMillis(TimeUnit.MINUTES.toMillis(3));
49
49
50
        return new GenericKeyedObjectPool<SocketConnectionInfos, SocketOutputStream>(
50
        return new GenericKeyedObjectPool<>(
51
                new SocketOutputStreamPoolFactory(SOCKET_CONNECT_TIMEOUT_MS, SOCKET_TIMEOUT), config);
51
                new SocketOutputStreamPoolFactory(SOCKET_CONNECT_TIMEOUT_MS, SOCKET_TIMEOUT), config);
52
    }
52
    }
53
    
53
    
(-)a/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java (-4 / +4 lines)
Lines 233-241 public class GraphiteBackendListenerClient extends AbstractBackendListenerClient Link Here
233
        rootMetricsPrefix = context.getParameter("rootMetricsPrefix", DEFAULT_METRICS_PREFIX);
233
        rootMetricsPrefix = context.getParameter("rootMetricsPrefix", DEFAULT_METRICS_PREFIX);
234
        String percentilesAsString = context.getParameter("percentiles", DEFAULT_METRICS_PREFIX);
234
        String percentilesAsString = context.getParameter("percentiles", DEFAULT_METRICS_PREFIX);
235
        String[]  percentilesStringArray = percentilesAsString.split(SEPARATOR);
235
        String[]  percentilesStringArray = percentilesAsString.split(SEPARATOR);
236
        okPercentiles = new HashMap<String, Float>(percentilesStringArray.length);
236
        okPercentiles = new HashMap<>(percentilesStringArray.length);
237
        koPercentiles = new HashMap<String, Float>(percentilesStringArray.length);
237
        koPercentiles = new HashMap<>(percentilesStringArray.length);
238
        allPercentiles = new HashMap<String, Float>(percentilesStringArray.length);
238
        allPercentiles = new HashMap<>(percentilesStringArray.length);
239
        DecimalFormat format = new DecimalFormat("0.##");
239
        DecimalFormat format = new DecimalFormat("0.##");
240
        for (int i = 0; i < percentilesStringArray.length; i++) {
240
        for (int i = 0; i < percentilesStringArray.length; i++) {
241
            if(!StringUtils.isEmpty(percentilesStringArray[i].trim())) {
241
            if(!StringUtils.isEmpty(percentilesStringArray[i].trim())) {
Lines 260-266 public class GraphiteBackendListenerClient extends AbstractBackendListenerClient Link Here
260
        this.graphiteMetricsManager = (GraphiteMetricsSender) clazz.newInstance();
260
        this.graphiteMetricsManager = (GraphiteMetricsSender) clazz.newInstance();
261
        graphiteMetricsManager.setup(graphiteHost, graphitePort, rootMetricsPrefix);
261
        graphiteMetricsManager.setup(graphiteHost, graphitePort, rootMetricsPrefix);
262
        String[] samplers = samplersList.split(SEPARATOR);
262
        String[] samplers = samplersList.split(SEPARATOR);
263
        samplersToFilter = new HashSet<String>();
263
        samplersToFilter = new HashSet<>();
264
        for (String samplerName : samplers) {
264
        for (String samplerName : samplers) {
265
            samplersToFilter.add(samplerName);
265
            samplersToFilter.add(samplerName);
266
        }
266
        }
(-)a/src/components/org/apache/jmeter/visualizers/backend/graphite/PickleGraphiteMetricsSender.java (-1 / +1 lines)
Lines 53-59 class PickleGraphiteMetricsSender extends AbstractGraphiteMetricsSender { Link Here
53
    private String prefix;
53
    private String prefix;
54
54
55
    // graphite expects a python-pickled list of nested tuples.
55
    // graphite expects a python-pickled list of nested tuples.
56
    private List<MetricTuple> metrics = new LinkedList<MetricTuple>();
56
    private List<MetricTuple> metrics = new LinkedList<>();
57
57
58
    private GenericKeyedObjectPool<SocketConnectionInfos, SocketOutputStream> socketOutputStreamPool;
58
    private GenericKeyedObjectPool<SocketConnectionInfos, SocketOutputStream> socketOutputStreamPool;
59
59
(-)a/src/components/org/apache/jmeter/visualizers/backend/graphite/SocketOutputStreamPoolFactory.java (-1 / +1 lines)
Lines 81-86 public class SocketOutputStreamPoolFactory Link Here
81
81
82
    @Override
82
    @Override
83
    public PooledObject<SocketOutputStream> wrap(SocketOutputStream outputStream) {
83
    public PooledObject<SocketOutputStream> wrap(SocketOutputStream outputStream) {
84
        return new DefaultPooledObject<SocketOutputStream>(outputStream);
84
        return new DefaultPooledObject<>(outputStream);
85
    }
85
    }
86
}
86
}
(-)a/src/components/org/apache/jmeter/visualizers/backend/graphite/TextGraphiteMetricsSender.java (-1 / +1 lines)
Lines 36-42 class TextGraphiteMetricsSender extends AbstractGraphiteMetricsSender { Link Here
36
        
36
        
37
    private String prefix;
37
    private String prefix;
38
38
39
    private List<MetricTuple> metrics = new ArrayList<MetricTuple>();
39
    private List<MetricTuple> metrics = new ArrayList<>();
40
40
41
    private GenericKeyedObjectPool<SocketConnectionInfos, SocketOutputStream> socketOutputStreamPool;
41
    private GenericKeyedObjectPool<SocketConnectionInfos, SocketOutputStream> socketOutputStreamPool;
42
42
(-)a/src/components/org/apache/jmeter/visualizers/utils/Colors.java (-1 / +1 lines)
Lines 78-84 public class Colors { Link Here
78
78
79
        String[] oList = order.split(ENTRY_SEP);
79
        String[] oList = order.split(ENTRY_SEP);
80
80
81
        List<Color> listColors = new ArrayList<Color>();
81
        List<Color> listColors = new ArrayList<>();
82
        for (String key : oList) {
82
        for (String key : oList) {
83
            String trimmed = key.trim();
83
            String trimmed = key.trim();
84
            String property = p.getProperty(trimmed);
84
            String property = p.getProperty(trimmed);
(-)a/src/core/org/apache/jmeter/JMeter.java (-4 / +5 lines)
Lines 756-762 public class JMeter implements JMeterPlugin { Link Here
756
            treeModel.addSubTree(tree, root);
756
            treeModel.addSubTree(tree, root);
757
757
758
            // Hack to resolve ModuleControllers in non GUI mode
758
            // Hack to resolve ModuleControllers in non GUI mode
759
            SearchByClass<ReplaceableController> replaceableControllers = new SearchByClass<ReplaceableController>(ReplaceableController.class);
759
            SearchByClass<ReplaceableController> replaceableControllers =
760
                    new SearchByClass<>(ReplaceableController.class);
760
            tree.traverse(replaceableControllers);
761
            tree.traverse(replaceableControllers);
761
            Collection<ReplaceableController> replaceableControllersRes = replaceableControllers.getSearchResults();
762
            Collection<ReplaceableController> replaceableControllersRes = replaceableControllers.getSearchResults();
762
            for (Iterator<ReplaceableController> iter = replaceableControllersRes.iterator(); iter.hasNext();) {
763
            for (Iterator<ReplaceableController> iter = replaceableControllersRes.iterator(); iter.hasNext();) {
Lines 792-798 public class JMeter implements JMeterPlugin { Link Here
792
            // when NON GUI mode is used
793
            // when NON GUI mode is used
793
            tree.add(tree.getArray()[0], new RemoteThreadsListenerTestElement());
794
            tree.add(tree.getArray()[0], new RemoteThreadsListenerTestElement());
794
795
795
            List<JMeterEngine> engines = new LinkedList<JMeterEngine>();
796
            List<JMeterEngine> engines = new LinkedList<>();
796
            tree.add(tree.getArray()[0], new ListenToTest(parent, (remoteStart && remoteStop) ? engines : null));
797
            tree.add(tree.getArray()[0], new ListenToTest(parent, (remoteStart && remoteStop) ? engines : null));
797
            println("Created the tree successfully using "+testFile);
798
            println("Created the tree successfully using "+testFile);
798
            if (!remoteStart) {
799
            if (!remoteStart) {
Lines 804-810 public class JMeter implements JMeterPlugin { Link Here
804
                engines.add(engine);
805
                engines.add(engine);
805
            } else {
806
            } else {
806
                java.util.StringTokenizer st = new java.util.StringTokenizer(remote_hosts_string, ",");//$NON-NLS-1$
807
                java.util.StringTokenizer st = new java.util.StringTokenizer(remote_hosts_string, ",");//$NON-NLS-1$
807
                List<String> hosts = new LinkedList<String>();
808
                List<String> hosts = new LinkedList<>();
808
                while (st.hasMoreElements()) {
809
                while (st.hasMoreElements()) {
809
                    hosts.add((String) st.nextElement());
810
                    hosts.add((String) st.nextElement());
810
                }
811
                }
Lines 829-835 public class JMeter implements JMeterPlugin { Link Here
829
     * @param tree The {@link HashTree} to convert
830
     * @param tree The {@link HashTree} to convert
830
     */
831
     */
831
    public static void convertSubTree(HashTree tree) {
832
    public static void convertSubTree(HashTree tree) {
832
        LinkedList<Object> copyList = new LinkedList<Object>(tree.list());
833
        LinkedList<Object> copyList = new LinkedList<>(tree.list());
833
        for (Object o  : copyList) {
834
        for (Object o  : copyList) {
834
            if (o instanceof TestElement) {
835
            if (o instanceof TestElement) {
835
                TestElement item = (TestElement) o;
836
                TestElement item = (TestElement) o;
(-)a/src/core/org/apache/jmeter/NewDriver.java (-1 / +1 lines)
Lines 52-58 public final class NewDriver { Link Here
52
    private static final String jmDir;
52
    private static final String jmDir;
53
53
54
    static {
54
    static {
55
        final List<URL> jars = new LinkedList<URL>();
55
        final List<URL> jars = new LinkedList<>();
56
        final String initial_classpath = System.getProperty(JAVA_CLASS_PATH);
56
        final String initial_classpath = System.getProperty(JAVA_CLASS_PATH);
57
57
58
        // Find JMeter home dir from the initial classpath
58
        // Find JMeter home dir from the initial classpath
(-)a/src/core/org/apache/jmeter/config/Arguments.java (-1 / +1 lines)
Lines 81-87 public class Arguments extends ConfigTestElement implements Serializable { Link Here
81
     */
81
     */
82
    public Map<String, String> getArgumentsAsMap() {
82
    public Map<String, String> getArgumentsAsMap() {
83
        PropertyIterator iter = getArguments().iterator();
83
        PropertyIterator iter = getArguments().iterator();
84
        Map<String, String> argMap = new LinkedHashMap<String, String>();
84
        Map<String, String> argMap = new LinkedHashMap<>();
85
        while (iter.hasNext()) {
85
        while (iter.hasNext()) {
86
            Argument arg = (Argument) iter.next().getObjectValue();
86
            Argument arg = (Argument) iter.next().getObjectValue();
87
            // Because CollectionProperty.mergeIn will not prevent adding two
87
            // Because CollectionProperty.mergeIn will not prevent adding two
(-)a/src/core/org/apache/jmeter/control/GenericController.java (-11 / +5 lines)
Lines 54-61 public class GenericController extends AbstractTestElement implements Controller Link Here
54
54
55
    private static final Logger log = LoggingManager.getLoggerForClass();
55
    private static final Logger log = LoggingManager.getLoggerForClass();
56
56
57
    private transient LinkedList<LoopIterationListener> iterationListeners =
57
    private transient LinkedList<LoopIterationListener> iterationListeners = new LinkedList<>();
58
        new LinkedList<LoopIterationListener>();
59
58
60
    // Only create the map if it is required
59
    // Only create the map if it is required
61
    private transient ConcurrentMap<TestElement, Object> children = 
60
    private transient ConcurrentMap<TestElement, Object> children = 
Lines 64-71 public class GenericController extends AbstractTestElement implements Controller Link Here
64
    private static final Object DUMMY = new Object();
63
    private static final Object DUMMY = new Object();
65
64
66
    // May be replaced by RandomOrderController
65
    // May be replaced by RandomOrderController
67
    protected transient List<TestElement> subControllersAndSamplers =
66
    protected transient List<TestElement> subControllersAndSamplers = new ArrayList<>();
68
        new ArrayList<TestElement>();
69
67
70
    /**
68
    /**
71
     * Index of current sub controller or sampler
69
     * Index of current sub controller or sampler
Lines 422-434 public class GenericController extends AbstractTestElement implements Controller Link Here
422
    }
420
    }
423
    
421
    
424
    protected Object readResolve(){
422
    protected Object readResolve(){
425
        iterationListeners =
423
        iterationListeners = new LinkedList<>();
426
                new LinkedList<LoopIterationListener>();
424
        children = TestCompiler.IS_USE_STATIC_SET ? null : new ConcurrentHashMap<TestElement, Object>();
427
        children = 
425
        subControllersAndSamplers = new ArrayList<>();
428
                TestCompiler.IS_USE_STATIC_SET ? null : new ConcurrentHashMap<TestElement, Object>();
429
        
430
        subControllersAndSamplers =
431
                new ArrayList<TestElement>();
432
426
433
        return this;
427
        return this;
434
    }
428
    }
(-)a/src/core/org/apache/jmeter/control/TransactionSampler.java (-1 / +1 lines)
Lines 41-47 import org.apache.jmeter.testelement.TestElement; Link Here
41
public class TransactionSampler extends AbstractSampler {
41
public class TransactionSampler extends AbstractSampler {
42
    private static final long serialVersionUID = 240L;
42
    private static final long serialVersionUID = 240L;
43
43
44
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
44
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<>(
45
            Arrays.asList(new String[]{
45
            Arrays.asList(new String[]{
46
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
46
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
47
47
(-)a/src/core/org/apache/jmeter/engine/DistributedRunner.java (-4 / +4 lines)
Lines 57-63 public class DistributedRunner { Link Here
57
    private final int retriesNumber;
57
    private final int retriesNumber;
58
    private PrintStream stdout = new PrintStream(new SilentOutputStream());
58
    private PrintStream stdout = new PrintStream(new SilentOutputStream());
59
    private PrintStream stderr = new PrintStream(new SilentOutputStream());
59
    private PrintStream stderr = new PrintStream(new SilentOutputStream());
60
    private final Map<String, JMeterEngine> engines = new HashMap<String, JMeterEngine>();
60
    private final Map<String, JMeterEngine> engines = new HashMap<>();
61
61
62
62
63
    public DistributedRunner() {
63
    public DistributedRunner() {
Lines 73-79 public class DistributedRunner { Link Here
73
73
74
    public void init(List<String> addresses, HashTree tree) {
74
    public void init(List<String> addresses, HashTree tree) {
75
        // converting list into mutable version
75
        // converting list into mutable version
76
        List<String> addrs = new LinkedList<String>(addresses);
76
        List<String> addrs = new LinkedList<>(addresses);
77
77
78
        for (int tryNo = 0; tryNo < retriesNumber; tryNo++) {
78
        for (int tryNo = 0; tryNo < retriesNumber; tryNo++) {
79
            if (tryNo > 0) {
79
            if (tryNo > 0) {
Lines 144-150 public class DistributedRunner { Link Here
144
     * Start all engines that were previously initiated
144
     * Start all engines that were previously initiated
145
     */
145
     */
146
    public void start() {
146
    public void start() {
147
        List<String> addresses = new LinkedList<String>();
147
        List<String> addresses = new LinkedList<>();
148
        addresses.addAll(engines.keySet());
148
        addresses.addAll(engines.keySet());
149
        start(addresses);
149
        start(addresses);
150
    }
150
    }
Lines 169-175 public class DistributedRunner { Link Here
169
     * Stop all engines that were previously initiated
169
     * Stop all engines that were previously initiated
170
     */
170
     */
171
    public void stop() {
171
    public void stop() {
172
        List<String> addresses = new LinkedList<String>();
172
        List<String> addresses = new LinkedList<>();
173
        addresses.addAll(engines.keySet());
173
        addresses.addAll(engines.keySet());
174
        stop(addresses);
174
        stop(addresses);
175
    }
175
    }
(-)a/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java (-7 / +7 lines)
Lines 80-86 public class StandardJMeterEngine implements JMeterEngine, Runnable { Link Here
80
     * Only used by the function parser so far.
80
     * Only used by the function parser so far.
81
     * The list is merged with the testListeners and then cleared.
81
     * The list is merged with the testListeners and then cleared.
82
     */
82
     */
83
    private static final List<TestStateListener> testList = new ArrayList<TestStateListener>();
83
    private static final List<TestStateListener> testList = new ArrayList<>();
84
84
85
    /** Whether to call System.exit(0) in exit after stopping RMI */
85
    /** Whether to call System.exit(0) in exit after stopping RMI */
86
    private static final boolean REMOTE_SYSTEM_EXIT = JMeterUtils.getPropDefault("jmeterengine.remote.system.exit", false);
86
    private static final boolean REMOTE_SYSTEM_EXIT = JMeterUtils.getPropDefault("jmeterengine.remote.system.exit", false);
Lines 111-117 public class StandardJMeterEngine implements JMeterEngine, Runnable { Link Here
111
    private final String host;
111
    private final String host;
112
112
113
    // The list of current thread groups; may be setUp, main, or tearDown.
113
    // The list of current thread groups; may be setUp, main, or tearDown.
114
    private final List<AbstractThreadGroup> groups = new CopyOnWriteArrayList<AbstractThreadGroup>();
114
    private final List<AbstractThreadGroup> groups = new CopyOnWriteArrayList<>();
115
115
116
    public static void stopEngineNow() {
116
    public static void stopEngineNow() {
117
        if (engine != null) {// May be null if called from Unit test
117
        if (engine != null) {// May be null if called from Unit test
Lines 164-170 public class StandardJMeterEngine implements JMeterEngine, Runnable { Link Here
164
    @Override
164
    @Override
165
    public void configure(HashTree testTree) {
165
    public void configure(HashTree testTree) {
166
        // Is testplan serialised?
166
        // Is testplan serialised?
167
        SearchByClass<TestPlan> testPlan = new SearchByClass<TestPlan>(TestPlan.class);
167
        SearchByClass<TestPlan> testPlan = new SearchByClass<>(TestPlan.class);
168
        testTree.traverse(testPlan);
168
        testTree.traverse(testPlan);
169
        Object[] plan = testPlan.getSearchResults().toArray();
169
        Object[] plan = testPlan.getSearchResults().toArray();
170
        if (plan.length == 0) {
170
        if (plan.length == 0) {
Lines 323-329 public class StandardJMeterEngine implements JMeterEngine, Runnable { Link Here
323
         * Notification of test listeners needs to happen after function
323
         * Notification of test listeners needs to happen after function
324
         * replacement, but before setting RunningVersion to true.
324
         * replacement, but before setting RunningVersion to true.
325
         */
325
         */
326
        SearchByClass<TestStateListener> testListeners = new SearchByClass<TestStateListener>(TestStateListener.class); // TL - S&E
326
        SearchByClass<TestStateListener> testListeners = new SearchByClass<>(TestStateListener.class); // TL - S&E
327
        test.traverse(testListeners);
327
        test.traverse(testListeners);
328
328
329
        // Merge in any additional test listeners
329
        // Merge in any additional test listeners
Lines 338-346 public class StandardJMeterEngine implements JMeterEngine, Runnable { Link Here
338
        List<?> testLevelElements = new LinkedList<Object>(test.list(test.getArray()[0]));
338
        List<?> testLevelElements = new LinkedList<Object>(test.list(test.getArray()[0]));
339
        removeThreadGroups(testLevelElements);
339
        removeThreadGroups(testLevelElements);
340
340
341
        SearchByClass<SetupThreadGroup> setupSearcher = new SearchByClass<SetupThreadGroup>(SetupThreadGroup.class);
341
        SearchByClass<SetupThreadGroup> setupSearcher = new SearchByClass<>(SetupThreadGroup.class);
342
        SearchByClass<AbstractThreadGroup> searcher = new SearchByClass<AbstractThreadGroup>(AbstractThreadGroup.class);
342
        SearchByClass<AbstractThreadGroup> searcher = new SearchByClass<>(AbstractThreadGroup.class);
343
        SearchByClass<PostThreadGroup> postSearcher = new SearchByClass<PostThreadGroup>(PostThreadGroup.class);
343
        SearchByClass<PostThreadGroup> postSearcher = new SearchByClass<>(PostThreadGroup.class);
344
344
345
        test.traverse(setupSearcher);
345
        test.traverse(setupSearcher);
346
        test.traverse(searcher);
346
        test.traverse(searcher);
(-)a/src/core/org/apache/jmeter/engine/TreeCloner.java (-1 / +1 lines)
Lines 33-39 public class TreeCloner implements HashTreeTraverser { Link Here
33
33
34
    private final ListedHashTree newTree;
34
    private final ListedHashTree newTree;
35
35
36
    private final LinkedList<Object> objects = new LinkedList<Object>();
36
    private final LinkedList<Object> objects = new LinkedList<>();
37
37
38
    private final boolean honourNoThreadClone;
38
    private final boolean honourNoThreadClone;
39
39
(-)a/src/core/org/apache/jmeter/engine/util/CompoundVariable.java (-4 / +3 lines)
Lines 48-61 public class CompoundVariable implements Function { Link Here
48
    private static final FunctionParser functionParser = new FunctionParser();
48
    private static final FunctionParser functionParser = new FunctionParser();
49
49
50
    // Created during class init; not modified thereafter 
50
    // Created during class init; not modified thereafter 
51
    private static final Map<String, Class<? extends Function>> functions =
51
    private static final Map<String, Class<? extends Function>> functions = new HashMap<>();
52
        new HashMap<String, Class<? extends Function>>();
53
52
54
    private boolean hasFunction, isDynamic;
53
    private boolean hasFunction, isDynamic;
55
54
56
    private String permanentResults;
55
    private String permanentResults;
57
56
58
    private LinkedList<Object> compiledComponents = new LinkedList<Object>();
57
    private LinkedList<Object> compiledComponents = new LinkedList<>();
59
58
60
    static {
59
    static {
61
        try {
60
        try {
Lines 171-177 public class CompoundVariable implements Function { Link Here
171
    /** {@inheritDoc} */
170
    /** {@inheritDoc} */
172
    @Override
171
    @Override
173
    public List<String> getArgumentDesc() {
172
    public List<String> getArgumentDesc() {
174
        return new LinkedList<String>();
173
        return new LinkedList<>();
175
    }
174
    }
176
175
177
    public void clear() {
176
    public void clear() {
(-)a/src/core/org/apache/jmeter/engine/util/FunctionParser.java (-2 / +2 lines)
Lines 55-61 class FunctionParser { Link Here
55
     */
55
     */
56
    LinkedList<Object> compileString(String value) throws InvalidVariableException {
56
    LinkedList<Object> compileString(String value) throws InvalidVariableException {
57
        StringReader reader = new StringReader(value);
57
        StringReader reader = new StringReader(value);
58
        LinkedList<Object> result = new LinkedList<Object>();
58
        LinkedList<Object> result = new LinkedList<>();
59
        StringBuilder buffer = new StringBuilder();
59
        StringBuilder buffer = new StringBuilder();
60
        char previous = ' '; // TODO - why use space?
60
        char previous = ' '; // TODO - why use space?
61
        char[] current = new char[1];
61
        char[] current = new char[1];
Lines 183-189 class FunctionParser { Link Here
183
     * @throws InvalidVariableException when evaluation of variables fail
183
     * @throws InvalidVariableException when evaluation of variables fail
184
     */
184
     */
185
    LinkedList<CompoundVariable> parseParams(StringReader reader) throws InvalidVariableException {
185
    LinkedList<CompoundVariable> parseParams(StringReader reader) throws InvalidVariableException {
186
        LinkedList<CompoundVariable> result = new LinkedList<CompoundVariable>();
186
        LinkedList<CompoundVariable> result = new LinkedList<>();
187
        StringBuilder buffer = new StringBuilder();
187
        StringBuilder buffer = new StringBuilder();
188
        char[] current = new char[1];
188
        char[] current = new char[1];
189
        char previous = ' ';
189
        char previous = ' ';
(-)a/src/core/org/apache/jmeter/engine/util/ValueReplacer.java (-2 / +2 lines)
Lines 43-49 public class ValueReplacer { Link Here
43
43
44
    private final CompoundVariable masterFunction = new CompoundVariable();
44
    private final CompoundVariable masterFunction = new CompoundVariable();
45
45
46
    private Map<String, String> variables = new HashMap<String, String>();
46
    private Map<String, String> variables = new HashMap<>();
47
47
48
    public ValueReplacer() {
48
    public ValueReplacer() {
49
    }
49
    }
Lines 157-163 public class ValueReplacer { Link Here
157
     * @throws InvalidVariableException when <code>transform</code> throws an {@link InvalidVariableException} while transforming a value
157
     * @throws InvalidVariableException when <code>transform</code> throws an {@link InvalidVariableException} while transforming a value
158
     */
158
     */
159
    private Collection<JMeterProperty> replaceValues(PropertyIterator iter, ValueTransformer transform) throws InvalidVariableException {
159
    private Collection<JMeterProperty> replaceValues(PropertyIterator iter, ValueTransformer transform) throws InvalidVariableException {
160
        List<JMeterProperty> props = new LinkedList<JMeterProperty>();
160
        List<JMeterProperty> props = new LinkedList<>();
161
        while (iter.hasNext()) {
161
        while (iter.hasNext()) {
162
            JMeterProperty val = iter.next();
162
            JMeterProperty val = iter.next();
163
            if (log.isDebugEnabled()) {
163
            if (log.isDebugEnabled()) {
(-)a/src/core/org/apache/jmeter/gui/GUIFactory.java (-3 / +3 lines)
Lines 32-44 import org.apache.jmeter.testbeans.gui.TestBeanGUI; Link Here
32
 */
32
 */
33
public final class GUIFactory {
33
public final class GUIFactory {
34
    /** A Map from String to JMeterGUIComponent of registered GUI classes. */
34
    /** A Map from String to JMeterGUIComponent of registered GUI classes. */
35
    private static final Map<String, JMeterGUIComponent> GUI_MAP = new HashMap<String, JMeterGUIComponent>();
35
    private static final Map<String, JMeterGUIComponent> GUI_MAP = new HashMap<>();
36
36
37
    /** A Map from String to ImageIcon of registered icons. */
37
    /** A Map from String to ImageIcon of registered icons. */
38
    private static final Map<String, ImageIcon> ICON_MAP = new HashMap<String, ImageIcon>();
38
    private static final Map<String, ImageIcon> ICON_MAP = new HashMap<>();
39
39
40
    /** A Map from String to ImageIcon of registered icons. */
40
    /** A Map from String to ImageIcon of registered icons. */
41
    private static final Map<String, ImageIcon> DISABLED_ICON_MAP = new HashMap<String, ImageIcon>();
41
    private static final Map<String, ImageIcon> DISABLED_ICON_MAP = new HashMap<>();
42
42
43
    /**
43
    /**
44
     * Prevent instantiation since this is a static utility class.
44
     * Prevent instantiation since this is a static utility class.
(-)a/src/core/org/apache/jmeter/gui/GuiPackage.java (-7 / +7 lines)
Lines 82-100 public final class GuiPackage implements LocaleChangeListener, HistoryListener { Link Here
82
     * Map from TestElement to JMeterGUIComponent, mapping the nodes in the tree
82
     * Map from TestElement to JMeterGUIComponent, mapping the nodes in the tree
83
     * to their corresponding GUI components.
83
     * to their corresponding GUI components.
84
     */
84
     */
85
    private Map<TestElement, JMeterGUIComponent> nodesToGui = new HashMap<TestElement, JMeterGUIComponent>();
85
    private Map<TestElement, JMeterGUIComponent> nodesToGui = new HashMap<>();
86
86
87
    /**
87
    /**
88
     * Map from Class to JMeterGUIComponent, mapping the Class of a GUI
88
     * Map from Class to JMeterGUIComponent, mapping the Class of a GUI
89
     * component to an instance of that component.
89
     * component to an instance of that component.
90
     */
90
     */
91
    private Map<Class<?>, JMeterGUIComponent> guis = new HashMap<Class<?>, JMeterGUIComponent>();
91
    private Map<Class<?>, JMeterGUIComponent> guis = new HashMap<>();
92
92
93
    /**
93
    /**
94
     * Map from Class to TestBeanGUI, mapping the Class of a TestBean to an
94
     * Map from Class to TestBeanGUI, mapping the Class of a TestBean to an
95
     * instance of TestBeanGUI to be used to edit such components.
95
     * instance of TestBeanGUI to be used to edit such components.
96
     */
96
     */
97
    private Map<Class<?>, JMeterGUIComponent> testBeanGUIs = new HashMap<Class<?>, JMeterGUIComponent>();
97
    private Map<Class<?>, JMeterGUIComponent> testBeanGUIs = new HashMap<>();
98
98
99
    /** The currently selected node in the tree. */
99
    /** The currently selected node in the tree. */
100
    private JMeterTreeNode currentNode = null;
100
    private JMeterTreeNode currentNode = null;
Lines 637-645 public final class GuiPackage implements LocaleChangeListener, HistoryListener { Link Here
637
637
638
        // Forget about all GUIs we've created so far: we'll need to re-created
638
        // Forget about all GUIs we've created so far: we'll need to re-created
639
        // them all!
639
        // them all!
640
        guis = new HashMap<Class<?>, JMeterGUIComponent>();
640
        guis = new HashMap<>();
641
        nodesToGui = new HashMap<TestElement, JMeterGUIComponent>();
641
        nodesToGui = new HashMap<>();
642
        testBeanGUIs = new HashMap<Class<?>, JMeterGUIComponent>();
642
        testBeanGUIs = new HashMap<>();
643
643
644
        // BeanInfo objects also contain locale-sensitive data -- flush them
644
        // BeanInfo objects also contain locale-sensitive data -- flush them
645
        // away:
645
        // away:
Lines 766-772 public final class GuiPackage implements LocaleChangeListener, HistoryListener { Link Here
766
     * @return copy of list of {@link Stoppable}s
766
     * @return copy of list of {@link Stoppable}s
767
     */
767
     */
768
    public List<Stoppable> getStoppables() {
768
    public List<Stoppable> getStoppables() {
769
        ArrayList<Stoppable> list = new ArrayList<Stoppable>();
769
        ArrayList<Stoppable> list = new ArrayList<>();
770
        list.addAll(stoppables);
770
        list.addAll(stoppables);
771
        return list;
771
        return list;
772
    }
772
    }
(-)a/src/core/org/apache/jmeter/gui/MainFrame.java (-1 / +1 lines)
Lines 164-170 public class MainFrame extends JFrame implements TestStateListener, Remoteable, Link Here
164
    private JButton runningIndicator;
164
    private JButton runningIndicator;
165
165
166
    /** The set of currently running hosts. */
166
    /** The set of currently running hosts. */
167
    private final Set<String> hosts = new HashSet<String>();
167
    private final Set<String> hosts = new HashSet<>();
168
168
169
    /** A message dialog shown while JMeter threads are stopping. */
169
    /** A message dialog shown while JMeter threads are stopping. */
170
    private JDialog stoppingMessage;
170
    private JDialog stoppingMessage;
(-)a/src/core/org/apache/jmeter/gui/SavePropertyDialog.java (-1 / +1 lines)
Lines 55-61 public class SavePropertyDialog extends JDialog implements ActionListener { Link Here
55
55
56
    private static final long serialVersionUID = 232L;
56
    private static final long serialVersionUID = 232L;
57
57
58
    private static final Map<String, Functor> functors = new HashMap<String, Functor>();
58
    private static final Map<String, Functor> functors = new HashMap<>();
59
59
60
    private static final String NAME_SAVE_PFX   = "save";  // $NON-NLS-1$ i.e. boolean saveXXX()
60
    private static final String NAME_SAVE_PFX   = "save";  // $NON-NLS-1$ i.e. boolean saveXXX()
61
    private static final String NAME_SET_PREFIX = "set";   // $NON-NLS-1$ i.e. void setXXX(boolean)
61
    private static final String NAME_SET_PREFIX = "set";   // $NON-NLS-1$ i.e. void setXXX(boolean)
(-)a/src/core/org/apache/jmeter/gui/UndoHistory.java (-3 / +3 lines)
Lines 83-89 public class UndoHistory implements TreeModelListener, Serializable { Link Here
83
    /**
83
    /**
84
     * temporary storage for GUI tree expansion state
84
     * temporary storage for GUI tree expansion state
85
     */
85
     */
86
    private ArrayList<Integer> savedExpanded = new ArrayList<Integer>();
86
    private ArrayList<Integer> savedExpanded = new ArrayList<>();
87
87
88
    /**
88
    /**
89
     * temporary storage for GUI tree selected row
89
     * temporary storage for GUI tree selected row
Lines 95-101 public class UndoHistory implements TreeModelListener, Serializable { Link Here
95
95
96
    private static final int HISTORY_SIZE = JMeterUtils.getPropDefault("undo.history.size", 0);
96
    private static final int HISTORY_SIZE = JMeterUtils.getPropDefault("undo.history.size", 0);
97
97
98
    private List<UndoHistoryItem> history = new LimitedArrayList<UndoHistoryItem>(HISTORY_SIZE);
98
    private List<UndoHistoryItem> history = new LimitedArrayList<>(HISTORY_SIZE);
99
99
100
    /**
100
    /**
101
     * flag to prevent recursive actions
101
     * flag to prevent recursive actions
Lines 105-111 public class UndoHistory implements TreeModelListener, Serializable { Link Here
105
    /**
105
    /**
106
     * History listeners
106
     * History listeners
107
     */
107
     */
108
    private List<HistoryListener> listeners = new ArrayList<UndoHistory.HistoryListener>();
108
    private List<HistoryListener> listeners = new ArrayList<>();
109
109
110
    public UndoHistory() {
110
    public UndoHistory() {
111
    }
111
    }
(-)a/src/core/org/apache/jmeter/gui/action/AboutCommand.java (-1 / +1 lines)
Lines 53-59 public class AboutCommand implements Command { Link Here
53
    private static JDialog about;
53
    private static JDialog about;
54
54
55
    static {
55
    static {
56
        HashSet<String> commands = new HashSet<String>();
56
        HashSet<String> commands = new HashSet<>();
57
        commands.add(ActionNames.ABOUT);
57
        commands.add(ActionNames.ABOUT);
58
        commandSet = Collections.unmodifiableSet(commands);
58
        commandSet = Collections.unmodifiableSet(commands);
59
    }
59
    }
(-)a/src/core/org/apache/jmeter/gui/action/ActionRouter.java (-8 / +8 lines)
Lines 44-56 public final class ActionRouter implements ActionListener { Link Here
44
44
45
    private static volatile ActionRouter router;
45
    private static volatile ActionRouter router;
46
46
47
    private Map<String, Set<Command>> commands = new HashMap<String, Set<Command>>();
47
    private Map<String, Set<Command>> commands = new HashMap<>();
48
48
49
    private final Map<String, HashSet<ActionListener>> preActionListeners =
49
    private final Map<String, HashSet<ActionListener>> preActionListeners =
50
        new HashMap<String, HashSet<ActionListener>>();
50
            new HashMap<>();
51
51
52
    private final Map<String, HashSet<ActionListener>> postActionListeners =
52
    private final Map<String, HashSet<ActionListener>> postActionListeners =
53
        new HashMap<String, HashSet<ActionListener>>();
53
            new HashMap<>();
54
54
55
    private ActionRouter() {
55
    private ActionRouter() {
56
    }
56
    }
Lines 124-130 public final class ActionRouter implements ActionListener { Link Here
124
     *         <code>actionName</code>
124
     *         <code>actionName</code>
125
     */
125
     */
126
    public Set<Command> getAction(String actionName) {
126
    public Set<Command> getAction(String actionName) {
127
        Set<Command> set = new HashSet<Command>();
127
        Set<Command> set = new HashSet<>();
128
        for (Command c : commands.get(actionName)) {
128
        for (Command c : commands.get(actionName)) {
129
            try {
129
            try {
130
                set.add(c);
130
                set.add(c);
Lines 190-196 public final class ActionRouter implements ActionListener { Link Here
190
        if (action != null) {
190
        if (action != null) {
191
            HashSet<ActionListener> set = preActionListeners.get(action.getName());
191
            HashSet<ActionListener> set = preActionListeners.get(action.getName());
192
            if (set == null) {
192
            if (set == null) {
193
                set = new HashSet<ActionListener>();
193
                set = new HashSet<>();
194
            }
194
            }
195
            set.add(listener);
195
            set.add(listener);
196
            preActionListeners.put(action.getName(), set);
196
            preActionListeners.put(action.getName(), set);
Lines 233-239 public final class ActionRouter implements ActionListener { Link Here
233
        if (action != null) {
233
        if (action != null) {
234
            HashSet<ActionListener> set = postActionListeners.get(action.getName());
234
            HashSet<ActionListener> set = postActionListeners.get(action.getName());
235
            if (set == null) {
235
            if (set == null) {
236
                set = new HashSet<ActionListener>();
236
                set = new HashSet<>();
237
            }
237
            }
238
            set.add(listener);
238
            set.add(listener);
239
            postActionListeners.put(action.getName(), set);
239
            postActionListeners.put(action.getName(), set);
Lines 295-301 public final class ActionRouter implements ActionListener { Link Here
295
                    // Ignore the classes which are specific to the reporting tool
295
                    // Ignore the classes which are specific to the reporting tool
296
                    "org.apache.jmeter.report.gui", // $NON-NLS-1$ // notContains - classname should not contain this string
296
                    "org.apache.jmeter.report.gui", // $NON-NLS-1$ // notContains - classname should not contain this string
297
                    false); // annotations - true if classnames are annotations
297
                    false); // annotations - true if classnames are annotations
298
            commands = new HashMap<String, Set<Command>>(listClasses.size());
298
            commands = new HashMap<>(listClasses.size());
299
            if (listClasses.isEmpty()) {
299
            if (listClasses.isEmpty()) {
300
                log.fatalError("!!!!!Uh-oh, didn't find any action handlers!!!!!");
300
                log.fatalError("!!!!!Uh-oh, didn't find any action handlers!!!!!");
301
                throw new JMeterError("No action handlers found - check JMeterHome and libraries");
301
                throw new JMeterError("No action handlers found - check JMeterHome and libraries");
Lines 306-312 public final class ActionRouter implements ActionListener { Link Here
306
                for (String commandName : command.getActionNames()) {
306
                for (String commandName : command.getActionNames()) {
307
                    Set<Command> commandObjects = commands.get(commandName);
307
                    Set<Command> commandObjects = commands.get(commandName);
308
                    if (commandObjects == null) {
308
                    if (commandObjects == null) {
309
                        commandObjects = new HashSet<Command>();
309
                        commandObjects = new HashSet<>();
310
                        commands.put(commandName, commandObjects);
310
                        commands.put(commandName, commandObjects);
311
                    }
311
                    }
312
                    commandObjects.add(command);
312
                    commandObjects.add(command);
(-)a/src/core/org/apache/jmeter/gui/action/AddParent.java (-1 / +1 lines)
Lines 35-41 import org.apache.log.Logger; Link Here
35
public class AddParent implements Command {
35
public class AddParent implements Command {
36
    private static final Logger log = LoggingManager.getLoggerForClass();
36
    private static final Logger log = LoggingManager.getLoggerForClass();
37
37
38
    private static final Set<String> commands = new HashSet<String>();
38
    private static final Set<String> commands = new HashSet<>();
39
39
40
    static {
40
    static {
41
        commands.add(ActionNames.ADD_PARENT);
41
        commands.add(ActionNames.ADD_PARENT);
(-)a/src/core/org/apache/jmeter/gui/action/AddToTree.java (-1 / +1 lines)
Lines 40-46 public class AddToTree implements Command { Link Here
40
    private static final Set<String> commandSet;
40
    private static final Set<String> commandSet;
41
41
42
    static {
42
    static {
43
        HashSet<String> commands = new HashSet<String>();
43
        HashSet<String> commands = new HashSet<>();
44
        commands.add(ActionNames.ADD);
44
        commands.add(ActionNames.ADD);
45
        commandSet = Collections.unmodifiableSet(commands);
45
        commandSet = Collections.unmodifiableSet(commands);
46
    }
46
    }
(-)a/src/core/org/apache/jmeter/gui/action/Analyze.java (-1 / +1 lines)
Lines 30-36 import org.apache.jmeter.reporters.FileReporter; Link Here
30
import org.apache.jmeter.util.JMeterUtils;
30
import org.apache.jmeter.util.JMeterUtils;
31
31
32
public class Analyze implements Command {
32
public class Analyze implements Command {
33
    private static final Set<String> commands = new HashSet<String>();
33
    private static final Set<String> commands = new HashSet<>();
34
34
35
    static {
35
    static {
36
        commands.add(ActionNames.ANALYZE_FILE);
36
        commands.add(ActionNames.ANALYZE_FILE);
(-)a/src/core/org/apache/jmeter/gui/action/ChangeLanguage.java (-1 / +1 lines)
Lines 33-39 import org.apache.log.Logger; Link Here
33
 * @version $Revision$
33
 * @version $Revision$
34
 */
34
 */
35
public class ChangeLanguage implements Command {
35
public class ChangeLanguage implements Command {
36
    private static final Set<String> commands = new HashSet<String>();
36
    private static final Set<String> commands = new HashSet<>();
37
37
38
    private static final Logger log = LoggingManager.getLoggerForClass();
38
    private static final Logger log = LoggingManager.getLoggerForClass();
39
39
(-)a/src/core/org/apache/jmeter/gui/action/ChangeParent.java (-1 / +1 lines)
Lines 38-44 import org.apache.log.Logger; Link Here
38
public class ChangeParent implements Command {
38
public class ChangeParent implements Command {
39
    private static final Logger log = LoggingManager.getLoggerForClass();
39
    private static final Logger log = LoggingManager.getLoggerForClass();
40
40
41
    private static final Set<String> commands = new HashSet<String>();
41
    private static final Set<String> commands = new HashSet<>();
42
42
43
    static {
43
    static {
44
        commands.add(ActionNames.CHANGE_PARENT);
44
        commands.add(ActionNames.CHANGE_PARENT);
(-)a/src/core/org/apache/jmeter/gui/action/CheckDirty.java (-2 / +2 lines)
Lines 49-55 public class CheckDirty extends AbstractAction implements HashTreeTraverser, Act Link Here
49
49
50
    private boolean dirty = false;
50
    private boolean dirty = false;
51
51
52
    private static final Set<String> commands = new HashSet<String>();
52
    private static final Set<String> commands = new HashSet<>();
53
53
54
    static {
54
    static {
55
        commands.add(ActionNames.CHECK_DIRTY);
55
        commands.add(ActionNames.CHECK_DIRTY);
Lines 61-67 public class CheckDirty extends AbstractAction implements HashTreeTraverser, Act Link Here
61
    }
61
    }
62
62
63
    public CheckDirty() {
63
    public CheckDirty() {
64
        previousGuiItems = new HashMap<JMeterTreeNode, TestElement>();
64
        previousGuiItems = new HashMap<>();
65
        ActionRouter.getInstance().addPreActionListener(ExitCommand.class, this);
65
        ActionRouter.getInstance().addPreActionListener(ExitCommand.class, this);
66
    }
66
    }
67
67
(-)a/src/core/org/apache/jmeter/gui/action/Clear.java (-1 / +1 lines)
Lines 38-44 import org.apache.log.Logger; Link Here
38
public class Clear implements Command {
38
public class Clear implements Command {
39
    private static final Logger log = LoggingManager.getLoggerForClass();
39
    private static final Logger log = LoggingManager.getLoggerForClass();
40
40
41
    private static final Set<String> commands = new HashSet<String>();
41
    private static final Set<String> commands = new HashSet<>();
42
42
43
    static {
43
    static {
44
        commands.add(ActionNames.CLEAR);
44
        commands.add(ActionNames.CLEAR);
(-)a/src/core/org/apache/jmeter/gui/action/Close.java (-1 / +1 lines)
Lines 36-42 import org.apache.jmeter.util.JMeterUtils; Link Here
36
 */
36
 */
37
public class Close implements Command {
37
public class Close implements Command {
38
38
39
    private static final Set<String> commands = new HashSet<String>();
39
    private static final Set<String> commands = new HashSet<>();
40
40
41
    static {
41
    static {
42
        commands.add(ActionNames.CLOSE);
42
        commands.add(ActionNames.CLOSE);
(-)a/src/core/org/apache/jmeter/gui/action/CollapseExpand.java (-1 / +1 lines)
Lines 32-38 import org.apache.jmeter.gui.GuiPackage; Link Here
32
 */
32
 */
33
public class CollapseExpand implements Command {
33
public class CollapseExpand implements Command {
34
34
35
    private static final Set<String> commands = new HashSet<String>();
35
    private static final Set<String> commands = new HashSet<>();
36
36
37
    static {
37
    static {
38
        commands.add(ActionNames.COLLAPSE_ALL);
38
        commands.add(ActionNames.COLLAPSE_ALL);
(-)a/src/core/org/apache/jmeter/gui/action/Copy.java (-2 / +2 lines)
Lines 43-49 import org.apache.log.Logger; Link Here
43
public class Copy extends AbstractAction {
43
public class Copy extends AbstractAction {
44
    private static final Logger log = LoggingManager.getLoggerForClass();
44
    private static final Logger log = LoggingManager.getLoggerForClass();
45
45
46
    private static final HashSet<String> commands = new HashSet<String>();
46
    private static final HashSet<String> commands = new HashSet<>();
47
47
48
    static {
48
    static {
49
        commands.add(ActionNames.COPY);
49
        commands.add(ActionNames.COPY);
Lines 94-100 public class Copy extends AbstractAction { Link Here
94
     * @return JMeterTreeNode[]
94
     * @return JMeterTreeNode[]
95
     */
95
     */
96
    static JMeterTreeNode[] keepOnlyAncestors(JMeterTreeNode[] currentNodes) {
96
    static JMeterTreeNode[] keepOnlyAncestors(JMeterTreeNode[] currentNodes) {
97
        List<JMeterTreeNode> nodes = new ArrayList<JMeterTreeNode>();
97
        List<JMeterTreeNode> nodes = new ArrayList<>();
98
        for (int i = 0; i < currentNodes.length; i++) {
98
        for (int i = 0; i < currentNodes.length; i++) {
99
            boolean exclude = false;
99
            boolean exclude = false;
100
            for (int j = 0; j < currentNodes.length; j++) {
100
            for (int j = 0; j < currentNodes.length; j++) {
(-)a/src/core/org/apache/jmeter/gui/action/CreateFunctionDialog.java (-1 / +1 lines)
Lines 29-35 public class CreateFunctionDialog extends AbstractAction { Link Here
29
29
30
    private static final Set<String> commands;
30
    private static final Set<String> commands;
31
    static {
31
    static {
32
        commands = new HashSet<String>();
32
        commands = new HashSet<>();
33
        commands.add(ActionNames.FUNCTIONS);
33
        commands.add(ActionNames.FUNCTIONS);
34
    }
34
    }
35
35
(-)a/src/core/org/apache/jmeter/gui/action/Cut.java (-1 / +1 lines)
Lines 29-35 import org.apache.jmeter.gui.tree.JMeterTreeNode; Link Here
29
 * Implements the Cut menu item command
29
 * Implements the Cut menu item command
30
 */
30
 */
31
public class Cut extends AbstractAction {
31
public class Cut extends AbstractAction {
32
    private static final Set<String> commands = new HashSet<String>();
32
    private static final Set<String> commands = new HashSet<>();
33
33
34
    static {
34
    static {
35
        commands.add(ActionNames.CUT);
35
        commands.add(ActionNames.CUT);
(-)a/src/core/org/apache/jmeter/gui/action/Duplicate.java (-1 / +1 lines)
Lines 37-43 import org.apache.jmeter.gui.tree.JMeterTreeNode; Link Here
37
 */
37
 */
38
public class Duplicate extends AbstractAction {
38
public class Duplicate extends AbstractAction {
39
39
40
    private static final HashSet<String> commands = new HashSet<String>();
40
    private static final HashSet<String> commands = new HashSet<>();
41
41
42
    static {
42
    static {
43
        commands.add(ActionNames.DUPLICATE);
43
        commands.add(ActionNames.DUPLICATE);
(-)a/src/core/org/apache/jmeter/gui/action/EditCommand.java (-1 / +1 lines)
Lines 30-36 import org.apache.jmeter.gui.NamePanel; Link Here
30
 * Implements the Edit menu item.
30
 * Implements the Edit menu item.
31
 */
31
 */
32
public class EditCommand implements Command {
32
public class EditCommand implements Command {
33
    private static final Set<String> commands = new HashSet<String>();
33
    private static final Set<String> commands = new HashSet<>();
34
34
35
    static {
35
    static {
36
        commands.add(ActionNames.EDIT);
36
        commands.add(ActionNames.EDIT);
(-)a/src/core/org/apache/jmeter/gui/action/EnableComponent.java (-1 / +1 lines)
Lines 33-39 import org.apache.log.Logger; Link Here
33
public class EnableComponent implements Command {
33
public class EnableComponent implements Command {
34
    private static final Logger log = LoggingManager.getLoggerForClass();
34
    private static final Logger log = LoggingManager.getLoggerForClass();
35
35
36
    private static final Set<String> commands = new HashSet<String>();
36
    private static final Set<String> commands = new HashSet<>();
37
37
38
    static {
38
    static {
39
        commands.add(ActionNames.ENABLE);
39
        commands.add(ActionNames.ENABLE);
(-)a/src/core/org/apache/jmeter/gui/action/ExitCommand.java (-1 / +1 lines)
Lines 29-35 import org.apache.jmeter.util.JMeterUtils; Link Here
29
29
30
public class ExitCommand implements Command {
30
public class ExitCommand implements Command {
31
31
32
    private static final Set<String> commands = new HashSet<String>();
32
    private static final Set<String> commands = new HashSet<>();
33
33
34
    static {
34
    static {
35
        commands.add(ActionNames.EXIT);
35
        commands.add(ActionNames.EXIT);
(-)a/src/core/org/apache/jmeter/gui/action/Help.java (-1 / +1 lines)
Lines 42-48 import org.apache.log.Logger; Link Here
42
public class Help implements Command {
42
public class Help implements Command {
43
    private static final Logger log = LoggingManager.getLoggerForClass();
43
    private static final Logger log = LoggingManager.getLoggerForClass();
44
44
45
    private static final Set<String> commands = new HashSet<String>();
45
    private static final Set<String> commands = new HashSet<>();
46
46
47
    private static final String HELP_DOCS = "file:///"  // $NON-NLS-1$
47
    private static final String HELP_DOCS = "file:///"  // $NON-NLS-1$
48
        + JMeterUtils.getJMeterHome()
48
        + JMeterUtils.getJMeterHome()
(-)a/src/core/org/apache/jmeter/gui/action/Load.java (-1 / +1 lines)
Lines 55-61 public class Load implements Command { Link Here
55
55
56
    private static final boolean expandTree = JMeterUtils.getPropDefault("onload.expandtree", false); //$NON-NLS-1$
56
    private static final boolean expandTree = JMeterUtils.getPropDefault("onload.expandtree", false); //$NON-NLS-1$
57
57
58
    private static final Set<String> commands = new HashSet<String>();
58
    private static final Set<String> commands = new HashSet<>();
59
59
60
    static {
60
    static {
61
        commands.add(ActionNames.OPEN);
61
        commands.add(ActionNames.OPEN);
(-)a/src/core/org/apache/jmeter/gui/action/LoadRecentProject.java (-3 / +3 lines)
Lines 40-46 public class LoadRecentProject extends Load { Link Here
40
    private static final String USER_PREFS_KEY = "recent_file_"; //$NON-NLS-1$
40
    private static final String USER_PREFS_KEY = "recent_file_"; //$NON-NLS-1$
41
    /** The number of menu items used for recent files */
41
    /** The number of menu items used for recent files */
42
    private static final int NUMBER_OF_MENU_ITEMS = 9;
42
    private static final int NUMBER_OF_MENU_ITEMS = 9;
43
    private static final Set<String> commands = new HashSet<String>();
43
    private static final Set<String> commands = new HashSet<>();
44
44
45
    static {
45
    static {
46
        commands.add(ActionNames.OPEN_RECENT);
46
        commands.add(ActionNames.OPEN_RECENT);
Lines 83-89 public class LoadRecentProject extends Load { Link Here
83
     * @return a List of JMenuItem and a JSeparator, representing recent files
83
     * @return a List of JMenuItem and a JSeparator, representing recent files
84
     */
84
     */
85
    public static List<JComponent> getRecentFileMenuItems() {
85
    public static List<JComponent> getRecentFileMenuItems() {
86
        LinkedList<JComponent> menuItems = new LinkedList<JComponent>();
86
        LinkedList<JComponent> menuItems = new LinkedList<>();
87
        // Get the preference for the recent files
87
        // Get the preference for the recent files
88
        for(int i = 0; i < NUMBER_OF_MENU_ITEMS; i++) {
88
        for(int i = 0; i < NUMBER_OF_MENU_ITEMS; i++) {
89
            // Create the menu item
89
            // Create the menu item
Lines 121-127 public class LoadRecentProject extends Load { Link Here
121
    public static void updateRecentFileMenuItems(List<JComponent> menuItems, String loadedFileName) {
121
    public static void updateRecentFileMenuItems(List<JComponent> menuItems, String loadedFileName) {
122
        // Get the preference for the recent files
122
        // Get the preference for the recent files
123
123
124
        LinkedList<String> newRecentFiles = new LinkedList<String>();
124
        LinkedList<String> newRecentFiles = new LinkedList<>();
125
        // Check if the new file is already in the recent list
125
        // Check if the new file is already in the recent list
126
        boolean alreadyExists = false;
126
        boolean alreadyExists = false;
127
        for(int i = 0; i < NUMBER_OF_MENU_ITEMS; i++) {
127
        for(int i = 0; i < NUMBER_OF_MENU_ITEMS; i++) {
(-)a/src/core/org/apache/jmeter/gui/action/LoggerPanelEnableDisable.java (-1 / +1 lines)
Lines 33-39 import org.apache.jmeter.gui.GuiPackage; Link Here
33
 */
33
 */
34
public class LoggerPanelEnableDisable implements Command {
34
public class LoggerPanelEnableDisable implements Command {
35
35
36
    private static final Set<String> commands = new HashSet<String>();
36
    private static final Set<String> commands = new HashSet<>();
37
37
38
    static {
38
    static {
39
        commands.add(ActionNames.LOGGER_PANEL_ENABLE_DISABLE);
39
        commands.add(ActionNames.LOGGER_PANEL_ENABLE_DISABLE);
(-)a/src/core/org/apache/jmeter/gui/action/LookAndFeelCommand.java (-2 / +2 lines)
Lines 45-51 public class LookAndFeelCommand implements Command { Link Here
45
45
46
    private static final String JMETER_LAF = "jmeter.laf"; // $NON-NLS-1$
46
    private static final String JMETER_LAF = "jmeter.laf"; // $NON-NLS-1$
47
47
48
    private static final Set<String> commands = new HashSet<String>();
48
    private static final Set<String> commands = new HashSet<>();
49
49
50
    private static final Preferences PREFS = Preferences.userNodeForPackage(LookAndFeelCommand.class);
50
    private static final Preferences PREFS = Preferences.userNodeForPackage(LookAndFeelCommand.class);
51
    // Note: Windows user preferences are stored relative to: HKEY_CURRENT_USER\Software\JavaSoft\Prefs
51
    // Note: Windows user preferences are stored relative to: HKEY_CURRENT_USER\Software\JavaSoft\Prefs
Lines 60-66 public class LookAndFeelCommand implements Command { Link Here
60
        }
60
        }
61
        String jMeterLaf = getJMeterLaf();
61
        String jMeterLaf = getJMeterLaf();
62
        if (log.isInfoEnabled()) {
62
        if (log.isInfoEnabled()) {
63
            ArrayList<String> names=new ArrayList<String>();
63
            ArrayList<String> names= new ArrayList<>();
64
            for(UIManager.LookAndFeelInfo laf : lfs) {
64
            for(UIManager.LookAndFeelInfo laf : lfs) {
65
                if (laf.getClassName().equals(jMeterLaf)) {
65
                if (laf.getClassName().equals(jMeterLaf)) {
66
                    names.add(laf.getName());
66
                    names.add(laf.getName());
(-)a/src/core/org/apache/jmeter/gui/action/Move.java (-1 / +1 lines)
Lines 36-42 import org.apache.jmeter.testelement.TestPlan; Link Here
36
import org.apache.jmeter.testelement.WorkBench;
36
import org.apache.jmeter.testelement.WorkBench;
37
37
38
public class Move extends AbstractAction {
38
public class Move extends AbstractAction {
39
    private static final Set<String> commands = new HashSet<String>();
39
    private static final Set<String> commands = new HashSet<>();
40
40
41
    static {
41
    static {
42
        commands.add(ActionNames.MOVE_DOWN);
42
        commands.add(ActionNames.MOVE_DOWN);
(-)a/src/core/org/apache/jmeter/gui/action/Paste.java (-1 / +1 lines)
Lines 40-46 public class Paste extends AbstractAction { Link Here
40
40
41
    private static final Logger log = LoggingManager.getLoggerForClass();
41
    private static final Logger log = LoggingManager.getLoggerForClass();
42
42
43
    private static final Set<String> commands = new HashSet<String>();
43
    private static final Set<String> commands = new HashSet<>();
44
44
45
    static {
45
    static {
46
        commands.add(ActionNames.PASTE);
46
        commands.add(ActionNames.PASTE);
(-)a/src/core/org/apache/jmeter/gui/action/RemoteStart.java (-2 / +2 lines)
Lines 41-47 public class RemoteStart extends AbstractAction { Link Here
41
41
42
    private static final String REMOTE_HOSTS_SEPARATOR = ","; // $NON-NLS-1$
42
    private static final String REMOTE_HOSTS_SEPARATOR = ","; // $NON-NLS-1$
43
43
44
    private static final Set<String> commands = new HashSet<String>();
44
    private static final Set<String> commands = new HashSet<>();
45
45
46
    static {
46
    static {
47
        commands.add(ActionNames.REMOTE_START);
47
        commands.add(ActionNames.REMOTE_START);
Lines 94-100 public class RemoteStart extends AbstractAction { Link Here
94
    private List<String> getRemoteHosts() {
94
    private List<String> getRemoteHosts() {
95
        String remote_hosts_string = JMeterUtils.getPropDefault(REMOTE_HOSTS, LOCAL_HOST);
95
        String remote_hosts_string = JMeterUtils.getPropDefault(REMOTE_HOSTS, LOCAL_HOST);
96
        StringTokenizer st = new StringTokenizer(remote_hosts_string, REMOTE_HOSTS_SEPARATOR);
96
        StringTokenizer st = new StringTokenizer(remote_hosts_string, REMOTE_HOSTS_SEPARATOR);
97
        List<String> list = new LinkedList<String>();
97
        List<String> list = new LinkedList<>();
98
        while (st.hasMoreElements())
98
        while (st.hasMoreElements())
99
            list.add((String) st.nextElement());
99
            list.add((String) st.nextElement());
100
        return list;
100
        return list;
(-)a/src/core/org/apache/jmeter/gui/action/Remove.java (-1 / +1 lines)
Lines 35-41 import org.apache.jmeter.util.JMeterUtils; Link Here
35
 */
35
 */
36
public class Remove implements Command {
36
public class Remove implements Command {
37
37
38
    private static final Set<String> commands = new HashSet<String>();
38
    private static final Set<String> commands = new HashSet<>();
39
39
40
    // Whether to skip the delete confirmation dialogue
40
    // Whether to skip the delete confirmation dialogue
41
    private static final boolean SKIP_CONFIRM = JMeterUtils.getPropDefault("confirm.delete.skip", false); // $NON-NLS-1$
41
    private static final boolean SKIP_CONFIRM = JMeterUtils.getPropDefault("confirm.delete.skip", false); // $NON-NLS-1$
(-)a/src/core/org/apache/jmeter/gui/action/ResetSearchCommand.java (-1 / +1 lines)
Lines 33-39 import org.apache.jmeter.gui.tree.JMeterTreeNode; Link Here
33
 */
33
 */
34
public class ResetSearchCommand extends AbstractAction {
34
public class ResetSearchCommand extends AbstractAction {
35
35
36
    private static final Set<String> commands = new HashSet<String>();
36
    private static final Set<String> commands = new HashSet<>();
37
37
38
    static {
38
    static {
39
        commands.add(ActionNames.SEARCH_RESET);
39
        commands.add(ActionNames.SEARCH_RESET);
(-)a/src/core/org/apache/jmeter/gui/action/RevertProject.java (-1 / +1 lines)
Lines 32-38 import org.apache.jmeter.util.JMeterUtils; Link Here
32
 *
32
 *
33
 */
33
 */
34
public class RevertProject implements Command {
34
public class RevertProject implements Command {
35
    private static final Set<String> commands = new HashSet<String>();
35
    private static final Set<String> commands = new HashSet<>();
36
36
37
    static {
37
    static {
38
        commands.add(ActionNames.REVERT_PROJECT);
38
        commands.add(ActionNames.REVERT_PROJECT);
(-)a/src/core/org/apache/jmeter/gui/action/SSLManagerCommand.java (-1 / +1 lines)
Lines 55-61 import org.apache.jmeter.util.SSLManager; Link Here
55
public class SSLManagerCommand implements Command {
55
public class SSLManagerCommand implements Command {
56
    private static final Set<String> commandSet;
56
    private static final Set<String> commandSet;
57
    static {
57
    static {
58
        HashSet<String> commands = new HashSet<String>();
58
        HashSet<String> commands = new HashSet<>();
59
        commands.add(ActionNames.SSL_MANAGER);
59
        commands.add(ActionNames.SSL_MANAGER);
60
        commandSet = Collections.unmodifiableSet(commands);
60
        commandSet = Collections.unmodifiableSet(commands);
61
    }
61
    }
(-)a/src/core/org/apache/jmeter/gui/action/Save.java (-4 / +4 lines)
Lines 97-103 public class Save implements Command { Link Here
97
    // NumberFormat to format version number in backup file names
97
    // NumberFormat to format version number in backup file names
98
    private static final DecimalFormat BACKUP_VERSION_FORMATER = new DecimalFormat("000000"); //$NON-NLS-1$
98
    private static final DecimalFormat BACKUP_VERSION_FORMATER = new DecimalFormat("000000"); //$NON-NLS-1$
99
    
99
    
100
    private static final Set<String> commands = new HashSet<String>();
100
    private static final Set<String> commands = new HashSet<>();
101
101
102
    static {
102
    static {
103
        commands.add(ActionNames.SAVE_AS); // Save (Selection) As
103
        commands.add(ActionNames.SAVE_AS); // Save (Selection) As
Lines 337-343 public class Save implements Command { Link Here
337
        // create a file filter that select files matching a given regex pattern
337
        // create a file filter that select files matching a given regex pattern
338
        IOFileFilter patternFileFilter = new PrivatePatternFileFilter(backupPattern);
338
        IOFileFilter patternFileFilter = new PrivatePatternFileFilter(backupPattern);
339
        // get all backup files in the backup directory
339
        // get all backup files in the backup directory
340
        List<File> backupFiles = new ArrayList<File>(FileUtils.listFiles(backupDir, patternFileFilter, null));
340
        List<File> backupFiles = new ArrayList<>(FileUtils.listFiles(backupDir, patternFileFilter, null));
341
        // find the highest version number among existing backup files (this
341
        // find the highest version number among existing backup files (this
342
        // should be the more recent backup)
342
        // should be the more recent backup)
343
        int lastVersionNumber = 0;
343
        int lastVersionNumber = 0;
Lines 351-357 public class Save implements Command { Link Here
351
            }
351
            }
352
        }
352
        }
353
        // find expired backup files
353
        // find expired backup files
354
        List<File> expiredFiles = new ArrayList<File>();
354
        List<File> expiredFiles = new ArrayList<>();
355
        if (BACKUP_MAX_HOURS > 0) {
355
        if (BACKUP_MAX_HOURS > 0) {
356
            Calendar cal = Calendar.getInstance();
356
            Calendar cal = Calendar.getInstance();
357
            cal.add(Calendar.HOUR_OF_DAY, -BACKUP_MAX_HOURS);
357
            cal.add(Calendar.HOUR_OF_DAY, -BACKUP_MAX_HOURS);
Lines 410-416 public class Save implements Command { Link Here
410
410
411
    // package protected to allow access from test code
411
    // package protected to allow access from test code
412
    void convertSubTree(HashTree tree) {
412
    void convertSubTree(HashTree tree) {
413
        Iterator<Object> iter = new LinkedList<Object>(tree.list()).iterator();
413
        Iterator<Object> iter = new LinkedList<>(tree.list()).iterator();
414
        while (iter.hasNext()) {
414
        while (iter.hasNext()) {
415
            JMeterTreeNode item = (JMeterTreeNode) iter.next();
415
            JMeterTreeNode item = (JMeterTreeNode) iter.next();
416
            convertSubTree(tree.getTree(item));
416
            convertSubTree(tree.getTree(item));
(-)a/src/core/org/apache/jmeter/gui/action/SaveGraphics.java (-1 / +1 lines)
Lines 45-51 import org.apache.jmeter.visualizers.Printable; Link Here
45
 */
45
 */
46
public class SaveGraphics implements Command {
46
public class SaveGraphics implements Command {
47
47
48
    private static final Set<String> commands = new HashSet<String>();
48
    private static final Set<String> commands = new HashSet<>();
49
49
50
    static {
50
    static {
51
        commands.add(ActionNames.SAVE_GRAPHICS);
51
        commands.add(ActionNames.SAVE_GRAPHICS);
(-)a/src/core/org/apache/jmeter/gui/action/SearchTreeCommand.java (-1 / +1 lines)
Lines 28-34 import java.util.Set; Link Here
28
 */
28
 */
29
public class SearchTreeCommand extends AbstractAction {
29
public class SearchTreeCommand extends AbstractAction {
30
30
31
    private static final Set<String> commands = new HashSet<String>();
31
    private static final Set<String> commands = new HashSet<>();
32
32
33
    static {
33
    static {
34
        commands.add(ActionNames.SEARCH_TREE);
34
        commands.add(ActionNames.SEARCH_TREE);
(-)a/src/core/org/apache/jmeter/gui/action/SearchTreeDialog.java (-1 / +1 lines)
Lines 197-203 public class SearchTreeDialog extends JDialog implements ActionListener { Link Here
197
        }
197
        }
198
        GuiPackage guiPackage = GuiPackage.getInstance();
198
        GuiPackage guiPackage = GuiPackage.getInstance();
199
        JMeterTreeModel jMeterTreeModel = guiPackage.getTreeModel();
199
        JMeterTreeModel jMeterTreeModel = guiPackage.getTreeModel();
200
        Set<JMeterTreeNode> nodes = new HashSet<JMeterTreeNode>();
200
        Set<JMeterTreeNode> nodes = new HashSet<>();
201
        for (JMeterTreeNode jMeterTreeNode : jMeterTreeModel.getNodesOfType(Searchable.class)) {
201
        for (JMeterTreeNode jMeterTreeNode : jMeterTreeModel.getNodesOfType(Searchable.class)) {
202
            try {
202
            try {
203
                if (jMeterTreeNode.getUserObject() instanceof Searchable){
203
                if (jMeterTreeNode.getUserObject() instanceof Searchable){
(-)a/src/core/org/apache/jmeter/gui/action/Start.java (-1 / +1 lines)
Lines 40-46 import org.apache.log.Logger; Link Here
40
public class Start extends AbstractAction {
40
public class Start extends AbstractAction {
41
    private static final Logger log = LoggingManager.getLoggerForClass();
41
    private static final Logger log = LoggingManager.getLoggerForClass();
42
42
43
    private static final Set<String> commands = new HashSet<String>();
43
    private static final Set<String> commands = new HashSet<>();
44
44
45
    static {
45
    static {
46
        commands.add(ActionNames.ACTION_START);
46
        commands.add(ActionNames.ACTION_START);
(-)a/src/core/org/apache/jmeter/gui/action/StopStoppables.java (-1 / +1 lines)
Lines 32-38 import org.apache.jmeter.gui.Stoppable; Link Here
32
 * @since 2.5.1
32
 * @since 2.5.1
33
 */
33
 */
34
public class StopStoppables extends AbstractAction implements ActionListener {
34
public class StopStoppables extends AbstractAction implements ActionListener {
35
    private static final Set<String> commands = new HashSet<String>();
35
    private static final Set<String> commands = new HashSet<>();
36
36
37
    static {
37
    static {
38
        commands.add(ActionNames.STOP_THREAD);
38
        commands.add(ActionNames.STOP_THREAD);
(-)a/src/core/org/apache/jmeter/gui/action/TemplatesCommand.java (-1 / +1 lines)
Lines 28-34 import java.util.Set; Link Here
28
 */
28
 */
29
public class TemplatesCommand extends AbstractAction {
29
public class TemplatesCommand extends AbstractAction {
30
30
31
    private static final Set<String> commands = new HashSet<String>();
31
    private static final Set<String> commands = new HashSet<>();
32
32
33
    // Ensure the dialog is only created when it is first needed
33
    // Ensure the dialog is only created when it is first needed
34
    // In turn this avoids scanning the templates until first needed
34
    // In turn this avoids scanning the templates until first needed
(-)a/src/core/org/apache/jmeter/gui/action/ToolBar.java (-1 / +1 lines)
Lines 30-36 import org.apache.jmeter.gui.GuiPackage; Link Here
30
 */
30
 */
31
public class ToolBar implements Command {
31
public class ToolBar implements Command {
32
32
33
    private static final Set<String> commands = new HashSet<String>();
33
    private static final Set<String> commands = new HashSet<>();
34
34
35
    static {
35
    static {
36
        commands.add(ActionNames.TOOLBAR);
36
        commands.add(ActionNames.TOOLBAR);
(-)a/src/core/org/apache/jmeter/gui/action/UndoCommand.java (-1 / +1 lines)
Lines 33-39 import org.apache.jorphan.collections.HashTree; Link Here
33
 */
33
 */
34
public class UndoCommand implements Command {
34
public class UndoCommand implements Command {
35
35
36
    private static final Set<String> commands = new HashSet<String>();
36
    private static final Set<String> commands = new HashSet<>();
37
37
38
    static {
38
    static {
39
        commands.add(ActionNames.UNDO);
39
        commands.add(ActionNames.UNDO);
(-)a/src/core/org/apache/jmeter/gui/action/What.java (-1 / +1 lines)
Lines 47-53 public class What implements Command { Link Here
47
    private static final Set<String> commandSet;
47
    private static final Set<String> commandSet;
48
48
49
    static {
49
    static {
50
        HashSet<String> commands = new HashSet<String>();
50
        HashSet<String> commands = new HashSet<>();
51
        commands.add(ActionNames.WHAT_CLASS);
51
        commands.add(ActionNames.WHAT_CLASS);
52
        commands.add(ActionNames.DEBUG_ON);
52
        commands.add(ActionNames.DEBUG_ON);
53
        commands.add(ActionNames.DEBUG_OFF);
53
        commands.add(ActionNames.DEBUG_OFF);
(-)a/src/core/org/apache/jmeter/gui/action/template/TemplateManager.java (-2 / +2 lines)
Lines 41-47 public class TemplateManager { Link Here
41
         * N.B. Must use LinkedHashMap for field type
41
         * N.B. Must use LinkedHashMap for field type
42
         * XStream creates a plain HashMap if one uses Map as the field type.
42
         * XStream creates a plain HashMap if one uses Map as the field type.
43
         */
43
         */
44
        private final LinkedHashMap<String, Template> templates = new LinkedHashMap<String, Template>();
44
        private final LinkedHashMap<String, Template> templates = new LinkedHashMap<>();
45
    }
45
    }
46
    private static final String TEMPLATE_FILES = JMeterUtils.getPropDefault("template.files", // $NON-NLS-1$
46
    private static final String TEMPLATE_FILES = JMeterUtils.getPropDefault("template.files", // $NON-NLS-1$
47
            "/bin/templates/templates.xml");
47
            "/bin/templates/templates.xml");
Lines 103-109 public class TemplateManager { Link Here
103
    }
103
    }
104
104
105
    private Map<String, Template> readTemplates() {
105
    private Map<String, Template> readTemplates() {
106
        final Map<String, Template> temps = new LinkedHashMap<String, Template>();
106
        final Map<String, Template> temps = new LinkedHashMap<>();
107
       
107
       
108
        final String[] templateFiles = TEMPLATE_FILES.split(",");
108
        final String[] templateFiles = TEMPLATE_FILES.split(",");
109
        for (String templateFile : templateFiles) {
109
        for (String templateFile : templateFiles) {
(-)a/src/core/org/apache/jmeter/gui/tree/JMeterTreeModel.java (-1 / +1 lines)
Lines 74-80 public class JMeterTreeModel extends DefaultTreeModel { Link Here
74
     * @return a list of tree nodes of the given <code>type</code>, or an empty list
74
     * @return a list of tree nodes of the given <code>type</code>, or an empty list
75
     */
75
     */
76
    public List<JMeterTreeNode> getNodesOfType(Class<?> type) {
76
    public List<JMeterTreeNode> getNodesOfType(Class<?> type) {
77
        List<JMeterTreeNode> nodeList = new LinkedList<JMeterTreeNode>();
77
        List<JMeterTreeNode> nodeList = new LinkedList<>();
78
        traverseAndFind(type, (JMeterTreeNode) this.getRoot(), nodeList);
78
        traverseAndFind(type, (JMeterTreeNode) this.getRoot(), nodeList);
79
        return nodeList;
79
        return nodeList;
80
    }
80
    }
(-)a/src/core/org/apache/jmeter/gui/tree/JMeterTreeNode.java (-1 / +1 lines)
Lines 76-82 public class JMeterTreeNode extends DefaultMutableTreeNode implements NamedTreeN Link Here
76
     * @return {@link List} of {@link JMeterTreeNode}s
76
     * @return {@link List} of {@link JMeterTreeNode}s
77
     */
77
     */
78
    public List<JMeterTreeNode> getPathToThreadGroup() {
78
    public List<JMeterTreeNode> getPathToThreadGroup() {
79
        List<JMeterTreeNode> nodes = new ArrayList<JMeterTreeNode>();
79
        List<JMeterTreeNode> nodes = new ArrayList<>();
80
        if(treeModel != null) {
80
        if(treeModel != null) {
81
            TreeNode[] nodesToRoot = treeModel.getPathToRoot(this);
81
            TreeNode[] nodesToRoot = treeModel.getPathToRoot(this);
82
            for (TreeNode node : nodesToRoot) {
82
            for (TreeNode node : nodesToRoot) {
(-)a/src/core/org/apache/jmeter/gui/tree/JMeterTreeTransferHandler.java (-2 / +2 lines)
Lines 234-240 public class JMeterTreeTransferHandler extends TransferHandler { Link Here
234
        TreePath dest = dl.getPath();
234
        TreePath dest = dl.getPath();
235
        JMeterTreeNode target = (JMeterTreeNode) dest.getLastPathComponent();
235
        JMeterTreeNode target = (JMeterTreeNode) dest.getLastPathComponent();
236
       
236
       
237
        nodesForRemoval = new ArrayList<JMeterTreeNode>();
237
        nodesForRemoval = new ArrayList<>();
238
        int index = dl.getChildIndex();
238
        int index = dl.getChildIndex();
239
        TreePath[] pathsToSelect = new TreePath[nodes.length];
239
        TreePath[] pathsToSelect = new TreePath[nodes.length];
240
        int pathPosition = 0;
240
        int pathPosition = 0;
Lines 253-259 public class JMeterTreeTransferHandler extends TransferHandler { Link Here
253
            
253
            
254
            // first copy the children as the call to copy.add will modify the collection we're iterating on
254
            // first copy the children as the call to copy.add will modify the collection we're iterating on
255
            Enumeration<?> enumFrom = node.children();
255
            Enumeration<?> enumFrom = node.children();
256
            List<JMeterTreeNode> tmp = new ArrayList<JMeterTreeNode>();
256
            List<JMeterTreeNode> tmp = new ArrayList<>();
257
            while (enumFrom.hasMoreElements()) {
257
            while (enumFrom.hasMoreElements()) {
258
                JMeterTreeNode child = (JMeterTreeNode) enumFrom.nextElement();
258
                JMeterTreeNode child = (JMeterTreeNode) enumFrom.nextElement();
259
                tmp.add(child);
259
                tmp.add(child);
(-)a/src/core/org/apache/jmeter/gui/util/FileListPanel.java (-1 / +1 lines)
Lines 61-67 public class FileListPanel extends JPanel implements ActionListener { Link Here
61
61
62
    private JButton delete = new JButton(JMeterUtils.getResString("delete")); // $NON-NLS-1$
62
    private JButton delete = new JButton(JMeterUtils.getResString("delete")); // $NON-NLS-1$
63
63
64
    private List<ChangeListener> listeners = new LinkedList<ChangeListener>();
64
    private List<ChangeListener> listeners = new LinkedList<>();
65
65
66
    private String title;
66
    private String title;
67
67
(-)a/src/core/org/apache/jmeter/gui/util/FilePanelEntry.java (-1 / +1 lines)
Lines 46-52 public class FilePanelEntry extends HorizontalPanel implements ActionListener { Link Here
46
46
47
    private static final String ACTION_BROWSE = "browse"; //$NON-NLS-1$
47
    private static final String ACTION_BROWSE = "browse"; //$NON-NLS-1$
48
48
49
    private final List<ChangeListener> listeners = new LinkedList<ChangeListener>();
49
    private final List<ChangeListener> listeners = new LinkedList<>();
50
50
51
    private final String[] filetypes;
51
    private final String[] filetypes;
52
52
(-)a/src/core/org/apache/jmeter/gui/util/JLabeledRadioI18N.java (-3 / +3 lines)
Lines 52-58 public class JLabeledRadioI18N extends JPanel implements JLabeledField, ActionLi Link Here
52
52
53
    private final ButtonGroup bGroup = new ButtonGroup();
53
    private final ButtonGroup bGroup = new ButtonGroup();
54
54
55
    private final ArrayList<ChangeListener> mChangeListeners = new ArrayList<ChangeListener>(3);
55
    private final ArrayList<ChangeListener> mChangeListeners = new ArrayList<>(3);
56
56
57
    /**
57
    /**
58
     *
58
     *
Lines 129-135 public class JLabeledRadioI18N extends JPanel implements JLabeledField, ActionLi Link Here
129
     */
129
     */
130
    public void resetButtons(String[] resouces, String selected) {
130
    public void resetButtons(String[] resouces, String selected) {
131
        Enumeration<AbstractButton> buttons = bGroup.getElements();
131
        Enumeration<AbstractButton> buttons = bGroup.getElements();
132
        List<AbstractButton> buttonsToRemove = new ArrayList<AbstractButton>(this.bGroup.getButtonCount());
132
        List<AbstractButton> buttonsToRemove = new ArrayList<>(this.bGroup.getButtonCount());
133
        while (buttons.hasMoreElements()) {
133
        while (buttons.hasMoreElements()) {
134
            AbstractButton abstractButton = buttons
134
            AbstractButton abstractButton = buttons
135
                    .nextElement();
135
                    .nextElement();
Lines 206-212 public class JLabeledRadioI18N extends JPanel implements JLabeledField, ActionLi Link Here
206
     */
206
     */
207
    @Override
207
    @Override
208
    public List<JComponent> getComponentList() {
208
    public List<JComponent> getComponentList() {
209
        List<JComponent> comps = new LinkedList<JComponent>();
209
        List<JComponent> comps = new LinkedList<>();
210
        comps.add(mLabel);
210
        comps.add(mLabel);
211
        Enumeration<AbstractButton> en = this.bGroup.getElements();
211
        Enumeration<AbstractButton> en = this.bGroup.getElements();
212
        while (en.hasMoreElements()) {
212
        while (en.hasMoreElements()) {
(-)a/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java (-7 / +7 lines)
Lines 149-160 public class JMeterMenuBar extends JMenuBar implements LocaleChangeListener { Link Here
149
149
150
    public JMeterMenuBar() {
150
    public JMeterMenuBar() {
151
        // List for recent files menu items
151
        // List for recent files menu items
152
        file_load_recent_files = new LinkedList<JComponent>();
152
        file_load_recent_files = new LinkedList<>();
153
        // Lists for remote engines menu items
153
        // Lists for remote engines menu items
154
        remote_engine_start = new LinkedList<JMenuItem>();
154
        remote_engine_start = new LinkedList<>();
155
        remote_engine_stop = new LinkedList<JMenuItem>();
155
        remote_engine_stop = new LinkedList<>();
156
        remote_engine_shut = new LinkedList<JMenuItem>();
156
        remote_engine_shut = new LinkedList<>();
157
        remote_engine_exit = new LinkedList<JMenuItem>();
157
        remote_engine_exit = new LinkedList<>();
158
        remoteHosts = JOrphanUtils.split(JMeterUtils.getPropDefault("remote_hosts", ""), ","); //$NON-NLS-1$
158
        remoteHosts = JOrphanUtils.split(JMeterUtils.getPropDefault("remote_hosts", ""), ","); //$NON-NLS-1$
159
        if (remoteHosts.length == 1 && remoteHosts[0].equals("")) {
159
        if (remoteHosts.length == 1 && remoteHosts[0].equals("")) {
160
            remoteHosts = new String[0];
160
            remoteHosts = new String[0];
Lines 238-244 public class JMeterMenuBar extends JMenuBar implements LocaleChangeListener { Link Here
238
     * should be defined in a file somewhere, but that is for later.
238
     * should be defined in a file somewhere, but that is for later.
239
     */
239
     */
240
    public void createMenuBar() {
240
    public void createMenuBar() {
241
        this.menuCreators = new ArrayList<MenuCreator>();
241
        this.menuCreators = new ArrayList<>();
242
        try {
242
        try {
243
            List<String> listClasses = ClassFinder.findClassesThatExtend(
243
            List<String> listClasses = ClassFinder.findClassesThatExtend(
244
                    JMeterUtils.getSearchPaths(), 
244
                    JMeterUtils.getSearchPaths(), 
Lines 387-393 public class JMeterMenuBar extends JMenuBar implements LocaleChangeListener { Link Here
387
     */
387
     */
388
    // Also used by org.apache.jmeter.resources.PackageTest
388
    // Also used by org.apache.jmeter.resources.PackageTest
389
    public static String[] getLanguages(){
389
    public static String[] getLanguages(){
390
        List<String> lang = new ArrayList<String>(20);
390
        List<String> lang = new ArrayList<>(20);
391
        lang.add(Locale.ENGLISH.toString()); // en
391
        lang.add(Locale.ENGLISH.toString()); // en
392
        lang.add(Locale.FRENCH.toString()); // fr
392
        lang.add(Locale.FRENCH.toString()); // fr
393
        lang.add(Locale.GERMAN.toString()); // de
393
        lang.add(Locale.GERMAN.toString()); // de
(-)a/src/core/org/apache/jmeter/gui/util/JMeterToolBar.java (-6 / +6 lines)
Lines 164-170 public class JMeterToolBar extends JToolBar implements LocaleChangeListener { Link Here
164
        
164
        
165
        String iconSize = JMeterUtils.getPropDefault(TOOLBAR_ICON_SIZE, DEFAULT_TOOLBAR_ICON_SIZE); 
165
        String iconSize = JMeterUtils.getPropDefault(TOOLBAR_ICON_SIZE, DEFAULT_TOOLBAR_ICON_SIZE); 
166
166
167
        List<IconToolbarBean> listIcons = new ArrayList<IconToolbarBean>();
167
        List<IconToolbarBean> listIcons = new ArrayList<>();
168
        for (String key : oList) {
168
        for (String key : oList) {
169
            log.debug("Toolbar icon key: " + key); //$NON-NLS-1$
169
            log.debug("Toolbar icon key: " + key); //$NON-NLS-1$
170
            String trimmed = key.trim();
170
            String trimmed = key.trim();
Lines 204-210 public class JMeterToolBar extends JToolBar implements LocaleChangeListener { Link Here
204
     */
204
     */
205
    private Map<String, Boolean> getCurrentButtonsStates() {
205
    private Map<String, Boolean> getCurrentButtonsStates() {
206
        Component[] components = getComponents();
206
        Component[] components = getComponents();
207
        Map<String, Boolean> buttonStates = new HashMap<String, Boolean>(components.length);
207
        Map<String, Boolean> buttonStates = new HashMap<>(components.length);
208
        for (int i = 0; i < components.length; i++) {
208
        for (int i = 0; i < components.length; i++) {
209
            if (components[i] instanceof JButton) {
209
            if (components[i] instanceof JButton) {
210
                JButton button = (JButton) components[i];
210
                JButton button = (JButton) components[i];
Lines 219-225 public class JMeterToolBar extends JToolBar implements LocaleChangeListener { Link Here
219
     */
219
     */
220
    public void initButtonsState() {
220
    public void initButtonsState() {
221
        final boolean started = false;
221
        final boolean started = false;
222
        Map<String, Boolean> buttonStates = new HashMap<String, Boolean>();
222
        Map<String, Boolean> buttonStates = new HashMap<>();
223
        buttonStates.put(ActionNames.ACTION_START, Boolean.valueOf(!started));
223
        buttonStates.put(ActionNames.ACTION_START, Boolean.valueOf(!started));
224
        buttonStates.put(ActionNames.ACTION_START_NO_TIMERS, Boolean.valueOf(!started));
224
        buttonStates.put(ActionNames.ACTION_START_NO_TIMERS, Boolean.valueOf(!started));
225
        buttonStates.put(ActionNames.ACTION_STOP, Boolean.valueOf(started));
225
        buttonStates.put(ActionNames.ACTION_STOP, Boolean.valueOf(started));
Lines 240-246 public class JMeterToolBar extends JToolBar implements LocaleChangeListener { Link Here
240
     *            Flag whether local test is started
240
     *            Flag whether local test is started
241
     */
241
     */
242
    public void setLocalTestStarted(boolean started) {
242
    public void setLocalTestStarted(boolean started) {
243
        Map<String, Boolean> buttonStates = new HashMap<String, Boolean>(3);
243
        Map<String, Boolean> buttonStates = new HashMap<>(3);
244
        buttonStates.put(ActionNames.ACTION_START, Boolean.valueOf(!started));
244
        buttonStates.put(ActionNames.ACTION_START, Boolean.valueOf(!started));
245
        buttonStates.put(ActionNames.ACTION_START_NO_TIMERS, Boolean.valueOf(!started));
245
        buttonStates.put(ActionNames.ACTION_START_NO_TIMERS, Boolean.valueOf(!started));
246
        buttonStates.put(ActionNames.ACTION_STOP, Boolean.valueOf(started));
246
        buttonStates.put(ActionNames.ACTION_STOP, Boolean.valueOf(started));
Lines 255-261 public class JMeterToolBar extends JToolBar implements LocaleChangeListener { Link Here
255
     *            Flag whether the test is started
255
     *            Flag whether the test is started
256
     */
256
     */
257
    public void setRemoteTestStarted(boolean started) {
257
    public void setRemoteTestStarted(boolean started) {
258
        Map<String, Boolean> buttonStates = new HashMap<String, Boolean>(3);
258
        Map<String, Boolean> buttonStates = new HashMap<>(3);
259
        buttonStates.put(ActionNames.REMOTE_START_ALL, Boolean.valueOf(!started));
259
        buttonStates.put(ActionNames.REMOTE_START_ALL, Boolean.valueOf(!started));
260
        buttonStates.put(ActionNames.REMOTE_STOP_ALL, Boolean.valueOf(started));
260
        buttonStates.put(ActionNames.REMOTE_STOP_ALL, Boolean.valueOf(started));
261
        buttonStates.put(ActionNames.REMOTE_SHUT_ALL, Boolean.valueOf(started));
261
        buttonStates.put(ActionNames.REMOTE_SHUT_ALL, Boolean.valueOf(started));
Lines 273-279 public class JMeterToolBar extends JToolBar implements LocaleChangeListener { Link Here
273
     *            {@link ActionNames#REDO} should be enabled
273
     *            {@link ActionNames#REDO} should be enabled
274
     */
274
     */
275
    public void updateUndoRedoIcons(boolean canUndo, boolean canRedo) {
275
    public void updateUndoRedoIcons(boolean canUndo, boolean canRedo) {
276
        Map<String, Boolean> buttonStates = new HashMap<String, Boolean>(2);
276
        Map<String, Boolean> buttonStates = new HashMap<>(2);
277
        buttonStates.put(ActionNames.UNDO, Boolean.valueOf(canUndo));
277
        buttonStates.put(ActionNames.UNDO, Boolean.valueOf(canUndo));
278
        buttonStates.put(ActionNames.REDO, Boolean.valueOf(canRedo));
278
        buttonStates.put(ActionNames.REDO, Boolean.valueOf(canRedo));
279
        updateButtons(buttonStates);
279
        updateButtons(buttonStates);
(-)a/src/core/org/apache/jmeter/gui/util/MenuFactory.java (-14 / +13 lines)
Lines 90-99 public final class MenuFactory { Link Here
90
90
91
    public static final String LISTENERS = "menu_listener"; //$NON-NLS-1$
91
    public static final String LISTENERS = "menu_listener"; //$NON-NLS-1$
92
92
93
    private static final Map<String, List<MenuInfo>> menuMap =
93
    private static final Map<String, List<MenuInfo>> menuMap = new HashMap<>();
94
        new HashMap<String, List<MenuInfo>>();
95
94
96
    private static final Set<String> elementsToSkip = new HashSet<String>();
95
    private static final Set<String> elementsToSkip = new HashSet<>();
97
96
98
    // MENU_ADD_xxx - controls which items are in the ADD menu
97
    // MENU_ADD_xxx - controls which items are in the ADD menu
99
    // MENU_PARENT_xxx - controls which items are in the Insert Parent menu
98
    // MENU_PARENT_xxx - controls which items are in the Insert Parent menu
Lines 128-144 public final class MenuFactory { Link Here
128
        postProcessors, preProcessors;
127
        postProcessors, preProcessors;
129
128
130
    static {
129
    static {
131
        threads = new LinkedList<MenuInfo>();
130
        threads = new LinkedList<>();
132
        fragments = new LinkedList<MenuInfo>();
131
        fragments = new LinkedList<>();
133
        timers = new LinkedList<MenuInfo>();
132
        timers = new LinkedList<>();
134
        controllers = new LinkedList<MenuInfo>();
133
        controllers = new LinkedList<>();
135
        samplers = new LinkedList<MenuInfo>();
134
        samplers = new LinkedList<>();
136
        configElements = new LinkedList<MenuInfo>();
135
        configElements = new LinkedList<>();
137
        assertions = new LinkedList<MenuInfo>();
136
        assertions = new LinkedList<>();
138
        listeners = new LinkedList<MenuInfo>();
137
        listeners = new LinkedList<>();
139
        postProcessors = new LinkedList<MenuInfo>();
138
        postProcessors = new LinkedList<>();
140
        preProcessors = new LinkedList<MenuInfo>();
139
        preProcessors = new LinkedList<>();
141
        nonTestElements = new LinkedList<MenuInfo>();
140
        nonTestElements = new LinkedList<>();
142
        menuMap.put(THREADS, threads);
141
        menuMap.put(THREADS, threads);
143
        menuMap.put(FRAGMENTS, fragments);
142
        menuMap.put(FRAGMENTS, fragments);
144
        menuMap.put(TIMERS, timers);
143
        menuMap.put(TIMERS, timers);
(-)a/src/core/org/apache/jmeter/reporters/AbstractListenerElement.java (-1 / +1 lines)
Lines 44-50 public abstract class AbstractListenerElement extends AbstractTestElement { Link Here
44
    }
44
    }
45
45
46
    public void setListener(Visualizer vis) {
46
    public void setListener(Visualizer vis) {
47
        listener = new WeakReference<Visualizer>(vis);
47
        listener = new WeakReference<>(vis);
48
    }
48
    }
49
49
50
    @Override
50
    @Override
(-)a/src/core/org/apache/jmeter/reporters/FileReporter.java (-1 / +1 lines)
Lines 55-61 public class FileReporter extends JPanel { Link Here
55
55
56
    private static final Logger log = LoggingManager.getLoggerForClass();
56
    private static final Logger log = LoggingManager.getLoggerForClass();
57
57
58
    private final Map<String, List<Integer>> data = new ConcurrentHashMap<String, List<Integer>>();
58
    private final Map<String, List<Integer>> data = new ConcurrentHashMap<>();
59
59
60
    /**
60
    /**
61
     * Initialize a file reporter from a file
61
     * Initialize a file reporter from a file
(-)a/src/core/org/apache/jmeter/reporters/ResultCollector.java (-1 / +1 lines)
Lines 105-111 public class ResultCollector extends AbstractListenerElement implements SampleLi Link Here
105
    private static final Object LOCK = new Object();
105
    private static final Object LOCK = new Object();
106
106
107
    //@GuardedBy("LOCK")
107
    //@GuardedBy("LOCK")
108
    private static final Map<String, FileEntry> files = new HashMap<String, FileEntry>();
108
    private static final Map<String, FileEntry> files = new HashMap<>();
109
109
110
    /**
110
    /**
111
     * Shutdown Hook that ensures PrintWriter is flushed is CTRL+C or kill is called during a test
111
     * Shutdown Hook that ensures PrintWriter is flushed is CTRL+C or kill is called during a test
(-)a/src/core/org/apache/jmeter/reporters/Summariser.java (-1 / +1 lines)
Lines 95-101 public class Summariser extends AbstractTestElement Link Here
95
     * This map allows summarisers with the same name to contribute to the same totals.
95
     * This map allows summarisers with the same name to contribute to the same totals.
96
     */
96
     */
97
    //@GuardedBy("LOCK") - needed to ensure consistency between this and INSTANCE_COUNT
97
    //@GuardedBy("LOCK") - needed to ensure consistency between this and INSTANCE_COUNT
98
    private static final Map<String, Totals> ACCUMULATORS = new ConcurrentHashMap<String, Totals>();
98
    private static final Map<String, Totals> ACCUMULATORS = new ConcurrentHashMap<>();
99
99
100
    //@GuardedBy("LOCK")
100
    //@GuardedBy("LOCK")
101
    private static int INSTANCE_COUNT; // number of active tests
101
    private static int INSTANCE_COUNT; // number of active tests
(-)a/src/core/org/apache/jmeter/samplers/AsynchSampleSender.java (-2 / +2 lines)
Lines 67-73 public class AsynchSampleSender extends AbstractSampleSender implements Serializ Link Here
67
    private Object readResolve() throws ObjectStreamException{
67
    private Object readResolve() throws ObjectStreamException{
68
        int capacity = getCapacity();
68
        int capacity = getCapacity();
69
        log.info("Using batch queue size (asynch.batch.queue.size): " + capacity); // server log file
69
        log.info("Using batch queue size (asynch.batch.queue.size): " + capacity); // server log file
70
        queue = new ArrayBlockingQueue<SampleEvent>(capacity);        
70
        queue = new ArrayBlockingQueue<>(capacity);
71
        Worker worker = new Worker(queue, listener);
71
        Worker worker = new Worker(queue, listener);
72
        worker.setDaemon(true);
72
        worker.setDaemon(true);
73
        worker.start();
73
        worker.start();
Lines 142-148 public class AsynchSampleSender extends AbstractSampleSender implements Serializ Link Here
142
            try {
142
            try {
143
                boolean eof = false;
143
                boolean eof = false;
144
                while (!eof) {
144
                while (!eof) {
145
                    List<SampleEvent> l = new ArrayList<SampleEvent>();
145
                    List<SampleEvent> l = new ArrayList<>();
146
                    SampleEvent e = queue.take();
146
                    SampleEvent e = queue.take();
147
                    while (!(eof = (e == FINAL_EVENT)) && e != null) { // try to process as many as possible
147
                    while (!(eof = (e == FINAL_EVENT)) && e != null) { // try to process as many as possible
148
                        l.add(e);
148
                        l.add(e);
(-)a/src/core/org/apache/jmeter/samplers/BatchSampleSender.java (-1 / +1 lines)
Lines 57-63 public class BatchSampleSender extends AbstractSampleSender implements Serializa Link Here
57
57
58
    private final RemoteSampleListener listener;
58
    private final RemoteSampleListener listener;
59
59
60
    private final List<SampleEvent> sampleStore = new ArrayList<SampleEvent>();
60
    private final List<SampleEvent> sampleStore = new ArrayList<>();
61
61
62
    // Server-only work item
62
    // Server-only work item
63
    private transient long batchSendTime = -1;
63
    private transient long batchSendTime = -1;
(-)a/src/core/org/apache/jmeter/samplers/Entry.java (-2 / +2 lines)
Lines 37-45 public class Entry { Link Here
37
    private List<Assertion> assertions;
37
    private List<Assertion> assertions;
38
38
39
    public Entry() {
39
    public Entry() {
40
        configSet = new HashMap<Class<?>, ConfigElement>();
40
        configSet = new HashMap<>();
41
        // clonedSet = new HashSet();
41
        // clonedSet = new HashSet();
42
        assertions = new LinkedList<Assertion>();
42
        assertions = new LinkedList<>();
43
    }
43
    }
44
44
45
    public void addAssertion(Assertion assertion) {
45
    public void addAssertion(Assertion assertion) {
(-)a/src/core/org/apache/jmeter/samplers/HoldSampleSender.java (-1 / +1 lines)
Lines 36-42 public class HoldSampleSender extends AbstractSampleSender implements Serializab Link Here
36
36
37
    private static final long serialVersionUID = 240L;
37
    private static final long serialVersionUID = 240L;
38
38
39
    private final List<SampleEvent> sampleStore = new ArrayList<SampleEvent>();
39
    private final List<SampleEvent> sampleStore = new ArrayList<>();
40
40
41
    private final RemoteSampleListener listener;
41
    private final RemoteSampleListener listener;
42
42
(-)a/src/core/org/apache/jmeter/samplers/SampleResult.java (-3 / +3 lines)
Lines 175-181 public class SampleResult implements Serializable, Cloneable { Link Here
175
    /** In Non GUI mode and when best config is used, size never exceeds 1, 
175
    /** In Non GUI mode and when best config is used, size never exceeds 1, 
176
     * but as a compromise set it to 3 
176
     * but as a compromise set it to 3 
177
     */
177
     */
178
    private final Set<String> files = new HashSet<String>(3);
178
    private final Set<String> files = new HashSet<>(3);
179
179
180
    private String dataEncoding;// (is this really the character set?) e.g.
180
    private String dataEncoding;// (is this really the character set?) e.g.
181
                                // ISO-8895-1, UTF-8
181
                                // ISO-8895-1, UTF-8
Lines 569-575 public class SampleResult implements Serializable, Cloneable { Link Here
569
569
570
    public void addAssertionResult(AssertionResult assertResult) {
570
    public void addAssertionResult(AssertionResult assertResult) {
571
        if (assertionResults == null) {
571
        if (assertionResults == null) {
572
            assertionResults = new ArrayList<AssertionResult>();
572
            assertionResults = new ArrayList<>();
573
        }
573
        }
574
        assertionResults.add(assertResult);
574
        assertionResults.add(assertResult);
575
    }
575
    }
Lines 636-642 public class SampleResult implements Serializable, Cloneable { Link Here
636
     */
636
     */
637
    public void storeSubResult(SampleResult subResult) {
637
    public void storeSubResult(SampleResult subResult) {
638
        if (subResults == null) {
638
        if (subResults == null) {
639
            subResults = new ArrayList<SampleResult>();
639
            subResults = new ArrayList<>();
640
        }
640
        }
641
        subResults.add(subResult);
641
        subResults.add(subResult);
642
        subResult.setParent(this);
642
        subResult.setParent(this);
(-)a/src/core/org/apache/jmeter/samplers/StatisticalSampleSender.java (-2 / +2 lines)
Lines 68-77 public class StatisticalSampleSender extends AbstractSampleSender implements Ser Link Here
68
68
69
    private final RemoteSampleListener listener;
69
    private final RemoteSampleListener listener;
70
70
71
    private final List<SampleEvent> sampleStore = new ArrayList<SampleEvent>();
71
    private final List<SampleEvent> sampleStore = new ArrayList<>();
72
72
73
    //@GuardedBy("sampleStore") TODO perhaps use ConcurrentHashMap ?
73
    //@GuardedBy("sampleStore") TODO perhaps use ConcurrentHashMap ?
74
    private final Map<String, StatisticalSampleResult> sampleTable = new HashMap<String, StatisticalSampleResult>();
74
    private final Map<String, StatisticalSampleResult> sampleTable = new HashMap<>();
75
75
76
    // Settings; readResolve sets these from the server/client values as appropriate
76
    // Settings; readResolve sets these from the server/client values as appropriate
77
    // TODO would be nice to make these final; not 100% sure volatile is needed as not changed after creation
77
    // TODO would be nice to make these final; not 100% sure volatile is needed as not changed after creation
(-)a/src/core/org/apache/jmeter/save/CSVSaveService.java (-1 / +1 lines)
Lines 1045-1051 public final class CSVSaveService { Link Here
1045
            throws IOException {
1045
            throws IOException {
1046
        int ch;
1046
        int ch;
1047
        ParserState state = ParserState.INITIAL;
1047
        ParserState state = ParserState.INITIAL;
1048
        List<String> list = new ArrayList<String>();
1048
        List<String> list = new ArrayList<>();
1049
        CharArrayWriter baos = new CharArrayWriter(200);
1049
        CharArrayWriter baos = new CharArrayWriter(200);
1050
        boolean push = false;
1050
        boolean push = false;
1051
        while (-1 != (ch = infile.read())) {
1051
        while (-1 != (ch = infile.read())) {
(-)a/src/core/org/apache/jmeter/save/SaveService.java (-1 / +1 lines)
Lines 422-428 public class SaveService { Link Here
422
    // Allow test code to check for spurious class references
422
    // Allow test code to check for spurious class references
423
    static List<String> checkClasses(){
423
    static List<String> checkClasses(){
424
        final ClassLoader classLoader = SaveService.class.getClassLoader();
424
        final ClassLoader classLoader = SaveService.class.getClassLoader();
425
        List<String> missingClasses = new ArrayList<String>();
425
        List<String> missingClasses = new ArrayList<>();
426
        //boolean OK = true;
426
        //boolean OK = true;
427
        for (Object clazz : classToAlias.keySet()) {
427
        for (Object clazz : classToAlias.keySet()) {
428
            String name = (String) clazz;
428
            String name = (String) clazz;
(-)a/src/core/org/apache/jmeter/save/converters/ConversionHelp.java (-1 / +1 lines)
Lines 147-153 public class ConversionHelp { Link Here
147
    /**
147
    /**
148
     *  Names of properties that are handled specially
148
     *  Names of properties that are handled specially
149
     */
149
     */
150
    private static final Map<String, String> propertyToAttribute=new HashMap<String, String>();
150
    private static final Map<String, String> propertyToAttribute= new HashMap<>();
151
151
152
    private static void mapentry(String prop, String att){
152
    private static void mapentry(String prop, String att){
153
        propertyToAttribute.put(prop,att);
153
        propertyToAttribute.put(prop,att);
(-)a/src/core/org/apache/jmeter/save/converters/TestResultWrapperConverter.java (-1 / +1 lines)
Lines 85-91 public class TestResultWrapperConverter extends AbstractCollectionConverter { Link Here
85
    @Override
85
    @Override
86
    public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
86
    public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
87
        TestResultWrapper results = new TestResultWrapper();
87
        TestResultWrapper results = new TestResultWrapper();
88
        Collection<SampleResult> samples = new ArrayList<SampleResult>();
88
        Collection<SampleResult> samples = new ArrayList<>();
89
        String ver = reader.getAttribute("version");  //$NON-NLS-1$
89
        String ver = reader.getAttribute("version");  //$NON-NLS-1$
90
        if (ver == null || ver.length() == 0) {
90
        if (ver == null || ver.length() == 0) {
91
            ver = "1.0";  //$NON-NLS-1$
91
            ver = "1.0";  //$NON-NLS-1$
(-)a/src/core/org/apache/jmeter/services/FileServer.java (-1 / +1 lines)
Lines 79-85 public class FileServer { Link Here
79
    private File base;
79
    private File base;
80
80
81
    //@GuardedBy("this") NOTE this also guards against possible window in checkForOpenFiles()
81
    //@GuardedBy("this") NOTE this also guards against possible window in checkForOpenFiles()
82
    private final Map<String, FileEntry> files = new HashMap<String, FileEntry>();
82
    private final Map<String, FileEntry> files = new HashMap<>();
83
83
84
    private static final FileServer server = new FileServer();
84
    private static final FileServer server = new FileServer();
85
85
(-)a/src/core/org/apache/jmeter/testbeans/TestBeanHelper.java (-1 / +1 lines)
Lines 137-143 public class TestBeanHelper { Link Here
137
    {
137
    {
138
        if(prop instanceof CollectionProperty)
138
        if(prop instanceof CollectionProperty)
139
        {
139
        {
140
            Collection<Object> values = new LinkedList<Object>();
140
            Collection<Object> values = new LinkedList<>();
141
            PropertyIterator iter = prop.iterator();
141
            PropertyIterator iter = prop.iterator();
142
            while(iter.hasNext())
142
            while(iter.hasNext())
143
            {
143
            {
(-)a/src/core/org/apache/jmeter/testbeans/gui/ComboStringEditor.java (-1 / +1 lines)
Lines 113-119 class ComboStringEditor extends PropertyEditorSupport implements ItemListener, C Link Here
113
        model = new DefaultComboBoxModel<>();
113
        model = new DefaultComboBoxModel<>();
114
114
115
        if (rb != null && tags.length > 0) {
115
        if (rb != null && tags.length > 0) {
116
            validTranslations=new HashMap<String, String>();
116
            validTranslations= new HashMap<>();
117
            for (String tag : this.tags) {
117
            for (String tag : this.tags) {
118
                validTranslations.put(tag, rb.getString(tag));
118
                validTranslations.put(tag, rb.getString(tag));
119
            }
119
            }
(-)a/src/core/org/apache/jmeter/testbeans/gui/TableEditor.java (-1 / +1 lines)
Lines 138-144 public class TableEditor extends PropertyEditorSupport implements FocusListener, Link Here
138
138
139
    private Collection<Object> convertCollection(Collection<?> values)
139
    private Collection<Object> convertCollection(Collection<?> values)
140
    {
140
    {
141
        List<Object> l = new LinkedList<Object>();
141
        List<Object> l = new LinkedList<>();
142
        for(Object obj : values)
142
        for(Object obj : values)
143
        {
143
        {
144
            if(obj instanceof TestElementProperty)
144
            if(obj instanceof TestElementProperty)
(-)a/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java (-3 / +3 lines)
Lines 122-128 public class TestBeanGUI extends AbstractJMeterGuiComponent implements JMeterGUI Link Here
122
    /**
122
    /**
123
     * The property name to value map that the active customizer edits:
123
     * The property name to value map that the active customizer edits:
124
     */
124
     */
125
    private final Map<String, Object> propertyMap = new HashMap<String, Object>();
125
    private final Map<String, Object> propertyMap = new HashMap<>();
126
126
127
    /**
127
    /**
128
     * Whether the GUI components have been created.
128
     * Whether the GUI components have been created.
Lines 130-136 public class TestBeanGUI extends AbstractJMeterGuiComponent implements JMeterGUI Link Here
130
    private boolean initialized = false;
130
    private boolean initialized = false;
131
131
132
    static {
132
    static {
133
        List<String> paths = new LinkedList<String>();
133
        List<String> paths = new LinkedList<>();
134
        paths.add("org.apache.jmeter.testbeans.gui");// $NON-NLS-1$
134
        paths.add("org.apache.jmeter.testbeans.gui");// $NON-NLS-1$
135
        paths.addAll(Arrays.asList(PropertyEditorManager.getEditorSearchPath()));
135
        paths.addAll(Arrays.asList(PropertyEditorManager.getEditorSearchPath()));
136
        String s = JMeterUtils.getPropDefault("propertyEditorSearchPath", null);// $NON-NLS-1$
136
        String s = JMeterUtils.getPropDefault("propertyEditorSearchPath", null);// $NON-NLS-1$
Lines 356-362 public TestElement createTestElement() { Link Here
356
    /** {@inheritDoc} */
356
    /** {@inheritDoc} */
357
    @Override
357
    @Override
358
    public Collection<String> getMenuCategories() {
358
    public Collection<String> getMenuCategories() {
359
        List<String> menuCategories = new LinkedList<String>();
359
        List<String> menuCategories = new LinkedList<>();
360
        BeanDescriptor bd = beanInfo.getBeanDescriptor();
360
        BeanDescriptor bd = beanInfo.getBeanDescriptor();
361
361
362
        // We don't want to show expert beans in the menus unless we're
362
        // We don't want to show expert beans in the menus unless we're
(-)a/src/core/org/apache/jmeter/testelement/AbstractScopedTestElement.java (-1 / +1 lines)
Lines 150-156 public abstract class AbstractScopedTestElement extends AbstractTestElement { Link Here
150
     * @return list containing the current sample and/or its child samples
150
     * @return list containing the current sample and/or its child samples
151
     */
151
     */
152
    protected List<SampleResult> getSampleList(SampleResult result) {
152
    protected List<SampleResult> getSampleList(SampleResult result) {
153
        List<SampleResult> sampleList = new ArrayList<SampleResult>();
153
        List<SampleResult> sampleList = new ArrayList<>();
154
154
155
        String scope = fetchScope();
155
        String scope = fetchScope();
156
        if (isScopeParent(scope) || isScopeAll(scope)) {
156
        if (isScopeParent(scope) || isScopeAll(scope)) {
(-)a/src/core/org/apache/jmeter/testelement/AbstractTestElement.java (-2 / +2 lines)
Lines 535-541 public abstract class AbstractTestElement implements TestElement, Serializable, Link Here
535
    @Override
535
    @Override
536
    public void setTemporary(JMeterProperty property) {
536
    public void setTemporary(JMeterProperty property) {
537
        if (temporaryProperties == null) {
537
        if (temporaryProperties == null) {
538
            temporaryProperties = new LinkedHashSet<JMeterProperty>();
538
            temporaryProperties = new LinkedHashSet<>();
539
        }
539
        }
540
        temporaryProperties.add(property);
540
        temporaryProperties.add(property);
541
        if (property instanceof MultiProperty) {
541
        if (property instanceof MultiProperty) {
Lines 629-635 public abstract class AbstractTestElement implements TestElement, Serializable, Link Here
629
     */
629
     */
630
    @Override
630
    @Override
631
    public List<String> getSearchableTokens() {
631
    public List<String> getSearchableTokens() {
632
        List<String> result = new ArrayList<String>(25);
632
        List<String> result = new ArrayList<>(25);
633
        PropertyIterator iterator = propertyIterator();
633
        PropertyIterator iterator = propertyIterator();
634
        while(iterator.hasNext()) {
634
        while(iterator.hasNext()) {
635
            JMeterProperty jMeterProperty = iterator.next();    
635
            JMeterProperty jMeterProperty = iterator.next();    
(-)a/src/core/org/apache/jmeter/testelement/TestPlan.java (-2 / +2 lines)
Lines 57-63 public class TestPlan extends AbstractTestElement implements Serializable, TestS Link Here
57
57
58
    private static final String BASEDIR = "basedir";
58
    private static final String BASEDIR = "basedir";
59
59
60
    private transient List<AbstractThreadGroup> threadGroups = new LinkedList<AbstractThreadGroup>();
60
    private transient List<AbstractThreadGroup> threadGroups = new LinkedList<>();
61
61
62
    // There's only 1 test plan, so can cache the mode here
62
    // There's only 1 test plan, so can cache the mode here
63
    private static volatile boolean functionalMode = false;
63
    private static volatile boolean functionalMode = false;
Lines 76-82 public class TestPlan extends AbstractTestElement implements Serializable, TestS Link Here
76
76
77
    // create transient item
77
    // create transient item
78
    private Object readResolve(){
78
    private Object readResolve(){
79
        threadGroups = new LinkedList<AbstractThreadGroup>();
79
        threadGroups = new LinkedList<>();
80
        return this;
80
        return this;
81
    }
81
    }
82
82
(-)a/src/core/org/apache/jmeter/testelement/VariablesCollection.java (-1 / +1 lines)
Lines 31-37 public class VariablesCollection implements Serializable { Link Here
31
31
32
    private static final long serialVersionUID = 240L;
32
    private static final long serialVersionUID = 240L;
33
33
34
    private final Map<String, JMeterVariables> varMap = new HashMap<String, JMeterVariables>();
34
    private final Map<String, JMeterVariables> varMap = new HashMap<>();
35
35
36
    public void addJMeterVariables(JMeterVariables jmVars) {
36
    public void addJMeterVariables(JMeterVariables jmVars) {
37
        varMap.put(Thread.currentThread().getName(), jmVars);
37
        varMap.put(Thread.currentThread().getName(), jmVars);
(-)a/src/core/org/apache/jmeter/testelement/property/CollectionProperty.java (-1 / +1 lines)
Lines 39-45 public class CollectionProperty extends MultiProperty { Link Here
39
39
40
    public CollectionProperty() {
40
    public CollectionProperty() {
41
        super();
41
        super();
42
        value = new ArrayList<JMeterProperty>();
42
        value = new ArrayList<>();
43
    }
43
    }
44
44
45
    @Override
45
    @Override
(-)a/src/core/org/apache/jmeter/threads/FindTestElementsUpToRootTraverser.java (-3 / +3 lines)
Lines 36-42 import org.apache.log.Logger; Link Here
36
public class FindTestElementsUpToRootTraverser implements HashTreeTraverser {
36
public class FindTestElementsUpToRootTraverser implements HashTreeTraverser {
37
    private static final Logger log = LoggingManager.getLoggerForClass();
37
    private static final Logger log = LoggingManager.getLoggerForClass();
38
38
39
    private final LinkedList<TestElement> stack = new LinkedList<TestElement>();
39
    private final LinkedList<TestElement> stack = new LinkedList<>();
40
40
41
    /**
41
    /**
42
     * Node to find in TestTree
42
     * Node to find in TestTree
Lines 89-96 public class FindTestElementsUpToRootTraverser implements HashTreeTraverser { Link Here
89
     * @return List of {@link Controller}
89
     * @return List of {@link Controller}
90
     */
90
     */
91
    public List<Controller> getControllersToRoot() {
91
    public List<Controller> getControllersToRoot() {
92
        List<Controller> result = new ArrayList<Controller>(stack.size());
92
        List<Controller> result = new ArrayList<>(stack.size());
93
        LinkedList<TestElement> stackLocalCopy = new LinkedList<TestElement>(stack);
93
        LinkedList<TestElement> stackLocalCopy = new LinkedList<>(stack);
94
        while(stackLocalCopy.size()>0) {
94
        while(stackLocalCopy.size()>0) {
95
            TestElement te = stackLocalCopy.getLast();
95
            TestElement te = stackLocalCopy.getLast();
96
            if(te instanceof Controller) {
96
            if(te instanceof Controller) {
(-)a/src/core/org/apache/jmeter/threads/JMeterContext.java (-1 / +1 lines)
Lines 52-58 public class JMeterContext { Link Here
52
52
53
    private boolean restartNextLoop = false;
53
    private boolean restartNextLoop = false;
54
54
55
    private ConcurrentHashMap<String, Object> samplerContext = new ConcurrentHashMap<String, Object>(5);
55
    private ConcurrentHashMap<String, Object> samplerContext = new ConcurrentHashMap<>(5);
56
56
57
    JMeterContext() {
57
    JMeterContext() {
58
        clear0();
58
        clear0();
(-)a/src/core/org/apache/jmeter/threads/JMeterThread.java (-2 / +2 lines)
Lines 140-146 public class JMeterThread implements Runnable, Interruptible { Link Here
140
        testTree = test;
140
        testTree = test;
141
        compiler = new TestCompiler(testTree);
141
        compiler = new TestCompiler(testTree);
142
        controller = (Controller) testTree.getArray()[0];
142
        controller = (Controller) testTree.getArray()[0];
143
        SearchByClass<TestIterationListener> threadListenerSearcher = new SearchByClass<TestIterationListener>(TestIterationListener.class); // TL - IS
143
        SearchByClass<TestIterationListener> threadListenerSearcher = new SearchByClass<>(TestIterationListener.class); // TL - IS
144
        test.traverse(threadListenerSearcher);
144
        test.traverse(threadListenerSearcher);
145
        testIterationStartListeners = threadListenerSearcher.getSearchResults();
145
        testIterationStartListeners = threadListenerSearcher.getSearchResults();
146
        notifier = note;
146
        notifier = note;
Lines 510-516 public class JMeterThread implements Runnable, Interruptible { Link Here
510
        List<SampleListener> sampleListeners = samplePack.getSampleListeners();
510
        List<SampleListener> sampleListeners = samplePack.getSampleListeners();
511
        // Do not send subsamples to listeners which receive the transaction sample
511
        // Do not send subsamples to listeners which receive the transaction sample
512
        if(transactionSampler != null) {
512
        if(transactionSampler != null) {
513
            ArrayList<SampleListener> onlySubSamplerListeners = new ArrayList<SampleListener>();
513
            ArrayList<SampleListener> onlySubSamplerListeners = new ArrayList<>();
514
            List<SampleListener> transListeners = transactionPack.getSampleListeners();
514
            List<SampleListener> transListeners = transactionPack.getSampleListeners();
515
            for(SampleListener listener : sampleListeners) {
515
            for(SampleListener listener : sampleListeners) {
516
                // Check if this instance is present in transaction listener list
516
                // Check if this instance is present in transaction listener list
(-)a/src/core/org/apache/jmeter/threads/JMeterVariables.java (-1 / +1 lines)
Lines 32-38 import org.apache.jmeter.util.JMeterUtils; Link Here
32
 * These are similar to properties, but they are local to a single thread.
32
 * These are similar to properties, but they are local to a single thread.
33
 */
33
 */
34
public class JMeterVariables {
34
public class JMeterVariables {
35
    private final Map<String, Object> variables = new HashMap<String, Object>();
35
    private final Map<String, Object> variables = new HashMap<>();
36
36
37
    private int iteration = 0;
37
    private int iteration = 0;
38
38
(-)a/src/core/org/apache/jmeter/threads/RemoteThreadsListenerImpl.java (-1 / +1 lines)
Lines 39-45 import org.apache.log.Logger; Link Here
39
public class RemoteThreadsListenerImpl extends UnicastRemoteObject implements
39
public class RemoteThreadsListenerImpl extends UnicastRemoteObject implements
40
        RemoteThreadsListener, ThreadListener {
40
        RemoteThreadsListener, ThreadListener {
41
    private static final Logger log = LoggingManager.getLoggerForClass();
41
    private static final Logger log = LoggingManager.getLoggerForClass();
42
    private final List<RemoteThreadsLifeCycleListener> listeners = new ArrayList<RemoteThreadsLifeCycleListener>();
42
    private final List<RemoteThreadsLifeCycleListener> listeners = new ArrayList<>();
43
43
44
    /**
44
    /**
45
     * 
45
     * 
(-)a/src/core/org/apache/jmeter/threads/TestCompiler.java (-20 / +20 lines)
Lines 76-89 public class TestCompiler implements HashTreeTraverser { Link Here
76
     * If the ObjectPair (child, parent) is present, then the child has been added.
76
     * If the ObjectPair (child, parent) is present, then the child has been added.
77
     * Otherwise, the child is added to the parent and the pair is added to the Set.
77
     * Otherwise, the child is added to the parent and the pair is added to the Set.
78
     */
78
     */
79
    private static final Set<ObjectPair> PAIRING = new HashSet<ObjectPair>();
79
    private static final Set<ObjectPair> PAIRING = new HashSet<>();
80
80
81
    private final LinkedList<TestElement> stack = new LinkedList<TestElement>();
81
    private final LinkedList<TestElement> stack = new LinkedList<>();
82
82
83
    private final Map<Sampler, SamplePackage> samplerConfigMap = new HashMap<Sampler, SamplePackage>();
83
    private final Map<Sampler, SamplePackage> samplerConfigMap = new HashMap<>();
84
84
85
    private final Map<TransactionController, SamplePackage> transactionControllerConfigMap =
85
    private final Map<TransactionController, SamplePackage> transactionControllerConfigMap =
86
        new HashMap<TransactionController, SamplePackage>();
86
            new HashMap<>();
87
87
88
    private final HashTree testTree;
88
    private final HashTree testTree;
89
89
Lines 204-220 public class TestCompiler implements HashTreeTraverser { Link Here
204
    }
204
    }
205
205
206
    private void saveSamplerConfigs(Sampler sam) {
206
    private void saveSamplerConfigs(Sampler sam) {
207
        List<ConfigTestElement> configs = new LinkedList<ConfigTestElement>();
207
        List<ConfigTestElement> configs = new LinkedList<>();
208
        List<Controller> controllers = new LinkedList<Controller>();
208
        List<Controller> controllers = new LinkedList<>();
209
        List<SampleListener> listeners = new LinkedList<SampleListener>();
209
        List<SampleListener> listeners = new LinkedList<>();
210
        List<Timer> timers = new LinkedList<Timer>();
210
        List<Timer> timers = new LinkedList<>();
211
        List<Assertion> assertions = new LinkedList<Assertion>();
211
        List<Assertion> assertions = new LinkedList<>();
212
        LinkedList<PostProcessor> posts = new LinkedList<PostProcessor>();
212
        LinkedList<PostProcessor> posts = new LinkedList<>();
213
        LinkedList<PreProcessor> pres = new LinkedList<PreProcessor>();
213
        LinkedList<PreProcessor> pres = new LinkedList<>();
214
        for (int i = stack.size(); i > 0; i--) {
214
        for (int i = stack.size(); i > 0; i--) {
215
            addDirectParentControllers(controllers, stack.get(i - 1));
215
            addDirectParentControllers(controllers, stack.get(i - 1));
216
            List<PreProcessor>  tempPre = new LinkedList<PreProcessor> ();
216
            List<PreProcessor>  tempPre = new LinkedList<>();
217
            List<PostProcessor> tempPost = new LinkedList<PostProcessor>();
217
            List<PostProcessor> tempPost = new LinkedList<>();
218
            for (Object item : testTree.list(stack.subList(0, i))) {
218
            for (Object item : testTree.list(stack.subList(0, i))) {
219
                if ((item instanceof ConfigTestElement)) {
219
                if ((item instanceof ConfigTestElement)) {
220
                    configs.add((ConfigTestElement) item);
220
                    configs.add((ConfigTestElement) item);
Lines 247-259 public class TestCompiler implements HashTreeTraverser { Link Here
247
    }
247
    }
248
248
249
    private void saveTransactionControllerConfigs(TransactionController tc) {
249
    private void saveTransactionControllerConfigs(TransactionController tc) {
250
        List<ConfigTestElement> configs = new LinkedList<ConfigTestElement>();
250
        List<ConfigTestElement> configs = new LinkedList<>();
251
        List<Controller> controllers = new LinkedList<Controller>();
251
        List<Controller> controllers = new LinkedList<>();
252
        List<SampleListener> listeners = new LinkedList<SampleListener>();
252
        List<SampleListener> listeners = new LinkedList<>();
253
        List<Timer> timers = new LinkedList<Timer>();
253
        List<Timer> timers = new LinkedList<>();
254
        List<Assertion> assertions = new LinkedList<Assertion>();
254
        List<Assertion> assertions = new LinkedList<>();
255
        LinkedList<PostProcessor> posts = new LinkedList<PostProcessor>();
255
        LinkedList<PostProcessor> posts = new LinkedList<>();
256
        LinkedList<PreProcessor> pres = new LinkedList<PreProcessor>();
256
        LinkedList<PreProcessor> pres = new LinkedList<>();
257
        for (int i = stack.size(); i > 0; i--) {
257
        for (int i = stack.size(); i > 0; i--) {
258
            addDirectParentControllers(controllers, stack.get(i - 1));
258
            addDirectParentControllers(controllers, stack.get(i - 1));
259
            for (Object item : testTree.list(stack.subList(0, i))) {
259
            for (Object item : testTree.list(stack.subList(0, i))) {
(-)a/src/core/org/apache/jmeter/threads/ThreadGroup.java (-1 / +1 lines)
Lines 77-83 public class ThreadGroup extends AbstractThreadGroup { Link Here
77
    private transient Thread threadStarter;
77
    private transient Thread threadStarter;
78
78
79
    // List of active threads
79
    // List of active threads
80
    private final Map<JMeterThread, Thread> allThreads = new ConcurrentHashMap<JMeterThread, Thread>();
80
    private final Map<JMeterThread, Thread> allThreads = new ConcurrentHashMap<>();
81
81
82
    /**
82
    /**
83
     * Is test (still) running?
83
     * Is test (still) running?
(-)a/src/core/org/apache/jmeter/util/JMeterUtils.java (-6 / +6 lines)
Lines 83-89 public class JMeterUtils implements UnitTestManager { Link Here
83
83
84
    private static volatile Properties appProperties;
84
    private static volatile Properties appProperties;
85
85
86
    private static final Vector<LocaleChangeListener> localeChangeListeners = new Vector<LocaleChangeListener>();
86
    private static final Vector<LocaleChangeListener> localeChangeListeners = new Vector<>();
87
87
88
    private static volatile Locale locale;
88
    private static volatile Locale locale;
89
89
Lines 668-674 public class JMeterUtils implements UnitTestManager { Link Here
668
    // TODO - does not appear to be called directly
668
    // TODO - does not appear to be called directly
669
    public static Vector<Object> getControllers(Properties properties) {
669
    public static Vector<Object> getControllers(Properties properties) {
670
        String name = "controller."; // $NON-NLS-1$
670
        String name = "controller."; // $NON-NLS-1$
671
        Vector<Object> v = new Vector<Object>();
671
        Vector<Object> v = new Vector<>();
672
        Enumeration<?> names = properties.keys();
672
        Enumeration<?> names = properties.keys();
673
        while (names.hasMoreElements()) {
673
        while (names.hasMoreElements()) {
674
            String prop = (String) names.nextElement();
674
            String prop = (String) names.nextElement();
Lines 735-741 public class JMeterUtils implements UnitTestManager { Link Here
735
     * @return The Vector value
735
     * @return The Vector value
736
     */
736
     */
737
    public static Vector<String> getVector(Properties properties, String name) {
737
    public static Vector<String> getVector(Properties properties, String name) {
738
        Vector<String> v = new Vector<String>();
738
        Vector<String> v = new Vector<>();
739
        Enumeration<?> names = properties.keys();
739
        Enumeration<?> names = properties.keys();
740
        while (names.hasMoreElements()) {
740
        while (names.hasMoreElements()) {
741
            String prop = (String) names.nextElement();
741
            String prop = (String) names.nextElement();
Lines 767-773 public class JMeterUtils implements UnitTestManager { Link Here
767
     *         the prefix removed
767
     *         the prefix removed
768
     */
768
     */
769
    public static Hashtable<String, String> getHashtable(Properties properties, String prefix) {
769
    public static Hashtable<String, String> getHashtable(Properties properties, String prefix) {
770
        Hashtable<String, String> t = new Hashtable<String, String>();
770
        Hashtable<String, String> t = new Hashtable<>();
771
        Enumeration<?> names = properties.keys();
771
        Enumeration<?> names = properties.keys();
772
        final int length = prefix.length();
772
        final int length = prefix.length();
773
        while (names.hasMoreElements()) {
773
        while (names.hasMoreElements()) {
Lines 970-976 public class JMeterUtils implements UnitTestManager { Link Here
970
     * @return Description of the Returned Value
970
     * @return Description of the Returned Value
971
     */
971
     */
972
    public static Vector<Object> instantiate(Vector<String> v, String className) {
972
    public static Vector<Object> instantiate(Vector<String> v, String className) {
973
        Vector<Object> i = new Vector<Object>();
973
        Vector<Object> i = new Vector<>();
974
        try {
974
        try {
975
            Class<?> c = Class.forName(className);
975
            Class<?> c = Class.forName(className);
976
            Enumeration<String> elements = v.elements();
976
            Enumeration<String> elements = v.elements();
Lines 1289-1295 public class JMeterUtils implements UnitTestManager { Link Here
1289
     * @return a map name/value for each header
1289
     * @return a map name/value for each header
1290
     */
1290
     */
1291
    public static LinkedHashMap<String, String> parseHeaders(String headers) {
1291
    public static LinkedHashMap<String, String> parseHeaders(String headers) {
1292
        LinkedHashMap<String, String> linkedHeaders = new LinkedHashMap<String, String>();
1292
        LinkedHashMap<String, String> linkedHeaders = new LinkedHashMap<>();
1293
        String[] list = headers.split("\n"); // $NON-NLS-1$
1293
        String[] list = headers.split("\n"); // $NON-NLS-1$
1294
        for (String header : list) {
1294
        for (String header : list) {
1295
            int colon = header.indexOf(':'); // $NON-NLS-1$
1295
            int colon = header.indexOf(':'); // $NON-NLS-1$
(-)a/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java (-1 / +1 lines)
Lines 41-47 public abstract class JSR223BeanInfoSupport extends ScriptingBeanInfoSupport { Link Here
41
    public static final String[][] LANGUAGE_NAMES;
41
    public static final String[][] LANGUAGE_NAMES;
42
42
43
    static {
43
    static {
44
        Map<String, ScriptEngineFactory> nameMap = new HashMap<String, ScriptEngineFactory>();
44
        Map<String, ScriptEngineFactory> nameMap = new HashMap<>();
45
        ScriptEngineManager sem = new ScriptEngineManager();
45
        ScriptEngineManager sem = new ScriptEngineManager();
46
        final List<ScriptEngineFactory> engineFactories = sem.getEngineFactories();
46
        final List<ScriptEngineFactory> engineFactories = sem.getEngineFactories();
47
        for(ScriptEngineFactory fact : engineFactories){
47
        for(ScriptEngineFactory fact : engineFactories){
(-)a/src/core/org/apache/jmeter/util/JsseSSLManager.java (-1 / +1 lines)
Lines 112-118 public class JsseSSLManager extends SSLManager { Link Here
112
                log.debug("Creating shared context");
112
                log.debug("Creating shared context");
113
                this.defaultContext = createContext();
113
                this.defaultContext = createContext();
114
            } else {
114
            } else {
115
                this.threadlocal = new ThreadLocal<SSLContext>();
115
                this.threadlocal = new ThreadLocal<>();
116
            }
116
            }
117
117
118
            HttpsURLConnection.setDefaultSSLSocketFactory(new HttpSSLProtocolSocketFactory(this, CPS));
118
            HttpsURLConnection.setDefaultSSLSocketFactory(new HttpSSLProtocolSocketFactory(this, CPS));
(-)a/src/core/org/apache/jmeter/util/PropertiesBasedPrefixResolver.java (-1 / +1 lines)
Lines 41-47 import org.w3c.dom.Node; Link Here
41
public class PropertiesBasedPrefixResolver extends PrefixResolverDefault {
41
public class PropertiesBasedPrefixResolver extends PrefixResolverDefault {
42
    private static final Logger logger = LoggingManager.getLoggerForClass();
42
    private static final Logger logger = LoggingManager.getLoggerForClass();
43
    private static final String XPATH_NAMESPACE_CONFIG = "xpath.namespace.config";
43
    private static final String XPATH_NAMESPACE_CONFIG = "xpath.namespace.config";
44
    private static final Map<String, String> NAMESPACE_MAP = new HashMap<String, String>();
44
    private static final Map<String, String> NAMESPACE_MAP = new HashMap<>();
45
    static {
45
    static {
46
        String pathToNamespaceConfig = JMeterUtils.getPropDefault(XPATH_NAMESPACE_CONFIG, "");
46
        String pathToNamespaceConfig = JMeterUtils.getPropDefault(XPATH_NAMESPACE_CONFIG, "");
47
        if(!StringUtils.isEmpty(pathToNamespaceConfig)) {
47
        if(!StringUtils.isEmpty(pathToNamespaceConfig)) {
(-)a/src/core/org/apache/jmeter/util/keystore/JmeterKeyStore.java (-5 / +5 lines)
Lines 59-66 public final class JmeterKeyStore { Link Here
59
    private String clientCertAliasVarName;
59
    private String clientCertAliasVarName;
60
60
61
    private String[] names = new String[0]; // default empty array to prevent NPEs
61
    private String[] names = new String[0]; // default empty array to prevent NPEs
62
    private Map<String, PrivateKey> privateKeyByAlias = new HashMap<String, PrivateKey>();
62
    private Map<String, PrivateKey> privateKeyByAlias = new HashMap<>();
63
    private Map<String, X509Certificate[]> certsByAlias = new HashMap<String, X509Certificate[]>();
63
    private Map<String, X509Certificate[]> certsByAlias = new HashMap<>();
64
64
65
    //@GuardedBy("this")
65
    //@GuardedBy("this")
66
    private int last_user;
66
    private int last_user;
Lines 114-122 public final class JmeterKeyStore { Link Here
114
        char pw[] = pword==null ? null : pword.toCharArray();
114
        char pw[] = pword==null ? null : pword.toCharArray();
115
        store.load(is, pw);
115
        store.load(is, pw);
116
    
116
    
117
        ArrayList<String> v_names = new ArrayList<String>();
117
        ArrayList<String> v_names = new ArrayList<>();
118
        this.privateKeyByAlias = new HashMap<String, PrivateKey>();
118
        this.privateKeyByAlias = new HashMap<>();
119
        this.certsByAlias = new HashMap<String, X509Certificate[]>();
119
        this.certsByAlias = new HashMap<>();
120
120
121
        if (null != is){ // No point checking an empty keystore
121
        if (null != is){ // No point checking an empty keystore
122
            PrivateKey _key = null;
122
            PrivateKey _key = null;
(-)a/src/functions/org/apache/jmeter/functions/AbstractHostIPName.java (-1 / +1 lines)
Lines 30-36 import org.apache.jmeter.util.JMeterUtils; Link Here
30
30
31
abstract class AbstractHostIPName extends AbstractFunction {
31
abstract class AbstractHostIPName extends AbstractFunction {
32
32
33
    private static final List<String> desc = new LinkedList<String>();
33
    private static final List<String> desc = new LinkedList<>();
34
34
35
    static {
35
    static {
36
        // desc.add("Use fully qualified host name: TRUE/FALSE (Default FALSE)");
36
        // desc.add("Use fully qualified host name: TRUE/FALSE (Default FALSE)");
(-)a/src/functions/org/apache/jmeter/functions/BeanShell.java (-1 / +1 lines)
Lines 41-47 public class BeanShell extends AbstractFunction { Link Here
41
41
42
    private static final Logger log = LoggingManager.getLoggerForClass();
42
    private static final Logger log = LoggingManager.getLoggerForClass();
43
43
44
    private static final List<String> desc = new LinkedList<String>();
44
    private static final List<String> desc = new LinkedList<>();
45
45
46
    private static final String KEY = "__BeanShell"; //$NON-NLS-1$
46
    private static final String KEY = "__BeanShell"; //$NON-NLS-1$
47
47
(-)a/src/functions/org/apache/jmeter/functions/CSVRead.java (-1 / +1 lines)
Lines 55-61 public class CSVRead extends AbstractFunction { Link Here
55
55
56
    private static final String KEY = "__CSVRead"; // Function name //$NON-NLS-1$
56
    private static final String KEY = "__CSVRead"; // Function name //$NON-NLS-1$
57
57
58
    private static final List<String> desc = new LinkedList<String>();
58
    private static final List<String> desc = new LinkedList<>();
59
59
60
    private Object[] values; // Parameter list
60
    private Object[] values; // Parameter list
61
61
(-)a/src/functions/org/apache/jmeter/functions/CharFunction.java (-1 / +1 lines)
Lines 37-43 public class CharFunction extends AbstractFunction { Link Here
37
37
38
    private static final Logger log = LoggingManager.getLoggerForClass();
38
    private static final Logger log = LoggingManager.getLoggerForClass();
39
39
40
    private static final List<String> desc = new LinkedList<String>();
40
    private static final List<String> desc = new LinkedList<>();
41
41
42
    private static final String KEY = "__char"; //$NON-NLS-1$
42
    private static final String KEY = "__char"; //$NON-NLS-1$
43
43
(-)a/src/functions/org/apache/jmeter/functions/EscapeHtml.java (-1 / +1 lines)
Lines 49-55 import org.apache.jmeter.util.JMeterUtils; Link Here
49
 */
49
 */
50
public class EscapeHtml extends AbstractFunction {
50
public class EscapeHtml extends AbstractFunction {
51
51
52
    private static final List<String> desc = new LinkedList<String>();
52
    private static final List<String> desc = new LinkedList<>();
53
53
54
    private static final String KEY = "__escapeHtml"; //$NON-NLS-1$
54
    private static final String KEY = "__escapeHtml"; //$NON-NLS-1$
55
55
(-)a/src/functions/org/apache/jmeter/functions/EscapeOroRegexpChars.java (-1 / +1 lines)
Lines 38-44 import org.apache.oro.text.regex.Perl5Compiler; Link Here
38
public class EscapeOroRegexpChars extends AbstractFunction {
38
public class EscapeOroRegexpChars extends AbstractFunction {
39
    private static final Logger log = LoggingManager.getLoggerForClass();
39
    private static final Logger log = LoggingManager.getLoggerForClass();
40
40
41
    private static final List<String> desc = new LinkedList<String>();
41
    private static final List<String> desc = new LinkedList<>();
42
42
43
    private static final String KEY = "__escapeOroRegexpChars"; //$NON-NLS-1$
43
    private static final String KEY = "__escapeOroRegexpChars"; //$NON-NLS-1$
44
44
(-)a/src/functions/org/apache/jmeter/functions/EvalFunction.java (-1 / +1 lines)
Lines 39-45 import org.apache.jmeter.util.JMeterUtils; Link Here
39
 */
39
 */
40
public class EvalFunction extends AbstractFunction {
40
public class EvalFunction extends AbstractFunction {
41
41
42
    private static final List<String> desc = new LinkedList<String>();
42
    private static final List<String> desc = new LinkedList<>();
43
43
44
    private static final String KEY = "__eval"; //$NON-NLS-1$
44
    private static final String KEY = "__eval"; //$NON-NLS-1$
45
45
(-)a/src/functions/org/apache/jmeter/functions/EvalVarFunction.java (-1 / +1 lines)
Lines 44-50 public class EvalVarFunction extends AbstractFunction { Link Here
44
44
45
    private static final Logger log = LoggingManager.getLoggerForClass();
45
    private static final Logger log = LoggingManager.getLoggerForClass();
46
46
47
    private static final List<String> desc = new LinkedList<String>();
47
    private static final List<String> desc = new LinkedList<>();
48
48
49
    private static final String KEY = "__evalVar"; //$NON-NLS-1$
49
    private static final String KEY = "__evalVar"; //$NON-NLS-1$
50
50
(-)a/src/functions/org/apache/jmeter/functions/FileRowColContainer.java (-3 / +3 lines)
Lines 58-64 public class FileRowColContainer { Link Here
58
        fileName = file;
58
        fileName = file;
59
        delimiter = delim;
59
        delimiter = delim;
60
        nextRow = 0;
60
        nextRow = 0;
61
        fileData = new ArrayList<List<String>>();
61
        fileData = new ArrayList<>();
62
        load();
62
        load();
63
    }
63
    }
64
64
Lines 67-73 public class FileRowColContainer { Link Here
67
        fileName = file;
67
        fileName = file;
68
        delimiter = DELIMITER;
68
        delimiter = DELIMITER;
69
        nextRow = 0;
69
        nextRow = 0;
70
        fileData = new ArrayList<List<String>>();
70
        fileData = new ArrayList<>();
71
        load();
71
        load();
72
    }
72
    }
73
73
Lines 144-150 public class FileRowColContainer { Link Here
144
     *         the line
144
     *         the line
145
     */
145
     */
146
    private static List<String> splitLine(String theLine, String delim) {
146
    private static List<String> splitLine(String theLine, String delim) {
147
        ArrayList<String> result = new ArrayList<String>();
147
        ArrayList<String> result = new ArrayList<>();
148
        StringTokenizer tokener = new StringTokenizer(theLine, delim, true);
148
        StringTokenizer tokener = new StringTokenizer(theLine, delim, true);
149
        /*
149
        /*
150
         * the beginning of the line is a "delimiter" so that ,a,b,c returns ""
150
         * the beginning of the line is a "delimiter" so that ,a,b,c returns ""
(-)a/src/functions/org/apache/jmeter/functions/FileToString.java (-1 / +1 lines)
Lines 51-57 import org.apache.log.Logger; Link Here
51
public class FileToString extends AbstractFunction {
51
public class FileToString extends AbstractFunction {
52
    private static final Logger log = LoggingManager.getLoggerForClass();
52
    private static final Logger log = LoggingManager.getLoggerForClass();
53
53
54
    private static final List<String> desc = new LinkedList<String>();
54
    private static final List<String> desc = new LinkedList<>();
55
55
56
    private static final String KEY = "__FileToString";//$NON-NLS-1$
56
    private static final String KEY = "__FileToString";//$NON-NLS-1$
57
57
(-)a/src/functions/org/apache/jmeter/functions/FileWrapper.java (-3 / +2 lines)
Lines 48-62 public final class FileWrapper { Link Here
48
     * - maps file names to  containers
48
     * - maps file names to  containers
49
     * - ensures only one container per file across all threads
49
     * - ensures only one container per file across all threads
50
     */
50
     */
51
    private static final Map<String, FileRowColContainer> fileContainers =
51
    private static final Map<String, FileRowColContainer> fileContainers = new HashMap<>();
52
        new HashMap<String, FileRowColContainer>();
53
52
54
    /* The cache of file packs - used to improve thread access */
53
    /* The cache of file packs - used to improve thread access */
55
    private static final ThreadLocal<Map<String, FileWrapper>> filePacks = 
54
    private static final ThreadLocal<Map<String, FileWrapper>> filePacks = 
56
        new ThreadLocal<Map<String, FileWrapper>>() {
55
        new ThreadLocal<Map<String, FileWrapper>>() {
57
        @Override
56
        @Override
58
        protected Map<String, FileWrapper> initialValue() {
57
        protected Map<String, FileWrapper> initialValue() {
59
            return new HashMap<String, FileWrapper>();
58
            return new HashMap<>();
60
        }
59
        }
61
    };
60
    };
62
61
(-)a/src/functions/org/apache/jmeter/functions/IntSum.java (-1 / +1 lines)
Lines 35-41 import org.apache.jmeter.util.JMeterUtils; Link Here
35
 * @since 1.8.1
35
 * @since 1.8.1
36
 */
36
 */
37
public class IntSum extends AbstractFunction {
37
public class IntSum extends AbstractFunction {
38
    private static final List<String> desc = new LinkedList<String>();
38
    private static final List<String> desc = new LinkedList<>();
39
39
40
    private static final String KEY = "__intSum"; //$NON-NLS-1$
40
    private static final String KEY = "__intSum"; //$NON-NLS-1$
41
41
(-)a/src/functions/org/apache/jmeter/functions/IterationCounter.java (-1 / +1 lines)
Lines 35-41 import org.apache.jmeter.util.JMeterUtils; Link Here
35
 */
35
 */
36
public class IterationCounter extends AbstractFunction {
36
public class IterationCounter extends AbstractFunction {
37
37
38
    private static final List<String> desc = new LinkedList<String>();
38
    private static final List<String> desc = new LinkedList<>();
39
39
40
    private static final String KEY = "__counter"; //$NON-NLS-1$
40
    private static final String KEY = "__counter"; //$NON-NLS-1$
41
41
(-)a/src/functions/org/apache/jmeter/functions/JavaScript.java (-1 / +1 lines)
Lines 41-47 import org.mozilla.javascript.Scriptable; Link Here
41
 */
41
 */
42
public class JavaScript extends AbstractFunction {
42
public class JavaScript extends AbstractFunction {
43
43
44
    private static final List<String> desc = new LinkedList<String>();
44
    private static final List<String> desc = new LinkedList<>();
45
45
46
    private static final String KEY = "__javaScript"; //$NON-NLS-1$
46
    private static final String KEY = "__javaScript"; //$NON-NLS-1$
47
47
(-)a/src/functions/org/apache/jmeter/functions/Jexl2Function.java (-2 / +2 lines)
Lines 46-54 public class Jexl2Function extends AbstractFunction implements ThreadListener { Link Here
46
46
47
    private static final String KEY = "__jexl2"; //$NON-NLS-1$
47
    private static final String KEY = "__jexl2"; //$NON-NLS-1$
48
48
49
    private static final List<String> desc = new LinkedList<String>();
49
    private static final List<String> desc = new LinkedList<>();
50
50
51
    private static final ThreadLocal<JexlEngine> threadLocalJexl = new ThreadLocal<JexlEngine>();
51
    private static final ThreadLocal<JexlEngine> threadLocalJexl = new ThreadLocal<>();
52
52
53
    static
53
    static
54
    {
54
    {
(-)a/src/functions/org/apache/jmeter/functions/JexlFunction.java (-1 / +1 lines)
Lines 46-52 public class JexlFunction extends AbstractFunction { Link Here
46
46
47
    private static final String KEY = "__jexl"; //$NON-NLS-1$
47
    private static final String KEY = "__jexl"; //$NON-NLS-1$
48
48
49
    private static final List<String> desc = new LinkedList<String>();
49
    private static final List<String> desc = new LinkedList<>();
50
50
51
    static
51
    static
52
    {
52
    {
(-)a/src/functions/org/apache/jmeter/functions/LogFunction.java (-1 / +1 lines)
Lines 49-55 import org.apache.log.Priority; Link Here
49
public class LogFunction extends AbstractFunction {
49
public class LogFunction extends AbstractFunction {
50
    private static final Logger log = LoggingManager.getLoggerForClass();
50
    private static final Logger log = LoggingManager.getLoggerForClass();
51
51
52
    private static final List<String> desc = new LinkedList<String>();
52
    private static final List<String> desc = new LinkedList<>();
53
53
54
    private static final String KEY = "__log"; //$NON-NLS-1$
54
    private static final String KEY = "__log"; //$NON-NLS-1$
55
55
(-)a/src/functions/org/apache/jmeter/functions/LogFunction2.java (-1 / +1 lines)
Lines 47-53 import org.apache.log.Logger; Link Here
47
public class LogFunction2 extends AbstractFunction {
47
public class LogFunction2 extends AbstractFunction {
48
    private static final Logger log = LoggingManager.getLoggerForClass();
48
    private static final Logger log = LoggingManager.getLoggerForClass();
49
49
50
    private static final List<String> desc = new LinkedList<String>();
50
    private static final List<String> desc = new LinkedList<>();
51
51
52
    private static final String KEY = "__logn"; //$NON-NLS-1$
52
    private static final String KEY = "__logn"; //$NON-NLS-1$
53
53
(-)a/src/functions/org/apache/jmeter/functions/LongSum.java (-1 / +1 lines)
Lines 35-41 import org.apache.jmeter.util.JMeterUtils; Link Here
35
 */
35
 */
36
public class LongSum extends AbstractFunction {
36
public class LongSum extends AbstractFunction {
37
37
38
    private static final List<String> desc = new LinkedList<String>();
38
    private static final List<String> desc = new LinkedList<>();
39
39
40
    private static final String KEY = "__longSum"; //$NON-NLS-1$
40
    private static final String KEY = "__longSum"; //$NON-NLS-1$
41
41
(-)a/src/functions/org/apache/jmeter/functions/Property.java (-1 / +1 lines)
Lines 44-50 import org.apache.jmeter.util.JMeterUtils; Link Here
44
 */
44
 */
45
public class Property extends AbstractFunction {
45
public class Property extends AbstractFunction {
46
46
47
    private static final List<String> desc = new LinkedList<String>();
47
    private static final List<String> desc = new LinkedList<>();
48
48
49
    private static final String KEY = "__property"; //$NON-NLS-1$
49
    private static final String KEY = "__property"; //$NON-NLS-1$
50
50
(-)a/src/functions/org/apache/jmeter/functions/Property2.java (-1 / +1 lines)
Lines 49-55 import org.apache.jmeter.util.JMeterUtils; Link Here
49
 */
49
 */
50
public class Property2 extends AbstractFunction {
50
public class Property2 extends AbstractFunction {
51
51
52
    private static final List<String> desc = new LinkedList<String>();
52
    private static final List<String> desc = new LinkedList<>();
53
53
54
    private static final String KEY = "__P"; //$NON-NLS-1$
54
    private static final String KEY = "__P"; //$NON-NLS-1$
55
55
(-)a/src/functions/org/apache/jmeter/functions/Random.java (-1 / +1 lines)
Lines 36-42 import org.apache.jmeter.util.JMeterUtils; Link Here
36
 */
36
 */
37
public class Random extends AbstractFunction {
37
public class Random extends AbstractFunction {
38
38
39
    private static final List<String> desc = new LinkedList<String>();
39
    private static final List<String> desc = new LinkedList<>();
40
    private static final String KEY = "__Random"; //$NON-NLS-1$
40
    private static final String KEY = "__Random"; //$NON-NLS-1$
41
41
42
    static {
42
    static {
(-)a/src/functions/org/apache/jmeter/functions/RandomString.java (-1 / +1 lines)
Lines 40-46 import org.apache.log.Logger; Link Here
40
public class RandomString extends AbstractFunction {
40
public class RandomString extends AbstractFunction {
41
    private static final Logger log = LoggingManager.getLoggerForClass();
41
    private static final Logger log = LoggingManager.getLoggerForClass();
42
42
43
    private static final List<String> desc = new LinkedList<String>();
43
    private static final List<String> desc = new LinkedList<>();
44
44
45
    private static final String KEY = "__RandomString"; //$NON-NLS-1$
45
    private static final String KEY = "__RandomString"; //$NON-NLS-1$
46
46
(-)a/src/functions/org/apache/jmeter/functions/RegexFunction.java (-4 / +4 lines)
Lines 57-63 public class RegexFunction extends AbstractFunction { Link Here
57
57
58
    private Object[] values;// Parameters are stored here
58
    private Object[] values;// Parameters are stored here
59
59
60
    private static final List<String> desc = new LinkedList<String>();
60
    private static final List<String> desc = new LinkedList<>();
61
61
62
    private static final String TEMPLATE_PATTERN = "\\$(\\d+)\\$";  //$NON-NLS-1$
62
    private static final String TEMPLATE_PATTERN = "\\$(\\d+)\\$";  //$NON-NLS-1$
63
    /** initialised to the regex \$(\d+)\$ */
63
    /** initialised to the regex \$(\d+)\$ */
Lines 151-157 public class RegexFunction extends AbstractFunction { Link Here
151
            return defaultValue;
151
            return defaultValue;
152
        }
152
        }
153
153
154
        List<MatchResult> collectAllMatches = new ArrayList<MatchResult>();
154
        List<MatchResult> collectAllMatches = new ArrayList<>();
155
        try {
155
        try {
156
            PatternMatcher matcher = JMeterUtils.getMatcher();
156
            PatternMatcher matcher = JMeterUtils.getMatcher();
157
            PatternMatcherInput input = new PatternMatcherInput(textToMatch);
157
            PatternMatcherInput input = new PatternMatcherInput(textToMatch);
Lines 246-254 public class RegexFunction extends AbstractFunction { Link Here
246
    }
246
    }
247
247
248
    private Object[] generateTemplate(String rawTemplate) {
248
    private Object[] generateTemplate(String rawTemplate) {
249
        List<String> pieces = new ArrayList<String>();
249
        List<String> pieces = new ArrayList<>();
250
        // String or Integer
250
        // String or Integer
251
        List<Object> combined = new LinkedList<Object>();
251
        List<Object> combined = new LinkedList<>();
252
        PatternMatcher matcher = JMeterUtils.getMatcher();
252
        PatternMatcher matcher = JMeterUtils.getMatcher();
253
        Util.split(pieces, matcher, templatePattern, rawTemplate);
253
        Util.split(pieces, matcher, templatePattern, rawTemplate);
254
        PatternMatcherInput input = new PatternMatcherInput(rawTemplate);
254
        PatternMatcherInput input = new PatternMatcherInput(rawTemplate);
(-)a/src/functions/org/apache/jmeter/functions/SamplerName.java (-1 / +1 lines)
Lines 36-42 public class SamplerName extends AbstractFunction { Link Here
36
36
37
    private static final String KEY = "__samplerName"; //$NON-NLS-1$
37
    private static final String KEY = "__samplerName"; //$NON-NLS-1$
38
38
39
    private static final List<String> desc = new LinkedList<String>();
39
    private static final List<String> desc = new LinkedList<>();
40
40
41
    static {
41
    static {
42
        // desc.add("Use fully qualified host name: TRUE/FALSE (Default FALSE)");
42
        // desc.add("Use fully qualified host name: TRUE/FALSE (Default FALSE)");
(-)a/src/functions/org/apache/jmeter/functions/SetProperty.java (-1 / +1 lines)
Lines 43-49 import org.apache.jmeter.util.JMeterUtils; Link Here
43
 */
43
 */
44
public class SetProperty extends AbstractFunction {
44
public class SetProperty extends AbstractFunction {
45
45
46
    private static final List<String> desc = new LinkedList<String>();
46
    private static final List<String> desc = new LinkedList<>();
47
47
48
    private static final String KEY = "__setProperty"; //$NON-NLS-1$
48
    private static final String KEY = "__setProperty"; //$NON-NLS-1$
49
49
(-)a/src/functions/org/apache/jmeter/functions/SplitFunction.java (-1 / +1 lines)
Lines 57-63 import org.apache.log.Logger; Link Here
57
public class SplitFunction extends AbstractFunction {
57
public class SplitFunction extends AbstractFunction {
58
    private static final Logger log = LoggingManager.getLoggerForClass();
58
    private static final Logger log = LoggingManager.getLoggerForClass();
59
59
60
    private static final List<String> desc = new LinkedList<String>();
60
    private static final List<String> desc = new LinkedList<>();
61
61
62
    private static final String KEY = "__split";// $NON-NLS-1$
62
    private static final String KEY = "__split";// $NON-NLS-1$
63
63
(-)a/src/functions/org/apache/jmeter/functions/StringFromFile.java (-1 / +1 lines)
Lines 67-73 public class StringFromFile extends AbstractFunction implements TestStateListene Link Here
67
    private static final Logger log = LoggingManager.getLoggerForClass();
67
    private static final Logger log = LoggingManager.getLoggerForClass();
68
68
69
    // Only modified by static block so no need to synchronize subsequent read-only access
69
    // Only modified by static block so no need to synchronize subsequent read-only access
70
    private static final List<String> desc = new LinkedList<String>();
70
    private static final List<String> desc = new LinkedList<>();
71
71
72
    private static final String KEY = "__StringFromFile";//$NON-NLS-1$
72
    private static final String KEY = "__StringFromFile";//$NON-NLS-1$
73
73
(-)a/src/functions/org/apache/jmeter/functions/TestPlanName.java (-1 / +1 lines)
Lines 33-39 import org.apache.jmeter.services.FileServer; Link Here
33
 */
33
 */
34
public class TestPlanName extends AbstractFunction {
34
public class TestPlanName extends AbstractFunction {
35
35
36
    private static final List<String> desc = new LinkedList<String>();
36
    private static final List<String> desc = new LinkedList<>();
37
37
38
    private static final String KEY = "__TestPlanName"; //$NON-NLS-1$
38
    private static final String KEY = "__TestPlanName"; //$NON-NLS-1$
39
39
(-)a/src/functions/org/apache/jmeter/functions/ThreadNumber.java (-1 / +1 lines)
Lines 34-40 public class ThreadNumber extends AbstractFunction { Link Here
34
34
35
    private static final String KEY = "__threadNum"; //$NON-NLS-1$
35
    private static final String KEY = "__threadNum"; //$NON-NLS-1$
36
36
37
    private static final List<String> desc = new LinkedList<String>();
37
    private static final List<String> desc = new LinkedList<>();
38
38
39
    /** {@inheritDoc} */
39
    /** {@inheritDoc} */
40
    @Override
40
    @Override
(-)a/src/functions/org/apache/jmeter/functions/TimeFunction.java (-2 / +2 lines)
Lines 42-51 public class TimeFunction extends AbstractFunction { Link Here
42
42
43
    private static final String KEY = "__time"; // $NON-NLS-1$
43
    private static final String KEY = "__time"; // $NON-NLS-1$
44
44
45
    private static final List<String> desc = new LinkedList<String>();
45
    private static final List<String> desc = new LinkedList<>();
46
46
47
    // Only modified in class init
47
    // Only modified in class init
48
    private static final Map<String, String> aliases = new HashMap<String, String>();
48
    private static final Map<String, String> aliases = new HashMap<>();
49
49
50
    static {
50
    static {
51
        desc.add(JMeterUtils.getResString("time_format")); //$NON-NLS-1$
51
        desc.add(JMeterUtils.getResString("time_format")); //$NON-NLS-1$
(-)a/src/functions/org/apache/jmeter/functions/UnEscape.java (-1 / +1 lines)
Lines 39-45 import org.apache.jmeter.util.JMeterUtils; Link Here
39
 */
39
 */
40
public class UnEscape extends AbstractFunction {
40
public class UnEscape extends AbstractFunction {
41
41
42
    private static final List<String> desc = new LinkedList<String>();
42
    private static final List<String> desc = new LinkedList<>();
43
43
44
    private static final String KEY = "__unescape"; //$NON-NLS-1$
44
    private static final String KEY = "__unescape"; //$NON-NLS-1$
45
45
(-)a/src/functions/org/apache/jmeter/functions/UnEscapeHtml.java (-1 / +1 lines)
Lines 45-51 import org.apache.jmeter.util.JMeterUtils; Link Here
45
 */
45
 */
46
public class UnEscapeHtml extends AbstractFunction {
46
public class UnEscapeHtml extends AbstractFunction {
47
47
48
    private static final List<String> desc = new LinkedList<String>();
48
    private static final List<String> desc = new LinkedList<>();
49
49
50
    private static final String KEY = "__unescapeHtml"; //$NON-NLS-1$
50
    private static final String KEY = "__unescapeHtml"; //$NON-NLS-1$
51
51
(-)a/src/functions/org/apache/jmeter/functions/UrlDecode.java (-1 / +1 lines)
Lines 39-45 public class UrlDecode extends AbstractFunction { Link Here
39
39
40
    private static final String CHARSET_ENCODING = "UTF-8"; //$NON-NLS-1$
40
    private static final String CHARSET_ENCODING = "UTF-8"; //$NON-NLS-1$
41
    
41
    
42
    private static final List<String> desc = new LinkedList<String>();
42
    private static final List<String> desc = new LinkedList<>();
43
43
44
    private static final String KEY = "__urldecode"; //$NON-NLS-1$
44
    private static final String KEY = "__urldecode"; //$NON-NLS-1$
45
45
(-)a/src/functions/org/apache/jmeter/functions/UrlEncode.java (-1 / +1 lines)
Lines 39-45 public class UrlEncode extends AbstractFunction { Link Here
39
39
40
    private static final String CHARSET_ENCODING = "UTF-8"; //$NON-NLS-1$
40
    private static final String CHARSET_ENCODING = "UTF-8"; //$NON-NLS-1$
41
    
41
    
42
    private static final List<String> desc = new LinkedList<String>();
42
    private static final List<String> desc = new LinkedList<>();
43
43
44
    private static final String KEY = "__urlencode"; //$NON-NLS-1$
44
    private static final String KEY = "__urlencode"; //$NON-NLS-1$
45
45
(-)a/src/functions/org/apache/jmeter/functions/Uuid.java (-1 / +1 lines)
Lines 39-45 import java.util.UUID; Link Here
39
 */
39
 */
40
public class Uuid extends AbstractFunction {
40
public class Uuid extends AbstractFunction {
41
41
42
    private static final List<String> desc = new LinkedList<String>();
42
    private static final List<String> desc = new LinkedList<>();
43
43
44
    private static final String KEY = "__UUID"; //$NON-NLS-1$
44
    private static final String KEY = "__UUID"; //$NON-NLS-1$
45
45
(-)a/src/functions/org/apache/jmeter/functions/Variable.java (-1 / +1 lines)
Lines 41-47 import org.apache.jmeter.util.JMeterUtils; Link Here
41
 */
41
 */
42
public class Variable extends AbstractFunction {
42
public class Variable extends AbstractFunction {
43
43
44
    private static final List<String> desc = new LinkedList<String>();
44
    private static final List<String> desc = new LinkedList<>();
45
45
46
    private static final String KEY = "__V"; //$NON-NLS-1$
46
    private static final String KEY = "__V"; //$NON-NLS-1$
47
47
(-)a/src/functions/org/apache/jmeter/functions/XPath.java (-1 / +1 lines)
Lines 54-60 public class XPath extends AbstractFunction { Link Here
54
    // }
54
    // }
55
    private static final String KEY = "__XPath"; // Function name //$NON-NLS-1$
55
    private static final String KEY = "__XPath"; // Function name //$NON-NLS-1$
56
56
57
    private static final List<String> desc = new LinkedList<String>();
57
    private static final List<String> desc = new LinkedList<>();
58
58
59
    private Object[] values; // Parameter list
59
    private Object[] values; // Parameter list
60
60
(-)a/src/functions/org/apache/jmeter/functions/XPathWrapper.java (-2 / +2 lines)
Lines 50-63 final class XPathWrapper { Link Here
50
     */
50
     */
51
    //@GuardedBy("fileContainers")
51
    //@GuardedBy("fileContainers")
52
    private static final Map<String, XPathFileContainer> fileContainers =
52
    private static final Map<String, XPathFileContainer> fileContainers =
53
        new HashMap<String, XPathFileContainer>();
53
            new HashMap<>();
54
54
55
    /* The cache of file packs - for faster local access */
55
    /* The cache of file packs - for faster local access */
56
    private static final ThreadLocal<Map<String, XPathFileContainer>> filePacks =
56
    private static final ThreadLocal<Map<String, XPathFileContainer>> filePacks =
57
        new ThreadLocal<Map<String, XPathFileContainer>>() {
57
        new ThreadLocal<Map<String, XPathFileContainer>>() {
58
        @Override
58
        @Override
59
        protected Map<String, XPathFileContainer> initialValue() {
59
        protected Map<String, XPathFileContainer> initialValue() {
60
            return new HashMap<String, XPathFileContainer>();
60
            return new HashMap<>();
61
        }
61
        }
62
    };
62
    };
63
63
(-)a/src/jorphan/org/apache/commons/cli/avalon/CLArgsParser.java (-2 / +2 lines)
Lines 223-229 public final class CLArgsParser { Link Here
223
    public CLArgsParser(final String[] args, final CLOptionDescriptor[] optionDescriptors, final ParserControl control) {
223
    public CLArgsParser(final String[] args, final CLOptionDescriptor[] optionDescriptors, final ParserControl control) {
224
        m_optionDescriptors = optionDescriptors;
224
        m_optionDescriptors = optionDescriptors;
225
        m_control = control;
225
        m_control = control;
226
        m_options = new Vector<CLOption>();
226
        m_options = new Vector<>();
227
        m_args = args;
227
        m_args = args;
228
228
229
        try {
229
        try {
Lines 666-672 public final class CLArgsParser { Link Here
666
     */
666
     */
667
    private final void buildOptionIndex() {
667
    private final void buildOptionIndex() {
668
        final int size = m_options.size();
668
        final int size = m_options.size();
669
        m_optionIndex = new Hashtable<Object, CLOption>(size * 2);
669
        m_optionIndex = new Hashtable<>(size * 2);
670
670
671
        for (int i = 0; i < size; i++) {
671
        for (int i = 0; i < size; i++) {
672
            final CLOption option = m_options.get(i);
672
            final CLOption option = m_options.get(i);
(-)a/src/jorphan/org/apache/jorphan/collections/Data.java (-9 / +9 lines)
Lines 57-64 public class Data implements Serializable { Link Here
57
     * Constructor - takes no arguments.
57
     * Constructor - takes no arguments.
58
     */
58
     */
59
    public Data() {
59
    public Data() {
60
        header = new ArrayList<String>();
60
        header = new ArrayList<>();
61
        data = new HashMap<String, List<Object>>();
61
        data = new HashMap<>();
62
        currentPos = -1;
62
        currentPos = -1;
63
        size = currentPos + 1;
63
        size = currentPos + 1;
64
    }
64
    }
Lines 151-160 public class Data implements Serializable { Link Here
151
151
152
    public void addRow() {
152
    public void addRow() {
153
        String[] headers = getHeaders();
153
        String[] headers = getHeaders();
154
        List<Object> tempList = new ArrayList<Object>();
154
        List<Object> tempList = new ArrayList<>();
155
        for (int i = 0; i < headers.length; i++) {
155
        for (int i = 0; i < headers.length; i++) {
156
            if ((tempList = data.get(header.get(i))) == null) {
156
            if ((tempList = data.get(header.get(i))) == null) {
157
                tempList = new ArrayList<Object>();
157
                tempList = new ArrayList<>();
158
                data.put(headers[i], tempList);
158
                data.put(headers[i], tempList);
159
            }
159
            }
160
            tempList.add("");
160
            tempList.add("");
Lines 271-277 public class Data implements Serializable { Link Here
271
    public void addColumnValue(String column, Object value) {
271
    public void addColumnValue(String column, Object value) {
272
        List<Object> tempList;
272
        List<Object> tempList;
273
        if ((tempList = data.get(column)) == null) {
273
        if ((tempList = data.get(column)) == null) {
274
            tempList = new ArrayList<Object>();
274
            tempList = new ArrayList<>();
275
            data.put(column, tempList);
275
            data.put(column, tempList);
276
        }
276
        }
277
        int s = tempList.size();
277
        int s = tempList.size();
Lines 320-326 public class Data implements Serializable { Link Here
320
    public void setColumnValue(String column, Object value) {
320
    public void setColumnValue(String column, Object value) {
321
        List<Object> tempList;
321
        List<Object> tempList;
322
        if ((tempList = data.get(column)) == null) {
322
        if ((tempList = data.get(column)) == null) {
323
            tempList = new ArrayList<Object>();
323
            tempList = new ArrayList<>();
324
            data.put(column, tempList);
324
            data.put(column, tempList);
325
        }
325
        }
326
326
Lines 468-477 public class Data implements Serializable { Link Here
468
     */
468
     */
469
    public void setHeaders(String[] h) {
469
    public void setHeaders(String[] h) {
470
        int x = 0;
470
        int x = 0;
471
        header = new ArrayList<String>(h.length);
471
        header = new ArrayList<>(h.length);
472
        for (x = 0; x < h.length; x++) {
472
        for (x = 0; x < h.length; x++) {
473
            header.add(h[x]);
473
            header.add(h[x]);
474
            data.put(h[x], new ArrayList<Object>());
474
            data.put(h[x], new ArrayList<>());
475
        }
475
        }
476
    }
476
    }
477
477
Lines 597-603 public class Data implements Serializable { Link Here
597
     */
597
     */
598
    public void addHeader(String s) {
598
    public void addHeader(String s) {
599
        header.add(s);
599
        header.add(s);
600
        data.put(s, new ArrayList<Object>(Math.max(size(), 100)));
600
        data.put(s, new ArrayList<>(Math.max(size(), 100)));
601
    }
601
    }
602
602
603
    /**
603
    /**
(-)a/src/jorphan/org/apache/jorphan/collections/HashTree.java (-3 / +3 lines)
Lines 98-104 public class HashTree implements Serializable, Map<Object, HashTree>, Cloneable Link Here
98
        if(_map != null) {
98
        if(_map != null) {
99
            data = _map;
99
            data = _map;
100
        } else {
100
        } else {
101
            data = new HashMap<Object, HashTree>();
101
            data = new HashMap<>();
102
        }
102
        }
103
        if(key != null) {
103
        if(key != null) {
104
            data.put(key, new HashTree());
104
            data.put(key, new HashTree());
Lines 215-221 public class HashTree implements Serializable, Map<Object, HashTree>, Cloneable Link Here
215
     *            a collection of objects to be added to the created HashTree.
215
     *            a collection of objects to be added to the created HashTree.
216
     */
216
     */
217
    public HashTree(Collection<?> keys) {
217
    public HashTree(Collection<?> keys) {
218
        data = new HashMap<Object, HashTree>();
218
        data = new HashMap<>();
219
        for (Object o : keys) {
219
        for (Object o : keys) {
220
            data.put(o, new HashTree());
220
            data.put(o, new HashTree());
221
        }
221
        }
Lines 229-235 public class HashTree implements Serializable, Map<Object, HashTree>, Cloneable Link Here
229
     *            array with names for the new top-level nodes
229
     *            array with names for the new top-level nodes
230
     */
230
     */
231
    public HashTree(Object[] keys) {
231
    public HashTree(Object[] keys) {
232
        data = new HashMap<Object, HashTree>();
232
        data = new HashMap<>();
233
        for (int x = 0; x < keys.length; x++) {
233
        for (int x = 0; x < keys.length; x++) {
234
            data.put(keys[x], new HashTree());
234
            data.put(keys[x], new HashTree());
235
        }
235
        }
(-)a/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java (-1 / +1 lines)
Lines 45-51 public class ListedHashTree extends HashTree implements Serializable, Cloneable Link Here
45
45
46
    public ListedHashTree() {
46
    public ListedHashTree() {
47
        super();
47
        super();
48
        order = new LinkedList<Object>();
48
        order = new LinkedList<>();
49
    }
49
    }
50
50
51
    public ListedHashTree(Object key) {
51
    public ListedHashTree(Object key) {
(-)a/src/jorphan/org/apache/jorphan/collections/SearchByClass.java (-2 / +2 lines)
Lines 54-62 import java.util.Map; Link Here
54
 *            Class that should be searched for
54
 *            Class that should be searched for
55
 */
55
 */
56
public class SearchByClass<T> implements HashTreeTraverser {
56
public class SearchByClass<T> implements HashTreeTraverser {
57
    private final List<T> objectsOfClass = new LinkedList<T>();
57
    private final List<T> objectsOfClass = new LinkedList<>();
58
58
59
    private final Map<Object, ListedHashTree> subTrees = new HashMap<Object, ListedHashTree>();
59
    private final Map<Object, ListedHashTree> subTrees = new HashMap<>();
60
60
61
    private final Class<T> searchClass;
61
    private final Class<T> searchClass;
62
62
(-)a/src/jorphan/org/apache/jorphan/exec/KeyToolUtils.java (-4 / +4 lines)
Lines 136-142 public class KeyToolUtils { Link Here
136
            throws IOException {
136
            throws IOException {
137
        final File workingDir = keystore.getParentFile();
137
        final File workingDir = keystore.getParentFile();
138
        final SystemCommand nativeCommand = new SystemCommand(workingDir, null);
138
        final SystemCommand nativeCommand = new SystemCommand(workingDir, null);
139
        final List<String> arguments = new ArrayList<String>();
139
        final List<String> arguments = new ArrayList<>();
140
        arguments.add(getKeyToolPath());
140
        arguments.add(getKeyToolPath());
141
        arguments.add("-genkeypair"); // $NON-NLS-1$
141
        arguments.add("-genkeypair"); // $NON-NLS-1$
142
        arguments.add("-alias"); // $NON-NLS-1$
142
        arguments.add("-alias"); // $NON-NLS-1$
Lines 305-311 public class KeyToolUtils { Link Here
305
    public static String list(final File keystore, final String storePass) throws IOException {
305
    public static String list(final File keystore, final String storePass) throws IOException {
306
        final File workingDir = keystore.getParentFile();
306
        final File workingDir = keystore.getParentFile();
307
        final SystemCommand nativeCommand = new SystemCommand(workingDir, null);
307
        final SystemCommand nativeCommand = new SystemCommand(workingDir, null);
308
        final List<String> arguments = new ArrayList<String>();
308
        final List<String> arguments = new ArrayList<>();
309
        arguments.add(getKeyToolPath());
309
        arguments.add(getKeyToolPath());
310
        arguments.add("-list"); // $NON-NLS-1$
310
        arguments.add("-list"); // $NON-NLS-1$
311
        arguments.add("-v"); // $NON-NLS-1$
311
        arguments.add("-v"); // $NON-NLS-1$
Lines 368-374 public class KeyToolUtils { Link Here
368
            throws IOException {
368
            throws IOException {
369
        final File workingDir = keystore.getParentFile();
369
        final File workingDir = keystore.getParentFile();
370
        final SystemCommand nativeCommand = new SystemCommand(workingDir, 0L, 0, null, input, output, null);
370
        final SystemCommand nativeCommand = new SystemCommand(workingDir, 0L, 0, null, input, output, null);
371
        final List<String> arguments = new ArrayList<String>();
371
        final List<String> arguments = new ArrayList<>();
372
        arguments.add(getKeyToolPath());
372
        arguments.add(getKeyToolPath());
373
        arguments.add(command);
373
        arguments.add(command);
374
        arguments.add("-keystore"); // $NON-NLS-1$
374
        arguments.add("-keystore"); // $NON-NLS-1$
Lines 420-426 public class KeyToolUtils { Link Here
420
     */
420
     */
421
    private static boolean checkKeytool(String keytoolPath) {
421
    private static boolean checkKeytool(String keytoolPath) {
422
        final SystemCommand nativeCommand = new SystemCommand(null, null);
422
        final SystemCommand nativeCommand = new SystemCommand(null, null);
423
        final List<String> arguments = new ArrayList<String>();
423
        final List<String> arguments = new ArrayList<>();
424
        arguments.add(keytoolPath);
424
        arguments.add(keytoolPath);
425
        arguments.add("-help"); // $NON-NLS-1$
425
        arguments.add("-help"); // $NON-NLS-1$
426
        try {
426
        try {
(-)a/src/jorphan/org/apache/jorphan/gui/AbstractTreeTableModel.java (-7 / +7 lines)
Lines 36-46 public abstract class AbstractTreeTableModel extends DefaultTableModel implement Link Here
36
    protected final TreeNode rootNode;
36
    protected final TreeNode rootNode;
37
    protected final EventListenerList listener = new EventListenerList();
37
    protected final EventListenerList listener = new EventListenerList();
38
38
39
    protected transient final List<Object> objects = new ArrayList<Object>();
39
    protected transient final List<Object> objects = new ArrayList<>();
40
40
41
    protected transient final List<String> headers = new ArrayList<String>();
41
    protected transient final List<String> headers = new ArrayList<>();
42
42
43
    protected transient final List<Class<?>> classes = new ArrayList<Class<?>>();
43
    protected transient final List<Class<?>> classes = new ArrayList<>();
44
44
45
    protected transient final List<Functor> readFunctors;
45
    protected transient final List<Functor> readFunctors;
46
46
Lines 48-55 public abstract class AbstractTreeTableModel extends DefaultTableModel implement Link Here
48
48
49
    public AbstractTreeTableModel(TreeNode root) {
49
    public AbstractTreeTableModel(TreeNode root) {
50
        this.rootNode = root;
50
        this.rootNode = root;
51
        readFunctors = new ArrayList<Functor>();
51
        readFunctors = new ArrayList<>();
52
        writeFunctors = new ArrayList<Functor>();
52
        writeFunctors = new ArrayList<>();
53
    }
53
    }
54
54
55
    public AbstractTreeTableModel(String[] headers,
55
    public AbstractTreeTableModel(String[] headers,
Lines 59-66 public abstract class AbstractTreeTableModel extends DefaultTableModel implement Link Here
59
        this.rootNode = null;
59
        this.rootNode = null;
60
        this.headers.addAll(Arrays.asList(headers));
60
        this.headers.addAll(Arrays.asList(headers));
61
        this.classes.addAll(Arrays.asList(editorClasses));
61
        this.classes.addAll(Arrays.asList(editorClasses));
62
        this.readFunctors = new ArrayList<Functor>(Arrays.asList(readFunctors));
62
        this.readFunctors = new ArrayList<>(Arrays.asList(readFunctors));
63
        this.writeFunctors = new ArrayList<Functor>(Arrays.asList(writeFunctors));
63
        this.writeFunctors = new ArrayList<>(Arrays.asList(writeFunctors));
64
    }
64
    }
65
65
66
    /**
66
    /**
(-)a/src/jorphan/org/apache/jorphan/gui/GuiUtils.java (-1 / +1 lines)
Lines 125-131 public final class GuiUtils { Link Here
125
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
125
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
126
        Transferable trans = clipboard.getContents(null);
126
        Transferable trans = clipboard.getContents(null);
127
        DataFlavor[] flavourList = trans.getTransferDataFlavors();
127
        DataFlavor[] flavourList = trans.getTransferDataFlavors();
128
        Collection<DataFlavor> flavours = new ArrayList<DataFlavor>(flavourList.length);
128
        Collection<DataFlavor> flavours = new ArrayList<>(flavourList.length);
129
        if (Collections.addAll(flavours, flavourList) && flavours.contains(DataFlavor.stringFlavor)) {
129
        if (Collections.addAll(flavours, flavourList) && flavours.contains(DataFlavor.stringFlavor)) {
130
            return (String) trans.getTransferData(DataFlavor.stringFlavor);
130
            return (String) trans.getTransferData(DataFlavor.stringFlavor);
131
        } else {
131
        } else {
(-)a/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java (-2 / +2 lines)
Lines 43-49 public class JLabeledChoice extends JPanel implements JLabeledField { Link Here
43
    private final JComboBox<String> choiceList;
43
    private final JComboBox<String> choiceList;
44
44
45
    // Maybe move to vector if MT problems occur
45
    // Maybe move to vector if MT problems occur
46
    private final ArrayList<ChangeListener> mChangeListeners = new ArrayList<ChangeListener>(3);
46
    private final ArrayList<ChangeListener> mChangeListeners = new ArrayList<>(3);
47
47
48
    private JButton delete, add;
48
    private JButton delete, add;
49
49
Lines 95-101 public class JLabeledChoice extends JPanel implements JLabeledField { Link Here
95
     */
95
     */
96
    @Override
96
    @Override
97
    public List<JComponent> getComponentList() {
97
    public List<JComponent> getComponentList() {
98
        List<JComponent> comps = new LinkedList<JComponent>();
98
        List<JComponent> comps = new LinkedList<>();
99
        comps.add(mLabel);
99
        comps.add(mLabel);
100
        comps.add(choiceList);
100
        comps.add(choiceList);
101
        return comps;
101
        return comps;
(-)a/src/jorphan/org/apache/jorphan/gui/JLabeledTextArea.java (-2 / +2 lines)
Lines 50-56 public class JLabeledTextArea extends JPanel implements JLabeledField, FocusList Link Here
50
    private final JTextArea mTextArea;
50
    private final JTextArea mTextArea;
51
51
52
    // Maybe move to vector if MT problems occur
52
    // Maybe move to vector if MT problems occur
53
    private final ArrayList<ChangeListener> mChangeListeners = new ArrayList<ChangeListener>(3);
53
    private final ArrayList<ChangeListener> mChangeListeners = new ArrayList<>(3);
54
54
55
    // A temporary cache for the focus listener
55
    // A temporary cache for the focus listener
56
    private String oldValue = "";
56
    private String oldValue = "";
Lines 94-100 public class JLabeledTextArea extends JPanel implements JLabeledField, FocusList Link Here
94
     */
94
     */
95
    @Override
95
    @Override
96
    public List<JComponent> getComponentList() {
96
    public List<JComponent> getComponentList() {
97
        List<JComponent> comps = new LinkedList<JComponent>();
97
        List<JComponent> comps = new LinkedList<>();
98
        comps.add(mLabel);
98
        comps.add(mLabel);
99
        comps.add(mTextArea);
99
        comps.add(mTextArea);
100
        return comps;
100
        return comps;
(-)a/src/jorphan/org/apache/jorphan/gui/JLabeledTextField.java (-2 / +2 lines)
Lines 49-55 public class JLabeledTextField extends JPanel implements JLabeledField, FocusLis Link Here
49
    private JTextField mTextField;
49
    private JTextField mTextField;
50
50
51
    // Maybe move to vector if MT problems occur
51
    // Maybe move to vector if MT problems occur
52
    private final ArrayList<ChangeListener> mChangeListeners = new ArrayList<ChangeListener>(3);
52
    private final ArrayList<ChangeListener> mChangeListeners = new ArrayList<>(3);
53
53
54
    // A temporary cache for the focus listener
54
    // A temporary cache for the focus listener
55
    private String oldValue = "";
55
    private String oldValue = "";
Lines 94-100 public class JLabeledTextField extends JPanel implements JLabeledField, FocusLis Link Here
94
     */
94
     */
95
    @Override
95
    @Override
96
    public List<JComponent> getComponentList() {
96
    public List<JComponent> getComponentList() {
97
        List<JComponent> comps = new LinkedList<JComponent>();
97
        List<JComponent> comps = new LinkedList<>();
98
        comps.add(mLabel);
98
        comps.add(mLabel);
99
        comps.add(mTextField);
99
        comps.add(mTextField);
100
        return comps;
100
        return comps;
(-)a/src/jorphan/org/apache/jorphan/gui/ObjectTableModel.java (-13 / +13 lines)
Lines 39-53 public class ObjectTableModel extends DefaultTableModel { Link Here
39
39
40
    private static final long serialVersionUID = 240L;
40
    private static final long serialVersionUID = 240L;
41
41
42
    private transient ArrayList<Object> objects = new ArrayList<Object>();
42
    private transient ArrayList<Object> objects = new ArrayList<>();
43
43
44
    private transient List<String> headers = new ArrayList<String>();
44
    private transient List<String> headers = new ArrayList<>();
45
45
46
    private transient ArrayList<Class<?>> classes = new ArrayList<Class<?>>();
46
    private transient ArrayList<Class<?>> classes = new ArrayList<>();
47
47
48
    private transient ArrayList<Functor> readFunctors = new ArrayList<Functor>();
48
    private transient ArrayList<Functor> readFunctors = new ArrayList<>();
49
49
50
    private transient ArrayList<Functor> writeFunctors = new ArrayList<Functor>();
50
    private transient ArrayList<Functor> writeFunctors = new ArrayList<>();
51
51
52
    private transient Class<?> objectClass = null; // if provided
52
    private transient Class<?> objectClass = null; // if provided
53
    
53
    
Lines 98-105 public class ObjectTableModel extends DefaultTableModel { Link Here
98
    public ObjectTableModel(String[] headers, Functor[] readFunctors, Functor[] writeFunctors, Class<?>[] editorClasses) {
98
    public ObjectTableModel(String[] headers, Functor[] readFunctors, Functor[] writeFunctors, Class<?>[] editorClasses) {
99
        this.headers.addAll(Arrays.asList(headers));
99
        this.headers.addAll(Arrays.asList(headers));
100
        this.classes.addAll(Arrays.asList(editorClasses));
100
        this.classes.addAll(Arrays.asList(editorClasses));
101
        this.readFunctors = new ArrayList<Functor>(Arrays.asList(readFunctors));
101
        this.readFunctors = new ArrayList<>(Arrays.asList(readFunctors));
102
        this.writeFunctors = new ArrayList<Functor>(Arrays.asList(writeFunctors));
102
        this.writeFunctors = new ArrayList<>(Arrays.asList(writeFunctors));
103
103
104
        int numHeaders = headers.length;
104
        int numHeaders = headers.length;
105
105
Lines 121-131 public class ObjectTableModel extends DefaultTableModel { Link Here
121
    }
121
    }
122
122
123
    private Object readResolve() {
123
    private Object readResolve() {
124
        objects = new ArrayList<Object>();
124
        objects = new ArrayList<>();
125
        headers = new ArrayList<String>();
125
        headers = new ArrayList<>();
126
        classes = new ArrayList<Class<?>>();
126
        classes = new ArrayList<>();
127
        readFunctors = new ArrayList<Functor>();
127
        readFunctors = new ArrayList<>();
128
        writeFunctors = new ArrayList<Functor>();
128
        writeFunctors = new ArrayList<>();
129
        return this;
129
        return this;
130
    }
130
    }
131
131
Lines 202-208 public class ObjectTableModel extends DefaultTableModel { Link Here
202
    /** {@inheritDoc} */
202
    /** {@inheritDoc} */
203
    @Override
203
    @Override
204
    public void moveRow(int start, int end, int to) {
204
    public void moveRow(int start, int end, int to) {
205
        List<Object> subList = new ArrayList<Object>(objects.subList(start, end));
205
        List<Object> subList = new ArrayList<>(objects.subList(start, end));
206
        for (int x = end - 1; x >= start; x--) {
206
        for (int x = end - 1; x >= start; x--) {
207
            objects.remove(x);
207
            objects.remove(x);
208
        }
208
        }
(-)a/src/jorphan/org/apache/jorphan/math/StatCalculator.java (-2 / +2 lines)
Lines 36-42 import org.apache.commons.lang3.mutable.MutableLong; Link Here
36
public abstract class StatCalculator<T extends Number & Comparable<? super T>> {
36
public abstract class StatCalculator<T extends Number & Comparable<? super T>> {
37
37
38
    // key is the type to collect (usually long), value = count of entries
38
    // key is the type to collect (usually long), value = count of entries
39
    private final Map<T, MutableLong> valuesMap = new TreeMap<T, MutableLong>();
39
    private final Map<T, MutableLong> valuesMap = new TreeMap<>();
40
    // We use a TreeMap because we need the entries to be sorted
40
    // We use a TreeMap because we need the entries to be sorted
41
41
42
    // Running values, updated for each sample
42
    // Running values, updated for each sample
Lines 165-171 public abstract class StatCalculator<T extends Number & Comparable<? super T>> { Link Here
165
     * TODO - why is the key value also stored in the entry array? See Bug 53825
165
     * TODO - why is the key value also stored in the entry array? See Bug 53825
166
     */
166
     */
167
    public Map<Number, Number[]> getDistribution() {
167
    public Map<Number, Number[]> getDistribution() {
168
        Map<Number, Number[]> items = new HashMap<Number, Number[]>();
168
        Map<Number, Number[]> items = new HashMap<>();
169
169
170
        for (Entry<T, MutableLong> entry : valuesMap.entrySet()) {
170
        for (Entry<T, MutableLong> entry : valuesMap.entrySet()) {
171
            Number[] dis = new Number[2];
171
            Number[] dis = new Number[2];
(-)a/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java (-3 / +3 lines)
Lines 167-173 public final class ClassFinder { Link Here
167
167
168
    // For each directory in the search path, add all the jars found there
168
    // For each directory in the search path, add all the jars found there
169
    private static String[] addJarsInPath(String[] paths) {
169
    private static String[] addJarsInPath(String[] paths) {
170
        Set<String> fullList = new HashSet<String>();
170
        Set<String> fullList = new HashSet<>();
171
        for (int i = 0; i < paths.length; i++) {
171
        for (int i = 0; i < paths.length; i++) {
172
            final String path = paths[i];
172
            final String path = paths[i];
173
            fullList.add(path); // Keep the unexpanded path
173
            fullList.add(path); // Keep the unexpanded path
Lines 317-323 public final class ClassFinder { Link Here
317
//            }
317
//            }
318
//        }
318
//        }
319
319
320
        return new ArrayList<String>(listClasses);//subClassList);
320
        return new ArrayList<>(listClasses);//subClassList);
321
    }
321
    }
322
322
323
    /*
323
    /*
Lines 335-341 public final class ClassFinder { Link Here
335
        }
335
        }
336
336
337
        // find all jar files or paths that end with strPathOrJar
337
        // find all jar files or paths that end with strPathOrJar
338
        ArrayList<String> listPaths = new ArrayList<String>();
338
        ArrayList<String> listPaths = new ArrayList<>();
339
        String strPath = null;
339
        String strPath = null;
340
        while (stPaths.hasMoreTokens()) {
340
        while (stPaths.hasMoreTokens()) {
341
            strPath = fixPathEntry(stPaths.nextToken());
341
            strPath = fixPathEntry(stPaths.nextToken());
(-)a/src/jorphan/org/apache/jorphan/util/JOrphanUtils.java (-2 / +2 lines)
Lines 92-98 public final class JOrphanUtils { Link Here
92
                splittee = splittee.substring(0,splittee.length()-splitLength);
92
                splittee = splittee.substring(0,splittee.length()-splitLength);
93
            }
93
            }
94
        }
94
        }
95
        List<String> returns = new ArrayList<String>();
95
        List<String> returns = new ArrayList<>();
96
        final int length = splittee.length(); // This is the new length
96
        final int length = splittee.length(); // This is the new length
97
        int start = 0;
97
        int start = 0;
98
        spot = 0;
98
        spot = 0;
Lines 145-151 public final class JOrphanUtils { Link Here
145
    public static String[] split(String splittee, String delims, String def) {
145
    public static String[] split(String splittee, String delims, String def) {
146
        StringTokenizer tokens = new StringTokenizer(splittee,delims,def!=null);
146
        StringTokenizer tokens = new StringTokenizer(splittee,delims,def!=null);
147
        boolean lastWasDelim=false;
147
        boolean lastWasDelim=false;
148
        List<String> strList=new ArrayList<String>();
148
        List<String> strList= new ArrayList<>();
149
        while (tokens.hasMoreTokens()) {
149
        while (tokens.hasMoreTokens()) {
150
            String tok=tokens.nextToken();
150
            String tok=tokens.nextToken();
151
            if (   tok.length()==1 // we have a single character; could be a token
151
            if (   tok.length()==1 // we have a single character; could be a token
(-)a/src/junit/org/apache/jmeter/protocol/java/control/gui/JUnitTestSamplerGui.java (-1 / +1 lines)
Lines 372-378 implements ChangeListener, ActionListener, ItemListener Link Here
372
    private String[] getMethodNames(Class<?> clazz)
372
    private String[] getMethodNames(Class<?> clazz)
373
    {
373
    {
374
        Method[] meths = clazz.getMethods();
374
        Method[] meths = clazz.getMethods();
375
        List<String> list = new ArrayList<String>();
375
        List<String> list = new ArrayList<>();
376
        for (int idx=0; idx < meths.length; idx++){
376
        for (int idx=0; idx < meths.length; idx++){
377
            final Method method = meths[idx];
377
            final Method method = meths[idx];
378
            final String name = method.getName();
378
            final String name = method.getName();
(-)a/src/monitor/components/org/apache/jmeter/visualizers/MonitorAccumModel.java (-2 / +2 lines)
Lines 57-64 public class MonitorAccumModel implements Clearable, Serializable { Link Here
57
     *
57
     *
58
     */
58
     */
59
    public MonitorAccumModel() {
59
    public MonitorAccumModel() {
60
        serverListMap = new HashMap<String, List<MonitorModel>>();
60
        serverListMap = new HashMap<>();
61
        listeners = new LinkedList<MonitorListener>();
61
        listeners = new LinkedList<>();
62
    }
62
    }
63
63
64
    public int getBufferSize() {
64
    public int getBufferSize() {
(-)a/src/monitor/components/org/apache/jmeter/visualizers/MonitorHealthPanel.java (-1 / +1 lines)
Lines 38-44 import org.apache.jmeter.util.JMeterUtils; Link Here
38
public class MonitorHealthPanel extends JPanel implements MonitorListener, Clearable {
38
public class MonitorHealthPanel extends JPanel implements MonitorListener, Clearable {
39
    private static final long serialVersionUID = 240L;
39
    private static final long serialVersionUID = 240L;
40
40
41
    private final Map<String, ServerPanel> serverPanelMap = new HashMap<String, ServerPanel>();
41
    private final Map<String, ServerPanel> serverPanelMap = new HashMap<>();
42
42
43
    private JPanel servers = null;
43
    private JPanel servers = null;
44
44
(-)a/src/monitor/components/org/apache/jmeter/visualizers/MonitorPerformancePanel.java (-1 / +1 lines)
Lines 118-124 public class MonitorPerformancePanel extends JSplitPane implements TreeSelection Link Here
118
     */
118
     */
119
    public MonitorPerformancePanel(MonitorAccumModel model, MonitorGraph graph) {
119
    public MonitorPerformancePanel(MonitorAccumModel model, MonitorGraph graph) {
120
        super();
120
        super();
121
        this.SERVERMAP = new HashMap<String, DefaultMutableTreeNode>();
121
        this.SERVERMAP = new HashMap<>();
122
        this.MODEL = model;
122
        this.MODEL = model;
123
        this.MODEL.addListener(this);
123
        this.MODEL.addListener(this);
124
        this.GRAPH = graph;
124
        this.GRAPH = graph;
(-)a/src/monitor/model/org/apache/jmeter/monitor/model/StatusImpl.java (-1 / +1 lines)
Lines 35-41 public class StatusImpl implements Status { Link Here
35
     */
35
     */
36
    public StatusImpl() {
36
    public StatusImpl() {
37
        super();
37
        super();
38
        connectors = new LinkedList<Connector>();
38
        connectors = new LinkedList<>();
39
    }
39
    }
40
40
41
    /** {@inheritDoc} */
41
    /** {@inheritDoc} */
(-)a/src/monitor/model/org/apache/jmeter/monitor/model/WorkersImpl.java (-1 / +1 lines)
Lines 31-37 public class WorkersImpl implements Workers { Link Here
31
     */
31
     */
32
    public WorkersImpl() {
32
    public WorkersImpl() {
33
        super();
33
        super();
34
        worker = new LinkedList<Worker>();
34
        worker = new LinkedList<>();
35
    }
35
    }
36
36
37
    @Override
37
    @Override
(-)a/src/monitor/model/org/apache/jmeter/monitor/parser/MonitorHandler.java (-1 / +1 lines)
Lines 71-77 public class MonitorHandler extends DefaultHandler { Link Here
71
    public void startDocument() throws SAXException {
71
    public void startDocument() throws SAXException {
72
        // this.startDoc = true;
72
        // this.startDoc = true;
73
        // Reset all work variables so reusing the instance starts afresh.
73
        // Reset all work variables so reusing the instance starts afresh.
74
        this.stacktree = new Stack<Object>();
74
        this.stacktree = new Stack<>();
75
        this.status = null;
75
        this.status = null;
76
        this.jvm = null;
76
        this.jvm = null;
77
        this.memory = null;
77
        this.memory = null;
(-)a/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java (-1 / +1 lines)
Lines 58-64 public class FTPSampler extends AbstractSampler implements Interruptible { Link Here
58
58
59
    private static final Logger log = LoggingManager.getLoggerForClass();
59
    private static final Logger log = LoggingManager.getLoggerForClass();
60
60
61
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
61
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<>(
62
            Arrays.asList(new String[]{
62
            Arrays.asList(new String[]{
63
                    "org.apache.jmeter.config.gui.LoginConfigGui",
63
                    "org.apache.jmeter.config.gui.LoginConfigGui",
64
                    "org.apache.jmeter.protocol.ftp.config.gui.FtpConfigGui",
64
                    "org.apache.jmeter.protocol.ftp.config.gui.FtpConfigGui",
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/control/AuthManager.java (-2 / +2 lines)
Lines 121-127 public class AuthManager extends ConfigTestElement implements TestStateListener, Link Here
121
     * Default Constructor.
121
     * Default Constructor.
122
     */
122
     */
123
    public AuthManager() {
123
    public AuthManager() {
124
        setProperty(new CollectionProperty(AUTH_LIST, new ArrayList<Object>()));
124
        setProperty(new CollectionProperty(AUTH_LIST, new ArrayList<>()));
125
    }
125
    }
126
126
127
    /** {@inheritDoc} */
127
    /** {@inheritDoc} */
Lines 129-135 public class AuthManager extends ConfigTestElement implements TestStateListener, Link Here
129
    public void clear() {
129
    public void clear() {
130
        super.clear();
130
        super.clear();
131
        kerberosManager.clearSubjects();
131
        kerberosManager.clearSubjects();
132
        setProperty(new CollectionProperty(AUTH_LIST, new ArrayList<Object>()));
132
        setProperty(new CollectionProperty(AUTH_LIST, new ArrayList<>()));
133
    }
133
    }
134
134
135
    /**
135
    /**
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java (-1 / +1 lines)
Lines 316-322 public class CookieManager extends ConfigTestElement implements TestStateListene Link Here
316
     */
316
     */
317
    private void clearCookies() {
317
    private void clearCookies() {
318
        log.debug("Clear all cookies from store");
318
        log.debug("Clear all cookies from store");
319
        setProperty(new CollectionProperty(COOKIES, new ArrayList<Object>()));
319
        setProperty(new CollectionProperty(COOKIES, new ArrayList<>()));
320
    }
320
    }
321
321
322
    /**
322
    /**
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/control/DNSCacheManager.java (-1 / +1 lines)
Lines 100-106 public class DNSCacheManager extends ConfigTestElement implements TestIterationL Link Here
100
    public Object clone() {
100
    public Object clone() {
101
        DNSCacheManager clone = (DNSCacheManager) super.clone();
101
        DNSCacheManager clone = (DNSCacheManager) super.clone();
102
        clone.systemDefaultDnsResolver = new SystemDefaultDnsResolver();
102
        clone.systemDefaultDnsResolver = new SystemDefaultDnsResolver();
103
        clone.cache = new LinkedHashMap<String, InetAddress[]>();
103
        clone.cache = new LinkedHashMap<>();
104
        CollectionProperty dnsServers = getServers();
104
        CollectionProperty dnsServers = getServers();
105
        try {
105
        try {
106
            String[] serverNames = new String[dnsServers.size()];
106
            String[] serverNames = new String[dnsServers.size()];
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/control/HC4CookieHandler.java (-2 / +2 lines)
Lines 166-172 public class HC4CookieHandler implements CookieHandler { Link Here
166
     */
166
     */
167
    List<org.apache.http.cookie.Cookie> getCookiesForUrl(
167
    List<org.apache.http.cookie.Cookie> getCookiesForUrl(
168
            CollectionProperty cookiesCP, URL url, boolean allowVariableCookie) {
168
            CollectionProperty cookiesCP, URL url, boolean allowVariableCookie) {
169
        List<org.apache.http.cookie.Cookie> cookies = new ArrayList<org.apache.http.cookie.Cookie>();
169
        List<org.apache.http.cookie.Cookie> cookies = new ArrayList<>();
170
170
171
        for (PropertyIterator iter = cookiesCP.iterator(); iter.hasNext();) {
171
        for (PropertyIterator iter = cookiesCP.iterator(); iter.hasNext();) {
172
            Cookie jmcookie = (Cookie) iter.next().getObjectValue();
172
            Cookie jmcookie = (Cookie) iter.next().getObjectValue();
Lines 187-193 public class HC4CookieHandler implements CookieHandler { Link Here
187
187
188
        CookieOrigin cookieOrigin = new CookieOrigin(host, port, path, secure);
188
        CookieOrigin cookieOrigin = new CookieOrigin(host, port, path, secure);
189
189
190
        List<org.apache.http.cookie.Cookie> cookiesValid = new ArrayList<org.apache.http.cookie.Cookie>();
190
        List<org.apache.http.cookie.Cookie> cookiesValid = new ArrayList<>();
191
        for (org.apache.http.cookie.Cookie cookie : cookies) {
191
        for (org.apache.http.cookie.Cookie cookie : cookies) {
192
            if (cookieSpec.match(cookie, cookieOrigin)) {
192
            if (cookieSpec.match(cookie, cookieOrigin)) {
193
                cookiesValid.add(cookie);
193
                cookiesValid.add(cookie);
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/control/HeaderManager.java (-3 / +3 lines)
Lines 63-76 public class HeaderManager extends ConfigTestElement implements Serializable { Link Here
63
    private Object SOAPHeader = null;
63
    private Object SOAPHeader = null;
64
64
65
    public HeaderManager() {
65
    public HeaderManager() {
66
        setProperty(new CollectionProperty(HEADERS, new ArrayList<Object>()));
66
        setProperty(new CollectionProperty(HEADERS, new ArrayList<>()));
67
    }
67
    }
68
68
69
    /** {@inheritDoc} */
69
    /** {@inheritDoc} */
70
    @Override
70
    @Override
71
    public void clear() {
71
    public void clear() {
72
        super.clear();
72
        super.clear();
73
        setProperty(new CollectionProperty(HEADERS, new ArrayList<Object>()));
73
        setProperty(new CollectionProperty(HEADERS, new ArrayList<>()));
74
    }
74
    }
75
75
76
    /**
76
    /**
Lines 217-223 public class HeaderManager extends ConfigTestElement implements Serializable { Link Here
217
     * @param name header name
217
     * @param name header name
218
     */
218
     */
219
    public void removeHeaderNamed(String name) {
219
    public void removeHeaderNamed(String name) {
220
        List<Integer> removeIndices = new ArrayList<Integer>();
220
        List<Integer> removeIndices = new ArrayList<>();
221
        for (int i = getHeaders().size() - 1; i >= 0; i--) {
221
        for (int i = getHeaders().size() - 1; i >= 0; i--) {
222
            Header header = (Header) getHeaders().get(i).getObjectValue();
222
            Header header = (Header) getHeaders().get(i).getObjectValue();
223
            if (header == null) {
223
            if (header == null) {
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorServer.java (-1 / +1 lines)
Lines 104-110 public class HttpMirrorServer extends Thread implements Stoppable { Link Here
104
        ServerSocket mainSocket = null;
104
        ServerSocket mainSocket = null;
105
        ThreadPoolExecutor threadPoolExecutor = null;
105
        ThreadPoolExecutor threadPoolExecutor = null;
106
        if(maxThreadPoolSize>0) {
106
        if(maxThreadPoolSize>0) {
107
            final ArrayBlockingQueue<Runnable> queue = new ArrayBlockingQueue<Runnable>(
107
            final ArrayBlockingQueue<Runnable> queue = new ArrayBlockingQueue<>(
108
                    maxQueueSize);
108
                    maxQueueSize);
109
            threadPoolExecutor = new ThreadPoolExecutor(
109
            threadPoolExecutor = new ThreadPoolExecutor(
110
                    maxThreadPoolSize/2, 
110
                    maxThreadPoolSize/2, 
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/control/HttpMirrorThread.java (-1 / +1 lines)
Lines 111-117 public class HttpMirrorThread implements Runnable { Link Here
111
            final String[] requestParts = firstLine.split("\\s+");
111
            final String[] requestParts = firstLine.split("\\s+");
112
            final String requestMethod = requestParts[0];
112
            final String requestMethod = requestParts[0];
113
            final String requestPath = requestParts[1];
113
            final String requestPath = requestParts[1];
114
            final HashMap<String, String> parameters = new HashMap<String, String>();
114
            final HashMap<String, String> parameters = new HashMap<>();
115
            if (HTTPConstants.GET.equals(requestMethod)) {
115
            if (HTTPConstants.GET.equals(requestMethod)) {
116
                int querypos = requestPath.indexOf('?');
116
                int querypos = requestPath.indexOf('?');
117
                if (querypos >= 0) {
117
                if (querypos >= 0) {
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/control/KerberosManager.java (-3 / +2 lines)
Lines 51-58 public class KerberosManager implements Serializable { Link Here
51
    private static final Logger log = LoggingManager.getLoggerForClass();
51
    private static final Logger log = LoggingManager.getLoggerForClass();
52
52
53
    private static final String JAAS_APPLICATION = JMeterUtils.getPropDefault("kerberos_jaas_application", "JMeter"); //$NON-NLS-1$ $NON-NLS-2$
53
    private static final String JAAS_APPLICATION = JMeterUtils.getPropDefault("kerberos_jaas_application", "JMeter"); //$NON-NLS-1$ $NON-NLS-2$
54
    private final ConcurrentMap<String, Future<Subject>> subjects
54
    private final ConcurrentMap<String, Future<Subject>> subjects = new ConcurrentHashMap<>();
55
        = new ConcurrentHashMap<String, Future<Subject>>();
56
55
57
    public KerberosManager() {
56
    public KerberosManager() {
58
    }
57
    }
Lines 80-86 public class KerberosManager implements Serializable { Link Here
80
            }
79
            }
81
        };
80
        };
82
81
83
        FutureTask<Subject> task = new FutureTask<Subject>(callable);
82
        FutureTask<Subject> task = new FutureTask<>(callable);
84
        if(log.isDebugEnabled()) {
83
        if(log.isDebugEnabled()) {
85
            log.debug("Subject cached:"+subjects.keySet() +" before:"+username);
84
            log.debug("Subject cached:"+subjects.keySet() +" before:"+username);
86
        }
85
        }
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java (-2 / +2 lines)
Lines 91-97 public class CookiePanel extends AbstractConfigGui implements ActionListener { Link Here
91
91
92
    private JComboBox<String> selectHandlerPanel;
92
    private JComboBox<String> selectHandlerPanel;
93
93
94
    private HashMap<String, String> handlerMap = new HashMap<String, String>();
94
    private HashMap<String, String> handlerMap = new HashMap<>();
95
95
96
    private static final String[] COLUMN_RESOURCE_NAMES = {
96
    private static final String[] COLUMN_RESOURCE_NAMES = {
97
        ("name"),   //$NON-NLS-1$
97
        ("name"),   //$NON-NLS-1$
Lines 401-407 public class CookiePanel extends AbstractConfigGui implements ActionListener { Link Here
401
    private JComboBox<String> createComboHandler() {
401
    private JComboBox<String> createComboHandler() {
402
        ComboBoxModel<String> nodesModel = new DefaultComboBoxModel<>();
402
        ComboBoxModel<String> nodesModel = new DefaultComboBoxModel<>();
403
        // drop-down list for renderer
403
        // drop-down list for renderer
404
        selectHandlerPanel = new JComboBox<String>(nodesModel);
404
        selectHandlerPanel = new JComboBox<>(nodesModel);
405
        selectHandlerPanel.setActionCommand(HANDLER_COMMAND);
405
        selectHandlerPanel.setActionCommand(HANDLER_COMMAND);
406
        selectHandlerPanel.addActionListener(this);
406
        selectHandlerPanel.addActionListener(this);
407
407
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java (-3 / +3 lines)
Lines 73-79 public class AnchorModifier extends AbstractTestElement implements PreProcessor, Link Here
73
            sampler = (HTTPSamplerBase) sam;
73
            sampler = (HTTPSamplerBase) sam;
74
            result = (HTTPSampleResult) res;
74
            result = (HTTPSampleResult) res;
75
        }
75
        }
76
        List<HTTPSamplerBase> potentialLinks = new ArrayList<HTTPSamplerBase>();
76
        List<HTTPSamplerBase> potentialLinks = new ArrayList<>();
77
        String responseText = ""; // $NON-NLS-1$
77
        String responseText = ""; // $NON-NLS-1$
78
        responseText = result.getResponseDataAsString();
78
        responseText = result.getResponseDataAsString();
79
        Document html;
79
        Document html;
Lines 117-123 public class AnchorModifier extends AbstractTestElement implements PreProcessor, Link Here
117
        if (log.isDebugEnabled()) {
117
        if (log.isDebugEnabled()) {
118
            log.debug("Modifying argument: " + arg);
118
            log.debug("Modifying argument: " + arg);
119
        }
119
        }
120
        List<Argument> possibleReplacements = new ArrayList<Argument>();
120
        List<Argument> possibleReplacements = new ArrayList<>();
121
        PropertyIterator iter = args.iterator();
121
        PropertyIterator iter = args.iterator();
122
        Argument replacementArg;
122
        Argument replacementArg;
123
        while (iter.hasNext()) {
123
        while (iter.hasNext()) {
Lines 148-154 public class AnchorModifier extends AbstractTestElement implements PreProcessor, Link Here
148
    private void addFormUrls(Document html, HTTPSampleResult result, HTTPSamplerBase config, 
148
    private void addFormUrls(Document html, HTTPSampleResult result, HTTPSamplerBase config, 
149
            List<HTTPSamplerBase> potentialLinks) {
149
            List<HTTPSamplerBase> potentialLinks) {
150
        NodeList rootList = html.getChildNodes();
150
        NodeList rootList = html.getChildNodes();
151
        List<HTTPSamplerBase> urls = new LinkedList<HTTPSamplerBase>();
151
        List<HTTPSamplerBase> urls = new LinkedList<>();
152
        for (int x = 0; x < rootList.getLength(); x++) {
152
        for (int x = 0; x < rootList.getLength(); x++) {
153
            urls.addAll(HtmlParsingUtils.createURLFromForm(rootList.item(x), result.getURL()));
153
            urls.addAll(HtmlParsingUtils.createURLFromForm(rootList.item(x), result.getURL()));
154
        }
154
        }
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/modifier/RegExUserParameters.java (-1 / +1 lines)
Lines 100-106 public class RegExUserParameters extends AbstractTestElement implements Serializ Link Here
100
            return null;
100
            return null;
101
        }
101
        }
102
        int n = Integer.parseInt(jmvars.get(regExRefName + MATCH_NR));
102
        int n = Integer.parseInt(jmvars.get(regExRefName + MATCH_NR));
103
        Map<String, String> map = new HashMap<String, String>(n);
103
        Map<String, String> map = new HashMap<>(n);
104
        for(int i=1; i<=n; i++){
104
        for(int i=1; i<=n; i++){
105
            map.put(jmvars.get(regExRefName + i + REGEX_GROUP_SUFFIX + grNames), 
105
            map.put(jmvars.get(regExRefName + i + REGEX_GROUP_SUFFIX + grNames), 
106
                    jmvars.get(regExRefName + i + REGEX_GROUP_SUFFIX + grValues));
106
                    jmvars.get(regExRefName + i + REGEX_GROUP_SUFFIX + grValues));
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/modifier/UserParameterXMLContentHandler.java (-3 / +3 lines)
Lines 41-53 public class UserParameterXMLContentHandler implements ContentHandler { Link Here
41
41
42
    // Note UserParameterXML accesses this variable
42
    // Note UserParameterXML accesses this variable
43
    // to obtain the Set data via method getParsedParameters()
43
    // to obtain the Set data via method getParsedParameters()
44
    private List<Map<String, String>> userThreads = new LinkedList<Map<String, String>>();
44
    private List<Map<String, String>> userThreads = new LinkedList<>();
45
45
46
    private String paramname = "";
46
    private String paramname = "";
47
47
48
    private String paramvalue = "";
48
    private String paramvalue = "";
49
49
50
    private Map<String, String> nameValuePair = new HashMap<String, String>();
50
    private Map<String, String> nameValuePair = new HashMap<>();
51
51
52
    /** Buffer for collecting data from the "characters" SAX event. */
52
    /** Buffer for collecting data from the "characters" SAX event. */
53
    private CharArrayWriter contents = new CharArrayWriter();
53
    private CharArrayWriter contents = new CharArrayWriter();
Lines 94-100 public class UserParameterXMLContentHandler implements ContentHandler { Link Here
94
        // must create a new object,
94
        // must create a new object,
95
        // or else end up with a set full of the same Map object
95
        // or else end up with a set full of the same Map object
96
        if (qName.equals("thread")) {
96
        if (qName.equals("thread")) {
97
            nameValuePair = new HashMap<String, String>();
97
            nameValuePair = new HashMap<>();
98
        }
98
        }
99
99
100
    }
100
    }
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/modifier/UserSequence.java (-1 / +1 lines)
Lines 89-95 public class UserSequence implements Serializable { Link Here
89
            log.debug("UserSequence.getNextuserMods(): current parameters will be " + "changed to: " + user);
89
            log.debug("UserSequence.getNextuserMods(): current parameters will be " + "changed to: " + user);
90
        } else {
90
        } else {
91
            // no entries in all users, therefore create an empty Map object
91
            // no entries in all users, therefore create an empty Map object
92
            user = new HashMap<String, String>();
92
            user = new HashMap<>();
93
        }
93
        }
94
94
95
        return user;
95
        return user;
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/parser/HTMLParser.java (-2 / +2 lines)
Lines 70-76 public abstract class HTMLParser { Link Here
70
    private   static final float IE_10                = 10.0f;
70
    private   static final float IE_10                = 10.0f;
71
71
72
    // Cache of parsers - parsers must be re-usable
72
    // Cache of parsers - parsers must be re-usable
73
    private static final Map<String, HTMLParser> parsers = new ConcurrentHashMap<String, HTMLParser>(4);
73
    private static final Map<String, HTMLParser> parsers = new ConcurrentHashMap<>(4);
74
74
75
    public static final String PARSER_CLASSNAME = "htmlParser.className"; // $NON-NLS-1$
75
    public static final String PARSER_CLASSNAME = "htmlParser.className"; // $NON-NLS-1$
76
76
Lines 147-153 public abstract class HTMLParser { Link Here
147
        // them roughly in order, which should be a better model of browser
147
        // them roughly in order, which should be a better model of browser
148
        // behaviour.
148
        // behaviour.
149
149
150
        Collection<URLString> col = new LinkedHashSet<URLString>();
150
        Collection<URLString> col = new LinkedHashSet<>();
151
        return getEmbeddedResourceURLs(userAgent, html, baseUrl, new URLCollection(col),encoding);
151
        return getEmbeddedResourceURLs(userAgent, html, baseUrl, new URLCollection(col),encoding);
152
152
153
        // An additional note on using HashSets to store URLs: I just
153
        // An additional note on using HashSets to store URLs: I just
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/parser/HtmlParsingUtils.java (-1 / +1 lines)
Lines 283-289 public final class HtmlParsingUtils { Link Here
283
283
284
    public static List<HTTPSamplerBase> createURLFromForm(Node doc, URL context) {
284
    public static List<HTTPSamplerBase> createURLFromForm(Node doc, URL context) {
285
        String selectName = null;
285
        String selectName = null;
286
        LinkedList<HTTPSamplerBase> urlConfigs = new LinkedList<HTTPSamplerBase>();
286
        LinkedList<HTTPSamplerBase> urlConfigs = new LinkedList<>();
287
        recurseForm(doc, urlConfigs, context, selectName, false);
287
        recurseForm(doc, urlConfigs, context, selectName, false);
288
        /*
288
        /*
289
         * NamedNodeMap atts = formNode.getAttributes();
289
         * NamedNodeMap atts = formNode.getAttributes();
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/parser/LagartoBasedHtmlParser.java (-2 / +2 lines)
Lines 65-71 public class LagartoBasedHtmlParser extends HTMLParser { Link Here
65
        private URLCollection urls;
65
        private URLCollection urls;
66
        private URLPointer baseUrl;
66
        private URLPointer baseUrl;
67
        private Float ieVersion;
67
        private Float ieVersion;
68
        private Stack<Boolean> enabled = new Stack<Boolean>();
68
        private Stack<Boolean> enabled = new Stack<>();
69
69
70
        /**
70
        /**
71
         * @param baseUrl base url to add possibly missing information to urls found in <code>urls</code>
71
         * @param baseUrl base url to add possibly missing information to urls found in <code>urls</code>
Lines 208-214 public class LagartoBasedHtmlParser extends HTMLParser { Link Here
208
            String contents = new String(html,encoding); 
208
            String contents = new String(html,encoding); 
209
            // As per Jodd javadocs, emitStrings should be false for visitor for better performances
209
            // As per Jodd javadocs, emitStrings should be false for visitor for better performances
210
            LagartoParser lagartoParser = new LagartoParser(contents, false);
210
            LagartoParser lagartoParser = new LagartoParser(contents, false);
211
            LagartoParserConfig<LagartoParserConfig<?>> config = new LagartoParserConfig<LagartoParserConfig<?>>();
211
            LagartoParserConfig<LagartoParserConfig<?>> config = new LagartoParserConfig<>();
212
            config.setCaseSensitive(false);
212
            config.setCaseSensitive(false);
213
            // Conditional comments only apply for IE < 10
213
            // Conditional comments only apply for IE < 10
214
            config.setEnableConditionalComments(isEnableConditionalComments(ieVersion));
214
            config.setEnableConditionalComments(isEnableConditionalComments(ieVersion));
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/proxy/AbstractSamplerCreator.java (-1 / +1 lines)
Lines 44-50 public abstract class AbstractSamplerCreator implements SamplerCreator { Link Here
44
                                   ".binary"); // $NON-NLS-1$
44
                                   ".binary"); // $NON-NLS-1$
45
45
46
    /** Which content-types will be treated as binary (exact match) */
46
    /** Which content-types will be treated as binary (exact match) */
47
    private static final Set<String> binaryContentTypes = new HashSet<String>();
47
    private static final Set<String> binaryContentTypes = new HashSet<>();
48
48
49
    /** Where to store the temporary binary files */
49
    /** Where to store the temporary binary files */
50
    private static final String binaryDirectory =
50
    private static final String binaryDirectory =
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java (-1 / +1 lines)
Lines 79-85 public class HttpRequestHdr { Link Here
79
79
80
    private byte[] rawPostData;
80
    private byte[] rawPostData;
81
81
82
    private final Map<String, Header> headers = new HashMap<String, Header>();
82
    private final Map<String, Header> headers = new HashMap<>();
83
83
84
    private final String httpSamplerName;
84
    private final String httpSamplerName;
85
85
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java (-2 / +2 lines)
Lines 87-93 public class Proxy extends Thread { Link Here
87
        JMeterUtils.getPropDefault("proxy.ssl.protocol", "TLS"); // $NON-NLS-1$ $NON-NLS-2$
87
        JMeterUtils.getPropDefault("proxy.ssl.protocol", "TLS"); // $NON-NLS-1$ $NON-NLS-2$
88
88
89
    // HashMap to save ssl connection between Jmeter proxy and browser
89
    // HashMap to save ssl connection between Jmeter proxy and browser
90
    private static final HashMap<String, SSLSocketFactory> HOST2SSL_SOCK_FAC = new HashMap<String, SSLSocketFactory>();
90
    private static final HashMap<String, SSLSocketFactory> HOST2SSL_SOCK_FAC = new HashMap<>();
91
91
92
    private static final SamplerCreatorFactory SAMPLERFACTORY = new SamplerCreatorFactory();
92
    private static final SamplerCreatorFactory SAMPLERFACTORY = new SamplerCreatorFactory();
93
93
Lines 281-287 public class Proxy extends Thread { Link Here
281
            }
281
            }
282
            if(result != null) // deliverSampler allows sampler to be null, but result must not be null
282
            if(result != null) // deliverSampler allows sampler to be null, but result must not be null
283
            {
283
            {
284
                List<TestElement> children = new ArrayList<TestElement>();
284
                List<TestElement> children = new ArrayList<>();
285
                if(captureHttpHeaders) {
285
                if(captureHttpHeaders) {
286
                    children.add(headers);
286
                    children.add(headers);
287
                }
287
                }
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java (-3 / +3 lines)
Lines 364-374 public class ProxyControl extends GenericController { Link Here
364
    }
364
    }
365
365
366
    public void setIncludeList(Collection<String> list) {
366
    public void setIncludeList(Collection<String> list) {
367
        setProperty(new CollectionProperty(INCLUDE_LIST, new HashSet<String>(list)));
367
        setProperty(new CollectionProperty(INCLUDE_LIST, new HashSet<>(list)));
368
    }
368
    }
369
369
370
    public void setExcludeList(Collection<String> list) {
370
    public void setExcludeList(Collection<String> list) {
371
        setProperty(new CollectionProperty(EXCLUDE_LIST, new HashSet<String>(list)));
371
        setProperty(new CollectionProperty(EXCLUDE_LIST, new HashSet<>(list)));
372
    }
372
    }
373
373
374
    /**
374
    /**
Lines 1039-1045 public class ProxyControl extends GenericController { Link Here
1039
    // TODO - could be converted to generic class?
1039
    // TODO - could be converted to generic class?
1040
    private Collection<?> findApplicableElements(JMeterTreeNode myTarget, Class<? extends TestElement> myClass, boolean ascending) {
1040
    private Collection<?> findApplicableElements(JMeterTreeNode myTarget, Class<? extends TestElement> myClass, boolean ascending) {
1041
        JMeterTreeModel treeModel = GuiPackage.getInstance().getTreeModel();
1041
        JMeterTreeModel treeModel = GuiPackage.getInstance().getTreeModel();
1042
        LinkedList<TestElement> elements = new LinkedList<TestElement>();
1042
        LinkedList<TestElement> elements = new LinkedList<>();
1043
1043
1044
        // Look for elements directly within the HTTP proxy:
1044
        // Look for elements directly within the HTTP proxy:
1045
        Enumeration<?> kids = treeModel.getNodeOf(this).children();
1045
        Enumeration<?> kids = treeModel.getNodeOf(this).children();
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/proxy/SamplerCreatorFactory.java (-1 / +1 lines)
Lines 37-43 public class SamplerCreatorFactory { Link Here
37
37
38
    private static final SamplerCreator DEFAULT_SAMPLER_CREATOR = new DefaultSamplerCreator();
38
    private static final SamplerCreator DEFAULT_SAMPLER_CREATOR = new DefaultSamplerCreator();
39
39
40
    private final Map<String, SamplerCreator> samplerCreatorMap = new HashMap<String, SamplerCreator>();
40
    private final Map<String, SamplerCreator> samplerCreatorMap = new HashMap<>();
41
41
42
    /**
42
    /**
43
     * 
43
     * 
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java (-1 / +1 lines)
Lines 288-294 public class ProxyControlGui extends LogicControllerGui implements JMeterGUIComp Link Here
288
288
289
    private List<String> getDataList(PowerTableModel p_model, String colName) {
289
    private List<String> getDataList(PowerTableModel p_model, String colName) {
290
        String[] dataArray = p_model.getData().getColumn(colName);
290
        String[] dataArray = p_model.getData().getColumn(colName);
291
        List<String> list = new LinkedList<String>();
291
        List<String> list = new LinkedList<>();
292
        for (int i = 0; i < dataArray.length; i++) {
292
        for (int i = 0; i < dataArray.length; i++) {
293
            list.add(dataArray[i]);
293
            list.add(dataArray[i]);
294
        }
294
        }
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java (-2 / +2 lines)
Lines 103-109 public class HTTPHC3Impl extends HTTPHCAbstractImpl { Link Here
103
        new ThreadLocal<Map<HostConfiguration, HttpClient>>(){
103
        new ThreadLocal<Map<HostConfiguration, HttpClient>>(){
104
        @Override
104
        @Override
105
        protected Map<HostConfiguration, HttpClient> initialValue() {
105
        protected Map<HostConfiguration, HttpClient> initialValue() {
106
            return new HashMap<HostConfiguration, HttpClient>();
106
            return new HashMap<>();
107
        }
107
        }
108
    };
108
    };
109
109
Lines 750-756 public class HTTPHC3Impl extends HTTPHCAbstractImpl { Link Here
750
750
751
            final boolean browserCompatible = getDoBrowserCompatibleMultipart();
751
            final boolean browserCompatible = getDoBrowserCompatibleMultipart();
752
            // We don't know how many entries will be skipped
752
            // We don't know how many entries will be skipped
753
            ArrayList<PartBase> partlist = new ArrayList<PartBase>();
753
            ArrayList<PartBase> partlist = new ArrayList<>();
754
            // Create the parts
754
            // Create the parts
755
            // Add any parameters
755
            // Add any parameters
756
            PropertyIterator args = getArguments().iterator();
756
            PropertyIterator args = getArguments().iterator();
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java (-2 / +2 lines)
Lines 187-193 public class HTTPHC4Impl extends HTTPHCAbstractImpl { Link Here
187
        new ThreadLocal<Map<HttpClientKey, HttpClient>>(){
187
        new ThreadLocal<Map<HttpClientKey, HttpClient>>(){
188
        @Override
188
        @Override
189
        protected Map<HttpClientKey, HttpClient> initialValue() {
189
        protected Map<HttpClientKey, HttpClient> initialValue() {
190
            return new HashMap<HttpClientKey, HttpClient>();
190
            return new HashMap<>();
191
        }
191
        }
192
    };
192
    };
193
193
Lines 1136-1142 public class HTTPHC4Impl extends HTTPHCAbstractImpl { Link Here
1136
                    }
1136
                    }
1137
                    // Add the parameters
1137
                    // Add the parameters
1138
                    PropertyIterator args = getArguments().iterator();
1138
                    PropertyIterator args = getArguments().iterator();
1139
                    List <NameValuePair> nvps = new ArrayList <NameValuePair>();
1139
                    List <NameValuePair> nvps = new ArrayList<>();
1140
                    String urlContentEncoding = contentEncoding;
1140
                    String urlContentEncoding = contentEncoding;
1141
                    if(urlContentEncoding == null || urlContentEncoding.length() == 0) {
1141
                    if(urlContentEncoding == null || urlContentEncoding.length() == 0) {
1142
                        // Use the default encoding for urls
1142
                        // Use the default encoding for urls
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java (-2 / +2 lines)
Lines 61-69 public abstract class HTTPHCAbstractImpl extends HTTPAbstractImpl { Link Here
61
61
62
    protected static final String localHost;
62
    protected static final String localHost;
63
63
64
    protected static final Set<String> nonProxyHostFull = new HashSet<String>();
64
    protected static final Set<String> nonProxyHostFull = new HashSet<>();
65
65
66
    protected static final List<String> nonProxyHostSuffix = new ArrayList<String>();
66
    protected static final List<String> nonProxyHostSuffix = new ArrayList<>();
67
67
68
    protected static final int nonProxyHostSuffixSize;
68
    protected static final int nonProxyHostSuffixSize;
69
69
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java (-4 / +4 lines)
Lines 100-106 public abstract class HTTPSamplerBase extends AbstractSampler Link Here
100
100
101
    private static final Logger log = LoggingManager.getLoggerForClass();
101
    private static final Logger log = LoggingManager.getLoggerForClass();
102
102
103
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
103
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<>(
104
            Arrays.asList(new String[]{
104
            Arrays.asList(new String[]{
105
                    "org.apache.jmeter.config.gui.LoginConfigGui",
105
                    "org.apache.jmeter.config.gui.LoginConfigGui",
106
                    "org.apache.jmeter.protocol.http.config.gui.HttpDefaultsGui",
106
                    "org.apache.jmeter.protocol.http.config.gui.HttpDefaultsGui",
Lines 298-304 public abstract class HTTPSamplerBase extends AbstractSampler Link Here
298
298
299
299
300
    // Derive the mapping of content types to parsers
300
    // Derive the mapping of content types to parsers
301
    private static final Map<String, String> parsersForType = new HashMap<String, String>();
301
    private static final Map<String, String> parsersForType = new HashMap<>();
302
    // Not synch, but it is not modified after creation
302
    // Not synch, but it is not modified after creation
303
303
304
    private static final String RESPONSE_PARSERS= // list of parsers
304
    private static final String RESPONSE_PARSERS= // list of parsers
Lines 1232-1238 public abstract class HTTPSamplerBase extends AbstractSampler Link Here
1232
            }
1232
            }
1233
            
1233
            
1234
            // For concurrent get resources
1234
            // For concurrent get resources
1235
            final List<Callable<AsynSamplerResultHolder>> liste = new ArrayList<Callable<AsynSamplerResultHolder>>();
1235
            final List<Callable<AsynSamplerResultHolder>> liste = new ArrayList<>();
1236
1236
1237
            while (urls.hasNext()) {
1237
            while (urls.hasNext()) {
1238
                Object binURL = urls.next(); // See catch clause below
1238
                Object binURL = urls.next(); // See catch clause below
Lines 1963-1969 public abstract class HTTPSamplerBase extends AbstractSampler Link Here
1963
     *
1963
     *
1964
     */
1964
     */
1965
    private static class CleanerThread extends Thread {
1965
    private static class CleanerThread extends Thread {
1966
        private final List<HTTPSamplerBase> samplersToNotify = new ArrayList<HTTPSamplerBase>();
1966
        private final List<HTTPSamplerBase> samplersToNotify = new ArrayList<>();
1967
        /**
1967
        /**
1968
         * @param runnable Runnable
1968
         * @param runnable Runnable
1969
         */
1969
         */
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HttpWebdav.java (-2 / +2 lines)
Lines 31-38 import org.apache.jmeter.protocol.http.util.HTTPConstants; Link Here
31
 * @since 2.12
31
 * @since 2.12
32
 */
32
 */
33
public final class HttpWebdav extends HttpEntityEnclosingRequestBase {
33
public final class HttpWebdav extends HttpEntityEnclosingRequestBase {
34
    private static final Set<String> WEBDAV_METHODS = 
34
    private static final Set<String> WEBDAV_METHODS =
35
            new HashSet<String>(Arrays.asList(new String[] {
35
            new HashSet<>(Arrays.asList(new String[]{
36
                    HTTPConstants.PROPFIND,
36
                    HTTPConstants.PROPFIND,
37
                    HTTPConstants.PROPPATCH,
37
                    HTTPConstants.PROPPATCH,
38
                    HTTPConstants.MKCOL,
38
                    HTTPConstants.MKCOL,
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java (-1 / +1 lines)
Lines 533-539 public class WebServiceSampler extends HTTPSamplerBase { Link Here
533
            Hashtable<String,String> reqHeaders = null;
533
            Hashtable<String,String> reqHeaders = null;
534
            if(headerManager != null) {
534
            if(headerManager != null) {
535
                int size = headerManager.getHeaders().size();
535
                int size = headerManager.getHeaders().size();
536
                reqHeaders = new Hashtable<String, String>(size);
536
                reqHeaders = new Hashtable<>(size);
537
                for (int i = 0; i < size; i++) {
537
                for (int i = 0; i < size; i++) {
538
                    Header header = headerManager.get(i);
538
                    Header header = headerManager.get(i);
539
                    reqHeaders.put(header.getName(), header.getValue());
539
                    reqHeaders.put(header.getName(), header.getValue());
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java (-1 / +1 lines)
Lines 220-226 public class ConversionUtils { Link Here
220
        final boolean endsWithSlash = currentPath.endsWith(SLASH);
220
        final boolean endsWithSlash = currentPath.endsWith(SLASH);
221
221
222
        StringTokenizer st = new StringTokenizer(currentPath, SLASH);
222
        StringTokenizer st = new StringTokenizer(currentPath, SLASH);
223
        List<String> tokens = new ArrayList<String>();
223
        List<String> tokens = new ArrayList<>();
224
        while (st.hasMoreTokens())
224
        while (st.hasMoreTokens())
225
        {
225
        {
226
            tokens.add(st.nextToken());
226
            tokens.add(st.nextToken());
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/util/HTTPArgument.java (-1 / +1 lines)
Lines 252-258 public class HTTPArgument extends Argument implements Serializable { Link Here
252
     * @param args collection of {@link Argument} and/or {@link HTTPArgument} entries
252
     * @param args collection of {@link Argument} and/or {@link HTTPArgument} entries
253
     */
253
     */
254
    public static void convertArgumentsToHTTP(Arguments args) {
254
    public static void convertArgumentsToHTTP(Arguments args) {
255
        List<Argument> newArguments = new LinkedList<Argument>();
255
        List<Argument> newArguments = new LinkedList<>();
256
        PropertyIterator iter = args.getArguments().iterator();
256
        PropertyIterator iter = args.getArguments().iterator();
257
        while (iter.hasNext()) {
257
        while (iter.hasNext()) {
258
            Argument arg = (Argument) iter.next().getObjectValue();
258
            Argument arg = (Argument) iter.next().getObjectValue();
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java (-3 / +3 lines)
Lines 78-84 public class WSDLHelper { Link Here
78
78
79
    private Object[] SOAPOPS = null;
79
    private Object[] SOAPOPS = null;
80
80
81
    private final Map<String, String> ACTIONS = new HashMap<String, String>();
81
    private final Map<String, String> ACTIONS = new HashMap<>();
82
82
83
    private final AuthManager AUTH;
83
    private final AuthManager AUTH;
84
84
Lines 320-326 public class WSDLHelper { Link Here
320
     * @return Node[]
320
     * @return Node[]
321
     */
321
     */
322
    public Object[] getSOAPBindings() {
322
    public Object[] getSOAPBindings() {
323
        ArrayList<Element> list = new ArrayList<Element>();
323
        ArrayList<Element> list = new ArrayList<>();
324
        NodeList bindings = WSDLDOC.getElementsByTagNameNS(WSDL_NAMESPACE,"binding");
324
        NodeList bindings = WSDLDOC.getElementsByTagNameNS(WSDL_NAMESPACE,"binding");
325
        for (int idx = 0; idx < bindings.getLength(); idx++) {
325
        for (int idx = 0; idx < bindings.getLength(); idx++) {
326
            Element nd = (Element) bindings.item(idx);
326
            Element nd = (Element) bindings.item(idx);
Lines 357-363 public class WSDLHelper { Link Here
357
     */
357
     */
358
    public Object[] getOperations() {
358
    public Object[] getOperations() {
359
        Object[] res = this.getSOAPBindings();
359
        Object[] res = this.getSOAPBindings();
360
        ArrayList<Element> ops = new ArrayList<Element>();
360
        ArrayList<Element> ops = new ArrayList<>();
361
        // first we iterate through the bindings
361
        // first we iterate through the bindings
362
        for (int idx = 0; idx < res.length; idx++) {
362
        for (int idx = 0; idx < res.length; idx++) {
363
            Element one = (Element) res[idx];
363
            Element one = (Element) res[idx];
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/LogFilter.java (-2 / +2 lines)
Lines 97-105 public class LogFilter implements Filter, Serializable { Link Here
97
97
98
    protected boolean PTRNFILTER = false;
98
    protected boolean PTRNFILTER = false;
99
99
100
    protected ArrayList<Pattern> EXCPATTERNS = new ArrayList<Pattern>();
100
    protected ArrayList<Pattern> EXCPATTERNS = new ArrayList<>();
101
101
102
    protected ArrayList<Pattern> INCPATTERNS = new ArrayList<Pattern>();
102
    protected ArrayList<Pattern> INCPATTERNS = new ArrayList<>();
103
103
104
    protected String NEWFILE = null;
104
    protected String NEWFILE = null;
105
105
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/SessionFilter.java (-1 / +1 lines)
Lines 89-95 public class SessionFilter implements Filter, Serializable, TestCloneable,Thread Link Here
89
    public Object clone() {
89
    public Object clone() {
90
        if(cookieManagers == null)
90
        if(cookieManagers == null)
91
        {
91
        {
92
            cookieManagers = new ConcurrentHashMap<String, CookieManager>();
92
            cookieManagers = new ConcurrentHashMap<>();
93
        }
93
        }
94
        if(managersInUse == null)
94
        if(managersInUse == null)
95
        {
95
        {
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/TCLogParser.java (-1 / +1 lines)
Lines 551-557 public class TCLogParser implements LogParser { Link Here
551
     * @return List of name/value pairs
551
     * @return List of name/value pairs
552
     */
552
     */
553
    protected List<String> parseParameters(String parameters) {
553
    protected List<String> parseParameters(String parameters) {
554
        List<String> parsedParams = new ArrayList<String>();
554
        List<String> parsedParams = new ArrayList<>();
555
        StringTokenizer paramtokens = this.tokenize(parameters, "&");
555
        StringTokenizer paramtokens = this.tokenize(parameters, "&");
556
        while (paramtokens.hasMoreElements()) {
556
        while (paramtokens.hasMoreElements()) {
557
            parsedParams.add(paramtokens.nextToken());
557
            parsedParams.add(paramtokens.nextToken());
(-)a/src/protocol/http/org/apache/jmeter/protocol/http/visualizers/RequestViewHTTP.java (-1 / +1 lines)
Lines 229-235 public class RequestViewHTTP implements RequestView { Link Here
229
    //TODO: move to utils class (JMeterUtils?)
229
    //TODO: move to utils class (JMeterUtils?)
230
    public static Map<String, String> getQueryMap(String query) {
230
    public static Map<String, String> getQueryMap(String query) {
231
231
232
        Map<String, String> map = new HashMap<String, String>();
232
        Map<String, String> map = new HashMap<>();
233
        if (query.trim().startsWith("<?")) { // $NON-NLS-1$
233
        if (query.trim().startsWith("<?")) { // $NON-NLS-1$
234
            // SOAP request (generally)
234
            // SOAP request (generally)
235
            map.put(" ", query); //blank name // $NON-NLS-1$
235
            map.put(" ", query); //blank name // $NON-NLS-1$
(-)a/src/protocol/java/org/apache/jmeter/protocol/java/config/gui/JavaConfigGui.java (-2 / +2 lines)
Lines 124-130 public class JavaConfigGui extends AbstractConfigGui implements ActionListener { Link Here
124
     * @return a panel containing the relevant components
124
     * @return a panel containing the relevant components
125
     */
125
     */
126
    private JPanel createClassnamePanel() {
126
    private JPanel createClassnamePanel() {
127
        List<String> possibleClasses = new ArrayList<String>();
127
        List<String> possibleClasses = new ArrayList<>();
128
128
129
        try {
129
        try {
130
            // Find all the classes which implement the JavaSamplerClient
130
            // Find all the classes which implement the JavaSamplerClient
Lines 245-251 public class JavaConfigGui extends AbstractConfigGui implements ActionListener { Link Here
245
     */
245
     */
246
    private static final boolean checkContainsClassName(ComboBoxModel<String> model, String className) {
246
    private static final boolean checkContainsClassName(ComboBoxModel<String> model, String className) {
247
        int size = model.getSize();
247
        int size = model.getSize();
248
        Set<String> set = new HashSet<String>(size);
248
        Set<String> set = new HashSet<>(size);
249
        for (int i = 0; i < size; i++) {
249
        for (int i = 0; i < size; i++) {
250
            set.add(model.getElementAt(i));
250
            set.add(model.getElementAt(i));
251
        }
251
        }
(-)a/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BSFSampler.java (-1 / +1 lines)
Lines 46-52 import org.apache.log.Logger; Link Here
46
 */
46
 */
47
public class BSFSampler extends BSFTestElement implements Sampler, TestBean, ConfigMergabilityIndicator {
47
public class BSFSampler extends BSFTestElement implements Sampler, TestBean, ConfigMergabilityIndicator {
48
48
49
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
49
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<>(
50
            Arrays.asList(new String[]{
50
            Arrays.asList(new String[]{
51
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
51
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
52
52
(-)a/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java (-1 / +1 lines)
Lines 41-47 import org.apache.log.Logger; Link Here
41
 */
41
 */
42
public class BeanShellSampler extends BeanShellTestElement implements Sampler, Interruptible, ConfigMergabilityIndicator
42
public class BeanShellSampler extends BeanShellTestElement implements Sampler, Interruptible, ConfigMergabilityIndicator
43
{
43
{
44
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
44
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<>(
45
            Arrays.asList(new String[]{
45
            Arrays.asList(new String[]{
46
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
46
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
47
    
47
    
(-)a/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JSR223Sampler.java (-1 / +1 lines)
Lines 39-45 import org.apache.jorphan.logging.LoggingManager; Link Here
39
import org.apache.log.Logger;
39
import org.apache.log.Logger;
40
40
41
public class JSR223Sampler extends JSR223TestElement implements Cloneable, Sampler, TestBean, ConfigMergabilityIndicator {
41
public class JSR223Sampler extends JSR223TestElement implements Cloneable, Sampler, TestBean, ConfigMergabilityIndicator {
42
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
42
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<>(
43
            Arrays.asList(new String[]{
43
            Arrays.asList(new String[]{
44
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
44
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
45
45
(-)a/src/protocol/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java (-1 / +1 lines)
Lines 48-54 public class JavaSampler extends AbstractSampler implements TestStateListener { Link Here
48
48
49
    private static final long serialVersionUID = 232L; // Remember to change this when the class changes ...
49
    private static final long serialVersionUID = 232L; // Remember to change this when the class changes ...
50
50
51
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
51
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<>(
52
            Arrays.asList(new String[]{
52
            Arrays.asList(new String[]{
53
                    "org.apache.jmeter.protocol.java.config.gui.JavaConfigGui",
53
                    "org.apache.jmeter.protocol.java.config.gui.JavaConfigGui",
54
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
54
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
(-)a/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java (-5 / +5 lines)
Lines 81-87 public abstract class AbstractJDBCTestElement extends AbstractTestElement implem Link Here
81
    static {
81
    static {
82
        // based on e291. Getting the Name of a JDBC Type from javaalmanac.com
82
        // based on e291. Getting the Name of a JDBC Type from javaalmanac.com
83
        // http://javaalmanac.com/egs/java.sql/JdbcInt2Str.html
83
        // http://javaalmanac.com/egs/java.sql/JdbcInt2Str.html
84
        mapJdbcNameToInt = new HashMap<String, Integer>();
84
        mapJdbcNameToInt = new HashMap<>();
85
85
86
        //Get all fields in java.sql.Types and store the corresponding int values
86
        //Get all fields in java.sql.Types and store the corresponding int values
87
        Field[] fields = java.sql.Types.class.getFields();
87
        Field[] fields = java.sql.Types.class.getFields();
Lines 130-136 public abstract class AbstractJDBCTestElement extends AbstractTestElement implem Link Here
130
     *  At one time a Connection is only held by one thread
130
     *  At one time a Connection is only held by one thread
131
     */
131
     */
132
    private static final Map<Connection, Map<String, PreparedStatement>> perConnCache =
132
    private static final Map<Connection, Map<String, PreparedStatement>> perConnCache =
133
            new ConcurrentHashMap<Connection, Map<String, PreparedStatement>>();
133
            new ConcurrentHashMap<>();
134
134
135
    /**
135
    /**
136
     * Creates a JDBCSampler.
136
     * Creates a JDBCSampler.
Lines 240-246 public abstract class AbstractJDBCTestElement extends AbstractTestElement implem Link Here
240
            }
240
            }
241
        } while (result || (updateCount != -1));
241
        } while (result || (updateCount != -1));
242
        if (out!=null && pstmt instanceof CallableStatement){
242
        if (out!=null && pstmt instanceof CallableStatement){
243
            ArrayList<Object> outputValues = new ArrayList<Object>();
243
            ArrayList<Object> outputValues = new ArrayList<>();
244
            CallableStatement cs = (CallableStatement) pstmt;
244
            CallableStatement cs = (CallableStatement) pstmt;
245
            sb.append("Output variables by position:\n");
245
            sb.append("Output variables by position:\n");
246
            for(int i=0; i < out.length; i++){
246
            for(int i=0; i < out.length; i++){
Lines 435-441 public abstract class AbstractJDBCTestElement extends AbstractTestElement implem Link Here
435
        String resultVariable = getResultVariable().trim();
435
        String resultVariable = getResultVariable().trim();
436
        List<Map<String, Object> > results = null;
436
        List<Map<String, Object> > results = null;
437
        if(resultVariable.length() > 0) {
437
        if(resultVariable.length() > 0) {
438
            results = new ArrayList<Map<String,Object> >();
438
            results = new ArrayList<>();
439
            jmvars.putObject(resultVariable, results);
439
            jmvars.putObject(resultVariable, results);
440
        }
440
        }
441
        int j = 0;
441
        int j = 0;
Lines 446-452 public abstract class AbstractJDBCTestElement extends AbstractTestElement implem Link Here
446
                Object o = rs.getObject(i);
446
                Object o = rs.getObject(i);
447
                if(results != null) {
447
                if(results != null) {
448
                    if(row == null) {
448
                    if(row == null) {
449
                        row = new HashMap<String, Object>(numColumns);
449
                        row = new HashMap<>(numColumns);
450
                        results.add(row);
450
                        results.add(row);
451
                    }
451
                    }
452
                    row.put(meta.getColumnLabel(i), o);
452
                    row.put(meta.getColumnLabel(i), o);
(-)a/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java (-1 / +1 lines)
Lines 245-251 public class DataSourceElement extends AbstractTestElement Link Here
245
        new ThreadLocal<Map<String, ResourceLimitingJdbcDataSource>>(){
245
        new ThreadLocal<Map<String, ResourceLimitingJdbcDataSource>>(){
246
        @Override
246
        @Override
247
        protected Map<String, ResourceLimitingJdbcDataSource> initialValue() {
247
        protected Map<String, ResourceLimitingJdbcDataSource> initialValue() {
248
            return new HashMap<String, ResourceLimitingJdbcDataSource>();
248
            return new HashMap<>();
249
        }
249
        }
250
    };
250
    };
251
251
(-)a/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config/DataSourceElementBeanInfo.java (-1 / +1 lines)
Lines 35-41 import org.apache.log.Logger; Link Here
35
35
36
public class DataSourceElementBeanInfo extends BeanInfoSupport {
36
public class DataSourceElementBeanInfo extends BeanInfoSupport {
37
    private static final Logger log = LoggingManager.getLoggerForClass();
37
    private static final Logger log = LoggingManager.getLoggerForClass();
38
    private static Map<String,Integer> TRANSACTION_ISOLATION_MAP = new HashMap<String, Integer>(5);
38
    private static Map<String,Integer> TRANSACTION_ISOLATION_MAP = new HashMap<>(5);
39
    static {
39
    static {
40
        // Will use default isolation
40
        // Will use default isolation
41
        TRANSACTION_ISOLATION_MAP.put("DEFAULT", Integer.valueOf(-1));
41
        TRANSACTION_ISOLATION_MAP.put("DEFAULT", Integer.valueOf(-1));
(-)a/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java (-1 / +1 lines)
Lines 42-48 import org.apache.log.Logger; Link Here
42
 *
42
 *
43
 */
43
 */
44
public class JDBCSampler extends AbstractJDBCTestElement implements Sampler, TestBean, ConfigMergabilityIndicator {
44
public class JDBCSampler extends AbstractJDBCTestElement implements Sampler, TestBean, ConfigMergabilityIndicator {
45
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
45
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<>(
46
            Arrays.asList(new String[]{
46
            Arrays.asList(new String[]{
47
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
47
                    "org.apache.jmeter.config.gui.SimpleConfigGui"}));
48
    
48
    
(-)a/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ClientPool.java (-2 / +2 lines)
Lines 35-44 import java.util.concurrent.ConcurrentHashMap; Link Here
35
public class ClientPool {
35
public class ClientPool {
36
36
37
    //GuardedBy("this")
37
    //GuardedBy("this")
38
    private static final ArrayList<Closeable> clients = new ArrayList<Closeable>();
38
    private static final ArrayList<Closeable> clients = new ArrayList<>();
39
39
40
    //GuardedBy("this")
40
    //GuardedBy("this")
41
    private static final Map<Object, Object> client_map = new ConcurrentHashMap<Object, Object>();
41
    private static final Map<Object, Object> client_map = new ConcurrentHashMap<>();
42
42
43
    /**
43
    /**
44
     * Add a ReceiveClient to the ClientPool. This is so that we can make sure
44
     * Add a ReceiveClient to the ClientPool. This is so that we can make sure
(-)a/src/protocol/jms/org/apache/jmeter/protocol/jms/client/InitialContextFactory.java (-1 / +1 lines)
Lines 34-40 import org.apache.log.Logger; Link Here
34
 */
34
 */
35
public class InitialContextFactory {
35
public class InitialContextFactory {
36
36
37
    private static final ConcurrentHashMap<String, Context> MAP = new ConcurrentHashMap<String, Context>();
37
    private static final ConcurrentHashMap<String, Context> MAP = new ConcurrentHashMap<>();
38
38
39
    private static final Logger log = LoggingManager.getLoggerForClass();
39
    private static final Logger log = LoggingManager.getLoggerForClass();
40
40
(-)a/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ReceiveSubscriber.java (-2 / +2 lines)
Lines 239-247 public class ReceiveSubscriber implements Closeable, MessageListener { Link Here
239
            subscriber = createSubscriber(session, dest, durableSubscriptionId, jmsSelector);
239
            subscriber = createSubscriber(session, dest, durableSubscriptionId, jmsSelector);
240
            if(useMessageListener) {
240
            if(useMessageListener) {
241
                if (queueSize <=0) {
241
                if (queueSize <=0) {
242
                    queue = new LinkedBlockingQueue<Message>();
242
                    queue = new LinkedBlockingQueue<>();
243
                } else {
243
                } else {
244
                    queue = new LinkedBlockingQueue<Message>(queueSize);            
244
                    queue = new LinkedBlockingQueue<>(queueSize);
245
                }
245
                }
246
                subscriber.setMessageListener(this);
246
                subscriber.setMessageListener(this);
247
            } else {
247
            } else {
(-)a/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSProperties.java (-1 / +1 lines)
Lines 85-91 public class JMSProperties extends AbstractTestElement implements Serializable { Link Here
85
     */
85
     */
86
    public Map<String, Object> getJmsPropertysAsMap() {
86
    public Map<String, Object> getJmsPropertysAsMap() {
87
        PropertyIterator iter = getProperties().iterator();
87
        PropertyIterator iter = getProperties().iterator();
88
        Map<String, Object> argMap = new LinkedHashMap<String, Object>();
88
        Map<String, Object> argMap = new LinkedHashMap<>();
89
        while (iter.hasNext()) {
89
        while (iter.hasNext()) {
90
            JMSProperty arg = (JMSProperty) iter.next().getObjectValue();
90
            JMSProperty arg = (JMSProperty) iter.next().getObjectValue();
91
            // Because CollectionProperty.mergeIn will not prevent adding two
91
            // Because CollectionProperty.mergeIn will not prevent adding two
(-)a/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java (-1 / +1 lines)
Lines 396-402 public class JMSSampler extends AbstractSampler implements ThreadListener { Link Here
396
    }
396
    }
397
397
398
    private Context getInitialContext() throws NamingException {
398
    private Context getInitialContext() throws NamingException {
399
        Hashtable<String, String> table = new Hashtable<String, String>();
399
        Hashtable<String, String> table = new Hashtable<>();
400
400
401
        if (getInitialContextFactory() != null && getInitialContextFactory().trim().length() > 0) {
401
        if (getInitialContextFactory() != null && getInitialContextFactory().trim().length() > 0) {
402
            if (LOGGER.isDebugEnabled()) {
402
            if (LOGGER.isDebugEnabled()) {
(-)a/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/MessageAdmin.java (-1 / +1 lines)
Lines 34-40 import org.apache.log.Logger; Link Here
34
public class MessageAdmin {
34
public class MessageAdmin {
35
    private static final MessageAdmin SINGLETON = new MessageAdmin();
35
    private static final MessageAdmin SINGLETON = new MessageAdmin();
36
36
37
    private final Map<String, PlaceHolder> table = new ConcurrentHashMap<String, PlaceHolder>();
37
    private final Map<String, PlaceHolder> table = new ConcurrentHashMap<>();
38
38
39
    private static final Logger log = LoggingManager.getLoggerForClass();
39
    private static final Logger log = LoggingManager.getLoggerForClass();
40
40
(-)a/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/PublisherSampler.java (-1 / +1 lines)
Lines 214-220 public class PublisherSampler extends BaseJMSSampler implements TestStateListene Link Here
214
    }
214
    }
215
215
216
    private Map<String, Object> getMapContent() throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
216
    private Map<String, Object> getMapContent() throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
217
        Map<String,Object> m = new HashMap<String,Object>();
217
        Map<String,Object> m = new HashMap<>();
218
        String text = getMessageContent();
218
        String text = getMessageContent();
219
        String[] lines = text.split("\n");
219
        String[] lines = text.split("\n");
220
        for (String line : lines){
220
        for (String line : lines){
(-)a/src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/gui/LDAPArguments.java (-3 / +3 lines)
Lines 48-54 public class LDAPArguments extends ConfigTestElement implements Serializable { Link Here
48
     * Create a new Arguments object with no arguments.
48
     * Create a new Arguments object with no arguments.
49
     */
49
     */
50
    public LDAPArguments() {
50
    public LDAPArguments() {
51
        setProperty(new CollectionProperty(ARGUMENTS, new ArrayList<Object>()));
51
        setProperty(new CollectionProperty(ARGUMENTS, new ArrayList<>()));
52
    }
52
    }
53
53
54
    /**
54
    /**
Lines 66-72 public class LDAPArguments extends ConfigTestElement implements Serializable { Link Here
66
    @Override
66
    @Override
67
    public void clear() {
67
    public void clear() {
68
        super.clear();
68
        super.clear();
69
        setProperty(new CollectionProperty(ARGUMENTS, new ArrayList<Object>()));
69
        setProperty(new CollectionProperty(ARGUMENTS, new ArrayList<>()));
70
    }
70
    }
71
71
72
    /**
72
    /**
Lines 87-93 public class LDAPArguments extends ConfigTestElement implements Serializable { Link Here
87
     */
87
     */
88
    public Map<String, String> getArgumentsAsMap() {
88
    public Map<String, String> getArgumentsAsMap() {
89
        PropertyIterator iter = getArguments().iterator();
89
        PropertyIterator iter = getArguments().iterator();
90
        Map<String, String> argMap = new HashMap<String, String>();
90
        Map<String, String> argMap = new HashMap<>();
91
        while (iter.hasNext()) {
91
        while (iter.hasNext()) {
92
            LDAPArgument arg = (LDAPArgument) iter.next().getObjectValue();
92
            LDAPArgument arg = (LDAPArgument) iter.next().getObjectValue();
93
            argMap.put(arg.getName(), arg.getValue());
93
            argMap.put(arg.getName(), arg.getValue());
(-)a/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java (-5 / +5 lines)
Lines 70-76 public class LDAPExtSampler extends AbstractSampler implements TestStateListener Link Here
70
70
71
    private static final long serialVersionUID = 240L;
71
    private static final long serialVersionUID = 240L;
72
72
73
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<String>(
73
    private static final Set<String> APPLIABLE_CONFIG_CLASSES = new HashSet<>(
74
            Arrays.asList(new String[]{
74
            Arrays.asList(new String[]{
75
                    "org.apache.jmeter.protocol.ldap.config.gui.LdapConfigGui",
75
                    "org.apache.jmeter.protocol.ldap.config.gui.LdapConfigGui",
76
                    "org.apache.jmeter.protocol.ldap.config.gui.LdapExtConfigGui",
76
                    "org.apache.jmeter.protocol.ldap.config.gui.LdapExtConfigGui",
Lines 152-158 public class LDAPExtSampler extends AbstractSampler implements TestStateListener Link Here
152
152
153
153
154
    private static final ConcurrentHashMap<String, DirContext> ldapContexts =