[Git][java-team/grengine][upstream] New upstream version 3.0.2+dfsg

Pierre Gruet (@pgt) gitlab at salsa.debian.org
Thu Jun 22 13:26:41 BST 2023



Pierre Gruet pushed to branch upstream at Debian Java Maintainers / grengine


Commits:
c3a234f7 by Pierre Gruet at 2023-06-21T20:50:05+02:00
New upstream version 3.0.2+dfsg
- - - - -


9 changed files:

- README.md
- build.gradle
- src/main/java/ch/artecat/grengine/code/groovy/DefaultGroovyCompiler.java
- src/main/java/ch/artecat/grengine/except/CompileException.java
- src/main/java/ch/artecat/grengine/except/CreateException.java
- src/main/java/ch/artecat/grengine/except/LoadException.java
- src/main/java/ch/artecat/grengine/source/DefaultSourceFactory.java
- src/test/java/ch/artecat/grengine/GrengineGrapeTest.java
- src/test/java/ch/artecat/grengine/code/groovy/DefaultGroovyCompilerTest.java


Changes:

=====================================
README.md
=====================================
@@ -8,8 +8,8 @@ See [artecat.ch/grengine](https://www.artecat.ch/grengine/) for user manual, jav
 Building
 --------
 
-* Requires Java 8 (or later) and Gradle
-* Build: `./gradlew clean build pom jacoco`
+* Requires Java 8 (or later)
+* Build: `./gradlew clean all`
 
 License
 -------


=====================================
build.gradle
=====================================
@@ -1,116 +1,164 @@
-  apply plugin: 'java'
-  apply plugin: 'eclipse'
-  apply plugin: 'maven'
-  apply plugin: 'jacoco'
 
-  sourceCompatibility = 1.8
-  targetCompatibility = 1.8
+plugins {
+  id 'java'
+  id 'maven-publish'
+  id 'jacoco'
+}
 
-  version = '3.0.0'
-  
-  description = 'Grengine is an engine for running and embedding Groovy in a Java VM.'
-
-  project.ext {
-    pkg = 'jar'
-  }
-  
-  ext {
-    groovyVersion='2.5.5'
-    junitVersion='5.3.2'
-    hamcrestVersion='2.1'
-    ivyVersion='2.4.0'
-    commonsIoVersion='2.6'
+java {
+  toolchain {
+    languageVersion = JavaLanguageVersion.of(8)
   }
+  withSourcesJar()
+  withJavadocJar()
+}
 
-  jar {
-    manifest {
-      attributes 'Implementation-Title': 'grengine', 'Implementation-Version': version, 'provider': 'gradle'
-    }
-  }
+version = '3.0.2'
 
-  dependencies {
-    compile "org.codehaus.groovy:groovy:$groovyVersion"
-    testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
-    testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
-    testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
-    testCompile "org.apache.ivy:ivy:$ivyVersion"
-    testCompile "commons-io:commons-io:$commonsIoVersion"
-  }
+description = 'Grengine is an engine for running and embedding Groovy in a Java VM.'
 
-  project.group = 'ch.artecat.grengine'
+project.ext {
+  pkg = 'jar'
+}
 
-  repositories {
-    mavenCentral()
-  }
+ext {
+  groovy4GroupId='org.apache.groovy'
+  groovy4Version='4.0.9'
+  groovy3GroupId='org.codehaus.groovy'
+  groovy3Version='3.0.15'
+  groovy2GroupId=groovy3GroupId
+  groovy2Version='2.5.21'
 
-  task sourcesJar(type: Jar, dependsOn:classes) {
-    classifier = 'sources'
-    from sourceSets.main.allSource
-  }
-  
-  javadoc {
-    configure(options) {
-      windowTitle = "Grengine - $project.version"
-      header = 'Grengine'
-      author = true
-      links = [ 'https://docs.oracle.com/javase/8/docs/api/', 'http://docs.groovy-lang.org/docs/groovy-' + groovyVersion + '/html/api/' ]
-      tags = [ 'grengine.scriptthrows:a:Throws (out of Groovy script):' ]
-    }
-  }
+  groovyGroupId=groovy4GroupId
+  groovyVersion=groovy4Version
 
-  task javadocJar(type: Jar, dependsOn:javadoc) {
-    classifier = 'javadoc'
-    from javadoc.destinationDir
-  }
+  junitVersion='5.9.2'
+  hamcrestVersion='2.2'
+  ivyVersion='2.5.1'
+  commonsIoVersion='2.11.0'
+}
 
-  tasks.withType(JavaCompile) {
-    // treat warnings as errors
-    options.compilerArgs << "-Xlint:all" << "-Werror"
-  }
-  
-  test {
-    testLogging.showStandardStreams = true
-    useJUnitPlatform()
-  }
-  
-  artifacts {
-    archives sourcesJar 
-    archives javadocJar 
+jar {
+  manifest {
+    attributes 'Implementation-Title': 'grengine', 'Implementation-Version': version, 'provider': 'gradle'
   }
-  
-  task jacoco(type:JacocoReport) {
-    executionData test
-    sourceSets sourceSets.main
+}
+
+dependencies {
+  implementation "$groovyGroupId:groovy:$groovyVersion"
+  testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
+  testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
+  testImplementation "org.hamcrest:hamcrest-library:$hamcrestVersion"
+  testImplementation "org.apache.ivy:ivy:$ivyVersion"
+  testImplementation "commons-io:commons-io:$commonsIoVersion"
+}
+
+project.group = 'ch.artecat.grengine'
+
+repositories {
+  mavenCentral()
+}
+
+javadoc {
+  configure(options) {
+    windowTitle = "Grengine - $project.version"
+    header = 'Grengine'
+    author = true
+    links = [ 'https://docs.oracle.com/javase/8/docs/api/', 'http://docs.groovy-lang.org/docs/groovy-' + groovyVersion + '/html/api/' ]
+    tags = [ 'grengine.scriptthrows:a:Throws (out of Groovy script):' ]
   }
-  
-  task pom {
-    doLast {
+}
+
+tasks.withType(JavaCompile) {
+  // treat warnings as errors
+  options.compilerArgs << "-Xlint:all" << "-Werror"
+}
+
+test {
+  testLogging.showStandardStreams = true
+  useJUnitPlatform()
+  finalizedBy(jacocoTestReport)
+}
+
+jacocoTestReport {
+  dependsOn(test)
+}
+
+publishing {
+  publications {
+    mavenJava(MavenPublication) {
+      // purposely no dependency to Groovy generated since the group ID depends on the Groovy version...
       pom {
-        project {
-          name 'grengine'
-          description project.description
-          url 'https://www.artecat.ch/grengine/'
-          packaging project.ext.pkg
-          licenses {
-            license {
-              name 'The Apache Software License, Version 2.0'
-              url 'https://www.apache.org/licenses/LICENSE-2.0'
-              distribution 'repo'
-            }
+        name = 'grengine'
+        description = project.description
+        url = 'https://www.artecat.ch/grengine/'
+        packaging project.ext.pkg
+        licenses {
+          license {
+            name = 'The Apache Software License, Version 2.0'
+            url = 'https://www.apache.org/licenses/LICENSE-2.0'
+            distribution = 'repo'
           }
-          scm {
-            url 'https://gitlab.com/jexler/grengine'
-            connection 'https://gitlab.com/jexler/grengine.git'
-            developerConnection 'https://gitlab.com/jexler/grengine.git'
-          }
-          developers {
-            developer {
-              id 'jexler'
-              name 'Jex Jexler (Alain Stalder)'
-              email 'jexler at artecat.ch'
-            }
+        }
+        scm {
+          url = 'https://gitlab.com/jexler/grengine'
+          connection = 'https://gitlab.com/jexler/grengine.git'
+          developerConnection = 'https://gitlab.com/jexler/grengine.git'
+        }
+        developers {
+          developer {
+            id = 'jexler'
+            name = 'Jex Jexler (Alain Stalder)'
+            email = 'jexler at artecat.ch'
           }
         }
-      }.writeTo("$buildDir/libs/${project.name}-${project.version}.pom")
+      }
+    }
+  }
+
+  // "publish" locally in build directory
+  repositories {
+    maven {
+      url = layout.buildDirectory.dir('pubs')
     }
   }
+}
+
+task copyPomToLibs(type: Copy) {
+  dependsOn(generatePomFileForMavenJavaPublication)
+  from "$buildDir/publications/mavenJava"
+  into "$buildDir/libs"
+  include 'pom-default.xml'
+  rename 'pom-default.xml', "${project.name}-${project.version}.pom"
+}
+
+task copyJarsAndPomToReleases(type: Copy) {
+  dependsOn(jar)
+  dependsOn(sourcesJar)
+  dependsOn(javadocJar)
+  dependsOn(copyPomToLibs)
+  from "$buildDir/libs"
+  into "$buildDir/releases/${project.version}"
+  include '*.jar'
+  include '*.pom'
+}
+
+task copyJavadocToReleases(type: Copy) {
+  dependsOn(javadoc)
+  from "$buildDir/docs/javadoc"
+  into "$buildDir/releases/${project.version}/javadoc"
+  include '**/*'
+}
+
+task copyJacocoToReleases(type: Copy) {
+  dependsOn(jacocoTestReport)
+  from "$buildDir/reports/jacoco/test/html"
+  into "$buildDir/releases/${project.version}/jacoco"
+  include '**/*'
+}
+
+task all {
+  dependsOn(copyJarsAndPomToReleases)
+  dependsOn(copyJavadocToReleases)
+  dependsOn(copyJacocoToReleases)
+}


=====================================
src/main/java/ch/artecat/grengine/code/groovy/DefaultGroovyCompiler.java
=====================================
@@ -239,8 +239,10 @@ public class DefaultGroovyCompiler implements Compiler {
                 compiledSourceInfoMap.put(source, compiledSourceInfo);
             });
 
+            // extra object to prevent compiler warning (raw List in Groovy 2, List<GroovyClass> in Groovy 3)
+            Object cuClassesObject = cu.getClasses();
             @SuppressWarnings("unchecked")
-            final Map<String, Bytecode> bytecodeMap = ((List<GroovyClass>)cu.getClasses()).stream()
+            final Map<String, Bytecode> bytecodeMap = ((List<GroovyClass>)cuClassesObject).stream()
                     .collect(Collectors.toMap(GroovyClass::getName, c -> new Bytecode(c.getName(), c.getBytes())));
 
             final Code code;
@@ -491,8 +493,10 @@ public class DefaultGroovyCompiler implements Compiler {
         // the lock for calls to GrapeEngine methods
         static volatile Object lock;
 
-        // default depth of wrapped GrapeEngine plus one
-        static volatile int defaultDepth;
+        // default callee depth of (unwrapped) GrapeEngine instance;
+        // value has been 3 up to at least Groovy 4; since Groovy 3
+        // publicly declared as GrapeEngine.DEFAULT_CALLEE_DEPTH
+        static volatile int grapeInstanceDefaultCalleeDepth;
 
         // the wrapped engine
         final GrapeEngine innerEngine;
@@ -503,7 +507,7 @@ public class DefaultGroovyCompiler implements Compiler {
         }
 
         // sets the engine instance in the Grape class (only once, idempotent)
-        static void wrap(Object newLock) {
+        static void wrap(final Object newLock) {
             synchronized (GrengineGrapeEngine.class) {
 
                 // already wrapped?
@@ -518,26 +522,21 @@ public class DefaultGroovyCompiler implements Compiler {
                     }
                 }
 
-                // verify preconditions and get GrapeIvy DEFAULT_DEPTH via reflection
-                final Class<?> grapeEngineClass = Grape.getInstance().getClass();
-                if (!grapeEngineClass.getName().equals("groovy.grape.GrapeIvy")) {
+                // verify preconditions
+                final Class<?> grapeIvyClass = Grape.getInstance().getClass();
+                if (!grapeIvyClass.getName().equals("groovy.grape.GrapeIvy")) {
                     throw new IllegalStateException("Unable to wrap GrapeEngine in Grape.class " +
-                            "(current GrapeEngine is " + grapeEngineClass.getName() +
+                            "(current GrapeEngine is " + grapeIvyClass.getName() +
                             ", supported is groovy.grape.GrapeIvy).");
                 }
-                final Field defaultDepthField;
+
                 try {
-                    defaultDepthField = grapeEngineClass.getDeclaredField("DEFAULT_DEPTH");
-                } catch (NoSuchFieldException e) {
-                    throw new IllegalStateException("Unable to wrap GrapeEngine in Grape.class " +
-                            "(no static field GrapeIvy.DEFAULT_DEPTH)");
-                }
-                defaultDepthField.setAccessible(true);
-                try {
-                    defaultDepth = defaultDepthField.getInt(grapeEngineClass) + 1;
-                } catch (IllegalAccessException e) {
-                    throw new IllegalStateException("Unable to wrap GrapeEngine in Grape.class " +
-                            "(could not read static int field GrapeIvy.DEFAULT_DEPTH: " + e + ")");
+                    // Groovy 3 and later
+                    final Field field = GrapeEngine.class.getDeclaredField("DEFAULT_CALLEE_DEPTH");
+                    grapeInstanceDefaultCalleeDepth = field.getInt(GrapeEngine.class);
+                } catch (Throwable t) {
+                    // earlier Groovy
+                    grapeInstanceDefaultCalleeDepth = 3;
                 }
 
                 // wrap
@@ -570,7 +569,7 @@ public class DefaultGroovyCompiler implements Compiler {
                     }.unwrap();
                 }
                 lock = null;
-                defaultDepth = 0;
+                grapeInstanceDefaultCalleeDepth = 0;
             }
         }
 
@@ -585,7 +584,7 @@ public class DefaultGroovyCompiler implements Compiler {
         @SuppressWarnings({ "rawtypes", "unchecked" })
         public Object grab(final Map args) {
             synchronized(lock) {
-                args.computeIfAbsent(CALLEE_DEPTH_KEY, k -> defaultDepth + 1);
+                adjustCalleeDepth(args);
                 // apply grab also to runtime loader, if present
                 final Object obj = args.get(CLASS_LOADER_KEY);
                 if (obj instanceof CompileTimeGroovyClassLoader) {
@@ -604,7 +603,7 @@ public class DefaultGroovyCompiler implements Compiler {
         @SuppressWarnings({ "rawtypes", "unchecked" })
         public Object grab(final Map args, final Map... dependencies) {
             synchronized(lock) {
-                args.computeIfAbsent(CALLEE_DEPTH_KEY, k -> defaultDepth);
+                adjustCalleeDepth(args);
                 // apply grab also to runtime loader, if present
                 final Object obj = args.get(CLASS_LOADER_KEY);
                 if (obj instanceof CompileTimeGroovyClassLoader) {
@@ -630,7 +629,7 @@ public class DefaultGroovyCompiler implements Compiler {
         @SuppressWarnings({ "rawtypes", "unchecked" })
         public URI[] resolve(final Map args, final Map... dependencies) {
             synchronized(lock) {
-                args.computeIfAbsent(CALLEE_DEPTH_KEY, k -> defaultDepth);
+                adjustCalleeDepth(args);
                 return innerEngine.resolve(args, dependencies);
             }
         }
@@ -658,6 +657,12 @@ public class DefaultGroovyCompiler implements Compiler {
             }
         }
 
+        private static void adjustCalleeDepth(Map<String, Object> args) {
+            Object calleeDepthObj = args.get(CALLEE_DEPTH_KEY);
+            int calleeDepth = (calleeDepthObj == null) ? grapeInstanceDefaultCalleeDepth : (int)calleeDepthObj;
+            args.put(CALLEE_DEPTH_KEY, calleeDepth + 1);
+        }
+
     }
 
 }


=====================================
src/main/java/ch/artecat/grengine/except/CompileException.java
=====================================
@@ -19,7 +19,6 @@ package ch.artecat.grengine.except;
 import ch.artecat.grengine.sources.Sources;
 
 
-
 /**
  * Exception thrown when (Groovy script) compilation failed.
  * 


=====================================
src/main/java/ch/artecat/grengine/except/CreateException.java
=====================================
@@ -17,7 +17,6 @@
 package ch.artecat.grengine.except;
 
 
-
 /**
  * Exception thrown when creating an instance of {@link groovy.lang.Script} failed.
  * 


=====================================
src/main/java/ch/artecat/grengine/except/LoadException.java
=====================================
@@ -17,7 +17,6 @@
 package ch.artecat.grengine.except;
 
 
-
 /**
  * Exception thrown when loading a class failed.
  * 


=====================================
src/main/java/ch/artecat/grengine/source/DefaultSourceFactory.java
=====================================
@@ -299,6 +299,12 @@ public class DefaultSourceFactory implements SourceFactory {
          * @since 1.0
          */
         public static final long DEFAULT_URL_TRACKING_LATENCY_MS = 60000L;
+
+        /**
+         * default latency for tracking file last modified (1000ms = 1 second).
+         *
+         * @since 1.0.1
+         */
         public static final long DEFAULT_FILE_LAST_MODIFIED_TRACKING_LATENCY_MS = 1000L;
         
         private boolean isCommitted;


=====================================
src/test/java/ch/artecat/grengine/GrengineGrapeTest.java
=====================================
@@ -45,12 +45,31 @@ import static org.junit.jupiter.api.Assertions.fail;
 class GrengineGrapeTest {
 
     @Test
-    void testHelloWorldWithGrape() {
+    void testHelloWorldWithGrape_unwrapped() {
+        printVersions();
         Grengine.Grape.newGrengine().run("@Grab('com.google.guava:guava:18.0')\n"
                 + "import com.google.common.base.Ascii\n" +
                 "println \"Grape: 'C' is upper case: ${Ascii.isUpperCase('C' as char)}\"");
     }
 
+    @Test
+    void testHelloWorldWithGrape_wrapped() {
+        printVersions();
+        try {
+            Grengine.Grape.activate();
+            Grengine.Grape.newGrengine().run("@Grab('com.google.guava:guava:18.0')\n"
+                    + "import com.google.common.base.Ascii\n" +
+                    "println \"Grape: 'C' is upper case: ${Ascii.isUpperCase('C' as char)}\"");
+        } finally {
+            Grengine.Grape.deactivate();
+        }
+    }
+
+    private static void printVersions() {
+        System.out.println("Java: " + System.getProperty("java.version"));
+        System.out.println("Groovy: " + GroovyClassLoader.class.getPackage().getImplementationVersion());
+    }
+
     @Test
     void testNoGrapeByDefault() {
         try {


=====================================
src/test/java/ch/artecat/grengine/code/groovy/DefaultGroovyCompilerTest.java
=====================================
@@ -64,6 +64,9 @@ import static org.junit.jupiter.api.Assertions.fail;
 
 class DefaultGroovyCompilerTest {
 
+    // so far same value for all Groovy versions up to Groovy 4
+    private static final int GRAPE_INSTANCE_DEFAULT_CALLEE_DEPTH = 3;
+
     @Test
     void testConstructDefaults() {
 
@@ -569,8 +572,9 @@ class DefaultGroovyCompilerTest {
             // then
 
             assertThat(engine, instanceOf(DefaultGroovyCompiler.GrengineGrapeEngine.class));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is((Object) Grape.class));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.defaultDepth, is(4));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is(Grape.class));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.grapeInstanceDefaultCalleeDepth,
+                    is(GRAPE_INSTANCE_DEFAULT_CALLEE_DEPTH));
             assertThat(((DefaultGroovyCompiler.GrengineGrapeEngine) engine).innerEngine.getClass().getName(),
                     is("groovy.grape.GrapeIvy"));
 
@@ -582,8 +586,9 @@ class DefaultGroovyCompilerTest {
             // then
 
             assertThat(engine, instanceOf(DefaultGroovyCompiler.GrengineGrapeEngine.class));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is((Object) Grape.class));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.defaultDepth, is(4));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is(Grape.class));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.grapeInstanceDefaultCalleeDepth,
+                    is(GRAPE_INSTANCE_DEFAULT_CALLEE_DEPTH));
             assertThat(((DefaultGroovyCompiler.GrengineGrapeEngine) engine).innerEngine.getClass().getName(),
                     is("groovy.grape.GrapeIvy"));
 
@@ -596,7 +601,7 @@ class DefaultGroovyCompilerTest {
 
             assertThat(engine.getClass().getName(), is("groovy.grape.GrapeIvy"));
             assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is(nullValue()));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.defaultDepth, is(0));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.grapeInstanceDefaultCalleeDepth, is(0));
 
             // when (disable again, must be idempotent, too)
 
@@ -607,7 +612,7 @@ class DefaultGroovyCompilerTest {
 
             assertThat(engine.getClass().getName(), is("groovy.grape.GrapeIvy"));
             assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is(nullValue()));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.defaultDepth, is(0));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.grapeInstanceDefaultCalleeDepth, is(0));
 
             // when (enable once more)
 
@@ -617,8 +622,9 @@ class DefaultGroovyCompilerTest {
             // then
 
             assertThat(engine, instanceOf(DefaultGroovyCompiler.GrengineGrapeEngine.class));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is((Object) Grape.class));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.defaultDepth, is(4));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is(Grape.class));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.grapeInstanceDefaultCalleeDepth,
+                    is(GRAPE_INSTANCE_DEFAULT_CALLEE_DEPTH));
             assertThat(((DefaultGroovyCompiler.GrengineGrapeEngine) engine).innerEngine.getClass().getName(),
                     is("groovy.grape.GrapeIvy"));
 
@@ -631,7 +637,7 @@ class DefaultGroovyCompilerTest {
 
             assertThat(engine.getClass().getName(), is("groovy.grape.GrapeIvy"));
             assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is(nullValue()));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.defaultDepth, is(0));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.grapeInstanceDefaultCalleeDepth, is(0));
 
         } finally {
             DefaultGroovyCompiler.disableGrapeSupport();
@@ -655,7 +661,8 @@ class DefaultGroovyCompilerTest {
 
             assertThat(engine, instanceOf(DefaultGroovyCompiler.GrengineGrapeEngine.class));
             assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is(lock));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.defaultDepth, is(4));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.grapeInstanceDefaultCalleeDepth,
+                    is(GRAPE_INSTANCE_DEFAULT_CALLEE_DEPTH));
             assertThat(((DefaultGroovyCompiler.GrengineGrapeEngine) engine).innerEngine.getClass().getName(),
                     is("groovy.grape.GrapeIvy"));
 
@@ -668,7 +675,8 @@ class DefaultGroovyCompilerTest {
 
             assertThat(engine, instanceOf(DefaultGroovyCompiler.GrengineGrapeEngine.class));
             assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is(lock));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.defaultDepth, is(4));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.grapeInstanceDefaultCalleeDepth,
+                    is(GRAPE_INSTANCE_DEFAULT_CALLEE_DEPTH));
             assertThat(((DefaultGroovyCompiler.GrengineGrapeEngine) engine).innerEngine.getClass().getName(),
                     is("groovy.grape.GrapeIvy"));
 
@@ -681,7 +689,7 @@ class DefaultGroovyCompilerTest {
 
             assertThat(engine.getClass().getName(), is("groovy.grape.GrapeIvy"));
             assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is(nullValue()));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.defaultDepth, is(0));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.grapeInstanceDefaultCalleeDepth, is(0));
 
             // when (disable again, must be idempotent, too)
 
