From 5084636a1884682517657039eb51b520a581a9cc Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 14 Jan 2011 05:14:52 +0000 Subject: [PATCH] the -source magic was broken for 1.5 and 1.6. PR 50578 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1058854 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 4 ++++ .../tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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); }