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 2024/10/13 15:48:08 UTC
(commons-net) branch master updated (f9d5748c -> 16f49f8b)
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-net.git
from f9d5748c Javadoc
new faab3206 Fix tags
new b3292640 Simplify implementation
new aa4d719d Move test to its home package
new 16f49f8b Move test to its home package
The 4 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:
.../java/org/apache/commons/net/util/SubnetUtils.java | 15 +++++++--------
.../commons/net/{ => util}/SubnetUtilsNet728Test.java | 2 +-
.../apache/commons/net/{ => util}/SubnetUtilsTest.java | 3 +--
3 files changed, 9 insertions(+), 11 deletions(-)
rename src/test/java/org/apache/commons/net/{ => util}/SubnetUtilsNet728Test.java (98%)
rename src/test/java/org/apache/commons/net/{ => util}/SubnetUtilsTest.java (99%)
(commons-net) 03/04: Move test to its home package
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-net.git
commit aa4d719d250e94ea0a9dcb208d900c0fa8fba354
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Oct 13 11:47:16 2024 -0400
Move test to its home package
---
src/test/java/org/apache/commons/net/{ => util}/SubnetUtilsTest.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/test/java/org/apache/commons/net/SubnetUtilsTest.java b/src/test/java/org/apache/commons/net/util/SubnetUtilsTest.java
similarity index 99%
rename from src/test/java/org/apache/commons/net/SubnetUtilsTest.java
rename to src/test/java/org/apache/commons/net/util/SubnetUtilsTest.java
index 2c5c2321..df0035b1 100644
--- a/src/test/java/org/apache/commons/net/SubnetUtilsTest.java
+++ b/src/test/java/org/apache/commons/net/util/SubnetUtilsTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.commons.net;
+package org.apache.commons.net.util;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
@@ -32,7 +32,6 @@ import java.util.stream.LongStream;
import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.apache.commons.net.util.SubnetUtils;
import org.apache.commons.net.util.SubnetUtils.SubnetInfo;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
(commons-net) 02/04: Simplify implementation
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-net.git
commit b3292640e137639f615dd2f9d9b46bb554972da9
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Oct 13 11:46:16 2024 -0400
Simplify implementation
Impl does not need an atomic integer
---
src/main/java/org/apache/commons/net/util/SubnetUtils.java | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/commons/net/util/SubnetUtils.java b/src/main/java/org/apache/commons/net/util/SubnetUtils.java
index 015dfa1b..6e6f236a 100644
--- a/src/main/java/org/apache/commons/net/util/SubnetUtils.java
+++ b/src/main/java/org/apache/commons/net/util/SubnetUtils.java
@@ -17,7 +17,6 @@
package org.apache.commons.net.util;
import java.util.Iterator;
-import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -60,7 +59,7 @@ public class SubnetUtils {
*/
public static class SubnetAddressIterator implements Iterator<String> {
- private final AtomicInteger currentAddress;
+ private int currentAddress;
private final SubnetInfo subnetInfo;
@@ -71,18 +70,18 @@ public class SubnetUtils {
*/
public SubnetAddressIterator(final SubnetInfo subnetInfo) {
this.subnetInfo = subnetInfo;
- currentAddress = new AtomicInteger(subnetInfo.low());
+ currentAddress = subnetInfo.low();
}
@Override
public boolean hasNext() {
- return subnetInfo.getAddressCount() > 0 && currentAddress.get() <= subnetInfo.high();
+ return subnetInfo.getAddressCountLong() > 0 && currentAddress <= subnetInfo.high();
}
@Override
public String next() {
- final String address = subnetInfo.format(subnetInfo.toArray(currentAddress.get()));
- currentAddress.incrementAndGet();
+ final String address = subnetInfo.format(subnetInfo.toArray(currentAddress));
+ currentAddress++;
return address;
}
}
(commons-net) 04/04: Move test to its home package
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-net.git
commit 16f49f8bbfedbebc1f912fd11982bb0b238214e7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Oct 13 11:48:01 2024 -0400
Move test to its home package
---
.../java/org/apache/commons/net/{ => util}/SubnetUtilsNet728Test.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/java/org/apache/commons/net/SubnetUtilsNet728Test.java b/src/test/java/org/apache/commons/net/util/SubnetUtilsNet728Test.java
similarity index 98%
rename from src/test/java/org/apache/commons/net/SubnetUtilsNet728Test.java
rename to src/test/java/org/apache/commons/net/util/SubnetUtilsNet728Test.java
index 4becc15d..9a95f1b0 100644
--- a/src/test/java/org/apache/commons/net/SubnetUtilsNet728Test.java
+++ b/src/test/java/org/apache/commons/net/util/SubnetUtilsNet728Test.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.commons.net;
+package org.apache.commons.net.util;
import static org.junit.jupiter.api.Assertions.assertTrue;
(commons-net) 01/04: Fix tags
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-net.git
commit faab3206f7371e80b2ad9a5b0595d7192391a6bd
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Oct 13 11:42:29 2024 -0400
Fix tags
---
src/main/java/org/apache/commons/net/util/SubnetUtils.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/net/util/SubnetUtils.java b/src/main/java/org/apache/commons/net/util/SubnetUtils.java
index 761b955f..015dfa1b 100644
--- a/src/main/java/org/apache/commons/net/util/SubnetUtils.java
+++ b/src/main/java/org/apache/commons/net/util/SubnetUtils.java
@@ -32,7 +32,7 @@ public class SubnetUtils {
/**
* Allows an object to be the target of the "for-each loop" statement for a SubnetInfo.
*
- * @since 3.12.0
+ * @since 3.18.0
*/
public static class SubnetAddressIterable implements Iterable<String> {
@@ -56,7 +56,7 @@ public class SubnetUtils {
/**
* Iterates over a SubnetInfo.
*
- * @since 3.12.0
+ * @since 3.18.0
*/
public static class SubnetAddressIterator implements Iterator<String> {