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