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

emilles 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 a44c8eaca1 fix test case
a44c8eaca1 is described below

commit a44c8eaca11200709b06f1b92b925e79650c5ee2
Author: Eric Milles <[email protected]>
AuthorDate: Mon Oct 20 14:33:02 2025 -0500

    fix test case
---
 .../groovy/transform/traitx/Groovy_7215.groovy      | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git 
a/src/test/groovy/org/codehaus/groovy/transform/traitx/Groovy_7215.groovy 
b/src/test/groovy/org/codehaus/groovy/transform/traitx/Groovy_7215.groovy
index e29e2840dd..835d3a5c77 100644
--- a/src/test/groovy/org/codehaus/groovy/transform/traitx/Groovy_7215.groovy
+++ b/src/test/groovy/org/codehaus/groovy/transform/traitx/Groovy_7215.groovy
@@ -26,20 +26,16 @@ final class Groovy_7215 {
 
     @Test
     void testTraitAndClassUnderJointCompilation() {
-        def config = new CompilerConfiguration().tap {
-            jointCompilationOptions = [flags: new String[]{'release=11'}, 
memStub: true]
-            targetDirectory = File.createTempDir()
-            targetBytecode = '11'
-        }
-        File parentDir = File.createTempDir()
+        File sourceDir = File.createTempDir()
+        File targetDir = File.createTempDir()
         try {
-            def a = new File(parentDir, 'A.java')
+            def a = new File(sourceDir, 'A.java')
             a.write '''
                 public class A {
                     public static final String TEXT = "";
                 }
             '''
-            def b = new File(parentDir, 'B.groovy')
+            def b = new File(sourceDir, 'B.groovy')
             b.write '''
                 @groovy.transform.CompileStatic
                 class B implements 
org.codehaus.groovy.transform.traitx.Groovy7215SupportTrait {
@@ -47,13 +43,18 @@ final class Groovy_7215 {
                 }
             '''
 
+            def config = new CompilerConfiguration(
+                classpath: new File(this.class.location.toURI()).path,
+                jointCompilationOptions: [memStub: true],
+                targetDirectory: targetDir
+            )
             def loader = new GroovyClassLoader(this.class.classLoader)
             def unit = new JavaAwareCompilationUnit(config, loader)
             unit.addSources(a, b)
             unit.compile()
         } finally {
-            parentDir.deleteDir()
-            config.targetDirectory.deleteDir()
+            sourceDir.deleteDir()
+            targetDir.deleteDir()
         }
     }
 }

Reply via email to