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/01/05 10:30:51 UTC

(groovy) branch master updated (306ba36b0e -> 579e497f91)

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 306ba36b0e GROOVY-11190: Jakarta EE 9 compatibility for groovy-servlet (add javax classifier for backwards compatibility)
     new f9a7971489 avoid deprecated usage
     new 579e497f91 GROOVY-11543: Bump hsqldb to 2.7.4 (test dependency)

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:
 .../apache/groovy/gradle/WriteExtensionDescriptorTask.groovy |  4 ++--
 src/main/groovy/groovy/util/ConfigSlurper.groovy             |  4 ++--
 .../control/customizers/ASTTransformationCustomizer.groovy   | 12 ++++++------
 .../src/main/groovy/groovy/console/ui/Console.groovy         |  2 +-
 subprojects/groovy-sql/build.gradle                          |  2 +-
 .../src/main/groovy/groovy/swing/LookAndFeelHelper.groovy    |  4 ++--
 .../src/main/groovy/groovy/swing/factory/BeanFactory.groovy  |  2 +-
 .../main/groovy/groovy/swing/factory/ColumnFactory.groovy    |  2 +-
 .../groovy/groovy/swing/factory/ColumnModelFactory.groovy    |  2 +-
 .../groovy/groovy/swing/factory/TextArgWidgetFactory.groovy  |  2 +-
 .../src/main/groovy/groovy/mock/interceptor/MockFor.groovy   |  6 +++---
 .../main/groovy/groovy/test/JavadocAssertionTestSuite.groovy |  2 +-
 12 files changed, 22 insertions(+), 22 deletions(-)


(groovy) 01/02: avoid deprecated usage

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 f9a7971489e18bbe9abc18f09e1754c96c049f9c
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sun Jan 5 20:28:25 2025 +1000

    avoid deprecated usage
---
 .../apache/groovy/gradle/WriteExtensionDescriptorTask.groovy |  4 ++--
 src/main/groovy/groovy/util/ConfigSlurper.groovy             |  4 ++--
 .../control/customizers/ASTTransformationCustomizer.groovy   | 12 ++++++------
 .../src/main/groovy/groovy/console/ui/Console.groovy         |  2 +-
 .../src/main/groovy/groovy/swing/LookAndFeelHelper.groovy    |  4 ++--
 .../src/main/groovy/groovy/swing/factory/BeanFactory.groovy  |  2 +-
 .../main/groovy/groovy/swing/factory/ColumnFactory.groovy    |  2 +-
 .../groovy/groovy/swing/factory/ColumnModelFactory.groovy    |  2 +-
 .../groovy/groovy/swing/factory/TextArgWidgetFactory.groovy  |  2 +-
 .../src/main/groovy/groovy/mock/interceptor/MockFor.groovy   |  6 +++---
 .../main/groovy/groovy/test/JavadocAssertionTestSuite.groovy |  2 +-
 11 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/build-logic/src/main/groovy/org/apache/groovy/gradle/WriteExtensionDescriptorTask.groovy b/build-logic/src/main/groovy/org/apache/groovy/gradle/WriteExtensionDescriptorTask.groovy
