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 2025/07/06 18:40:31 UTC
(commons-codec) branch master updated (ed943155 -> ab821ad6)
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-codec.git
from ed943155 Use longer lines
new 218d031d Javadoc
new e3b840fa Better local variable names
new 801afd97 eprecate unused constant org.apache.commons.codec.language.bm.Rule.ALL
new 70e423b8 Fix bug in test
new ab821ad6 Better exception message
The 5 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 | 1 +
.../org/apache/commons/codec/language/bm/Rule.java | 38 +++++++++++++---------
.../codec/digest/MessageDigestAlgorithmsTest.java | 2 --
3 files changed, 24 insertions(+), 17 deletions(-)
(commons-codec) 01/05: 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-codec.git
commit 218d031d5c9163b7688e358639b2b0f9b5f891e8
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Jul 6 14:32:01 2025 -0400
Javadoc
---
src/main/java/org/apache/commons/codec/language/bm/Rule.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/main/java/org/apache/commons/codec/language/bm/Rule.java b/src/main/java/org/apache/commons/codec/language/bm/Rule.java
index 3205f71c..77e34ea9 100644
--- a/src/main/java/org/apache/commons/codec/language/bm/Rule.java
+++ b/src/main/java/org/apache/commons/codec/language/bm/Rule.java
@@ -289,6 +289,10 @@ public class Rule {
private static final Pattern AROUND_PLUS = Pattern.compile("[+]");
private static final Pattern AROUND_PIPE = Pattern.compile("[|]");
private static final Map<NameType, Map<RuleType, Map<String, Map<String, List<Rule>>>>> RULES = new EnumMap<>(NameType.class);
+
+ /**
+ * Initializes {@code RULES}.
+ */
static {
for (final NameType s : NameType.values()) {
final Map<RuleType, Map<String, Map<String, List<Rule>>>> rts = new EnumMap<>(RuleType.class);
(commons-codec) 04/05: Fix bug in test
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-codec.git
commit 70e423b8e632b416bbf1ddd9d31493758c905940
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Jul 6 14:40:17 2025 -0400
Fix bug in test
JUnit annotations shouldn't decorate this private method
---
.../org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java b/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java
index 8e840add..5c4a4a7d 100644
--- a/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java
+++ b/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java
@@ -169,8 +169,6 @@ class MessageDigestAlgorithmsTest {
DigestUtils.digest(DigestUtils.getDigest(messageDigestAlgorithm), new ByteArrayInputStream(getTestData())));
}
- @ParameterizedTest
- @MethodSource("data")
private void testDigestPath(final String messageDigestAlgorithm, final OpenOption... options) throws IOException {
assumeTrue(DigestUtils.isAvailable(messageDigestAlgorithm));
assertArrayEquals(digestTestData(messageDigestAlgorithm), DigestUtils.digest(DigestUtils.getDigest(messageDigestAlgorithm), getTestPath(), options));
(commons-codec) 02/05: Better local variable names
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-codec.git
commit e3b840fa7401663935ecd66d20e74981b4c41d0e
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Jul 6 14:33:52 2025 -0400
Better local variable names
---
.../org/apache/commons/codec/language/bm/Rule.java | 28 +++++++++++-----------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/main/java/org/apache/commons/codec/language/bm/Rule.java b/src/main/java/org/apache/commons/codec/language/bm/Rule.java
index 77e34ea9..3f05787c 100644
--- a/src/main/java/org/apache/commons/codec/language/bm/Rule.java
+++ b/src/main/java/org/apache/commons/codec/language/bm/Rule.java
@@ -294,26 +294,26 @@ public class Rule {
* Initializes {@code RULES}.
*/
static {
- for (final NameType s : NameType.values()) {
- final Map<RuleType, Map<String, Map<String, List<Rule>>>> rts = new EnumMap<>(RuleType.class);
- for (final RuleType rt : RuleType.values()) {
- final Map<String, Map<String, List<Rule>>> rs = new HashMap<>();
- final Languages ls = Languages.getInstance(s);
- ls.getLanguages().forEach(l -> {
- try (Scanner scanner = createScanner(s, rt, l)) {
- rs.put(l, parseRules(scanner, createResourceName(s, rt, l)));
+ for (final NameType nameType : NameType.values()) {
+ final Map<RuleType, Map<String, Map<String, List<Rule>>>> rtsMap = new EnumMap<>(RuleType.class);
+ for (final RuleType ruleType : RuleType.values()) {
+ final Map<String, Map<String, List<Rule>>> rsMap = new HashMap<>();
+ final Languages languages = Languages.getInstance(nameType);
+ languages.getLanguages().forEach(l -> {
+ try (Scanner scanner = createScanner(nameType, ruleType, l)) {
+ rsMap.put(l, parseRules(scanner, createResourceName(nameType, ruleType, l)));
} catch (final IllegalStateException e) {
- throw new IllegalStateException("Problem processing " + createResourceName(s, rt, l), e);
+ throw new IllegalStateException("Problem processing " + createResourceName(nameType, ruleType, l), e);
}
});
- if (!rt.equals(RuleType.RULES)) {
- try (Scanner scanner = createScanner(s, rt, "common")) {
- rs.put("common", parseRules(scanner, createResourceName(s, rt, "common")));
+ if (!ruleType.equals(RuleType.RULES)) {
+ try (Scanner scanner = createScanner(nameType, ruleType, "common")) {
+ rsMap.put("common", parseRules(scanner, createResourceName(nameType, ruleType, "common")));
}
}
- rts.put(rt, Collections.unmodifiableMap(rs));
+ rtsMap.put(ruleType, Collections.unmodifiableMap(rsMap));
}
- RULES.put(s, Collections.unmodifiableMap(rts));
+ RULES.put(nameType, Collections.unmodifiableMap(rtsMap));
}
}
(commons-codec) 03/05: eprecate unused constant org.apache.commons.codec.language.bm.Rule.ALL
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-codec.git
commit 801afd9731ee93cd265089ced09b916713aa761f
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Jul 6 14:35:43 2025 -0400
eprecate unused constant org.apache.commons.codec.language.bm.Rule.ALL
---
src/changes/changes.xml | 1 +
src/main/java/org/apache/commons/codec/language/bm/Rule.java | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 469bb8b7..a6fab1a6 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -55,6 +55,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" dev="ggregory" due-to="Gary Gregory">Precompile regular expressions in org.apache.commons.codec.language.bm.Rule.parse*(*).</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">Remove redundant checks for whitespace in DaitchMokotoffSoundex.soundex(String, boolean).</action>
<action type="fix" dev="ggregory" due-to="Sebastian Baunsgaard">Javadoc typo in Base16.java #380.</action>
+ <action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate unused constant org.apache.commons.codec.language.bm.Rule.ALL.</action>
<!-- ADD -->
<action type="add" dev="ggregory" due-to="Gary Gregory">Add HmacUtils.hmac(Path).</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add HmacUtils.hmacHex(Path).</action>
diff --git a/src/main/java/org/apache/commons/codec/language/bm/Rule.java b/src/main/java/org/apache/commons/codec/language/bm/Rule.java
index 3f05787c..8d7d6b66 100644
--- a/src/main/java/org/apache/commons/codec/language/bm/Rule.java
+++ b/src/main/java/org/apache/commons/codec/language/bm/Rule.java
@@ -281,8 +281,12 @@ public class Rule {
/**
* Unused.
+ *
+ * @deprecated This is unused.
*/
+ @Deprecated
public static final String ALL = "ALL";
+
private static final String DOUBLE_QUOTE = "\"";
private static final String HASH_INCLUDE = "#include";
private static final int HASH_INCLUDE_LENGTH = HASH_INCLUDE.length();
(commons-codec) 05/05: Better exception message
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-codec.git
commit ab821ad679907677b5b9da5b0972a47615b2bd02
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sun Jul 6 14:40:23 2025 -0400
Better exception message
---
src/main/java/org/apache/commons/codec/language/bm/Rule.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/codec/language/bm/Rule.java b/src/main/java/org/apache/commons/codec/language/bm/Rule.java
index 8d7d6b66..fdd5ba3a 100644
--- a/src/main/java/org/apache/commons/codec/language/bm/Rule.java
+++ b/src/main/java/org/apache/commons/codec/language/bm/Rule.java
@@ -407,7 +407,7 @@ public class Rule {
public static Map<String, List<Rule>> getInstanceMap(final NameType nameType, final RuleType rt, final String lang) {
final Map<String, List<Rule>> rules = RULES.get(nameType).get(rt).get(lang);
if (rules == null) {
- throw new IllegalArgumentException(String.format("No rules found for %s, %s, %s.", nameType.getName(), rt.getName(), lang));
+ throw new IllegalArgumentException(String.format("No rules found for %s, %s, '%s'.", nameType.getName(), rt.getName(), lang));
}
return rules;
}