Java 17 features (H-M) (#15520)
- add missing @override - Java style array syntax - remove redundant modifiers - always move String constants to left side in comparisons - simplify lambda expressions and return statements - use replace instead of replaceAll w/o regex - instanceof matching and multiline strings - remove null check before instanceof Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
@@ -39,9 +39,7 @@ public class HPFeatures {
|
||||
boolean localScannerStatus = false;
|
||||
|
||||
for (Node n = root.getFirstChild(); n != null; n = n.getNextSibling()) {
|
||||
if (n instanceof Element) {
|
||||
Element feature = (Element) n;
|
||||
|
||||
if (n instanceof Element feature) {
|
||||
NodeList resourceType = feature.getElementsByTagName("dd:ResourceType");
|
||||
|
||||
if (resourceType.getLength() > 0) {
|
||||
|
||||
@@ -279,8 +279,7 @@ public class HPUsage {
|
||||
int value = 0;
|
||||
|
||||
for (Node n = parentNode.getFirstChild(); n != null; n = n.getNextSibling()) {
|
||||
if (n instanceof Element) {
|
||||
Element nodeItem = (Element) n;
|
||||
if (n instanceof Element nodeItem) {
|
||||
if (nodeItem.getElementsByTagName(collateTagName).item(0).getTextContent()
|
||||
.equalsIgnoreCase(collateTagNameValue)) {
|
||||
int nodeValue = Integer
|
||||
|
||||
Reference in New Issue
Block a user