Skip to content

Incorrect semantics of JavacCompiler.isPreJavaXX #356

Closed
@kwin

Description

@kwin

According to the javadoc of

and the methods isPreJavaXX are supposed to

return true if the compiler configuration represents a Java XX compiler or later, false otherwise

The logic within those methods evaluates partially also the parameter source (

) or release ( ) which are completely orthogonal to the javac version being used. They only determine the bytecode version being generated but have nothing to do with the version of the compiler itself.

However I am not sure when CompilerConfiguration.getCompilerVersion() is reliably set at all. IMHO there should be some logic separate for in-process and forked compiling which determines the real javac version (either from system property java.version for in-process compilation or the parsed output of javac -version)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions