[commons-codec] branch master updated: Simplify comment

2023-10-18 Thread ggregory
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


The following commit(s) were added to refs/heads/master by this push:
 new 2aa8f67b Simplify comment
2aa8f67b is described below

commit 2aa8f67b8c17a059a492ffc889e4a3dd64c8d675
Author: Gary Gregory 
AuthorDate: Wed Oct 18 07:09:20 2023 -0400

Simplify comment
---
 .../java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java 
b/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java
index ca45900b..21be7b0b 100644
--- a/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java
+++ b/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java
@@ -172,7 +172,7 @@ public class MessageDigestAlgorithms {
  * @since 1.11
  */
 public static String[] values() {
-// N.B. do not use a constant array here as that can be changed 
externally by accident or design
+// Do not use a constant array here as that can be changed externally 
by accident or design
 return new String[] {
 MD2, MD5, SHA_1, SHA_224, SHA_256, SHA_384,
 SHA_512, SHA_512_224, SHA_512_256, SHA3_224, SHA3_256, SHA3_384, 
SHA3_512



[commons-codec] branch master updated: Only list Java LTS versions in Javadoc

2023-10-18 Thread ggregory
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


The following commit(s) were added to refs/heads/master by this push:
 new 57b1285c Only list Java LTS versions in Javadoc
57b1285c is described below

commit 57b1285ccf8c7de66186b9458d2020097813f36d
Author: Gary Gregory 
AuthorDate: Wed Oct 18 07:10:55 2023 -0400

Only list Java LTS versions in Javadoc
---
 .../codec/digest/MessageDigestAlgorithms.java  | 24 ++
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java 
b/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java
index 21be7b0b..0a5ba944 100644
--- a/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java
+++ b/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java
@@ -30,34 +30,14 @@ import java.security.MessageDigest;
  * Java 9 and up: SHA3-224, SHA3-256, SHA3-384, SHA3-512.
  * 
  *
- * @see http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#MessageDigest";>
- *  Java 7 Cryptography Architecture Standard Algorithm Name 
Documentation
  * @see http://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#MessageDigest";>
  *  Java 8 Cryptography Architecture Standard Algorithm Name 
Documentation
- * @see https://docs.oracle.com/javase/9/docs/specs/security/standard-names.html#messagedigest-algorithms";>
- *  Java 9 Cryptography Architecture Standard Algorithm Name 
Documentation
- * @see https://docs.oracle.com/javase/10/docs/specs/security/standard-names.html#messagedigest-algorithms";>
- *  Java 10 Cryptography Architecture Standard Algorithm Name 
Documentation
  * @see https://docs.oracle.com/en/java/javase/11/docs/specs/security/standard-names.html#messagedigest-algorithms";>
  *  Java 11 Cryptography Architecture Standard Algorithm Name 
Documentation
- * @see https://docs.oracle.com/en/java/javase/12/docs/specs/security/standard-names.html#messagedigest-algorithms";>
- *  Java 12 Cryptography Architecture Standard Algorithm Name 
Documentation
- * @see https://docs.oracle.com/en/java/javase/13/docs/specs/security/standard-names.html#messagedigest-algorithms";>
- *  Java 13 Cryptography Architecture Standard Algorithm Name 
Documentation
- * @see https://docs.oracle.com/en/java/javase/14/docs/specs/security/standard-names.html#messagedigest-algorithms";>
- *  Java 14 Cryptography Architecture Standard Algorithm Name 
Documentation
- * @see https://docs.oracle.com/en/java/javase/15/docs/specs/security/standard-names.html#messagedigest-algorithms";>
- *  Java 15 Cryptography Architecture Standard Algorithm Name 
Documentation
- * @see https://docs.oracle.com/en/java/javase/16/docs/specs/security/standard-names.html#messagedigest-algorithms";>
- *  Java 16 Cryptography Architecture Standard Algorithm Name 
Documentation
  * @see https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html#messagedigest-algorithms";>
  *  Java 17 Cryptography Architecture Standard Algorithm Name 
Documentation
- * @see https://docs.oracle.com/en/java/javase/18/docs/specs/security/standard-names.html#messagedigest-algorithms";>
- *  Java 18 Cryptography Architecture Standard Algorithm Name 
Documentation
- * @see https://docs.oracle.com/en/java/javase/19/docs/specs/security/standard-names.html#messagedigest-algorithms";>
- *  Java 19 Cryptography Architecture Standard Algorithm Name 
Documentation
- * @see https://docs.oracle.com/en/java/javase/20/docs/specs/security/standard-names.html#messagedigest-algorithms";>
- *  Java 20 Cryptography Architecture Standard Algorithm Name 
Documentation
+ * @see https://docs.oracle.com/en/java/javase/21/docs/specs/security/standard-names.html#messagedigest-algorithms";>
+ *  Java 21 Cryptography Architecture Standard Algorithm Name 
Documentation
  *
  * @see http://dx.doi.org/10.6028/NIST.FIPS.180-4";>FIPS PUB 180-4
  * @see http://dx.doi.org/10.6028/NIST.FIPS.202";>FIPS PUB 202



[commons-io] 01/02: Fix constant name

2023-10-18 Thread ggregory
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

commit 7dd7e4bc469e4dac5c0cc869b52ab1bdfd494ae9
Author: Gary Gregory 
AuthorDate: Wed Oct 18 08:02:43 2023 -0400

Fix constant name
---
 src/test/java/org/apache/commons/io/DemuxInputStreamTest.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/apache/commons/io/DemuxInputStreamTest.java 
b/src/test/java/org/apache/commons/io/DemuxInputStreamTest.java
index 73466c21..6b1a63b2 100644
--- a/src/test/java/org/apache/commons/io/DemuxInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/DemuxInputStreamTest.java
@@ -62,7 +62,7 @@ public class DemuxInputStreamTest {
 // System.out.println( "Reading: " + (char)ch );
 stringBuffer.append((char) ch);
 
-final int sleepMillis = Math.abs(c_random.nextInt() % 10);
+final int sleepMillis = Math.abs(RANDOM.nextInt() % 10);
 TestUtils.sleep(sleepMillis);
 ch = demuxInputStream.read();
 }
@@ -91,7 +91,7 @@ public class DemuxInputStreamTest {
 try {
 // System.out.println( "Writing: " + (char)byteArray[ i ] 
);
 demuxOutputStream.write(element);
-final int sleepMillis = Math.abs(c_random.nextInt() % 10);
+final int sleepMillis = Math.abs(RANDOM.nextInt() % 10);
 TestUtils.sleep(sleepMillis);
 } catch (final Exception e) {
 e.printStackTrace();
@@ -100,7 +100,7 @@ public class DemuxInputStreamTest {
 }
 }
 
-private static final Random c_random = new Random();
+private static final Random RANDOM = new Random();
 private static final String DATA1 = "Data for thread1";
 
 private static final String DATA2 = "Data for thread2";



[commons-io] branch master updated (c9dfe728 -> 50e2d770)

2023-10-18 Thread ggregory
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-io.git


from c9dfe728 The declared exceptions are not actually thrown by test 
methods
 new 7dd7e4bc Fix constant name
 new 50e2d770 Add MessageDigestInputStream and deprecate 
MessageDigestCalculatingInputStream

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|   6 ++
 src/changes/changes.xml|   3 +
 .../input/MessageDigestCalculatingInputStream.java |  21 -
 ...utStream.java => MessageDigestInputStream.java} | 103 +++--
 .../commons/io/input/ObservableInputStream.java|   2 +-
 .../apache/commons/io/DemuxInputStreamTest.java|   6 +-
 .../MessageDigestCalculatingInputStreamTest.java   |  47 +++---
 ...Test.java => MessageDigestInputStreamTest.java} |  30 +++---
 .../io/input/ObservableInputStreamTest.java|  11 +--
 .../commons/io/input/TimestampedObserverTest.java  |   4 +-
 10 files changed, 115 insertions(+), 118 deletions(-)
 copy 
src/main/java/org/apache/commons/io/input/{MessageDigestCalculatingInputStream.java
 => MessageDigestInputStream.java} (61%)
 copy 
src/test/java/org/apache/commons/io/input/{MessageDigestCalculatingInputStreamTest.java
 => MessageDigestInputStreamTest.java} (60%)



[commons-io] 02/02: Add MessageDigestInputStream and deprecate MessageDigestCalculatingInputStream

2023-10-18 Thread ggregory
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

commit 50e2d770f98cbcb709dcb2a981cac53ea70b4f45
Author: Gary Gregory 
AuthorDate: Wed Oct 18 08:27:46 2023 -0400

Add MessageDigestInputStream and deprecate
MessageDigestCalculatingInputStream
---
 pom.xml|   6 ++
 src/changes/changes.xml|   3 +
 .../input/MessageDigestCalculatingInputStream.java |  21 -
 ...utStream.java => MessageDigestInputStream.java} | 103 +++--
 .../commons/io/input/ObservableInputStream.java|   2 +-
 .../MessageDigestCalculatingInputStreamTest.java   |  47 +++---
 ...Test.java => MessageDigestInputStreamTest.java} |  30 +++---
 .../io/input/ObservableInputStreamTest.java|  11 +--
 .../commons/io/input/TimestampedObserverTest.java  |   4 +-
 9 files changed, 112 insertions(+), 115 deletions(-)

