ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1237442 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
Date Sun, 29 Jan 2012 19:58:16 GMT
Author: bodewig
Date: Sun Jan 29 19:58:16 2012
New Revision: 1237442

URL: http://svn.apache.org/viewvc?rev=1237442&view=rev
Log:
another readablilty tweak

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java?rev=1237442&r1=1237441&r2=1237442&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
Sun Jan 29 19:58:16 2012
@@ -338,16 +338,15 @@ public abstract class DefaultCompilerAda
      */
     protected Commandline setupModernJavacCommandlineSwitches(Commandline cmd) {
         setupJavacCommandlineSwitches(cmd, true);
-        if (attributes.getSource() != null && !assumeJava13()) {
-            cmd.createArgument().setValue("-source");
-            String source = attributes.getSource();
-            cmd.createArgument().setValue(adjustSourceValue(source));
-        } else if (!assumeJava13() && !assumeJava14()
-                   && attributes.getTarget() != null) {
-            String t = attributes.getTarget();
-            String s = adjustSourceValue(t);
-            if (mustSetSourceForTarget(t)) {
-                setImplicitSourceSwitch(cmd, t, s);
+        if (!assumeJava13()) { // -source added with JDK 1.4
+            final String t = attributes.getTarget();
+            if (attributes.getSource() != null) {
+                cmd.createArgument().setValue("-source");
+                cmd.createArgument()
+                    .setValue(adjustSourceValue(attributes.getSource()));
+
+            } else if (t != null && mustSetSourceForTarget(t)) {
+                setImplicitSourceSwitch(cmd, t, adjustSourceValue(t));
             }
         }
         return cmd;
@@ -694,6 +693,9 @@ public abstract class DefaultCompilerAda
      * @param t the -target value, must not be null
      */
     private boolean mustSetSourceForTarget(String t) {
+        if (assumeJava14()) {
+            return false;
+        }
         if (t.startsWith("1.")) {
             t = t.substring(2);
         }



Mime
View raw message