Skip to content

Commit 4e219c0

Browse files
committed
test: use <> diamond operator in Java tests
1 parent f7e9673 commit 4e219c0

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/core/src/test/java/org/apache/jmeter/testelement/property/AbstractPropertyTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ public void testNormalizeListWithEmptyList() {
7474

7575
@Test
7676
public void testNormalizeListWithEmptyArrayList() {
77-
Collection<JMeterProperty> emptyCollection = new ArrayList<JMeterProperty>();
77+
Collection<JMeterProperty> emptyCollection = new ArrayList<>();
7878
Collection<JMeterProperty> newCollection = dummyProperty.normalizeList(emptyCollection);
7979
assertThat(newCollection, CoreMatchers.not(CoreMatchers.sameInstance(emptyCollection)));
8080
assertThat(newCollection, CoreMatchers.equalTo(emptyCollection));
8181
}
8282

8383
@Test
8484
public void testNormalizeListWithFilledArrayList() {
85-
List<JMeterProperty> filledCollection = new ArrayList<JMeterProperty>();
85+
List<JMeterProperty> filledCollection = new ArrayList<>();
8686
filledCollection.add(new StringProperty("key", "value"));
8787
Collection<JMeterProperty> newCollection = dummyProperty.normalizeList(filledCollection);
8888
assertThat(newCollection, CoreMatchers.not(CoreMatchers.sameInstance(filledCollection)));

src/core/src/test/java/org/apache/jmeter/testelement/property/MapPropertyTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void testBug62281MapProperty() {
3535

3636
@Test
3737
public void testGetPropertyTypeOfEmptyMap() {
38-
MapProperty props = new MapProperty("foo", new HashMap<Object, Object>());
38+
MapProperty props = new MapProperty("foo", new HashMap<>());
3939
assertThat(props.getPropertyType(), CoreMatchers.equalTo(NullProperty.class));
4040
}
4141

src/core/src/test/java/org/apache/jmeter/util/XPathUtilTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void testBug63033() throws SaxonApiException {
8080
@Test
8181
public void testputValuesForXPathInListUsingSaxon() throws SaxonApiException, FactoryConfigurationError{
8282
String xPathQuery="//Employees/Employee/role";
83-
ArrayList<String> matchStrings = new ArrayList<String>();
83+
ArrayList<String> matchStrings = new ArrayList<>();
8484
boolean fragment = false;
8585
String namespaces = "age=http://www.w3.org/2003/01/geo/wgs84_pos#";
8686
int matchNumber = 3;

src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,15 @@ public void testParserSet() throws Exception {
368368
public void testParserList() throws Exception {
369369
HTMLParser p = (HTMLParser) BaseParser.getParser(parserName);
370370
filetest(p, TESTS[testNumber].fileName, TESTS[testNumber].baseUrl, TESTS[testNumber].expectedList,
371-
new Vector<URLString>(), true, TESTS[testNumber].userAgent);
371+
new Vector<>(), true, TESTS[testNumber].userAgent);
372372
}
373373

374374
public void testSpecificParserList() throws Exception {
375375
HTMLParser p = (HTMLParser) BaseParser.getParser(parserName);
376376
filetest(p, SPECIFIC_PARSER_TESTS[testNumber].fileName,
377377
SPECIFIC_PARSER_TESTS[testNumber].baseUrl,
378378
SPECIFIC_PARSER_TESTS[testNumber].expectedList,
379-
new ArrayList<URLString>(), true,
379+
new ArrayList<>(), true,
380380
SPECIFIC_PARSER_TESTS[testNumber].userAgent);
381381
}
382382

src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,8 @@ private HTTPSamplerBase getSamplerForRequest(String url, String request, String
646646
}
647647
req.parse(bis);
648648
bis.close();
649-
Map<String, String> pageEncodings = Collections.synchronizedMap(new HashMap<String, String>());
650-
Map<String, String> formEncodings = Collections.synchronizedMap(new HashMap<String, String>());
649+
Map<String, String> pageEncodings = Collections.synchronizedMap(new HashMap<>());
650+
Map<String, String> formEncodings = Collections.synchronizedMap(new HashMap<>());
651651
if(url != null && contentEncoding != null) {
652652
pageEncodings.put(url, contentEncoding);
653653
}

0 commit comments

Comments
 (0)