index 0e021df9b4..72a62f0387 100644
--- a/build-logic/src/main/groovy/org/apache/groovy/gradle/WriteExtensionDescriptorTask.groovy
+++ b/build-logic/src/main/groovy/org/apache/groovy/gradle/WriteExtensionDescriptorTask.groovy
@@ -35,8 +35,8 @@ class WriteExtensionDescriptorTask extends DefaultTask {
     @OutputFile File descriptor = computeDescriptorFile()
 
     private File computeDescriptorFile() {
-        def metaInfDir = new File("${project.buildDir}/resources/main/META-INF/groovy")
-        return new File(metaInfDir, "org.codehaus.groovy.runtime.ExtensionModule")
+        def metaInfDir = project.layout.buildDirectory.dir('/resources/main/META-INF/groovy').get()
+        return new File(metaInfDir, 'org.codehaus.groovy.runtime.ExtensionModule')
     }
 
     @TaskAction
diff --git a/src/main/groovy/groovy/util/ConfigSlurper.groovy b/src/main/groovy/groovy/util/ConfigSlurper.groovy
index d7f47d54c3..c16bceb6cf 100644
--- a/src/main/groovy/groovy/util/ConfigSlurper.groovy
+++ b/src/main/groovy/groovy/util/ConfigSlurper.groovy
@@ -150,7 +150,7 @@ class ConfigSlurper {
      * @see ConfigSlurper#parse(groovy.lang.Script)
      */
     ConfigObject parse(Class scriptClass) {
-        parse(scriptClass.newInstance())
+        parse(scriptClass.getConstructor().newInstance())
     }
 
     /**
@@ -171,7 +171,7 @@ class ConfigSlurper {
      * @return The ConfigObject instance
      */
     ConfigObject parse(URL scriptLocation) {
-        parse(classLoader.parseClass(scriptLocation.text).newInstance(), scriptLocation)
+        parse(classLoader.parseClass(scriptLocation.text).getConstructor().newInstance(), scriptLocation)
     }
 
     /**
diff --git a/src/main/groovy/org/codehaus/groovy/control/customizers/ASTTransformationCustomizer.groovy b/src/main/groovy/org/codehaus/groovy/control/customizers/ASTTransformationCustomizer.groovy
index 6c3d3f6ba6..2d43061410 100644
--- a/src/main/groovy/org/codehaus/groovy/control/customizers/ASTTransformationCustomizer.groovy
+++ b/src/main/groovy/org/codehaus/groovy/control/customizers/ASTTransformationCustomizer.groovy
@@ -104,7 +104,7 @@ class ASTTransformationCustomizer extends CompilationCustomizer implements Compi
     ASTTransformationCustomizer(Class<? extends Annotation> transformationAnnotation, String astTransformationClassName, ClassLoader transformationClassLoader) {
         super(findPhase(transformationAnnotation, astTransformationClassName, transformationClassLoader))
         Class<ASTTransformation> clazz = findASTTransformationClass(transformationAnnotation, astTransformationClassName, transformationClassLoader)
-        this.transformation = clazz.newInstance()
+        this.transformation = clazz.getConstructor().newInstance()
         this.annotationNode = new AnnotationNode(ClassHelper.make(transformationAnnotation))
     }
 
@@ -132,7 +132,7 @@ class ASTTransformationCustomizer extends CompilationCustomizer implements Compi
     ASTTransformationCustomizer(Map annotationParams, Class<? extends Annotation> transformationAnnotation, String astTransformationClassName, ClassLoader transformationClassLoader) {
         super(findPhase(transformationAnnotation, astTransformationClassName, transformationClassLoader))
         Class<ASTTransformation> clazz = findASTTransformationClass(transformationAnnotation, astTransformationClassName, transformationClassLoader)
-        this.transformation = clazz.newInstance()
+        this.transformation = clazz.getConstructor().newInstance()
         this.annotationNode = new AnnotationNode(ClassHelper.make(transformationAnnotation))
         this.annotationParameters = annotationParams
     }
@@ -150,7 +150,7 @@ class ASTTransformationCustomizer extends CompilationCustomizer implements Compi
     ASTTransformationCustomizer(Class<? extends Annotation> transformationAnnotation, ClassLoader transformationClassLoader) {
         super(findPhase(transformationAnnotation, transformationClassLoader))
         Class<ASTTransformation> clazz = findASTTransformationClass(transformationAnnotation, transformationClassLoader)
-        this.transformation = clazz.newInstance()
+        this.transformation = clazz.getConstructor().newInstance()
         this.annotationNode = new AnnotationNode(ClassHelper.make(transformationAnnotation))
     }
 
@@ -181,7 +181,7 @@ class ASTTransformationCustomizer extends CompilationCustomizer implements Compi
     ASTTransformationCustomizer(Map annotationParams, Class<? extends Annotation> transformationAnnotation, ClassLoader transformationClassLoader) {
         super(findPhase(transformationAnnotation, transformationClassLoader))
         Class<ASTTransformation> clazz = findASTTransformationClass(transformationAnnotation, transformationClassLoader)
-        this.transformation = clazz.newInstance()
+        this.transformation = clazz.getConstructor().newInstance()
         this.annotationNode = new AnnotationNode(ClassHelper.make(transformationAnnotation))
         this.annotationParameters = annotationParams
     }
@@ -229,13 +229,13 @@ class ASTTransformationCustomizer extends CompilationCustomizer implements Compi
     private static CompilePhase findPhase(Class<? extends Annotation> annotationClass, ClassLoader transformationClassLoader) {
         Class<ASTTransformation> clazz = findASTTransformationClass(annotationClass, transformationClassLoader)
 
-        findPhase(clazz.newInstance())
+        findPhase(clazz.getConstructor().newInstance())
     }
 
     private static CompilePhase findPhase(Class<? extends Annotation> annotationClass, String astTransformationClassName, ClassLoader transformationClassLoader) {
         Class<ASTTransformation> clazz = findASTTransformationClass(annotationClass, astTransformationClassName, transformationClassLoader)
 
-        findPhase(clazz.newInstance())
+        findPhase(clazz.getConstructor().newInstance())
     }
 
     /**
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy
index 8fa8c5a331..2139b85fee 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy
+++ b/subprojects/groovy-console/src/main/groovy/groovy/console/ui/Console.groovy
@@ -373,7 +373,7 @@ class Console implements CaretListener, HyperlinkListener, ComponentListener, Fo
         try {
             if (Class.forName('org.apache.ivy.core.event.IvyListener')) {
                 def ivyPluginClass = Class.forName('groovy.console.ui.ConsoleIvyPlugin')
-                ivyPluginClass.newInstance().addListener(this)
+                ivyPluginClass.getConstructor().newInstance().addListener(this)
             }
         } catch (ClassNotFoundException ignore) {
         }
diff --git a/subprojects/groovy-swing/src/main/groovy/groovy/swing/LookAndFeelHelper.groovy b/subprojects/groovy-swing/src/main/groovy/groovy/swing/LookAndFeelHelper.groovy
index a88467d6cc..975b7a71a1 100644
--- a/subprojects/groovy-swing/src/main/groovy/groovy/swing/LookAndFeelHelper.groovy
+++ b/subprojects/groovy-swing/src/main/groovy/groovy/swing/LookAndFeelHelper.groovy
@@ -72,11 +72,11 @@ class LookAndFeelHelper {
             theme : { laf, theme ->
                 if (!(theme instanceof MetalTheme)) {
                     if (theme == 'ocean') {
-                        theme = Class.forName('javax.swing.plaf.metal.OceanTheme').newInstance()
+                        theme = Class.forName('javax.swing.plaf.metal.OceanTheme').getConstructor().newInstance()
                     } else if (theme == 'steel') {
                         theme = new DefaultMetalTheme();
                     } else {
-                        theme = Class.forName(theme as String).newInstance()
+                        theme = Class.forName(theme as String).getConstructor().newInstance()
                     }
                 };
                 MetalLookAndFeel.currentTheme = theme
diff --git a/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/BeanFactory.groovy b/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/BeanFactory.groovy
index bf42e12829..f19385d609 100644
--- a/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/BeanFactory.groovy
+++ b/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/BeanFactory.groovy
@@ -43,7 +43,7 @@ class BeanFactory extends AbstractFactory {
         if (FactoryBuilderSupport.checkValueIsTypeNotString(value, name, beanClass)) {
             return value
         }
-        Object bean = beanClass.newInstance()
+        Object bean = beanClass.getConstructor().newInstance()
         if (value instanceof String) {
             try {
                 bean.text = value
diff --git a/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/ColumnFactory.groovy b/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/ColumnFactory.groovy
index cdc6748e7a..fc086bd371 100644
--- a/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/ColumnFactory.groovy
+++ b/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/ColumnFactory.groovy
@@ -40,7 +40,7 @@ class ColumnFactory extends AbstractFactory {
         }
 
         if (jxTableClass != null && builder.current instanceof TableColumnModel) {
-            node = Class.forName("org.jdesktop.swingx.table.TableColumnExt").newInstance()
+            node = Class.forName("org.jdesktop.swingx.table.TableColumnExt").getConstructor().newInstance()
         } else {
             node = new javax.swing.table.TableColumn()
         }
diff --git a/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/ColumnModelFactory.groovy b/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/ColumnModelFactory.groovy
index a43b432e0a..ec020cd8c1 100644
--- a/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/ColumnModelFactory.groovy
+++ b/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/ColumnModelFactory.groovy
@@ -38,7 +38,7 @@ class ColumnModelFactory extends AbstractFactory {
         }
 
         if (jxTableClass != null && jxTableClass.isAssignableFrom(builder.current.getClass())) {
-            return Class.forName("org.jdesktop.swingx.table.DefaultTableColumnModelExt").newInstance()
+            return Class.forName("org.jdesktop.swingx.table.DefaultTableColumnModelExt").ngetConstructor().newInstance()
         } else {
             return new javax.swing.table.DefaultTableColumnModel()
         }
diff --git a/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/TextArgWidgetFactory.groovy b/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/TextArgWidgetFactory.groovy
index 8ffc8472dc..beeafc51c7 100644
--- a/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/TextArgWidgetFactory.groovy
+++ b/subprojects/groovy-swing/src/main/groovy/groovy/swing/factory/TextArgWidgetFactory.groovy
@@ -34,7 +34,7 @@ class TextArgWidgetFactory extends AbstractFactory {
             return value
         }
 
-        Object widget = klass.newInstance()
+        Object widget = klass.getConstructor().newInstance()
 
         if (value instanceof String) {
             // this does not create property setting order issues, since the value arg precedes all attributes in the builder element
diff --git a/subprojects/groovy-test/src/main/groovy/groovy/mock/interceptor/MockFor.groovy b/subprojects/groovy-test/src/main/groovy/groovy/mock/interceptor/MockFor.groovy
index 82f7c98211..519c49a6d0 100644
--- a/subprojects/groovy-test/src/main/groovy/groovy/mock/interceptor/MockFor.groovy
+++ b/subprojects/groovy-test/src/main/groovy/groovy/mock/interceptor/MockFor.groovy
@@ -285,12 +285,12 @@ class MockFor {
             }
         } else {
             if (GroovyObject.isAssignableFrom(clazz)) {
-                instance = clazz.newInstance()
+                instance = clazz.getConstructor().newInstance()
             } else {
-                instance = ProxyGenerator.INSTANCE.instantiateDelegate(clazz.newInstance())
+                instance = ProxyGenerator.INSTANCE.instantiateDelegate(clazz.getConstructor().newInstance())
             }
         }
         return instance
     }
 
-}
\ No newline at end of file
+}
diff --git a/subprojects/groovy-test/src/main/groovy/groovy/test/JavadocAssertionTestSuite.groovy b/subprojects/groovy-test/src/main/groovy/groovy/test/JavadocAssertionTestSuite.groovy
index 9b1b3313a1..f3d7e0429f 100644
--- a/subprojects/groovy-test/src/main/groovy/groovy/test/JavadocAssertionTestSuite.groovy
+++ b/subprojects/groovy-test/src/main/groovy/groovy/test/JavadocAssertionTestSuite.groovy
@@ -69,7 +69,7 @@ class JavadocAssertionTestSuite extends TestSuite {
     public static final String SYSPROP_SRC_EXCLUDES_PATTERN = "javadocAssertion.src.excludesPattern";
 
     private static final JavadocAssertionTestBuilder testBuilder = new JavadocAssertionTestBuilder()
-    private static final IFileNameFinder finder = Class.forName('groovy.ant.FileNameFinder',true,this.classLoader).newInstance()
+    private static final IFileNameFinder finder = Class.forName('groovy.ant.FileNameFinder',true,this.classLoader).getConstructor().newInstance()
 
     static Test suite() {
         String basedir = System.getProperty(SYSPROP_SRC_DIR, "./src/")


(groovy) 02/02: GROOVY-11543: Bump hsqldb to 2.7.4 (test dependency)

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 579e497f912b9a88a6da4f9d9ceb377b4b382bc1
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sun Jan 5 20:30:39 2025 +1000

    GROOVY-11543: Bump hsqldb to 2.7.4 (test dependency)
---
 subprojects/groovy-sql/build.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/subprojects/groovy-sql/build.gradle b/subprojects/groovy-sql/build.gradle
index f41f530335..be98db8b37 100644
--- a/subprojects/groovy-sql/build.gradle
+++ b/subprojects/groovy-sql/build.gradle
@@ -22,7 +22,7 @@ plugins {
 
 dependencies {
     api rootProject // Sql uses Closure...
-    testImplementation group: 'org.hsqldb', name: 'hsqldb', version: '2.7.3'
+    testImplementation group: 'org.hsqldb', name: 'hsqldb', version: '2.7.4'
 // uncomment to test with other databases (requires changes elsewhere too)
 //    testImplementation 'com.h2database:h2:1.3.164'
 //    testImplementation 'hsqldb:hsqldb:1.8.0.10'