[ https://issues.apache.org/jira/browse/GROOVY-11293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17809614#comment-17809614 ]
Eric Milles edited comment on GROOVY-11293 at 1/22/24 7:30 PM: --------------------------------------------------------------- Interesting that it works for 8 and 16+ but not 9-15. There are vmplugins for 8, 9 and 16. So there may be a bug in one of the 9 methods. Also for reference, the {{java.nio.file.FileSystem}} method in question looks like this: {code:java} public abstract Path getPath(String first, String... more); {code} Update: I can get the error when running this as a groovy script with Java 9: {code:groovy} java.nio.file.FileSystems.getDefault().getPath('root.txt') {code} was (Author: emilles): Interesting that it works for 8 and 16+ but not 9-15. There are vmplugins for 8, 9 and 16. So there may be a bug in one of the 9 methods. Also for reference, the {{java.nio.file.FileSystem}} method in question looks like this: {code:java} public abstract Path getPath(String first, String... more); {code} > Error "BUG! At this point argument array length and parameter array length > should be the same" > ---------------------------------------------------------------------------------------------- > > Key: GROOVY-11293 > URL: https://issues.apache.org/jira/browse/GROOVY-11293 > Project: Groovy > Issue Type: Bug > Affects Versions: 4.0.4, 4.0.16, 4.0.18 > Reporter: Alexander Kriegisch > Priority: Major > Attachments: groovy-11293-reproducer.zip > > > When I compile and run this Spock 2.3-groovy-4.0 test on JDK 17 (build target > 8), it works fine: > {code:groovy} > import com.github.marschall.memoryfilesystem.MemoryFileSystemBuilder > import com.google.common.jimfs.Configuration > import com.google.common.jimfs.Jimfs > import spock.lang.Specification > import spock.lang.Unroll > import java.nio.file.FileSystems > import java.nio.file.Files > @Grab('com.google.jimfs:jimfs:1.3.0') > @Grab('com.github.marschall:memoryfilesystem:2.8.0') > class NestedZipTest extends Specification { > @Unroll('#scenario') > def 'create nested zip file'() { > given: 'a text file on the default FS' > def sourceFS = MemoryFileSystemBuilder.newEmpty().build() > def rootTxtPath = sourceFS.getPath('root.txt') > Files.write(rootTxtPath, 'Hello root!'.bytes) > when: 'creating a zip FS on the target FS, adding two text files' > def outerZipPath = targetFS.getPath('outer.zip') > if (Files.exists(outerZipPath)) > Files.delete(outerZipPath) > def outerZipFS = FileSystems.newFileSystem(outerZipPath, [create: 'true']) > Files.write(outerZipFS.getPath('outer.txt'), 'Hello outer!'.bytes) > Files.copy(rootTxtPath, outerZipFS.getPath('from-root.txt')) > and: 'creating a zip FS inside the outer zip file, adding two text files' > def innerZipPath = outerZipFS.getPath('inner.zip') > def innerZipFS = FileSystems.newFileSystem(innerZipPath, [create: 'true']) > Files.write(innerZipFS.getPath('inner.txt'), 'Hello inner!'.bytes) > Files.copy(rootTxtPath, innerZipFS.getPath('from-root.txt')) > and: 'creating a zip FS inside the inner zip file, adding two text files' > def inner2ZipPath = innerZipFS.getPath('inner2.zip') > def inner2ZipFS = FileSystems.newFileSystem(inner2ZipPath, [create: > 'true']) > Files.write(inner2ZipFS.getPath('inner2.txt'), 'Hello inner2!'.bytes) > Files.copy(rootTxtPath, inner2ZipFS.getPath('from-root.txt')) > then: 'no errors occur' > noExceptionThrown() > cleanup: > inner2ZipFS?.close() > innerZipFS?.close() > outerZipFS?.close() > where: > scenario | targetFS > 'on disk' | FileSystems.default > 'JimFS' | > Jimfs.newFileSystem(Configuration.unix().toBuilder().setWorkingDirectory('/').build()) > 'MemoryFileSystem' | MemoryFileSystemBuilder.newEmpty().build() > } > } > {code} > Try it in the [Groovy Web > Console|https://gwc-experiment.appspot.com/?g=groovy_4_0&codez=eNqdVVFv0zAQfs-vOMSDU2kYCC-oEmICNhASCKlDSCAeXOeSenPsyHZoC-y_4zhpnXSZ1tKHyD3ffXffd9adqGptHHBd0VK4VbOkFTOWr5iUtMJKm20hJNqtdVjRT8Fw6Q2LYHjTCJmjScQAROtSIvXHSit6LarC0rdaFaJsDHNCq4ecP7bfnZOtNb-hkqmSLmrkohB8BDK4_6qMljLZ3VyzX4wqoWlbPo0l2_sdbJKcvzdsmZJBbaGoefd9Tl_QZ2Q28jrQbH6o2TyjL0MQl8xa-IzemH8X9ZU_AG4cqtzCiBv8SQDOOzopeWw5KmaE9hAAORZAuEHmEFSAgt-ihjYdSWchEqAUv1DNgTBwPkG4BA_rVtjGs0Y6uFyQ4NriWd0YjpcLeAX39JcqXF9UtdumM7psTelsH220dlcb94W5lQfYYdESgykl7T11G0e6kKAzXRvhMB2EngH5gFLqAPeI0OXWoZ0lIWS9CmwCa6FKYIGyr7fn5Jjx2bzhDFietx5urSN1G5nqxqHx2vfFdoHDYoMD9fB9taKAtKsYN8I6mw4RZp3PjlOOEj2pkcedzEHlwWNslY1_R8Fn8KNrtOfuTIPk510FI-whh6D4XtVgi7JGGK7r7bgPU5CF0dWT2Mi-L0zlk20RyoocQ2sC2P6FPtgfodSwP1OlBJdBh4ZhD4g7RD9G3Ah7mH4sbrAdJ-4U5H-LG8BOFDeL6t5LL5uSNztS3-xUgbPpEiYkzk7QODtKZNdNFqUBjdHGgua8MZ1kSl9sONbtQL5aGb1WaR_EJTLV1PNuQMRkrymX2mI_GqO6Y3t809G-m3IGO9DdxIf4-7sfVsGD-NGXC3tDhh7DzvRzvnP2G9XPexjBhS170MDRmqaNEhs_753ul4A_W3TftLnxr-ydMMid3xUpeUr2S6GjSA63CPH5Ttost8lt8g9XIuDH]. > You can also comment out the test iterations for JimFS and MemoryFileSystem > in the {{where}} blocks, if you want to test without external dependencies. > When running the same code on JDK 8, there is a {{MissingMethodException}}, > which is fine, because some JDK API I am calling only exists since JDK 13. > I.e., I expect the {{MissingMethodException}} on JDKs 8-12 and a working test > on 13+. > What happens instead is that on JDKs 9-16, I see: *"BUG! At this point > argument array length and parameter array length should be the same"* > Because of this message coming from Groovy directly, I am opening a bug here > first, not in the Spock project. -- This message was sent by Atlassian Jira (v8.20.10#820010)