diff --git a/src/main/java/com/norconex/commons/lang/map/Properties.java b/src/main/java/com/norconex/commons/lang/map/Properties.java index 75e7600d..305089da 100644 --- a/src/main/java/com/norconex/commons/lang/map/Properties.java +++ b/src/main/java/com/norconex/commons/lang/map/Properties.java @@ -58,8 +58,6 @@ import org.apache.commons.text.translate.UnicodeEscaper; import org.json.JSONObject; import org.json.JSONTokener; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import com.norconex.commons.lang.EqualsUtil; import com.norconex.commons.lang.bean.BeanException; @@ -69,6 +67,8 @@ import com.norconex.commons.lang.convert.GenericConverter; import com.norconex.commons.lang.text.TextMatcher; +import lombok.extern.slf4j.Slf4j; + /** *

This class is a enhanced version of {@link java.util.Properties} * that enforces the use of String keys and values internally, but offers many @@ -99,6 +99,7 @@ *

Upon encountering a problem in parsing a value to * its desired type, a {@link PropertiesException} is thrown.

*/ +@Slf4j public class Properties extends ObservableMap> implements Serializable { @@ -114,7 +115,6 @@ public class Properties extends ObservableMap> // entered (to know which case-version to use). private static final long serialVersionUID = -7215126924574341L; - private static final Logger LOG = LoggerFactory.getLogger(Properties.class); //MAYBE still support this? private final boolean caseInsensitiveKeys; diff --git a/src/main/java/com/norconex/commons/lang/map/PropertyMatchers.java b/src/main/java/com/norconex/commons/lang/map/PropertyMatchers.java index e7c2a0a4..caa1691e 100644 --- a/src/main/java/com/norconex/commons/lang/map/PropertyMatchers.java +++ b/src/main/java/com/norconex/commons/lang/map/PropertyMatchers.java @@ -17,7 +17,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.Iterator; import java.util.List; import java.util.function.Predicate; @@ -62,10 +61,10 @@ public boolean addAll(Collection matchers) { * @return how many matchers were removed */ public synchronized int remove(String field) { - Iterator it = iterator(); - int count = 0; + var it = iterator(); + var count = 0; while (it.hasNext()) { - PropertyMatcher m = it.next(); + var m = it.next(); if (m.getFieldMatcher().matches(field)) { it.remove(); count++; @@ -116,12 +115,12 @@ public boolean test(Properties properties) { * @see #test(Properties) */ public Properties match(Properties properties) { - Properties props = new Properties(); + var props = new Properties(); if (properties == null) { return props; } for (PropertyMatcher matcher : this) { - Properties matches = matcher.match(properties); + var matches = matcher.match(properties); if (!matches.isEmpty()) { props.putAll(matches); } @@ -139,12 +138,12 @@ public Properties match(Properties properties) { * @return properties that were replaced with their original values */ public Properties replace(Properties properties, String replacement) { - Properties props = new Properties(); + var props = new Properties(); if (properties == null) { return props; } for (PropertyMatcher matcher : this) { - Properties replaced = matcher.replace(properties, replacement); + var replaced = matcher.replace(properties, replacement); if (!replaced.isEmpty()) { props.putAll(replaced); } diff --git a/src/main/java/com/norconex/commons/lang/xml/XML.java b/src/main/java/com/norconex/commons/lang/xml/XML.java index ef088ded..4f5128e5 100644 --- a/src/main/java/com/norconex/commons/lang/xml/XML.java +++ b/src/main/java/com/norconex/commons/lang/xml/XML.java @@ -342,7 +342,6 @@ public XML create() { "$1$2 xml:space=\"empty\" $3$4"); Element node = null; try { - documentBuilderFactory.setNamespaceAware(false); node = documentBuilderFactory.newDocumentBuilder() .parse(new InputSource(new StringReader(xmlStr))) .getDocumentElement();