diff --git a/pom.xml b/pom.xml
index 592367ff..ac5ee3d7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -288,6 +288,12 @@ file comparators, endian transformation classes, and much 
more.
   3.13.0
   test
 
+
+  commons-codec
+  commons-codec
+  1.16.0
+  test
+
 
   org.openjdk.jmh
   jmh-core
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 109061de..ff6a6c48 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -121,6 +121,9 @@ The  type attribute can be add,update,fix,remove.
   
 Add org.apache.commons.io.StreamIterator.
   
+  
+Add MessageDigestInputStream and deprecate 
MessageDigestCalculatingInputStream.
+  
   
   
 Bump org.apache.commons:commons-parent from 62 to 64.
diff --git 
a/src/main/java/org/apache/commons/io/input/MessageDigestCalculatingInputStream.java
 
b/src/main/java/org/apache/commons/io/input/MessageDigestCalculatingInputStream.java
index 429b225b..97d7ff59 100644
--- 
a/src/main/java/org/apache/commons/io/input/MessageDigestCalculatingInputStream.java
+++ 
b/src/main/java/org/apache/commons/io/input/MessageDigestCalculatingInputStream.java
@@ -27,7 +27,7 @@ import org.apache.commons.io.build.AbstractStreamBuilder;
 
 /**
  * This class is an example for using an {@link ObservableInputStream}. It 
creates its own {@link 
org.apache.commons.io.input.ObservableInputStream.Observer},
- * which calculates a checksum using a MessageDigest, for example an MD5 sum.
+ * which calculates a checksum using a {@link MessageDigest}, for example, a 
SHA-512 sum.
  * 
  * To build an instance, see {@link Builder}.
  * 
@@ -36,12 +36,11 @@ import org.apache.commons.io.build.AbstractStreamBuilder;
  * Cryptography Architecture Standard Algorithm Name Documentation for 
information about standard algorithm names.
  * 
  * 
- * Note: Neither {@link ObservableInputStream}, nor {@link 
MessageDigest}, are thread safe. So is {@link 
MessageDigestCalculatingInputStream}.
- * 
- * 
- * TODO Rename to MessageDigestInputStream in 3.0.
+ * Note: Neither {@link ObservableInputStream}, nor {@link 
MessageDigest}, are thread safe, so is {@link 
MessageDigestCalculatingInputStream}.
  * 
+ * @deprecated Use {@link MessageDigestInputStream}.
  */
