(commons-configuration) 01/02: Add ImmutableConfiguration.containsValue(Object)
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 30a4d6bf307914eb47651a083fc9c7c521f33921 Author: Gary Gregory AuthorDate: Tue May 7 22:04:38 2024 -0400 Add ImmutableConfiguration.containsValue(Object) - Account for null inputs --- src/changes/changes.xml| 2 +- .../configuration2/AbstractConfiguration.java | 29 -- .../AbstractHierarchicalConfiguration.java | 2 +- .../commons/configuration2/BaseConfiguration.java | 2 +- .../configuration2/CompositeConfiguration.java | 2 +- .../commons/configuration2/DataConfiguration.java | 2 +- .../configuration2/DatabaseConfiguration.java | 4 +-- .../DynamicCombinedConfiguration.java | 2 +- .../configuration2/ImmutableConfiguration.java | 5 ++-- .../commons/configuration2/JNDIConfiguration.java | 2 +- .../commons/configuration2/MapConfiguration.java | 4 +-- .../PatternSubtreeConfigurationWrapper.java| 2 +- .../configuration2/SubsetConfiguration.java| 2 +- .../configuration2/web/BaseWebConfiguration.java | 2 +- .../configuration2/NonCloneableConfiguration.java | 2 +- .../configuration2/TestAbstractConfiguration.java | 6 +++-- .../TestAbstractConfigurationBasicFeatures.java| 2 +- .../TestAbstractHierarchicalConfiguration.java | 3 ++- .../configuration2/TestDataConfiguration.java | 1 + .../TestDefaultImmutableConfiguration.java | 3 +++ .../configuration2/TestMapConfiguration.java | 3 ++- .../TestPropertiesConfiguration.java | 2 ++ .../web/TestAppletConfiguration.java | 6 ++--- .../web/TestServletConfiguration.java | 6 ++--- .../web/TestServletContextConfiguration.java | 6 ++--- .../web/TestServletFilterConfiguration.java| 6 ++--- .../web/TestServletRequestConfiguration.java | 5 ++-- 27 files changed, 64 insertions(+), 49 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 6cc84f19..89746c2c 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -26,7 +26,7 @@ Add support for empty sections #408. - Add ImmutableConfiguration.containsValue(String). + Add ImmutableConfiguration.containsValue(Object). Fail-fast with a NullPointerException if DataConfiguration.DataConfiguration(Configuration) is called with null. Fail-fast with a NullPointerException if XMLPropertiesConfiguration.XMLPropertiesConfiguration(Element) is called with null. diff --git a/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java b/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java index ba32c599..e4911b9a 100644 --- a/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java +++ b/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java @@ -424,7 +424,7 @@ public abstract class AbstractConfiguration extends BaseEventSource implements C * @since 2.11.0 */ @Override -public final boolean containsValue(final String value) { +public final boolean containsValue(final Object value) { beginRead(false); try { return containsValueInternal(value); @@ -444,20 +444,23 @@ public abstract class AbstractConfiguration extends BaseEventSource implements C protected abstract boolean containsKeyInternal(String key); /** - * Tests whether this configuration contains one or more matches to this value. This operation stops at first - * match but may be more expensive than the {@link #containsKeyInternal containsKey} method. - * The implementation of this method will be different depending on the type of Configuration used. + * Tests whether this configuration contains one or more matches to this value. This operation stops at first match but may be more expensive than the + * {@link #containsKeyInternal containsKey} method. + * + * The implementation of this method will be different depending on the type of Configuration used. + * * - * Note that this method is identical in functionality to - * {@link #containsValue containsValue}, (which is part of the {@link ImmutableConfiguration} interface). + * + * Note that this method is identical in functionality to {@link #containsValue containsValue}, (which is part of the {@link ImmutableConfiguration} + * interface). + * * - * @param value a value to search for - * @return {@code true} if and only if some key maps to the {@code value} argument in this hashtable as determined - * by the {@code equals} method; {@code false} otherwise. - * @throws NullPointerException if the value is {@code null} + * @param value the value in
(commons-configuration) 02/02: Sort members
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 c12599f1daf2b423f9730e657c3af2efd7ec515c Author: Gary Gregory AuthorDate: Tue May 7 22:05:08 2024 -0400 Sort members --- .../configuration2/AbstractConfiguration.java | 54 +++--- .../commons/configuration2/INIConfiguration.java | 10 ++-- .../configuration2/TestAbstractConfiguration.java | 52 ++--- .../TestAbstractHierarchicalConfiguration.java | 12 ++--- .../configuration2/TestBaseConfiguration.java | 10 ++-- .../configuration2/TestDataConfiguration.java | 14 +++--- .../configuration2/TestDatabaseConfiguration.java | 36 +++ .../TestDefaultImmutableConfiguration.java | 16 +++ .../configuration2/TestMapConfiguration.java | 12 ++--- .../TestPropertiesConfiguration.java | 22 - .../web/TestServletRequestConfiguration.java | 12 ++--- 11 files changed, 125 insertions(+), 125 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java b/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java index e4911b9a..df58fba7 100644 --- a/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java +++ b/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java @@ -406,6 +406,23 @@ public abstract class AbstractConfiguration extends BaseEventSource implements C installInterpolator(orgInterpolator.getLookups(), defaultLookups); } +/** + * Checks if the specified value exists in the properties structure mapped by the provided keys. + * + * @param keys an Iterator of String keys to search for the value + * @param value the String value to search for in the properties + * @return true if the value is found in the properties, false otherwise + * @since 2.11.0 + */ +protected boolean contains(final Iterator keys, final Object value) { +while (keys.hasNext()) { +if (Objects.equals(value, getProperty(keys.next( { +return true; +} +} +return false; +} + /** * {@inheritDoc} This implementation handles synchronization and delegates to {@code containsKeyInternal()}. */ @@ -419,6 +436,16 @@ public abstract class AbstractConfiguration extends BaseEventSource implements C } } +/** + * Actually checks whether the specified key is contained in this configuration. This method is called by + * {@code containsKey()}. It has to be defined by concrete subclasses. + * + * @param key the key in question + * @return true if this key is contained in this configuration, false otherwise + * @since 2.0 + */ +protected abstract boolean containsKeyInternal(String key); + /** * {@inheritDoc} This implementation handles synchronization and delegates to {@code containsKeyInternal()}. * @since 2.11.0 @@ -433,16 +460,6 @@ public abstract class AbstractConfiguration extends BaseEventSource implements C } } -/** - * Actually checks whether the specified key is contained in this configuration. This method is called by - * {@code containsKey()}. It has to be defined by concrete subclasses. - * - * @param key the key in question - * @return true if this key is contained in this configuration, false otherwise - * @since 2.0 - */ -protected abstract boolean containsKeyInternal(String key); - /** * Tests whether this configuration contains one or more matches to this value. This operation stops at first match but may be more expensive than the * {@link #containsKeyInternal containsKey} method. @@ -1550,23 +1567,6 @@ public abstract class AbstractConfiguration extends BaseEventSource implements C return size; } -/** - * Checks if the specified value exists in the properties structure mapped by the provided keys. - * - * @param keys an Iterator of String keys to search for the value - * @param value the String value to search for in the properties - * @return true if the value is found in the properties, false otherwise - * @since 2.11.0 - */ -protected boolean contains(final Iterator keys, final Object value) { -while (keys.hasNext()) { -if (Objects.equals(value, getProperty(keys.next( { -return true; -} -} -return false; -} - @Override public Configuration subset(final String prefix) { return new SubsetConfiguration(this, prefix, "."); diff --git a/src/main/java/org/apache/commons/configuration2/INIConfiguration.java b/src/main/java/org/apache/commons/configuration2/INIConfiguration.java index 703ad340..7088271b 100644 ---
(commons-configuration) branch master updated (63aef465 -> c12599f1)
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 63aef465 PMD: Remove private unused constructor new 30a4d6bf Add ImmutableConfiguration.containsValue(Object) new c12599f1 Sort members 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: src/changes/changes.xml| 2 +- .../configuration2/AbstractConfiguration.java | 79 +++--- .../AbstractHierarchicalConfiguration.java | 2 +- .../commons/configuration2/BaseConfiguration.java | 2 +- .../configuration2/CompositeConfiguration.java | 2 +- .../commons/configuration2/DataConfiguration.java | 2 +- .../configuration2/DatabaseConfiguration.java | 4 +- .../DynamicCombinedConfiguration.java | 2 +- .../commons/configuration2/INIConfiguration.java | 10 +-- .../configuration2/ImmutableConfiguration.java | 5 +- .../commons/configuration2/JNDIConfiguration.java | 2 +- .../commons/configuration2/MapConfiguration.java | 4 +- .../PatternSubtreeConfigurationWrapper.java| 2 +- .../configuration2/SubsetConfiguration.java| 2 +- .../configuration2/web/BaseWebConfiguration.java | 2 +- .../configuration2/NonCloneableConfiguration.java | 2 +- .../configuration2/TestAbstractConfiguration.java | 50 +++--- .../TestAbstractConfigurationBasicFeatures.java| 2 +- .../TestAbstractHierarchicalConfiguration.java | 11 +-- .../configuration2/TestBaseConfiguration.java | 10 +-- .../configuration2/TestDataConfiguration.java | 13 ++-- .../configuration2/TestDatabaseConfiguration.java | 36 +- .../TestDefaultImmutableConfiguration.java | 15 ++-- .../configuration2/TestMapConfiguration.java | 11 +-- .../TestPropertiesConfiguration.java | 20 +++--- .../web/TestAppletConfiguration.java | 6 +- .../web/TestServletConfiguration.java | 6 +- .../web/TestServletContextConfiguration.java | 6 +- .../web/TestServletFilterConfiguration.java| 6 +- .../web/TestServletRequestConfiguration.java | 13 ++-- 30 files changed, 172 insertions(+), 157 deletions(-)
(commons-configuration) branch master updated: PMD: Remove private unused constructor
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 The following commit(s) were added to refs/heads/master by this push: new 63aef465 PMD: Remove private unused constructor 63aef465 is described below commit 63aef46584cc7b68235e2660dfbda66462daa4e3 Author: Gary Gregory AuthorDate: Tue May 7 21:39:06 2024 -0400 PMD: Remove private unused constructor --- .../java/org/apache/commons/configuration2/io/VFSFileSystem.java | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/io/VFSFileSystem.java b/src/main/java/org/apache/commons/configuration2/io/VFSFileSystem.java index a791b2dc..7fa7e5be 100644 --- a/src/main/java/org/apache/commons/configuration2/io/VFSFileSystem.java +++ b/src/main/java/org/apache/commons/configuration2/io/VFSFileSystem.java @@ -53,10 +53,6 @@ public class VFSFileSystem extends DefaultFileSystem { */ private static final class VFSURLStreamHandler extends URLStreamHandler { -public VFSURLStreamHandler(final FileName file) { -// empty -} - @Override protected URLConnection openConnection(final URL url) throws IOException { throw new IOException("VFS URLs can only be used with VFS APIs"); @@ -226,7 +222,7 @@ public class VFSFileSystem extends DefaultFileSystem { path = resolveURI(file); } -final URLStreamHandler handler = new VFSURLStreamHandler(path); +final URLStreamHandler handler = new VFSURLStreamHandler(); return new URL(null, path.getURI(), handler); } catch (final FileSystemException fse) { throw new ConfigurationRuntimeException("Could not parse basePath: " + basePath + " and fileName: " + file, fse); @@ -261,7 +257,7 @@ public class VFSFileSystem extends DefaultFileSystem { return null; } final FileName path = file.getName(); -final URLStreamHandler handler = new VFSURLStreamHandler(path); +final URLStreamHandler handler = new VFSURLStreamHandler(); return new URL(null, path.getURI(), handler); } catch (final FileSystemException | MalformedURLException fse) { return null;
(commons-configuration) 01/03: Add ImmutableConfiguration.containsValue(String)
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 a30a6037b0e0a1679a205adcadca428a59d0fbc7 Author: Gary Gregory AuthorDate: Tue May 7 20:49:26 2024 -0400 Add ImmutableConfiguration.containsValue(String) --- src/changes/changes.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 976dfa59..6cc84f19 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -23,9 +23,10 @@ Apache Commons Community - + - Add support for empty sections #408. + Add support for empty sections #408. + Add ImmutableConfiguration.containsValue(String). Fail-fast with a NullPointerException if DataConfiguration.DataConfiguration(Configuration) is called with null. Fail-fast with a NullPointerException if XMLPropertiesConfiguration.XMLPropertiesConfiguration(Element) is called with null.
(commons-configuration) 03/03: Bump release properties
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 3c8104931ad343a6cb8329222dae797b32265f49 Author: Gary Gregory AuthorDate: Tue May 7 20:50:41 2024 -0400 Bump release properties --- pom.xml | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index a8617568..11717233 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 4.0.0 commons-configuration2 - 2.10.2-SNAPSHOT + 2.11.0-SNAPSHOT Apache Commons Configuration 2001 @@ -35,8 +35,8 @@ configuration org.apache.commons.configuration2 -2.10.1 -2.10.2 +2.11.0 +2.11.1 (Java 8 or above) commons-configuration-${commons.release.2.version} 1.10 @@ -66,7 +66,7 @@ 5.3.34 false -2.10.0 +2.10.1 RC1 true scm:svn:https://dist.apache.org/repos/dist/dev/commons/${commons.componentid}
(commons-configuration) 02/03: Remove unused
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 38e553980d690b556dc0caeee0dd7dd44813f207 Author: Gary Gregory AuthorDate: Tue May 7 20:49:35 2024 -0400 Remove unused --- .../java/org/apache/commons/configuration2/io/VFSFileSystem.java | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/io/VFSFileSystem.java b/src/main/java/org/apache/commons/configuration2/io/VFSFileSystem.java index f815c82d..a791b2dc 100644 --- a/src/main/java/org/apache/commons/configuration2/io/VFSFileSystem.java +++ b/src/main/java/org/apache/commons/configuration2/io/VFSFileSystem.java @@ -47,15 +47,14 @@ import org.apache.commons.vfs2.provider.UriParser; * @since 1.7 */ public class VFSFileSystem extends DefaultFileSystem { + /** * Stream handler required to create URL. */ private static final class VFSURLStreamHandler extends URLStreamHandler { -/** The Protocol used */ -private final String protocol; public VFSURLStreamHandler(final FileName file) { -this.protocol = file.getScheme(); +// empty } @Override @@ -197,7 +196,6 @@ public class VFSFileSystem extends DefaultFileSystem { return name.toString(); } } - if (UriParser.extractScheme(fileName) != null) { return fileName; } @@ -238,7 +236,6 @@ public class VFSFileSystem extends DefaultFileSystem { @Override public URL locateFromURL(final String basePath, final String fileName) { final String fileScheme = UriParser.extractScheme(fileName); - // Use DefaultFileSystem if basePath and fileName don't have a scheme. if ((basePath == null || UriParser.extractScheme(basePath) == null) && fileScheme == null) { return super.locateFromURL(basePath, fileName); @@ -280,7 +277,6 @@ public class VFSFileSystem extends DefaultFileSystem { final Class[] paramTypes = new Class[2]; paramTypes[0] = FileSystemOptions.class; paramTypes[1] = value.getClass(); - try { final Method method = builder.getClass().getMethod(methodName, paramTypes); final Object[] params = new Object[2]; @@ -290,6 +286,5 @@ public class VFSFileSystem extends DefaultFileSystem { } catch (final Exception ex) { log.warn("Cannot access property '" + key + "'! Ignoring.", ex); } - } }
(commons-configuration) branch master updated (63435b21 -> 3c810493)
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 63435b21 feat/configuration-contains-value (#412) new a30a6037 Add ImmutableConfiguration.containsValue(String) new 38e55398 Remove unused new 3c810493 Bump release properties The 3 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: pom.xml | 8 src/changes/changes.xml | 5 +++-- .../java/org/apache/commons/configuration2/io/VFSFileSystem.java | 9 ++--- 3 files changed, 9 insertions(+), 13 deletions(-)
(commons-configuration) branch master updated: feat/configuration-contains-value (#412)
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 The following commit(s) were added to refs/heads/master by this push: new 63435b21 feat/configuration-contains-value (#412) 63435b21 is described below commit 63435b214598bd7ed6c7b3f8f36fdc1feb7f075e Author: Rikkarth <76500344+rikka...@users.noreply.github.com> AuthorDate: Wed May 8 01:46:17 2024 +0100 feat/configuration-contains-value (#412) * feat: contains value initial implementation * test: tests adjusted * chore: remove temp class * chore: lint fix * fix: MapConfiguration containsValue test: moved test * chore: minor cleanup, renaming * test: improved err message * fix: moved contains impl to AbstractConfiguration * change: simplified contains in AbstractConfiguration.java * change: adjusted containsValueInternal in DatabaseConfiguration test: containsValue() in TestDatabaseConfiguration * docs: add javadoc * fix: incompatibility issue * docs: minor javadoc update * test: nullity tests * fix: add null validation to contains test: nullity test adjusted * docs: javadoc contains in AbstractConfiguration * docs: javadoc adaption * feat: add impl to containsValue in ImmutableConfiguration chore: add final to contains in AbstractConfiguration chore: remove white space in DatabaseConfiguration chore: add missing public and final to TestAbstractConfiguration test: given existing value test containsValue with default impl * docs: javadoc NonCloneableConfiguration * docs: complete javadocs * test: adjusted containsValue tests, test each containsValue implementation * test: remove string messages from tests * chore: changed tests signature names * docs: adjusted javadoc * docs: adjusted since javadoc version * docs: add missing javadoc * workflows update * Revert "workflows update" This reverts commit 56fafc9e972aa901c34c3157d9ea72537db8b1b4. * Add Javadoc since tag - Co-authored-by: Gary Gregory --- .../configuration2/AbstractConfiguration.java | 47 ++ .../AbstractHierarchicalConfiguration.java | 10 + .../commons/configuration2/BaseConfiguration.java | 10 + .../configuration2/CompositeConfiguration.java | 10 + .../commons/configuration2/DataConfiguration.java | 10 + .../configuration2/DatabaseConfiguration.java | 19 + .../DynamicCombinedConfiguration.java | 10 + .../configuration2/ImmutableConfiguration.java | 18 + .../commons/configuration2/JNDIConfiguration.java | 10 + .../commons/configuration2/MapConfiguration.java | 10 + .../PatternSubtreeConfigurationWrapper.java| 10 + .../configuration2/SubsetConfiguration.java| 10 + .../configuration2/web/BaseWebConfiguration.java | 10 + .../configuration2/NonCloneableConfiguration.java | 10 + .../configuration2/TestAbstractConfiguration.java | 29 + .../TestAbstractConfigurationBasicFeatures.java| 5 +++ .../TestAbstractHierarchicalConfiguration.java | 5 +++ .../configuration2/TestBaseConfiguration.java | 5 +++ .../configuration2/TestDataConfiguration.java | 6 +++ .../configuration2/TestDatabaseConfiguration.java | 18 + .../TestDefaultImmutableConfiguration.java | 10 - .../configuration2/TestMapConfiguration.java | 5 +++ .../TestPropertiesConfiguration.java | 10 + .../web/TestAppletConfiguration.java | 7 .../web/TestServletConfiguration.java | 7 .../web/TestServletContextConfiguration.java | 7 .../web/TestServletFilterConfiguration.java| 7 .../web/TestServletRequestConfiguration.java | 6 +++ 28 files changed, 319 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java b/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java index e0c0ddcf..ba32c599 100644 --- a/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java +++ b/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java @@ -419,6 +419,20 @@ public abstract class AbstractConfiguration extends BaseEventSource implements C } } +/** + * {@inheritDoc} This implementation handles synchronization and delegates to {@code containsKeyInternal()}. + * @since 2.11.0 + */ +@Override +public final boolean containsValue(final String value) { +beginRead(false); +try { +return
(commons-configuration) branch master updated: Javadoc
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 The following commit(s) were added to refs/heads/master by this push: new 4a6ba6da Javadoc 4a6ba6da is described below commit 4a6ba6dae26b43b71410ea655f94f272d30c0e59 Author: Gary Gregory AuthorDate: Tue May 7 10:07:48 2024 -0400 Javadoc --- .../builder/combined/CombinedConfigurationBuilder.java | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/builder/combined/CombinedConfigurationBuilder.java b/src/main/java/org/apache/commons/configuration2/builder/combined/CombinedConfigurationBuilder.java index dd576798..e80e3b1a 100644 --- a/src/main/java/org/apache/commons/configuration2/builder/combined/CombinedConfigurationBuilder.java +++ b/src/main/java/org/apache/commons/configuration2/builder/combined/CombinedConfigurationBuilder.java @@ -286,10 +286,11 @@ public class CombinedConfigurationBuilder extends BasicConfigurationBuilder> createAndAddConfigurations(final CombinedConfiguration ccResult, final List srcDecl, final List> builders) throws ConfigurationException {
(commons-collections) branch master updated: Track changes
This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-collections.git The following commit(s) were added to refs/heads/master by this push: new 98e543a2d Track changes 98e543a2d is described below commit 98e543a2d50ee984a04c83280c2b74eff13a585c Author: aherbert AuthorDate: Tue May 7 15:00:21 2024 +0100 Track changes --- src/changes/changes.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 2eeb4e220..680e901e8 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -24,7 +24,8 @@ - Add layerd bloom filter clean method #476. + Add layered Bloom filter clean method #476. + Deprecate Lists incompatible with Java 21, add new variant of AbstractLinkedList #485. Deprecate Closure in favor of java.util.function.Consumer. Deprecate Factory in favor of java.util.function.Supplier.
(commons-configuration) branch master updated: Better internal names
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 The following commit(s) were added to refs/heads/master by this push: new 0d72b185 Better internal names 0d72b185 is described below commit 0d72b185e7f205823189d42ec13ffd904d7683dc Author: Gary Gregory AuthorDate: Tue May 7 10:00:51 2024 -0400 Better internal names --- .../commons/configuration2/DatabaseConfiguration.java| 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java b/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java index 2b8b9d12..e4547956 100644 --- a/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java +++ b/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java @@ -125,10 +125,10 @@ public class DatabaseConfiguration extends AbstractConfiguration { */ private abstract class AbstractJdbcOperation { /** Stores the connection. */ -private Connection conn; +private Connection connection; /** Stores the statement. */ -private PreparedStatement pstmt; +private PreparedStatement preparedStatement; /** Stores the result set. */ private ResultSet resultSet; @@ -179,8 +179,8 @@ public class DatabaseConfiguration extends AbstractConfiguration { statement = sql; } -pstmt = getConnection().prepareStatement(statement); -return pstmt; +preparedStatement = getConnection().prepareStatement(statement); +return preparedStatement; } /** @@ -195,16 +195,16 @@ public class DatabaseConfiguration extends AbstractConfiguration { if (getDataSource() != null) { try { -conn = getDataSource().getConnection(); +connection = getDataSource().getConnection(); result = performOperation(); if (isAutoCommit()) { -conn.commit(); +connection.commit(); } } catch (final SQLException e) { fireError(errorEventType, operationEventType, errorPropertyName, errorPropertyValue, e); } finally { -close(conn, pstmt, resultSet); +close(connection, preparedStatement, resultSet); } } @@ -218,7 +218,7 @@ public class DatabaseConfiguration extends AbstractConfiguration { * @return the current connection */ protected Connection getConnection() { -return conn; +return connection; } /**
(commons-configuration) branch master updated: Javadoc
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 The following commit(s) were added to refs/heads/master by this push: new 8ab15861 Javadoc 8ab15861 is described below commit 8ab15861148fd15b93f7f162e96c9e197cdb Author: Gary Gregory AuthorDate: Tue May 7 09:58:56 2024 -0400 Javadoc Whitespace --- src/test/java/org/apache/commons/configuration2/test/HsqlDB.java | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java b/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java index 4ba1af15..f96aa71a 100644 --- a/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java +++ b/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java @@ -30,7 +30,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** - * Stolen from Turbine + * Sourced from Apache Turbine. */ public class HsqlDB { @@ -40,9 +40,7 @@ public class HsqlDB { public HsqlDB(final String uri, final String databaseDriver, final String loadFile) throws Exception { Class.forName(databaseDriver); - this.connection = DriverManager.getConnection(uri, "sa", ""); - if (StringUtils.isNotEmpty(loadFile)) { loadSqlFile(loadFile); } @@ -67,7 +65,6 @@ public class HsqlDB { private void loadSqlFile(final String fileName) throws Exception { try (Statement statement = connection.createStatement()) { String commands = getFileContents(fileName); - for (int targetPos = commands.indexOf(';'); targetPos > -1; targetPos = commands.indexOf(';')) { final String cmd = commands.substring(0, targetPos + 1); try { @@ -75,7 +72,6 @@ public class HsqlDB { } catch (final SQLException sqle) { LOG.warn("Statement: " + cmd + ": " + sqle.getMessage()); } - commands = commands.substring(targetPos + 2); } }
(commons-configuration) 01/02: Better test method and ivar names
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 de43676862e6436064492c0bc923ec092d536095 Author: Gary Gregory AuthorDate: Tue May 7 09:53:48 2024 -0400 Better test method and ivar names --- .../DatabaseConfigurationTestHelper.java | 23 +++--- .../configuration2/TestDatabaseConfiguration.java | 4 ++-- .../apache/commons/configuration2/test/HsqlDB.java | 1 - 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/test/java/org/apache/commons/configuration2/DatabaseConfigurationTestHelper.java b/src/test/java/org/apache/commons/configuration2/DatabaseConfigurationTestHelper.java index 1110dcee..9ac3c285 100644 --- a/src/test/java/org/apache/commons/configuration2/DatabaseConfigurationTestHelper.java +++ b/src/test/java/org/apache/commons/configuration2/DatabaseConfigurationTestHelper.java @@ -76,7 +76,7 @@ public class DatabaseConfigurationTestHelper { private HsqlDB hsqlDB; /** The data source. */ -private DataSource datasource; +private DataSource dataSource; /** * The auto-commit mode for the configuration instances created by this helper. @@ -92,7 +92,8 @@ public class DatabaseConfigurationTestHelper { * @return the newly created configuration instance * @throws ConfigurationException if an error occurs */ -public T createConfig(final Class configCls, final DatabaseBuilderParameters params) throws ConfigurationException { +public T createConfiguration(final Class configCls, final DatabaseBuilderParameters params) +throws ConfigurationException { return new BasicConfigurationBuilder<>(configCls).configure(params).getConfiguration(); } @@ -101,15 +102,15 @@ public class DatabaseConfigurationTestHelper { * * @return the {@code DataSource} */ -public DataSource getDatasource() { -if (datasource == null) { +public DataSource getDataSource() { +if (dataSource == null) { try { -datasource = setUpDataSource(); +dataSource = setUpDataSource(); } catch (final Exception ex) { throw new ConfigurationRuntimeException("Could not create data source", ex); } } -return datasource; +return dataSource; } /** @@ -160,7 +161,7 @@ public class DatabaseConfigurationTestHelper { * @throws ConfigurationException if an error occurs */ public T setUpConfig(final Class configCls) throws ConfigurationException { -return createConfig(configCls, setUpDefaultParameters()); +return createConfiguration(configCls, setUpDefaultParameters()); } /** @@ -200,7 +201,7 @@ public class DatabaseConfigurationTestHelper { * @return the parameters object */ public DatabaseBuilderParameters setUpDefaultParameters() { -return new Parameters().database().setDataSource(getDatasource()).setTable(TABLE).setKeyColumn(COL_KEY).setValueColumn(COL_VALUE) +return new Parameters().database().setDataSource(getDataSource()).setTable(TABLE).setKeyColumn(COL_KEY).setValueColumn(COL_VALUE) .setAutoCommit(isAutoCommit()); } @@ -224,7 +225,7 @@ public class DatabaseConfigurationTestHelper { * @throws ConfigurationException if an error occurs */ public T setUpMultiConfig(final Class configCls, final String configName) throws ConfigurationException { -return createConfig(configCls, setUpMultiParameters(configName)); +return createConfiguration(configCls, setUpMultiParameters(configName)); } /** @@ -245,8 +246,8 @@ public class DatabaseConfigurationTestHelper { * @throws Exception if an error occurs */ public void tearDown() throws Exception { -if (datasource != null) { -datasource.getConnection().close(); +if (dataSource != null) { +dataSource.getConnection().close(); } hsqlDB.close(); } diff --git a/src/test/java/org/apache/commons/configuration2/TestDatabaseConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestDatabaseConfiguration.java index 845e1024..e2a6df2d 100644 --- a/src/test/java/org/apache/commons/configuration2/TestDatabaseConfiguration.java +++ b/src/test/java/org/apache/commons/configuration2/TestDatabaseConfiguration.java @@ -385,7 +385,7 @@ public class TestDatabaseConfiguration { @Test public void testGetKeys() throws ConfigurationException { final DatabaseBuilderParameters params = helper.setUpDefaultParameters().setTable("configurationList"); -final Configuration config1 = helper.createConfig(DatabaseConfiguration.class, params); +final Configuration config1 =
(commons-configuration) 02/02: Reuse PathUtils
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 73af05c1e2b42f6f16091d1742fdb6e6ad155de9 Author: Gary Gregory AuthorDate: Tue May 7 09:57:12 2024 -0400 Reuse PathUtils --- .../org/apache/commons/configuration2/test/HsqlDB.java | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java b/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java index 8f3cf21e..4ba1af15 100644 --- a/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java +++ b/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java @@ -17,12 +17,14 @@ package org.apache.commons.configuration2.test; -import java.io.FileReader; +import java.nio.charset.Charset; +import java.nio.file.Paths; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; +import org.apache.commons.io.file.PathUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -59,17 +61,7 @@ public class HsqlDB { } private String getFileContents(final String fileName) throws Exception { -try (FileReader fr = new FileReader(fileName)) { - -final char[] fileBuf = new char[1024]; -final StringBuilder sb = new StringBuilder(1000); -int res = -1; - -while ((res = fr.read(fileBuf, 0, 1024)) > -1) { -sb.append(fileBuf, 0, res); -} -return sb.toString(); -} +return PathUtils.readString(Paths.get(fileName), Charset.defaultCharset()); } private void loadSqlFile(final String fileName) throws Exception {
(commons-configuration) branch master updated (bb883412 -> 73af05c1)
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 bb883412 Deprecate DatabaseConfiguration.getDatasource() in favor of getDataSource() new de436768 Better test method and ivar names new 73af05c1 Reuse PathUtils 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: .../DatabaseConfigurationTestHelper.java | 23 +++--- .../configuration2/TestDatabaseConfiguration.java | 4 ++-- .../apache/commons/configuration2/test/HsqlDB.java | 17 3 files changed, 18 insertions(+), 26 deletions(-)
(commons-io) branch master updated: Better Javadoc
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-io.git The following commit(s) were added to refs/heads/master by this push: new 0bc1f4839 Better Javadoc 0bc1f4839 is described below commit 0bc1f48390191e5d0450da13e1582eb97fb9a8b4 Author: Gary Gregory AuthorDate: Tue May 7 09:56:00 2024 -0400 Better Javadoc --- src/main/java/org/apache/commons/io/file/PathUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/commons/io/file/PathUtils.java b/src/main/java/org/apache/commons/io/file/PathUtils.java index 6db7515ef..36b080761 100644 --- a/src/main/java/org/apache/commons/io/file/PathUtils.java +++ b/src/main/java/org/apache/commons/io/file/PathUtils.java @@ -1421,13 +1421,14 @@ public final class PathUtils { } /** - * Reads the given path as a String. + * Reads the file contents at the given path as a String using the Charset. * * @param pathThe source path. * @param charset How to convert bytes to a String, null uses the default Charset. - * @return a new String. + * @return the file contents as a new String. * @throws IOException if an I/O error occurs reading from the stream. * @see Files#readAllBytes(Path) + * @see Charsets#toCharset(Charset) * @since 2.12.0 */ public static String readString(final Path path, final Charset charset) throws IOException {
(commons-collections) branch master updated: COLLECTIONS-842: Deprecate Lists incompatible with Java 21, add new variant of AbstractLinkedList (#485)
This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-collections.git The following commit(s) were added to refs/heads/master by this push: new 634b23dbb COLLECTIONS-842: Deprecate Lists incompatible with Java 21, add new variant of AbstractLinkedList (#485) 634b23dbb is described below commit 634b23dbbbaf64816685b168aedfcfec2dbe00c1 Author: Julian Reschke AuthorDate: Tue May 7 15:54:40 2024 +0200 COLLECTIONS-842: Deprecate Lists incompatible with Java 21, add new variant of AbstractLinkedList (#485) --- .../collections4/list/AbstractLinkedList.java | 2 + ...dList.java => AbstractLinkedListForJava21.java} | 32 +-- .../collections4/list/CursorableLinkedList.java| 2 + .../collections4/list/NodeCachingLinkedList.java | 2 + .../DefaultAbstractLinkedListForJava21Test.java| 316 + 5 files changed, 338 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java index aecb2e948..1d66a792f 100644 --- a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java +++ b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java @@ -43,7 +43,9 @@ import org.apache.commons.collections4.OrderedIterator; * * @param the type of elements in this list * @since 3.0 + * @deprecated use {@link AbstractLinkedListForJava21} instead */ +@Deprecated public abstract class AbstractLinkedList implements List { /* diff --git a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListForJava21.java similarity index 96% copy from src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java copy to src/main/java/org/apache/commons/collections4/list/AbstractLinkedListForJava21.java index aecb2e948..b6563597d 100644 --- a/src/main/java/org/apache/commons/collections4/list/AbstractLinkedList.java +++ b/src/main/java/org/apache/commons/collections4/list/AbstractLinkedListForJava21.java @@ -39,12 +39,14 @@ import org.apache.commons.collections4.OrderedIterator; * Overridable methods are provided to change the storage node and to change how * nodes are added to and removed. Hopefully, all you need for unusual subclasses * is here. - * + * + * This is a copy of AbstractLinkedList, modified to be compatible with Java 21 + * (see COLLECTIONS-842 for details). * * @param the type of elements in this list * @since 3.0 */ -public abstract class AbstractLinkedList implements List { +public abstract class AbstractLinkedListForJava21 implements List { /* * Implementation notes: @@ -65,11 +67,11 @@ public abstract class AbstractLinkedList implements List { protected static class LinkedListIterator implements ListIterator, OrderedIterator { /** The parent list */ -protected final AbstractLinkedList parent; +protected final AbstractLinkedListForJava21 parent; /** * The node that will be returned by {@link #next()}. If this is equal - * to {@link AbstractLinkedList#header} then there are no more values to return. + * to {@link AbstractLinkedListForJava21#header} then there are no more values to return. */ protected Node next; @@ -103,7 +105,7 @@ public abstract class AbstractLinkedList implements List { * @param fromIndex the index to start at * @throws IndexOutOfBoundsException if fromIndex is less than 0 or greater than the size of the list */ -protected LinkedListIterator(final AbstractLinkedList parent, final int fromIndex) +protected LinkedListIterator(final AbstractLinkedListForJava21 parent, final int fromIndex) throws IndexOutOfBoundsException { this.parent = parent; this.expectedModCount = parent.modCount; @@ -219,13 +221,13 @@ public abstract class AbstractLinkedList implements List { } /** - * The sublist implementation for AbstractLinkedList. + * The sublist implementation for AbstractLinkedListForJava21. * * @param the type of elements in this list. */ protected static class LinkedSubList extends AbstractList { /** The main list */ -AbstractLinkedList parent; +AbstractLinkedListForJava21 parent; /** Offset from the main list */ int offset; /** Sublist size */ @@ -233,7 +235,7 @@ public abstract class AbstractLinkedList implements List { /** Sublist modCount */ int expectedModCount; -protected LinkedSubList(final AbstractLinkedList parent, final int fromIndex, final int toIndex) { +protected LinkedSubList(final
(commons-configuration) branch master updated: Deprecate DatabaseConfiguration.getDatasource() in favor of getDataSource()
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 The following commit(s) were added to refs/heads/master by this push: new bb883412 Deprecate DatabaseConfiguration.getDatasource() in favor of getDataSource() bb883412 is described below commit bb883412c2ba4ce54c5e1ccfecdcdd170dbbde0d Author: Gary Gregory AuthorDate: Tue May 7 08:06:45 2024 -0400 Deprecate DatabaseConfiguration.getDatasource() in favor of getDataSource() --- src/changes/changes.xml | 1 + .../commons/configuration2/DatabaseConfiguration.java | 6 -- .../commons/configuration2/TestDatabaseConfiguration.java | 13 - 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 1787ff91..976dfa59 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -39,6 +39,7 @@ Fail-fast with a NullPointerException if ServletContextConfiguration(ServletContext) is called with null. Fail-fast with a NullPointerException if ServletFilterConfiguration(FilterConfig) is called with null. Fail-fast with a NullPointerException if ServletRequestConfiguration(ServletRequest) is called with null. + Deprecate DatabaseConfiguration.getDatasource() in favor of getDataSource(). Bump commons-logging:commons-logging from 1.3.0 to 1.3.1 #390. Bump commons-io:commons-io from 2.15.1 to 2.16.1 #394, #400. diff --git a/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java b/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java index 6b34cb0b..2b8b9d12 100644 --- a/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java +++ b/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java @@ -193,9 +193,9 @@ public class DatabaseConfiguration extends AbstractConfiguration { public T execute() { T result = null; -if (getDatasource() != null) { +if (getDataSource() != null) { try { -conn = getDatasource().getConnection(); +conn = getDataSource().getConnection(); result = performOperation(); if (isAutoCommit()) { @@ -519,7 +519,9 @@ public class DatabaseConfiguration extends AbstractConfiguration { * * @return the data source * @since 1.4 + * @deprecated Use {@link #getDataSource()} */ +@Deprecated public DataSource getDatasource() { return dataSource; } diff --git a/src/test/java/org/apache/commons/configuration2/TestDatabaseConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestDatabaseConfiguration.java index 4acd132a..845e1024 100644 --- a/src/test/java/org/apache/commons/configuration2/TestDatabaseConfiguration.java +++ b/src/test/java/org/apache/commons/configuration2/TestDatabaseConfiguration.java @@ -54,22 +54,33 @@ import org.junit.jupiter.api.Test; * tries. Otherwise you may get database is already in use by another process errors. */ public class TestDatabaseConfiguration { + /** * A specialized database configuration implementation that can be configured to throw an exception when obtaining a * connection. This way database exceptions can be simulated. */ public static class PotentialErrorDatabaseConfiguration extends DatabaseConfiguration { + /** A flag whether a getConnection() call should fail. */ private boolean failOnConnect; @Override public DataSource getDatasource() { +return getDS(); +} + +@Override +public DataSource getDataSource() { +return getDS(); +} + +private DataSource getDS() { if (failOnConnect) { final DataSource ds = mock(DataSource.class); assertDoesNotThrow(() -> when(ds.getConnection()).thenThrow(new SQLException("Simulated DB error"))); return ds; } -return super.getDatasource(); +return super.getDataSource(); } }
(commons-net) branch jartests updated: Windows needs quotes
This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch jartests in repository https://gitbox.apache.org/repos/asf/commons-net.git The following commit(s) were added to refs/heads/jartests by this push: new 530c4364 Windows needs quotes 530c4364 is described below commit 530c43642046d5bb0da2e37c05b7ce159d66d7dc Author: Sebb AuthorDate: Tue May 7 11:16:23 2024 +0100 Windows needs quotes --- .github/workflows/maven_adhoc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven_adhoc.yml b/.github/workflows/maven_adhoc.yml index 5025ae18..1f3f2090 100644 --- a/.github/workflows/maven_adhoc.yml +++ b/.github/workflows/maven_adhoc.yml @@ -40,4 +40,4 @@ jobs: java-version: 8 - name: Test NET710 run: | -mvn -V --batch-mode --file pom.xml --no-transfer-progress test -Dnet.version=${{ matrix.tag }} +mvn -V --batch-mode --file pom.xml --no-transfer-progress test "-Dnet.version=${{ matrix.tag }}"
(commons-net) branch jartests updated: Fix 3.7 version, add OSes
This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch jartests in repository https://gitbox.apache.org/repos/asf/commons-net.git The following commit(s) were added to refs/heads/jartests by this push: new 86a6ab68 Fix 3.7 version, add OSes 86a6ab68 is described below commit 86a6ab687aaa5f16cce20cea8c33759b99205d9e Author: Sebb AuthorDate: Tue May 7 11:13:05 2024 +0100 Fix 3.7 version, add OSes --- .github/workflows/maven_adhoc.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven_adhoc.yml b/.github/workflows/maven_adhoc.yml index 07cbf618..5025ae18 100644 --- a/.github/workflows/maven_adhoc.yml +++ b/.github/workflows/maven_adhoc.yml @@ -26,8 +26,9 @@ jobs: continue-on-error: true strategy: matrix: -tag: [ 3.10.0, 3.9.0, 3.8.0, 3.7.0 ] -runs-on: ubuntu-latest +tag: [ 3.10.0, 3.9.0, 3.8.0, 3.7 ] +os: [ ubuntu-latest, windows-latest, macos-13 ] +runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with:
(commons-net) branch jartests created (now 64ae3619)
This is an automated email from the ASF dual-hosted git repository. sebb pushed a change to branch jartests in repository https://gitbox.apache.org/repos/asf/commons-net.git at 64ae3619 Test against released jars This branch includes the following new commits: new 00caad3b root commit new 64ae3619 Test against released jars 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.
(commons-net) 02/02: Test against released jars
This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch jartests in repository https://gitbox.apache.org/repos/asf/commons-net.git commit 64ae361900572ab4dfb67de6f8cec89de1f66e83 Author: Sebb AuthorDate: Tue May 7 11:09:45 2024 +0100 Test against released jars --- .github/workflows/maven_adhoc.yml | 42 ++ .gitignore | 1 + pom.xml| 40 + .../net/ftp/parser/FTPTimestampNET710Test.java | 27 ++ 4 files changed, 110 insertions(+) diff --git a/.github/workflows/maven_adhoc.yml b/.github/workflows/maven_adhoc.yml new file mode 100644 index ..07cbf618 --- /dev/null +++ b/.github/workflows/maven_adhoc.yml @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Java CI adhoc testing + +on: workflow_dispatch + +permissions: + contents: read + +jobs: + build: +timeout-minutes: 7 +continue-on-error: true +strategy: + matrix: +tag: [ 3.10.0, 3.9.0, 3.8.0, 3.7.0 ] +runs-on: ubuntu-latest +steps: +- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + with: +persist-credentials: false +- name: Set up JDK + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + with: +distribution: 'temurin' +java-version: 8 +- name: Test NET710 + run: | +mvn -V --batch-mode --file pom.xml --no-transfer-progress test -Dnet.version=${{ matrix.tag }} diff --git a/.gitignore b/.gitignore new file mode 100644 index ..9f970225 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target/ \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index ..20d0c6a8 --- /dev/null +++ b/pom.xml @@ -0,0 +1,40 @@ + +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; +xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> + 4.0.0 + + org.apache.commons + net-jartests + 1.0-SNAPSHOT + + + UTF-8 + 1.8 + ${maven.compiler.source} + 3.10.0 + + + + + commons-net + commons-net + ${net.version} + + + org.junit.jupiter + junit-jupiter + 5.10.2 + test + + + + + + + maven-surefire-plugin + 3.2.5 + + + + + diff --git a/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampNET710Test.java b/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampNET710Test.java new file mode 100644 index ..8de21d3d --- /dev/null +++ b/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampNET710Test.java @@ -0,0 +1,27 @@ +package org.apache.commons.net.ftp.parser; + + +import java.text.ParseException; +import java.util.Calendar; +import java.util.Locale; +import java.util.TimeZone; + +import org.junit.jupiter.api.Test; + +/** +* Test NET710 +*/ +public class FTPTimestampNET710Test { + +@Test +public void testNet710() throws ParseException { +FTPTimestampParserImpl parser = new FTPTimestampParserImpl(); +Class klass = FTPTimestampParserImpl.class; +System.out.println(klass.getResource('/' + klass.getName().replace('.', '/') + ".class")); +Calendar serverTime = Calendar.getInstance(TimeZone.getTimeZone("EDT"), Locale.US); +serverTime.set(2022, 2, 16, 14, 0); +Calendar p = parser.parseTimestamp("Mar 13 02:33", serverTime); +System.out.println(p); +} + +}
(commons-net) 01/02: root commit
This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch jartests in repository https://gitbox.apache.org/repos/asf/commons-net.git commit 00caad3b47669759cfdec9d8bf2bf88a4b818551 Author: Sebb AuthorDate: Tue May 7 11:02:00 2024 +0100 root commit
(commons-parent) branch master updated: Obsolete comments
This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-parent.git The following commit(s) were added to refs/heads/master by this push: new 827d2cf Obsolete comments 827d2cf is described below commit 827d2cfd53ac761b5c4964f6b7ae8e823a956de5 Author: Sebb AuthorDate: Tue May 7 08:22:41 2024 +0100 Obsolete comments --- pom.xml | 12 1 file changed, 12 deletions(-) diff --git a/pom.xml b/pom.xml index e85ddcd..c48de03 100644 --- a/pom.xml +++ b/pom.xml @@ -36,18 +36,6 @@ https://commons.apache.org/proper/commons-parent/
(commons-net) branch master updated: Accidental commit
This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-net.git The following commit(s) were added to refs/heads/master by this push: new 1d50eff6 Accidental commit 1d50eff6 is described below commit 1d50eff6d5bffc036ca47944e16d5002e2f87d8f Author: Sebb AuthorDate: Tue May 7 08:13:11 2024 +0100 Accidental commit --- .../net/ftp/parser/FTPTimestampNET710Test.java | 21 - 1 file changed, 21 deletions(-) diff --git a/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampNET710Test.java b/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampNET710Test.java deleted file mode 100644 index 5f823b38.. --- a/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampNET710Test.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.apache.commons.net.ftp.parser; - - -import java.text.ParseException; -import java.util.Calendar; -import java.util.Locale; -import java.util.TimeZone; - -/** -* Test NET710 -*/ -public class FTPTimestampNET710Test { - -public static void main(String [] args) throws ParseException { -Calendar serverTime = Calendar.getInstance(TimeZone.getTimeZone("EDT"), Locale.US); -serverTime.set(2022, 2, 16, 14, 0); -Calendar p = new FTPTimestampParserImpl().parseTimestamp("Mar 13 02:33", serverTime); -System.out.println(p); -} - -}