Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
As part of fixing GROOVY-8579, I noticed that we don't do many checks for bytecode version. There are several areas that are possibly worth addressing:
- In CompilerConfiguration we have a minimum bytecode version but we don't give an error or warning if the bytecode version is set to a value below the minimum version. If we did, would we even need the old, e.g. 1.4, 1.5 values in the allowed JDKs list? One option is to just check at the periphery, e.g. in groovyc/groovy options and assume people using the api know what they are doing?
- There are some places where we produce very vanilla bytecodes and don't require a very high bytecode level, e.g. ProxyGeneratorAdapter (currently V1_5). Should we align those also with the minimum JDK version?
- We have some checks that make sure we are using an annotation compatible JDK. These can surely be removed/simplified. Examples: ExtendedVerifier, JavaAwareCompilationUnit, JavaStubCompilationUnit.
- We have some checks to ensure that we have a high enough bytecode level when using indy. Since our minimum (Groovy 2.5+) is now high enough to support indy, many of theose checks could be simplified/removed. One example is in WriterController#chooseBytecodeVersion.