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
The following commit(s) were added to refs/heads/master by this push: new 00122a1d82 minor refactoring 00122a1d82 is described below commit 00122a1d82f52720c1e82b3b759c3e37f56117ec Author: Paul King <pa...@asert.com.au> AuthorDate: Sun Jun 23 13:37:53 2024 +1000 minor refactoring --- src/main/groovy/groovy/grape/GrapeIvy.groovy | 4 ++-- .../org/codehaus/groovy/tools/GrapeMain.groovy | 2 +- src/main/java/groovy/grape/Grape.java | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/groovy/groovy/grape/GrapeIvy.groovy b/src/main/groovy/groovy/grape/GrapeIvy.groovy index 94778f5cb6..75486334c9 100644 --- a/src/main/groovy/groovy/grape/GrapeIvy.groovy +++ b/src/main/groovy/groovy/grape/GrapeIvy.groovy @@ -257,7 +257,7 @@ class GrapeIvy implements GrapeEngine { conf } - @Override + @Override // TODO deprecate grab(String endorsedModule) { grab(group: 'groovy.endorsed', module: endorsedModule, version: GroovySystem.getVersion()) } @@ -417,7 +417,7 @@ class GrapeIvy implements GrapeEngine { is.getText().readLines()*.trim().each { String line -> if (!line.isEmpty() && line[0] != '#') try { - registry[name] = (GroovyRunner) loader.loadClass(line).newInstance() + registry[name] = (GroovyRunner) loader.loadClass(line).getDeclaredConstructor().newInstance() } catch (Exception e) { throw new IllegalStateException("Error registering runner class '$line'", e) } diff --git a/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy b/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy index 2080c5e4b4..5b0ebe09e9 100644 --- a/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy +++ b/src/main/groovy/org/codehaus/groovy/tools/GrapeMain.groovy @@ -84,7 +84,7 @@ class GrapeMain implements Runnable { } @SuppressWarnings('UnusedPrivateMethod') // used in run() - private void setupLogging(int defaultLevel = 2) { // = Message.MSG_INFO -> some parsing error :( + private void setupLogging(int defaultLevel = Message.MSG_INFO) { if (quiet) { Message.defaultLogger = new DefaultMessageLogger(Message.MSG_ERR) } else if (warn) { diff --git a/src/main/java/groovy/grape/Grape.java b/src/main/java/groovy/grape/Grape.java index 5e71bf3b76..e392f2b06e 100644 --- a/src/main/java/groovy/grape/Grape.java +++ b/src/main/java/groovy/grape/Grape.java @@ -41,18 +41,18 @@ public class Grape { protected static GrapeEngine instance; /** - * This is a static access kill-switch. All of the static shortcut - * methods in this class will not work if this property is set to false. - * By default it is set to true. + * This is a static access kill-switch. All the static shortcut + * methods in this class will be disabled if this property is set to false. + * By default, it is set to true. */ public static boolean getEnableGrapes() { return enableGrapes; } /** - * This is a static access kill-switch. All of the static shortcut - * methods in this class will not work if this property is set to false. - * By default it is set to true. + * This is a static access kill-switch. All the static shortcut + * methods in this class will be disabled if this property is set to false. + * By default, it is set to true. */ public static void setEnableGrapes(boolean enableGrapes) { Grape.enableGrapes = enableGrapes; @@ -74,7 +74,7 @@ public class Grape { * will be checked for new versions and downloaded (with dependencies) * if found. * <p> - * By default it is set to true. + * By default, it is set to true. */ public static boolean getEnableAutoDownload() { return enableAutoDownload; @@ -94,7 +94,7 @@ public class Grape { * If it is set to true, then any jars not already downloaded will * automatically be downloaded. Also, any versions expressed as a range * will be checked for new versions and downloaded (with dependencies) - * if found. By default it is set to true. + * if found. By default, it is set to true. */ public static void setEnableAutoDownload(boolean enableAutoDownload) { Grape.enableAutoDownload = enableAutoDownload; @@ -102,7 +102,7 @@ public class Grape { /** * Global flag to ignore checksums. - * By default it is set to false. + * By default, it is set to false. */ public static boolean getDisableChecksums() { return disableChecksums; @@ -110,7 +110,7 @@ public class Grape { /** * Set global flag to ignore checksums. - * By default it is set to false. + * By default, it is set to false. */ public static void setDisableChecksums(boolean disableChecksums) { Grape.disableChecksums = disableChecksums;