You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a parallel maven build with "mvn --builder smart -T1C clean install -DskipTests" occasionally causes the following error:
[ERROR] /*
[ERROR] ^
[ERROR] General error during class generation: java.lang.UnsupportedOperationException
[ERROR]
[ERROR] java.lang.UnsupportedOperationException
[ERROR] at java.util.Collections$UnmodifiableMap.put(Collections.java:1457)
[ERROR] at org.codehaus.groovy.ast.ImmutableClassNode.enableWriteProtection(ImmutableClassNode.java:128)
[ERROR] at org.codehaus.groovy.ast.ImmutableClassNode.getDeclaredMethods(ImmutableClassNode.java:120)
[ERROR] at org.codehaus.groovy.ast.ClassNode.getMethods(ClassNode.java:1004)
[ERROR] at org.codehaus.groovy.classgen.ClassCompletionVerifier.checkMethodForWeakerAccessPrivileges(ClassCompletionVerifier.java:369)
[ERROR] at org.codehaus.groovy.classgen.ClassCompletionVerifier.checkMethodsForWeakerAccess(ClassCompletionVerifier.java:266)
[ERROR] at org.codehaus.groovy.classgen.ClassCompletionVerifier.visitClass(ClassCompletionVerifier.java:66)
[ERROR] at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:857)
[ERROR] at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:909)
[ERROR] at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1221)
[ERROR] at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:651)
[ERROR] at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:629)
[ERROR] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:606)
[ERROR] at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:202)
[ERROR] at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.generateCode(GroovyCompilationUnitDeclaration.java:1711)
[ERROR] at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:838)
[ERROR] at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:137)
[ERROR] at java.lang.Thread.run(Thread.java:745)
It appears that at least two threads think that writeProtected == false and both try to enter the synchronized enableWriteProtection() method. One will block
while the other is creating the unmodifiableMap. But when the blocked thread then executes the enableWriteProtection() method it will generate the above error.
Environment
Description
Running a parallel maven build with "
mvn --builder smart -T1C clean install -DskipTests
" occasionally causes the following error:ImmutableClassNode.java:128
It appears that at least two threads think that
writeProtected == false
and both try to enter the synchronizedenableWriteProtection()
method. One will blockwhile the other is creating the
unmodifiableMap
. But when the blocked thread then executes theenableWriteProtection()
method it will generate the above error.One solution is to make
writeProtected
volatile and check it again inside theenableWriteProtection()
method.The text was updated successfully, but these errors were encountered: