Merge "Enable Java language level 9 by default."

This commit is contained in:
Pete Gillin
2019-10-17 10:38:35 +00:00
committed by Gerrit Code Review
3 changed files with 18 additions and 16 deletions

View File

@@ -386,13 +386,14 @@ func NewConfig(srcDir, buildDir string) (Config, error) {
func (c *config) fromEnv() error {
switch c.Getenv("EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9") {
case "":
// Nothing, this is the default
case "true":
// Use -source 9 -target 9
case "", "true":
// Use -source 9 -target 9. This is the default.
c.targetOpenJDK9 = true
case "false":
// Use -source 8 -target 8. This is the legacy behaviour.
c.targetOpenJDK9 = false
default:
return fmt.Errorf(`Invalid value for EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9, should be "" or "true"`)
return fmt.Errorf(`Invalid value for EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9, should be "", "true", or "false"`)
}
return nil