+@Deprecated
 public class MessageDigestCalculatingInputStream extends ObservableInputStream 
{
 
 /**
@@ -96,6 +95,9 @@ public class MessageDigestCalculatingInputStream extends 
ObservableInputStream {
 
 /**
  * Sets the message digest.
+ * 
+ * The MD5 cryptographic algorithm is weak and should not be used.
+ * 
  *
  * @param messageDigest the message digest.
  */
@@ -105,6 +107,9 @@ public class MessageDigestCalculatingInputStream extends 
ObservableInputStream {
 
 /**
  * Sets the name of the name of the message digest algorithm.
+ * 
+ * The MD5 cryptographic algorithm is weak and should not be used.
+ * 
  *
  * @param algorithm the name of the algorithm. See the MessageDigest 
section in the
  *  https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#MessageDigest";>
 Java Cryptography
@@ -192,6 +197,9 @@ public class MessageDigestCalculatingInputStream extends 
ObservableInputStream {
 
 /**
  * Constructs a new instance, which calculates a signature on the given 
stream, using the given {@link MessageDigest}.
+ * 
+ * The MD5 cryptographic algorithm is weak and should not be used.
+ * 
  *
  * @param inputStream   the stream to calculate the message digest for
  * @param messageDigest the message digest to use
@@ -206,6 +214,9 @@ public class MessageDigestCalculatingInputStream extends 
ObservableInputStream {
 
 /**
  * Constructs a new instance, which calculates a signature on the given 
stream, using a {@link MessageDiges

[commons-jexl] branch master updated: JEXL-410, JEXL-409, JEXL-408: added new methods to instantiate JexlFeatures with no/default/scripting features set; - fixed lexical/lexicalShade missing relations

2023-10-18 Thread henrib
This is an automated email from the ASF dual-hosted git repository.

henrib pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jexl.git


The following commit(s) were added to refs/heads/master by this push:
 new 41d69998 JEXL-410, JEXL-409, JEXL-408: added new methods to 
instantiate JexlFeatures with no/default/scripting features set; - fixed 
lexical/lexicalShade missing relationship; - updated doc;
41d69998 is described below

commit 41d6999840bc54ad4b044924060406738337ffeb
Author: Henri Biestro 
AuthorDate: Wed Oct 18 15:28:24 2023 +0200

JEXL-410, JEXL-409, JEXL-408: added new methods to instantiate JexlFeatures 
with no/default/scripting features set;
- fixed lexical/lexicalShade missing relationship;
- updated doc;
---
 .../org/apache/commons/jexl3/JexlFeatures.java | 135 -
 .../org/apache/commons/jexl3/FeaturesTest.java |  50 +++-
 2 files changed, 155 insertions(+), 30 deletions(-)

diff --git a/src/main/java/org/apache/commons/jexl3/JexlFeatures.java 
b/src/main/java/org/apache/commons/jexl3/JexlFeatures.java
index c5a23926..4ed1f8d7 100644
--- a/src/main/java/org/apache/commons/jexl3/JexlFeatures.java
+++ b/src/main/java/org/apache/commons/jexl3/JexlFeatures.java
@@ -80,7 +80,7 @@ public final class JexlFeatures {
 public static final int LOCAL_VAR = 2;
 /** Side effects feature ordinal. */
 public static final int SIDE_EFFECT = 3;
-/** Global side-effects feature ordinal. */
+/** Global side effects feature ordinal. */
 public static final int SIDE_EFFECT_GLOBAL = 4;
 /** Array get is allowed on expr. */
 public static final int ARRAY_REF_EXPR = 5;
@@ -104,7 +104,7 @@ public final class JexlFeatures {
 public static final int LEXICAL = 14;
 /** Lexical shade feature ordinal. */
 public static final int LEXICAL_SHADE = 15;
-/** Fat-arrow lambda syntax. */
+/** Thin-arrow lambda syntax. */
 public static final int THIN_ARROW = 16;
 /** Fat-arrow lambda syntax. */
 public static final int FAT_ARROW = 17;
@@ -117,36 +117,99 @@ public final class JexlFeatures {
 /** The pragma anywhere feature ordinal. */
 public static final int PRAGMA_ANYWHERE = 21;
 /** Captured variables are const. */
-public static final  int CONST_CAPTURE = 22;
+public static final int CONST_CAPTURE = 22;
+
 /**
  * The default features flag mask.
+ * Meant for compatibility with scripts written before 3.3.1
  */
 private static final long DEFAULT_FEATURES =
-1L << LOCAL_VAR
-| 1L << SIDE_EFFECT
-| 1L << SIDE_EFFECT_GLOBAL
-| 1L << ARRAY_REF_EXPR
-| 1L << NEW_INSTANCE
-| 1L << LOOP
-| 1L << LAMBDA
-| 1L << METHOD_CALL
-| 1L << STRUCTURED_LITERAL
-| 1L << PRAGMA
-| 1L << ANNOTATION
-| 1L << SCRIPT
-| 1L << THIN_ARROW
-| 1L << NS_PRAGMA
-| 1L << IMPORT_PRAGMA
-| 1L << COMPARATOR_NAMES
-| 1L << PRAGMA_ANYWHERE;
-
-/**
- * Creates an all-features-enabled instance.
+1L << LOCAL_VAR
+| 1L << SIDE_EFFECT
+| 1L << SIDE_EFFECT_GLOBAL
+| 1L << ARRAY_REF_EXPR
+| 1L << NEW_INSTANCE
+| 1L << LOOP
+| 1L << LAMBDA
+| 1L << METHOD_CALL
+| 1L << STRUCTURED_LITERAL
+| 1L << PRAGMA
+| 1L << ANNOTATION
+| 1L << SCRIPT
+| 1L << THIN_ARROW
+| 1L << NS_PRAGMA
+| 1L << IMPORT_PRAGMA
+| 1L << COMPARATOR_NAMES
+| 1L << PRAGMA_ANYWHERE;
+
+/**
+ * The canonical scripting (since 3.3.1) features flag mask based on the 
original default.
+ * Adds lexical, lexical-shade and const-capture but removes 
comparator-names and pragma-anywhere
+ */
+private static final long SCRIPT_FEATURES =
+DEFAULT_FEATURES
+| 1L << LEXICAL
+| 1L << LEXICAL_SHADE
+| 1L << CONST_CAPTURE
+& ~(1L << COMPARATOR_NAMES)
+& ~(1L << PRAGMA_ANYWHERE);
+
+/**
+ * Creates an empty feature set.
+ * This is the strictest base-set since no feature is allowed, suitable 
as-is only
+ * for the simplest expressions.
+ * @return a new instance of an empty features set
+ * @since 3.3.1
+ */
+public static JexlFeatures create() {
+return new JexlFeatures(0L, null, null);
+}
+
+/**
+ * Creates a default features set suitable for basic scripting needs.
+ * Meant for legacy (before 3.3) scripting checks.
+ * The following scripting features are enabled:
+ * 
+ *   local variable {@link JexlFeatures#supportsLocalVar()}
+ *   side effect {@link JexlFeatures#supportsSideEffect()}
+ *   global side effect {@link 
JexlFeatures#supportsSideEffectGlobal()}
+ *   array reference expression {@link 
JexlFeatures#supportsStructuredLite

[commons-jexl] branch master updated: Javadoc, comments, formatting tidbits

2023-10-18 Thread henrib
This is an automated email from the ASF dual-hosted git repository.

henrib pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jexl.git


The following commit(s) were added to refs/heads/master by this push:
 new 891a6d7d Javadoc, comments, formatting tidbits
891a6d7d is described below

commit 891a6d7d3f7afd8c1d14581c21fc589c56190e6b
Author: Henri Biestro 
AuthorDate: Wed Oct 18 15:31:12 2023 +0200

Javadoc, comments, formatting tidbits
---
 .../org/apache/commons/jexl3/JexlArithmetic.java |  9 ++---
 .../org/apache/commons/jexl3/internal/Debugger.java  | 20 ++--
 .../commons/jexl3/introspection/JexlPermissions.java |  9 +
 3 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/src/main/java/org/apache/commons/jexl3/JexlArithmetic.java 
b/src/main/java/org/apache/commons/jexl3/JexlArithmetic.java
index f92a0274..fc6ad8a4 100644
--- a/src/main/java/org/apache/commons/jexl3/JexlArithmetic.java
+++ b/src/main/java/org/apache/commons/jexl3/JexlArithmetic.java
@@ -1393,9 +1393,12 @@ public class JexlArithmetic {
 protected static boolean isMultiplyExact(final long x, final long y, final 
long r) {
 final long ax = Math.abs(x);
 final long ay = Math.abs(y);
-return !((ax | ay) >>> Integer.SIZE - 1 != 0
-  && (y != 0 && r / y != x
-  || x == Long.MIN_VALUE && y == -1));
+// Some bits greater than 2^31 that might cause overflow
+// Check the result using the divide operator
+// and check for the special case of Long.MIN_VALUE * -1
+return !(((ax | ay) >>> (Integer.SIZE - 1) != 0)
+ && ((y != 0 && r / y != x)
+ || (x == Long.MIN_VALUE && y == -1)));
 }
 
 /**
diff --git a/src/main/java/org/apache/commons/jexl3/internal/Debugger.java 
b/src/main/java/org/apache/commons/jexl3/internal/Debugger.java
index b0683ece..710cae8d 100644
--- a/src/main/java/org/apache/commons/jexl3/internal/Debugger.java
+++ b/src/main/java/org/apache/commons/jexl3/internal/Debugger.java
@@ -439,7 +439,7 @@ public class Debugger extends ParserVisitor implements 
JexlInfo.Detail {
 /**
  * Checks if a terminal node is the cause to debug & adds its 
representation to the rebuilt expression.
  * @param node  the child node
- * @param image the child node token image (may be null)
+ * @param image the child node token image (optionally null)
  * @param data  visitor pattern argument
  * @return visitor pattern value
  */
@@ -802,7 +802,7 @@ public class Debugger extends ParserVisitor implements 
JexlInfo.Detail {
  * (but underscore, at-sign, sharp-sign and dollar).
  */
 protected static final Pattern QUOTED_IDENTIFIER =
-Pattern.compile("[\\s]|[\\p{Punct}&&[^@#$_]]");
+Pattern.compile("\\s|\\p{Punct}&&[^@#$_]");
 
 /**
  * Checks whether an identifier should be quoted or not.
@@ -897,7 +897,9 @@ public class Debugger extends ParserVisitor implements 
JexlInfo.Detail {
 for (final Map.Entry pragma : pragmas.entrySet()) {
 final String key = pragma.getKey();
 final Object value = pragma.getValue();
-final Set values = value instanceof Set ? (Set) value 
: Collections.singleton(value);
+final Set values = value instanceof Set
+? (Set) value
+: Collections.singleton(value);
 for (final Object pragmaValue : values) {
 builder.append("#pragma ");
 builder.append(key);
@@ -1054,8 +1056,6 @@ public class Debugger extends ParserVisitor implements 
JexlInfo.Detail {
 for (int i = 1; i < num; ++i) {
 if (!first) {
 builder.append(", ");
-} else {
-first = true;
 }
 accept(node.jjtGetChild(i), data);
 }
@@ -1275,15 +1275,15 @@ public class Debugger extends ParserVisitor implements 
JexlInfo.Detail {
 if (child instanceof ASTAssignment) {
 final ASTAssignment assign = (ASTAssignment) child;
 final int nc = assign.jjtGetNumChildren();
-final ASTVar var = (ASTVar) assign.jjtGetChild(0);
-builder.append(var.getName());
+final ASTVar avar = (ASTVar) assign.jjtGetChild(0);
+builder.append(avar.getName());
 if (nc > 1) {
 builder.append(" = ");
 accept(assign.jjtGetChild(1), data);
 }
 } else if (child instanceof ASTVar) {
-final ASTVar var = (ASTVar) child;
-builder.append(var.getName());
+final ASTVar avar = (ASTVar) child;
+builder.append(avar.getNam

[commons-jexl] branch master updated: JEXL-410: Javadoc

2023-10-18 Thread henrib
This is an automated email from the ASF dual-hosted git repository.

henrib pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jexl.git


The following commit(s) were added to refs/heads/master by this push:
 new 2e0e8e94 JEXL-410: Javadoc
2e0e8e94 is described below

commit 2e0e8e940cbfb0feb146ccfec99abeacbb164972
Author: Henri Biestro 
AuthorDate: Wed Oct 18 15:40:00 2023 +0200

JEXL-410: Javadoc
---
 src/main/java/org/apache/commons/jexl3/JexlFeatures.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/jexl3/JexlFeatures.java 
b/src/main/java/org/apache/commons/jexl3/JexlFeatures.java
index 4ed1f8d7..56939d30 100644
--- a/src/main/java/org/apache/commons/jexl3/JexlFeatures.java
+++ b/src/main/java/org/apache/commons/jexl3/JexlFeatures.java
@@ -169,7 +169,7 @@ public final class JexlFeatures {
  * Creates a default features set suitable for basic scripting needs.
  * Meant for legacy (before 3.3) scripting checks.
  * The following scripting features are enabled:
- * 
+ * 
  *   local variable {@link JexlFeatures#supportsLocalVar()}
  *   side effect {@link JexlFeatures#supportsSideEffect()}
  *   global side effect {@link 
JexlFeatures#supportsSideEffectGlobal()}
@@ -186,7 +186,7 @@ public final class JexlFeatures {
  *   namespace pragma  {@link 
JexlFeatures#supportsNamespacePragma()}
  *   import pragma {@link JexlFeatures#supportsImportPragma()}
  *   pragma anywhere {@link JexlFeatures#supportsPragmaAnywhere()} 

- * 
+ * 
  * @return a new instance of a default scripting features set
  * @since 3.3.1
  */



[commons-logging] branch master updated (2ec8020 -> ca2cdfe)

2023-10-18 Thread ggregory
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-logging.git


from 2ec8020  Add Java 21 build to GitHub
 add ca2cdfe  [LOGGING-186] Replace custom code with `ServiceLoader` call 
(#171)

No new revisions were added by this update.

Summary of changes:
 pom.xml| 21 +
 src/changes/changes.xml|  5 ++-
 .../org/apache/commons/logging/LogFactory.java | 52 +-
 .../ServiceLoaderTestCase.java}| 21 -
 .../internal/DummyLogFactory.java} | 41 -
 .../internal/ThrowingLogFactory.java}  |  8 +++-
 .../org.apache.commons.logging.LogFactory} | 12 +++--
 src/test/resources/serviceloader/README.txt|  1 +
 8 files changed, 101 insertions(+), 60 deletions(-)
 copy 
src/test/java/org/apache/commons/logging/{BadHashtablePropertyTestCase.java => 
serviceloader/ServiceLoaderTestCase.java} (64%)
 copy 
src/test/java/org/apache/commons/logging/{tccl/custom/MyLogFactoryImpl.java => 
serviceloader/internal/DummyLogFactory.java} (57%)
 copy src/{main/java/org/apache/commons/logging/impl/package-info.java => 
test/java/org/apache/commons/logging/serviceloader/internal/ThrowingLogFactory.java}
 (75%)
 copy 
src/test/resources/{org/apache/commons/logging/config/priority10/commons-logging.properties
 => serviceloader/META-INF/services/org.apache.commons.logging.LogFactory} (68%)
 create mode 100644 src/test/resources/serviceloader/README.txt



[commons-logging] branch master updated: Fix Javadoc (Java 11 on Windows)

2023-10-18 Thread ggregory
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-logging.git


The following commit(s) were added to refs/heads/master by this push:
 new 58ec313  Fix Javadoc (Java 11 on Windows)
58ec313 is described below

commit 58ec3139c24f575fa4d78d351cd68e1f9d40edcd
Author: Gary Gregory 
AuthorDate: Wed Oct 18 16:59:30 2023 -0400

Fix Javadoc (Java 11 on Windows)

[ERROR] 
C:\Users\ggregory\git\a\commons-logging\src\main\java\org\apache\commons\logging\LogFactory.java:892:
error: header used out of sequence: 
[ERROR]  * ClassLoader conflicts
[ERROR]^
---
 src/main/java/org/apache/commons/logging/LogFactory.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/logging/LogFactory.java 
b/src/main/java/org/apache/commons/logging/LogFactory.java
index 46c2d23..f0a71dd 100644
--- a/src/main/java/org/apache/commons/logging/LogFactory.java
+++ b/src/main/java/org/apache/commons/logging/LogFactory.java
@@ -889,7 +889,7 @@ public abstract class LogFactory {
 /**
  * Return a new instance of the specified {@code LogFactory} 
implementation class, loaded by the specified class loader. If that fails, try 
the class loader
  * used to load this (abstract) LogFactory.
- * ClassLoader conflicts
+ * ClassLoader conflicts
  * 
  * Note that there can be problems if the specified ClassLoader is not the 
same as the classloader that loaded this class, ie when loading a concrete
  * LogFactory subclass via a context classloader.



[commons-logging] 02/03: Organize imports

2023-10-18 Thread ggregory
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-logging.git

commit 174f40d1687872cd1cd948b2762aebb5bbdf742e
Author: Gary Gregory 
AuthorDate: Wed Oct 18 17:05:12 2023 -0400

Organize imports
---
 src/main/java/org/apache/commons/logging/LogFactory.java   |  2 --
 .../org/apache/commons/logging/impl/Jdk13LumberjackLogger.java |  8 
 src/main/java/org/apache/commons/logging/impl/Log4JLogger.java |  3 ++-
 .../java/org/apache/commons/logging/impl/LogKitLogger.java |  5 +++--
 src/main/java/org/apache/commons/logging/impl/NoOpLog.java |  1 +
 .../apache/commons/logging/BadHashtablePropertyTestCase.java   |  3 ++-
 .../apache/commons/logging/avalon/AvalonLoggerTestCase.java| 10 +-
 .../apache/commons/logging/jdk14/CustomConfigFullTestCase.java |  2 +-
 .../java/org/apache/commons/logging/noop/NoOpLogTestCase.java  |  2 +-
 .../commons/logging/serviceloader/ServiceLoaderTestCase.java   |  1 +
 .../org/apache/commons/logging/simple/DecoratedSimpleLog.java  |  3 ++-
 .../java/org/apache/commons/logging/tccl/BadTCCLTestCase.java  |  6 +++---
 .../java/org/apache/commons/logging/tccl/NullTCCLTestCase.java |  6 +++---
 13 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/src/main/java/org/apache/commons/logging/LogFactory.java 
b/src/main/java/org/apache/commons/logging/LogFactory.java
index 9773a88..ff987e0 100644
--- a/src/main/java/org/apache/commons/logging/LogFactory.java
+++ b/src/main/java/org/apache/commons/logging/LogFactory.java
@@ -17,11 +17,9 @@
 
 package org.apache.commons.logging;
 
-import java.io.BufferedReader;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.io.PrintStream;
 import java.lang.ref.WeakReference;
 import java.net.URL;
diff --git 
a/src/main/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java 
b/src/main/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
index 1abf6fb..3404667 100644
--- a/src/main/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
+++ b/src/main/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
@@ -17,13 +17,13 @@
 
 package org.apache.commons.logging.impl;
 
+import java.io.PrintWriter;
 import java.io.Serializable;
+import java.io.StringWriter;
+import java.util.StringTokenizer;
 import java.util.logging.Level;
-import java.util.logging.Logger;
 import java.util.logging.LogRecord;
-import java.util.StringTokenizer;
-import java.io.PrintWriter;
-import java.io.StringWriter;
+import java.util.logging.Logger;
 
 import org.apache.commons.logging.Log;
 
diff --git a/src/main/java/org/apache/commons/logging/impl/Log4JLogger.java 
b/src/main/java/org/apache/commons/logging/impl/Log4JLogger.java
index abd896b..f1a1309 100644
--- a/src/main/java/org/apache/commons/logging/impl/Log4JLogger.java
+++ b/src/main/java/org/apache/commons/logging/impl/Log4JLogger.java
@@ -18,10 +18,11 @@
 package org.apache.commons.logging.impl;
 
 import java.io.Serializable;
+
 import org.apache.commons.logging.Log;
+import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.log4j.Priority;
-import org.apache.log4j.Level;
 
 /**
  * Implementation of {@link Log} that maps directly to a
diff --git a/src/main/java/org/apache/commons/logging/impl/LogKitLogger.java 
b/src/main/java/org/apache/commons/logging/impl/LogKitLogger.java
index a05e8f0..6ab8eeb 100644
--- a/src/main/java/org/apache/commons/logging/impl/LogKitLogger.java
+++ b/src/main/java/org/apache/commons/logging/impl/LogKitLogger.java
@@ -18,9 +18,10 @@
 package org.apache.commons.logging.impl;
 
 import java.io.Serializable;
-import org.apache.log.Logger;
-import org.apache.log.Hierarchy;
+
 import org.apache.commons.logging.Log;
+import org.apache.log.Hierarchy;
+import org.apache.log.Logger;
 
 /**
  * Implementation of {@code org.apache.commons.logging.Log}
diff --git a/src/main/java/org/apache/commons/logging/impl/NoOpLog.java 
b/src/main/java/org/apache/commons/logging/impl/NoOpLog.java
index c5aed46..97fc43e 100644
--- a/src/main/java/org/apache/commons/logging/impl/NoOpLog.java
+++ b/src/main/java/org/apache/commons/logging/impl/NoOpLog.java
@@ -18,6 +18,7 @@
 package org.apache.commons.logging.impl;
 
 import java.io.Serializable;
+
 import org.apache.commons.logging.Log;
 
 /**
diff --git 
a/src/test/java/org/apache/commons/logging/BadHashtablePropertyTestCase.java 
b/src/test/java/org/apache/commons/logging/BadHashtablePropertyTestCase.java
index d4b5e40..83c860a 100644
--- a/src/test/java/org/apache/commons/logging/BadHashtablePropertyTestCase.java
+++ b/src/test/java/org/apache/commons/logging/BadHashtablePropertyTestCase.java
@@ -17,9 +17,10 @@
 
 package org.apache.commons.logging;
 
-import junit.framework.TestCase;
 import java.util.Hashtable;
 
+import junit.framework.TestCase;
+
 /**
  

[commons-logging] 03/03: Use final

2023-10-18 Thread ggregory
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-logging.git

commit 245211c4bdcc8d533837e86f36bd3759401b3400
Author: Gary Gregory 
AuthorDate: Wed Oct 18 17:06:46 2023 -0400

Use final

Use compact array notation
Remove trailing whitespace
---
 .../org/apache/commons/logging/LogFactory.java | 202 +
 .../java/org/apache/commons/logging/LogSource.java |   2 +-
 .../apache/commons/logging/impl/AvalonLogger.java  |   2 +-
 .../logging/impl/Jdk13LumberjackLogger.java|   6 +-
 .../apache/commons/logging/impl/Jdk14Logger.java   |   2 +-
 .../apache/commons/logging/impl/LogKitLogger.java  |   2 +-
 .../org/apache/commons/logging/impl/NoOpLog.java   |   2 +-
 .../org/apache/commons/logging/impl/SimpleLog.java |  17 +-
 .../commons/logging/GarbageCollectionHelper.java   |   8 +-
 .../logging/LogFactoryWeakReferenceTestCase.java   |   6 +-
 .../commons/logging/PathableClassLoader.java   |   2 +-
 .../logging/impl/WeakHashtableTestCase.java|  74 
 .../logging/jdk14/CustomConfigTestCase.java|   6 +-
 .../commons/logging/pathable/GeneralTestCase.java  |   2 +-
 .../serviceloader/internal/DummyLogFactory.java|  10 +-
 15 files changed, 154 insertions(+), 189 deletions(-)

diff --git a/src/main/java/org/apache/commons/logging/LogFactory.java 
b/src/main/java/org/apache/commons/logging/LogFactory.java
index ff987e0..d15a025 100644
--- a/src/main/java/org/apache/commons/logging/LogFactory.java
+++ b/src/main/java/org/apache/commons/logging/LogFactory.java
@@ -227,8 +227,8 @@ public abstract class LogFactory {
 static {
 // note: it's safe to call methods before initDiagnostics (though
 // diagnostic output gets discarded).
-ClassLoader thisClassLoader = getClassLoader(LogFactory.class);
-thisClassLoaderRef = new WeakReference(thisClassLoader);
+final ClassLoader thisClassLoader = getClassLoader(LogFactory.class);
+thisClassLoaderRef = new WeakReference<>(thisClassLoader);
 // In order to avoid confusion where multiple instances of JCL are
 // being used via different classloaders within the same app, we
 // ensure each logged message has a prefix of form
@@ -305,28 +305,26 @@ public abstract class LogFactory {
 logDiagnostic("Loaded class " + 
logFactoryClass.getName() +
   " from classloader " + 
objectId(classLoader));
 }
-} else {
-//
-// This indicates a problem with the ClassLoader tree.
-// An incompatible ClassLoader was used to load the
-// implementation.
-// As the same classes
-// must be available in multiple class loaders,
-// it is very likely that multiple JCL jars are 
present.
-// The most likely fix for this
-// problem is to remove the extra JCL jars from the
-// ClassLoader hierarchy.
-//
-if (isDiagnosticsEnabled()) {
-logDiagnostic("Factory class " + 
logFactoryClass.getName() +
-  " loaded from classloader " + 
objectId(logFactoryClass.getClassLoader()) +
-  " does not extend '" + 
LogFactory.class.getName() +
-  "' as loaded by this classloader.");
-logHierarchy("[BAD CL TREE] ", classLoader);
-}
+} else //
+// This indicates a problem with the ClassLoader tree.
+// An incompatible ClassLoader was used to load the
+// implementation.
+// As the same classes
+// must be available in multiple class loaders,
+// it is very likely that multiple JCL jars are present.
+// The most likely fix for this
+// problem is to remove the extra JCL jars from the
+// ClassLoader hierarchy.
+//
+if (isDiagnosticsEnabled()) {
+logDiagnostic("Factory class " + 
logFactoryClass.getName() +
+  " loaded from classloader " + 
objectId(logFactoryClass.getClassLoader()) +
+  " does not extend '" + 
LogFactory.class.getName() +
+  "' as loaded by this classloader.");
+logHierarchy("[BAD CL TREE] ", classLoader);
 }
 
-return (LogFactory) 

[commons-logging] branch master updated (58ec313 -> 245211c)

2023-10-18 Thread ggregory
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-logging.git


from 58ec313  Fix Javadoc (Java 11 on Windows)
 new 0b4d31d  Sort members
 new 174f40d  Organize imports
 new 245211c  Use final

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:
 .../commons/logging/LogConfigurationException.java |   24 +-
 .../org/apache/commons/logging/LogFactory.java | 2214 ++--
 .../java/org/apache/commons/logging/LogSource.java |  110 +-
 .../apache/commons/logging/impl/AvalonLogger.java  |  114 +-
 .../logging/impl/Jdk13LumberjackLogger.java|  128 +-
 .../apache/commons/logging/impl/Jdk14Logger.java   |   68 +-
 .../apache/commons/logging/impl/Log4JLogger.java   |  199 +-
 .../commons/logging/impl/LogFactoryImpl.java   | 1848 
 .../apache/commons/logging/impl/LogKitLogger.java  |  183 +-
 .../org/apache/commons/logging/impl/NoOpLog.java   |   55 +-
 .../org/apache/commons/logging/impl/SimpleLog.java |  595 +++---
 .../apache/commons/logging/impl/WeakHashtable.java |  378 ++--
 .../commons/logging/AltHashtableTestCase.java  |   30 +-
 .../logging/BadHashtablePropertyTestCase.java  |   11 +-
 .../commons/logging/BasicOperationsTestCase.java   |   72 +-
 .../commons/logging/GarbageCollectionHelper.java   |   46 +-
 .../org/apache/commons/logging/LoadTestCase.java   |   94 +-
 .../logging/LogFactoryWeakReferenceTestCase.java   |6 +-
 .../commons/logging/PathableClassLoader.java   |  310 +--
 .../logging/avalon/AvalonLoggerTestCase.java   |   10 +-
 .../logging/impl/WeakHashtableTestCase.java|  164 +-
 .../logging/jdk14/CustomConfigAPITestCase.java |8 +-
 .../logging/jdk14/CustomConfigFullTestCase.java|   12 +-
 .../logging/jdk14/CustomConfigTestCase.java|  294 +--
 .../logging/jdk14/DefaultConfigTestCase.java   |   96 +-
 .../apache/commons/logging/jdk14/TestHandler.java  |8 +-
 .../commons/logging/log4j/StandardTests.java   |  164 +-
 .../logging/log4j/log4j12/TestAppender.java|   12 +-
 .../commons/logging/logkit/StandardTestCase.java   |   92 +-
 .../commons/logging/noop/NoOpLogTestCase.java  |   60 +-
 .../logging/pathable/ChildFirstTestCase.java   |   82 +-
 .../commons/logging/pathable/GeneralTestCase.java  |   84 +-
 .../logging/pathable/ParentFirstTestCase.java  |   82 +-
 .../logging/security/MockSecurityManager.java  |   26 +-
 .../logging/security/SecurityAllowedTestCase.java  |4 +-
 .../security/SecurityForbiddenTestCase.java|   42 +-
 .../serviceloader/ServiceLoaderTestCase.java   |1 +
 .../serviceloader/internal/DummyLogFactory.java|   10 +-
 .../logging/simple/CustomConfigTestCase.java   |  166 +-
 .../simple/DateTimeCustomConfigTestCase.java   |   44 +-
 .../commons/logging/simple/DecoratedSimpleLog.java |   53 +-
 .../logging/simple/DefaultConfigTestCase.java  |  158 +-
 .../apache/commons/logging/simple/LogRecord.java   |8 +-
 .../commons/logging/tccl/BadTCCLTestCase.java  |6 +-
 .../commons/logging/tccl/NullTCCLTestCase.java |6 +-
 .../apache/commons/logging/tccl/custom/MyLog.java  |   34 +-
 46 files changed, 4090 insertions(+), 4121 deletions(-)