diff --git a/WHATSNEW b/WHATSNEW index 7772cb580..93abe4238 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -10,6 +10,10 @@ Fixed bugs: * Encoding of unicode escape sequences by the property file task Bugzilla Report 50515. + * The code that implicitly sets the -source switch if only -target is + in was broken for Java 5 and 6. + Bugzilla Report 50578. + Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java b/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java index b678984c5..e129f02af 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java @@ -361,7 +361,7 @@ public abstract class DefaultCompilerAdapter setImplicitSourceSwitch((assumeJava15() || assumeJava16()) ? "1.5 in JDK 1.5 and 1.6" : "1.7 in JDK 1.7", - cmd, s, t); + cmd, t, s); } else if (assumeJava17() && (t.equals("1.5") || t.equals("1.6"))) { setImplicitSourceSwitch("1.7 in JDK 1.7", cmd, t, t); }