Skip to content

Commit 41c74b5

Browse files
simschlaaugi
authored andcommitted
fix: prevent SO in methodMissing
When using nested configurations, sometimes (haven't figured out when exactly) the following exception appears: ``` Cause: java.lang.StackOverflowError at com.avast.gradle.dockercompose.ComposeExtension.methodMissing(ComposeExtension.groovy:40) at org.gradle.internal.classpath.CallInterceptingMetaClass.lambda$invokeMethod$5(CallInterceptingMetaClass.java:185) at org.gradle.internal.classpath.CallInterceptingMetaClass.invokeIntercepted(CallInterceptingMetaClass.java:244) at org.gradle.internal.classpath.CallInterceptingMetaClass.invokeMethod(CallInterceptingMetaClass.java:185) at com.avast.gradle.dockercompose.ComposeExtension.methodMissing(ComposeExtension.groovy:60) at org.gradle.internal.classpath.CallInterceptingMetaClass.lambda$invokeMethod$5(CallInterceptingMetaClass.java:185) at org.gradle.internal.classpath.CallInterceptingMetaClass.invokeIntercepted(CallInterceptingMetaClass.java:244) at org.gradle.internal.classpath.CallInterceptingMetaClass.invokeMethod(CallInterceptingMetaClass.java:185) at com.avast.gradle.dockercompose.ComposeExtension.methodMissing(ComposeExtension.groovy:60) ... ``` Where the first invocation of `methodMissing` is with `name=myCustomNestedConfigurationName` and all further invocations are with `name=getOrCreateNested` and `args=[myCustomNestedConfigurationName]`. So I assume this is an issue due to the gradle 9 (and therefore groovy-4 vs. groovy-3) update. Probably similar issue as in #492. Refs: #492
1 parent 34a7d18 commit 41c74b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/groovy/com/avast/gradle/dockercompose/ComposeExtension.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ abstract class ComposeExtension extends ComposeSettings {
1212

1313
private HashMap<String, ComposeSettings> settings = [:]
1414

15-
private ComposeSettings getOrCreateNested(String name) {
15+
ComposeSettings getOrCreateNested(String name) {
1616
settings.computeIfAbsent(name, { cloneAsNested(name) })
1717
}
1818

0 commit comments

Comments
 (0)