You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2019/05/23 18:30:40 UTC
[commons-configuration] branch master updated (3a87e6e -> 60b3883)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-configuration.git.
from 3a87e6e Checktyle. Don't use magic numbers. Also refactor UnicodeEscaper into a constant.
new c1898cd Checkstyle.
new 60b3883 Fix remaining checkstyle issues.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../builder/INIBuilderParametersImpl.java | 10 ++++-
.../builder/INIBuilderProperties.java | 9 +++--
.../interpol/ConfigurationInterpolator.java | 44 +++++++++++-----------
.../configuration2/interpol/DefaultLookups.java | 12 ++++--
.../interpol/StringLookupAdapter.java | 12 ++++--
5 files changed, 53 insertions(+), 34 deletions(-)
[commons-configuration] 01/02: Checkstyle.
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-configuration.git
commit c1898cd7b5331931867b009f0c8905da57286512
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu May 23 14:23:57 2019 -0400
Checkstyle.
---
.../commons/configuration2/interpol/DefaultLookups.java | 12 ++++++++----
.../commons/configuration2/interpol/StringLookupAdapter.java | 12 +++++++++---
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/src/main/java/org/apache/commons/configuration2/interpol/DefaultLookups.java b/src/main/java/org/apache/commons/configuration2/interpol/DefaultLookups.java
index 8984a38..6c4353f 100644
--- a/src/main/java/org/apache/commons/configuration2/interpol/DefaultLookups.java
+++ b/src/main/java/org/apache/commons/configuration2/interpol/DefaultLookups.java
@@ -56,7 +56,8 @@ import org.apache.commons.text.lookup.StringLookupFactory;
*
* @since 2.0
*/
-public enum DefaultLookups {
+public enum DefaultLookups
+{
/**
* The lookup for Base64 decoding.
@@ -190,7 +191,8 @@ public enum DefaultLookups {
* @param lookup
* the {@code Lookup} instance
*/
- private DefaultLookups(final String prefix, final Lookup lookup) {
+ private DefaultLookups(final String prefix, final Lookup lookup)
+ {
this.prefix = prefix;
this.lookup = lookup;
}
@@ -200,7 +202,8 @@ public enum DefaultLookups {
*
* @return the associated {@code Lookup} object
*/
- public Lookup getLookup() {
+ public Lookup getLookup()
+ {
return lookup;
}
@@ -209,7 +212,8 @@ public enum DefaultLookups {
*
* @return the prefix
*/
- public String getPrefix() {
+ public String getPrefix()
+ {
return prefix;
}
}
diff --git a/src/main/java/org/apache/commons/configuration2/interpol/StringLookupAdapter.java b/src/main/java/org/apache/commons/configuration2/interpol/StringLookupAdapter.java
index 74bf673..b2ca9e6 100644
--- a/src/main/java/org/apache/commons/configuration2/interpol/StringLookupAdapter.java
+++ b/src/main/java/org/apache/commons/configuration2/interpol/StringLookupAdapter.java
@@ -25,17 +25,23 @@ import org.apache.commons.text.lookup.StringLookup;
*
* @since 2.4
*/
-class StringLookupAdapter implements Lookup {
+class StringLookupAdapter implements Lookup
+{
+ /**
+ * The StringLookup delegate.
+ */
private final StringLookup stringLookup;
- StringLookupAdapter(final StringLookup stringLookup) {
+ StringLookupAdapter(final StringLookup stringLookup)
+ {
super();
this.stringLookup = Objects.requireNonNull(stringLookup, "stringLookup");
}
@Override
- public Object lookup(final String key) {
+ public Object lookup(final String key)
+ {
return stringLookup.lookup(key);
}
[commons-configuration] 02/02: Fix remaining checkstyle issues.
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-configuration.git
commit 60b38833c29205039378c043fc3f1c10ec1cce70
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu May 23 14:30:37 2019 -0400
Fix remaining checkstyle issues.
---
.../builder/INIBuilderParametersImpl.java | 10 ++++-
.../builder/INIBuilderProperties.java | 9 +++--
.../interpol/ConfigurationInterpolator.java | 44 +++++++++++-----------
3 files changed, 36 insertions(+), 27 deletions(-)
diff --git a/src/main/java/org/apache/commons/configuration2/builder/INIBuilderParametersImpl.java b/src/main/java/org/apache/commons/configuration2/builder/INIBuilderParametersImpl.java
index 2b90b12..a676787 100644
--- a/src/main/java/org/apache/commons/configuration2/builder/INIBuilderParametersImpl.java
+++ b/src/main/java/org/apache/commons/configuration2/builder/INIBuilderParametersImpl.java
@@ -40,8 +40,12 @@ public class INIBuilderParametersImpl extends HierarchicalBuilderParametersImpl
/** The key for the separatorUsedInINIOutput property. */
private static final String PROP_SEPARATOR_USED_IN_INI_OUTPUT
= "separatorUsedInOutput";
+
+ /** The key for the separatorUsedInInput property. */
private static final String PROP_SEPARATOR_USED_IN_INI_INPUT
= "separatorUsedInInput";
+
+ /** The key for the commentLeadingCharsUsedInInput property. */
private static final String PROP_COMMENT_LEADING_SEPARATOR_USED_IN_INI_INPUT
= "commentLeadingCharsUsedInInput";
@@ -62,13 +66,15 @@ public class INIBuilderParametersImpl extends HierarchicalBuilderParametersImpl
}
@Override
- public INIBuilderParametersImpl setSeparatorUsedInInput(final String separator) {
+ public INIBuilderParametersImpl setSeparatorUsedInInput(final String separator)
+ {
storeProperty(PROP_SEPARATOR_USED_IN_INI_INPUT, separator);
return this;
}
@Override
- public INIBuilderParametersImpl setCommentLeadingCharsUsedInInput(final String separator) {
+ public INIBuilderParametersImpl setCommentLeadingCharsUsedInInput(final String separator)
+ {
storeProperty(PROP_COMMENT_LEADING_SEPARATOR_USED_IN_INI_INPUT, separator);
return this;
}
diff --git a/src/main/java/org/apache/commons/configuration2/builder/INIBuilderProperties.java b/src/main/java/org/apache/commons/configuration2/builder/INIBuilderProperties.java
index b196eb5..541e6b1 100644
--- a/src/main/java/org/apache/commons/configuration2/builder/INIBuilderProperties.java
+++ b/src/main/java/org/apache/commons/configuration2/builder/INIBuilderProperties.java
@@ -33,7 +33,8 @@ package org.apache.commons.configuration2.builder;
* @since 2.2
* @param <T> the type of the result of all set methods for method chaining
*/
-public interface INIBuilderProperties<T> {
+public interface INIBuilderProperties<T>
+{
/**
* Allows setting the leading comment separator which is used in reading an INI
@@ -43,7 +44,8 @@ public interface INIBuilderProperties<T> {
* @return a reference to this object for method chaining
* @since 2.5
*/
- default T setCommentLeadingCharsUsedInInput(final String separator) {
+ default T setCommentLeadingCharsUsedInInput(final String separator)
+ {
// NoOp
return (T) this;
}
@@ -56,7 +58,8 @@ public interface INIBuilderProperties<T> {
* @return a reference to this object for method chaining
* @since 2.5
*/
- default T setSeparatorUsedInInput(final String separator) {
+ default T setSeparatorUsedInInput(final String separator)
+ {
// NoOp
return (T) this;
}
diff --git a/src/main/java/org/apache/commons/configuration2/interpol/ConfigurationInterpolator.java b/src/main/java/org/apache/commons/configuration2/interpol/ConfigurationInterpolator.java
index 10e17f8..4cea821 100644
--- a/src/main/java/org/apache/commons/configuration2/interpol/ConfigurationInterpolator.java
+++ b/src/main/java/org/apache/commons/configuration2/interpol/ConfigurationInterpolator.java
@@ -115,6 +115,28 @@ public class ConfigurationInterpolator
DEFAULT_PREFIX_LOOKUPS = Collections.unmodifiableMap(lookups);
}
+ /** A map with the currently registered lookup objects. */
+ private final Map<String, Lookup> prefixLookups;
+
+ /** Stores the default lookup objects. */
+ private final List<Lookup> defaultLookups;
+
+ /** The helper object performing variable substitution. */
+ private final StringSubstitutor substitutor;
+
+ /** Stores a parent interpolator objects if the interpolator is nested hierarchically. */
+ private volatile ConfigurationInterpolator parentInterpolator;
+
+ /**
+ * Creates a new instance of {@code ConfigurationInterpolator}.
+ */
+ public ConfigurationInterpolator()
+ {
+ prefixLookups = new ConcurrentHashMap<>();
+ defaultLookups = new CopyOnWriteArrayList<>();
+ substitutor = initSubstitutor();
+ }
+
/**
* Creates a new instance based on the properties in the given specification
* object.
@@ -206,28 +228,6 @@ public class ConfigurationInterpolator
return lookup;
}
- /** A map with the currently registered lookup objects. */
- private final Map<String, Lookup> prefixLookups;
-
- /** Stores the default lookup objects. */
- private final List<Lookup> defaultLookups;
-
- /** The helper object performing variable substitution. */
- private final StringSubstitutor substitutor;
-
- /** Stores a parent interpolator objects if the interpolator is nested hierarchically. */
- private volatile ConfigurationInterpolator parentInterpolator;
-
- /**
- * Creates a new instance of {@code ConfigurationInterpolator}.
- */
- public ConfigurationInterpolator()
- {
- prefixLookups = new ConcurrentHashMap<>();
- defaultLookups = new CopyOnWriteArrayList<>();
- substitutor = initSubstitutor();
- }
-
/**
* Adds a default {@code Lookup} object. Default {@code Lookup} objects are
* queried (in the order they were added) for all variables without a