@@ -692,7 +700,7 @@ class DefaultGroovyCompilerTest {
 
             assertThat(engine.getClass().getName(), is("groovy.grape.GrapeIvy"));
             assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is(nullValue()));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.defaultDepth, is(0));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.grapeInstanceDefaultCalleeDepth, is(0));
 
             // when (enable once more)
 
@@ -703,7 +711,8 @@ class DefaultGroovyCompilerTest {
 
             assertThat(engine, instanceOf(DefaultGroovyCompiler.GrengineGrapeEngine.class));
             assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is(lock));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.defaultDepth, is(4));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.grapeInstanceDefaultCalleeDepth,
+                    is(GRAPE_INSTANCE_DEFAULT_CALLEE_DEPTH));
             assertThat(((DefaultGroovyCompiler.GrengineGrapeEngine) engine).innerEngine.getClass().getName(),
                     is("groovy.grape.GrapeIvy"));
 
@@ -716,7 +725,7 @@ class DefaultGroovyCompilerTest {
 
             assertThat(engine.getClass().getName(), is("groovy.grape.GrapeIvy"));
             assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.lock, is(nullValue()));
-            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.defaultDepth, is(0));
+            assertThat(DefaultGroovyCompiler.GrengineGrapeEngine.grapeInstanceDefaultCalleeDepth, is(0));
 
         } finally {
             DefaultGroovyCompiler.disableGrapeSupport();



View it on GitLab: https://salsa.debian.org/java-team/grengine/-/commit/c3a234f7fe1cb3538d70f2ded3eff0c8c73817d3

-- 
View it on GitLab: https://salsa.debian.org/java-team/grengine/-/commit/c3a234f7fe1cb3538d70f2ded3eff0c8c73817d3
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20230622/9063a886/attachment.htm>


More information about the pkg-java-commits mailing list