You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2025/08/25 09:47:00 UTC

(groovy) branch master updated (6d6383dcb1 -> 561244e585)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


    from 6d6383dcb1 remove pre-JDK17 JDKs
     new d9d4717dce updated license info to reflect temporarily copied methods
     new 561244e585 merge upstream improvement

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:
 licenses/jline3-BINZIP-SRC.txt                     | 10 +++++++++-
 .../groovy/groovysh/jline/GroovyPosixCommands.java | 22 ++++++++++++++--------
 2 files changed, 23 insertions(+), 9 deletions(-)


(groovy) 01/02: updated license info to reflect temporarily copied methods

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit d9d4717dcec6b2f98236d0a76d588314c6a92bf4
Author: Paul King <pa...@asert.com.au>
AuthorDate: Mon Aug 25 19:39:43 2025 +1000

    updated license info to reflect temporarily copied methods
---
 licenses/jline3-BINZIP-SRC.txt                                 | 10 +++++++++-
 .../org/apache/groovy/groovysh/jline/GroovyPosixCommands.java  |  8 ++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/licenses/jline3-BINZIP-SRC.txt b/licenses/jline3-BINZIP-SRC.txt
index f97727d66f..95c226f223 100644
--- a/licenses/jline3-BINZIP-SRC.txt
+++ b/licenses/jline3-BINZIP-SRC.txt
@@ -9,7 +9,15 @@ The following source files within this product:
     org/apache/groovy/groovysh/jline/PackageHelper.java
 
 were derived from similarly named files in the JLine3 source repository which
-have a BSD-style license. Details can be found in: licenses/jline3-license.txt
+have a BSD-style license.
+
+Some parts of the source code from:
+
+    org/apache/groovy/groovysh/jline/GroovyPosixCommands.java
+
+were derived from the JLine3 PosixCommands class.
+
+Details can be found in: licenses/jline3-license.txt
 
 This product bundles several JLine3 jars (optional dependency used with groovysh),
 which are available under a BSD License.  For details, see licenses/jline3-license.txt.
diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyPosixCommands.java b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyPosixCommands.java
index dcf56c2446..445a03f08e 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyPosixCommands.java
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyPosixCommands.java
@@ -15,6 +15,14 @@
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
  *  under the License.
+ *
+ * This file has some code copied from its parent's class: PosixCommands from JLine3.
+ * This is in some cases due to bug fixes not yet merged or released in JLine3,
+ * and in other cases where existing extensibility points were insufficient.
+ * Additional PRs related to extensibility might still be needed.
+ * The intent would be to delete all copied code (and maybe most of this file)
+ * if/when the relevant PRs have been merged into JLine3.
+ * The copied code is available under the BSD License.
  */
 package org.apache.groovy.groovysh.jline;
 


(groovy) 02/02: merge upstream improvement

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 561244e5853b0856f3f9defca303b56baabe95ca
Author: Paul King <pa...@asert.com.au>
AuthorDate: Mon Aug 25 19:46:50 2025 +1000

    merge upstream improvement
---
 .../apache/groovy/groovysh/jline/GroovyPosixCommands.java  | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyPosixCommands.java b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyPosixCommands.java
index 445a03f08e..cb7aa2c25c 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyPosixCommands.java
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyPosixCommands.java
@@ -518,9 +518,7 @@ public class GroovyPosixCommands extends PosixCommands {
         if (opt.args().isEmpty()) {
             expanded.add(currentDir);
         } else {
-            opt.args().forEach(s -> {
-                expanded.addAll(maybeExpandGlob(context, s));
-            });
+            opt.args().stream().flatMap(s -> maybeExpandGlob(context, s)).forEach(expanded::add);
         }
         boolean listAll = opt.isSet("a");
         Predicate<Path> filter = p -> listAll
@@ -901,7 +899,7 @@ public class GroovyPosixCommands extends PosixCommands {
             } else if (arg.startsWith("[Ljava.lang.String;@")) {
                 sources.add(new NamedInputStream(variableInputStream(argv, arg), arg));
             } else {
-                sources.addAll(maybeExpandGlob(context, arg).stream()
+                sources.addAll(maybeExpandGlob(context, arg)
                     .map(gp -> new NamedInputStream(newInputStream(gp), gp.toString()))
                     .collect(Collectors.toList()));
             }
@@ -926,7 +924,7 @@ public class GroovyPosixCommands extends PosixCommands {
             if ("-".equals(arg)) {
                 sources.add(new Source.StdInSource(context.in()));
             } else {
-                sources.addAll(maybeExpandGlob(context, arg).stream()
+                sources.addAll(maybeExpandGlob(context, arg)
                     .map(p -> {
                         try {
                             return new Source.URLSource(p.toUri().toURL(), p.toString());
@@ -1024,11 +1022,11 @@ public class GroovyPosixCommands extends PosixCommands {
         return perms;
     }
 
-    private static List<Path> maybeExpandGlob(Context context, String s) {
+    private static Stream<Path> maybeExpandGlob(Context context, String s) {
         if (s.contains("*") || s.contains("?")) {
-            return expandGlob(context, s);
+            return expandGlob(context, s).stream();
         }
-        return Collections.singletonList(context.currentDir().resolve(s));
+        return Stream.of(context.currentDir().resolve(s));
     }
 
     private static List<Path> expandGlob(Context context, String pattern) {