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/07/21 15:00:02 UTC
(commons-validator) branch master updated (b77fec61 -> ca4db8dc)
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-validator.git
from b77fec61 Merge pull request #242 from apache/dependabot/github_actions/github/codeql-action-3.25.13
new 761d5983 Add IBANValidator.Validator.getIbanLength()
new ca4db8dc Javadoc
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:
pom.xml | 8 ++++----
src/changes/changes.xml | 3 ++-
.../commons/validator/routines/IBANValidator.java | 21 +++++++++++++++++++--
.../validator/routines/IBANValidatorTest.java | 2 +-
4 files changed, 26 insertions(+), 8 deletions(-)
(commons-validator) 01/02: Add IBANValidator.Validator.getIbanLength()
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-validator.git
commit 761d5983f1612a0f38220f92e071cb348d68ffd7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jul 21 10:59:50 2024 -0400
Add IBANValidator.Validator.getIbanLength()
---
pom.xml | 8 ++++----
src/changes/changes.xml | 3 ++-
.../apache/commons/validator/routines/IBANValidator.java | 16 +++++++++++++++-
.../commons/validator/routines/IBANValidatorTest.java | 2 +-
4 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/pom.xml b/pom.xml
index 27c8131f..26663a4a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,7 +27,7 @@
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
- <version>1.9.1-SNAPSHOT</version>
+ <version>1.10.0-SNAPSHOT</version>
<name>Apache Commons Validator</name>
<description>
Apache Commons Validator provides the building blocks for both client-side and server-side data validation.
@@ -40,11 +40,11 @@
<commons.componentid>validator</commons.componentid>
<commons.module.name>org.apache.commons.validator</commons.module.name>
<!-- Re-generate the download page using: mvn commons:download-page -->
- <commons.release.version>1.9.0</commons.release.version>
- <commons.release.next>1.9.1</commons.release.next>
+ <commons.release.version>1.10.0</commons.release.version>
+ <commons.release.next>1.10.1</commons.release.next>
<commons.rc.version>RC1</commons.rc.version>
<commons.release.desc>(requires JDK ${maven.compiler.target})</commons.release.desc>
- <commons.bc.version>1.8.0</commons.bc.version>
+ <commons.bc.version>1.9.0</commons.bc.version>
<commons.jira.id>VALIDATOR</commons.jira.id>
<commons.jira.pid>12310494</commons.jira.pid>
<commons.encoding>UTF-8</commons.encoding>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index a0cb1bec..a3de3bc9 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -64,9 +64,10 @@ The <action> type attribute can be add,update,fix,remove.
-->
<body>
- <release version="1.9.1" date="YYYY-MM-DD" description="This is a maintenance and bug fix release; requires Java 8.">
+ <release version="1.10.0" date="YYYY-MM-DD" description="This is a maintenance and bug fix release; requires Java 8.">
<!-- FIX -->
<!-- ADD -->
+ <action type="update" dev="ggregory" due-to="Leonard Wicke, Gary Gregory">Add IBANValidator.Validator.getIbanLength().</action>
<!-- UPDATE -->
<action type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump org.apache.commons:commons-parent from 70 to 71 #231.</action>
<action type="update" dev="ggregory" due-to="Dependabot, Gary Gregory">Bump commons-logging:commons-logging from 1.3.2 to 1.3.3 #238.</action>
diff --git a/src/main/java/org/apache/commons/validator/routines/IBANValidator.java b/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
index aa6136ca..68408207 100644
--- a/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
@@ -69,7 +69,11 @@ public class IBANValidator {
final String countryCode;
final String[] otherCountryCodes;
final RegexValidator regexValidator;
- final int ibanLength; // used to avoid unnecessary regex matching
+
+ /**
+ * Used to avoid unnecessary regex matching.
+ */
+ private final int ibanLength;
/**
* Creates the validator.
@@ -109,6 +113,16 @@ public class IBANValidator {
this.regexValidator = new RegexValidator(regexList);
}
+ /**
+ * Gets the length.
+ *
+ * @return the length.
+ * @since 1.10.0
+ */
+ public int getIbanLength() {
+ return ibanLength;
+ }
+
/**
* Gets the RegexValidator.
*
diff --git a/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java
index 29906333..d83900cc 100644
--- a/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java
@@ -231,7 +231,7 @@ public class IBANValidatorTest {
System.out.println("// Missing entry:");
printEntry(cc.get(i), newLength, newRE, country.get(i));
} else {
- final String currentLength = Integer.toString(valre.ibanLength);
+ final String currentLength = Integer.toString(valre.getIbanLength());
final String currentRE = valre.getRegexValidator().toString().replaceAll("^.+?\\{(.+)}", "$1") // Extract RE from RegexValidator{re}
// string
.replace("\\d", "\\\\d"); // convert \d to \\d
(commons-validator) 02/02: Javadoc
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-validator.git
commit ca4db8dca6829bce1b1701a74a115c6e2e39f2f0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jul 21 10:59:57 2024 -0400
Javadoc
---
.../java/org/apache/commons/validator/routines/IBANValidator.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/validator/routines/IBANValidator.java b/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
index 68408207..277b5b36 100644
--- a/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
@@ -54,7 +54,8 @@ public class IBANValidator {
* The validation class
*/
public static class Validator {
- /*
+
+ /**
* The minimum length does not appear to be defined by the standard.
* Norway is currently the shortest at 15.
*
@@ -77,6 +78,7 @@ public class IBANValidator {
/**
* Creates the validator.
+ *
* @param countryCode the country code
* @param ibanLength the length of the IBAN
* @param regexWithCC the regex to use to check the format, the regex MUST start with the country code.
@@ -87,6 +89,7 @@ public class IBANValidator {
/**
* Creates the validator.
+ *
* @param countryCode the country code
* @param ibanLength the length of the IBAN
* @param regexWithoutCC the regex to use to check the format, the regex MUST NOT start with the country code.