[
https://issues.apache.org/jira/browse/GROOVY-11907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18074973#comment-18074973
]
Eric Milles commented on GROOVY-11907:
--------------------------------------
This is an excerpt of the trait that produces the assertion error within ASM
stack frame writing.
{code:groovy}
@CompileStatic
@SelfType(ContainerGebSpec)
trait ContainerSupport implements DownloadSupport {
@Shared
static BrowserWebDriverContainer container
/**
* Copies a file from the host to the container for assignment to a Geb
FileInput module.
* This method is useful when you need to upload a file to a form in a Geb
test and will work cross-platform.
*
* @param hostPath relative path to the file on the host
* @param containerPath absolute path to where to put the file in the
container
* @return the file object to assign to the FileInput module
* @since 4.2
*/
File createFileInputSource(String hostPath, String containerPath) {
container.copyFileToContainer(Transferable.of(new
File(hostPath).bytes), containerPath)
return new ContainerGebFileInputSource(containerPath)
}
}
{code}
The {{createFileInputSource}} method gets translated into roughly:
{code:groovy}
synthetic abstract static class
grails.plugin.geb.support.ContainerSupport$Trait$Helper {
java.io.File createFileInputSource(grails.plugin.geb.support.ContainerSupport
$self, java.lang.String hostPath, java.lang.String containerPath) {
(
((ContainerSupport$Trait$FieldHelper) $self) instanceof Class
? (ContainerSupport$Trait$FieldHelper) $self
: ((ContainerSupport$Trait$FieldHelper) $self).getClass()
).grails_plugin_geb_support_ContainerSupport__container$get()
.copyFileToContainer(Transferable.of(new File(hostPath).bytes),
containerPath);
return new ContainerGebFileInputSource(containerPath);
}
}
{code}
The {{((ContainerSupport$Trait$FieldHelper) $self).getClass()}} is marked as
implicit-this, which produces an extra "getClass" dynamic class variable.
However, I tried setting implicit-this to false and it didn't make a difference.
It is this last line (1482) of {{Frame}} that throws. The value of
{{abstractType}} is -67108865 (0xfbffffff). {{currentFrame}} in
{{MethodVisitor}} is {{[31, /*numLocal:*/3, /*numStack:*/1, 8388610, 8388619,
8388619, -67108865]}}. 4..6 are for the 3 parameters. I think the 7th
position is for the 1 stack variable.
!screenshot-1.png!
> SC: trait static field helper generates invalid bytecode when method-level
> DYNAMIC_RESOLUTION is present (GROOVY-11817 regression)
> -----------------------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-11907
> URL: https://issues.apache.org/jira/browse/GROOVY-11907
> Project: Groovy
> Issue Type: Bug
> Reporter: Paul King
> Assignee: Eric Milles
> Priority: Major
> Fix For: 5.0.6
>
> Attachments: screenshot-1.png
>
>
> This is to track the *_grails-geb testFixtures_* error discussed here:
> [Canary] Grails 8 on Groovy 5 + Spring Boot 4 integration branch
> https://github.com/apache/grails-core/pull/15557
--
This message was sent by Atlassian Jira
(v8.20.10#820010)