@@ -349,7 +349,7 @@ public void setProxySettings(Proxy proxy) {
349
349
switch (proxy .getProxyType ()) {
350
350
case MANUAL :
351
351
352
- ArrayList <String > noProxyHosts = new ArrayList <String >();
352
+ ArrayList <String > noProxyHosts = new ArrayList <>();
353
353
String noProxy = proxy .getNoProxy ();
354
354
if (noProxy != null && !noProxy .equals ("" )) {
355
355
String [] hosts = noProxy .split ("," );
@@ -735,14 +735,14 @@ private Object parseArgumentIntoJavascriptParameter(
735
735
return element .getScriptObject ();
736
736
737
737
} else if (arg instanceof Collection <?>) {
738
- List <Object > list = new ArrayList <Object >();
738
+ List <Object > list = new ArrayList <>();
739
739
for (Object o : (Collection <?>) arg ) {
740
740
list .add (parseArgumentIntoJavascriptParameter (context , scope , o ));
741
741
}
742
742
return context .newArray (scope , list .toArray ());
743
743
744
744
} else if (arg .getClass ().isArray ()) {
745
- List <Object > list = new ArrayList <Object >();
745
+ List <Object > list = new ArrayList <>();
746
746
for (Object o : (Object []) arg ) {
747
747
list .add (parseArgumentIntoJavascriptParameter (context , scope , o ));
748
748
}
@@ -899,7 +899,7 @@ private Map<String, Object> convertLocationToMap(Location location) {
899
899
}
900
900
901
901
private List <Object > parseJavascriptResultsList (JavaScriptResultsCollection array ) {
902
- List <Object > list = new ArrayList <Object >(array .getLength ());
902
+ List <Object > list = new ArrayList <>(array .getLength ());
903
903
for (int i = 0 ; i < array .getLength (); ++i ) {
904
904
list .add (parseNativeJavascriptResult (array .item (i )));
905
905
}
@@ -951,7 +951,7 @@ protected WebElement newHtmlUnitWebElement(HtmlElement element) {
951
951
952
952
@ Override
953
953
public List <WebElement > findElementsByLinkText (String selector ) {
954
- List <WebElement > elements = new ArrayList <WebElement >();
954
+ List <WebElement > elements = new ArrayList <>();
955
955
956
956
if (!(lastPage () instanceof HtmlPage )) {
957
957
return elements ;
@@ -1037,7 +1037,7 @@ public List<WebElement> findElementsByCssSelector(String using) {
1037
1037
throw new NoSuchElementException ("Unable to locate element using css" , ex );
1038
1038
}
1039
1039
1040
- List <WebElement > toReturn = new ArrayList <WebElement >();
1040
+ List <WebElement > toReturn = new ArrayList <>();
1041
1041
1042
1042
for (DomNode node : allNodes ) {
1043
1043
if (node instanceof HtmlElement ) {
@@ -1067,7 +1067,7 @@ public WebElement findElementByName(String name) {
1067
1067
@ Override
1068
1068
public List <WebElement > findElementsByName (String using ) {
1069
1069
if (!(lastPage () instanceof HtmlPage )) {
1070
- return new ArrayList <WebElement >();
1070
+ return new ArrayList <>();
1071
1071
}
1072
1072
1073
1073
List <DomElement > allElements = ((HtmlPage ) lastPage ()).getElementsByName (using );
@@ -1091,11 +1091,11 @@ public WebElement findElementByTagName(String name) {
1091
1091
@ Override
1092
1092
public List <WebElement > findElementsByTagName (String using ) {
1093
1093
if (!(lastPage () instanceof HtmlPage )) {
1094
- return new ArrayList <WebElement >();
1094
+ return new ArrayList <>();
1095
1095
}
1096
1096
1097
1097
NodeList allElements = ((HtmlPage ) lastPage ()).getElementsByTagName (using );
1098
- List <WebElement > toReturn = new ArrayList <WebElement >(allElements .getLength ());
1098
+ List <WebElement > toReturn = new ArrayList <>(allElements .getLength ());
1099
1099
for (int i = 0 ; i < allElements .getLength (); i ++) {
1100
1100
Node item = allElements .item (i );
1101
1101
if (item instanceof HtmlElement ) {
@@ -1135,7 +1135,7 @@ public WebElement findElementByXPath(String selector) {
1135
1135
@ Override
1136
1136
public List <WebElement > findElementsByXPath (String selector ) {
1137
1137
if (!(lastPage () instanceof HtmlPage )) {
1138
- return new ArrayList <WebElement >();
1138
+ return new ArrayList <>();
1139
1139
}
1140
1140
1141
1141
List <?> nodes ;
@@ -1167,7 +1167,7 @@ public List<WebElement> findElementsByXPath(String selector) {
1167
1167
}
1168
1168
1169
1169
private List <WebElement > convertRawHtmlElementsToWebElements (List <?> nodes ) {
1170
- List <WebElement > elements = new ArrayList <WebElement >();
1170
+ List <WebElement > elements = new ArrayList <>();
1171
1171
1172
1172
for (Object node : nodes ) {
1173
1173
if (node instanceof HtmlElement ) {
@@ -1658,7 +1658,7 @@ public WebElement findElementByPartialLinkText(String using) {
1658
1658
@ Override
1659
1659
public List <WebElement > findElementsByPartialLinkText (String using ) {
1660
1660
List <HtmlAnchor > anchors = ((HtmlPage ) lastPage ()).getAnchors ();
1661
- List <WebElement > elements = new ArrayList <WebElement >();
1661
+ List <WebElement > elements = new ArrayList <>();
1662
1662
for (HtmlAnchor anchor : anchors ) {
1663
1663
if (anchor .asText ().contains (using )) {
1664
1664
elements .add (newHtmlUnitWebElement (anchor ));
0 commit comments