GateNLP / gate-core

The GATE Embedded core API and GATE Developer application
GNU Lesser General Public License v3.0
75 stars 29 forks source link

Update ASM visitors to support newer class versions #162

Closed ianroberts closed 1 year ago

ianroberts commented 1 year ago

While we've updated gate-asm to ASM version 9, we are still using Opcodes.ASM5, which causes users of our visitors (notably DumpCreoleToXML in the maven builds of plugins) to throw exceptions when asked to process class files compiled for Java 11 or later using newer class file format features like NestHost/NestMembers. This PR switches to Opcodes.ASM9, which fixes these issues.

This PR has been tested by creating a dummy plugin that compiles with Java 11 and includes an inner class that calls a private method of its enclosing class (which is what triggers the NestMembers attribute). When building against a master version of gate-core this produces an error

[ERROR] Failed to execute goal uk.ac.gate:gate-maven-plugin:9.1-SNAPSHOT:DumpCreoleToXML (default) on project dummy-plugin: error expanding creole: NestMember requires ASM7 -> [Help 1]

but when building against a gate-core built from this PR branch DumpCreoleToXML runs successfully and generates the correct -creole.jar.

Closes #160

github-actions[bot] commented 1 year ago

Test Results

108 tests  ±0   108 :heavy_check_mark: ±0   9s :stopwatch: -1s   27 suites ±0       0 :zzz: ±0    27 files   ±0       0 :x: ±0 

Results for commit 78c5dabf. ± Comparison against base commit 1fe52093.