ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/util/facade FacadeTaskHelperTest.java
Date Fri, 04 Oct 2002 10:06:28 GMT
bodewig     2002/10/04 03:06:28

  Modified:    src/main/org/apache/tools/ant/taskdefs Javac.java
               src/main/org/apache/tools/ant/util/facade
                        FacadeTaskHelper.java
               src/testcases/org/apache/tools/ant/util/facade
                        FacadeTaskHelperTest.java
  Log:
  Suppress "ignoring compiler setting" warning in javac if the user
  hasn't set the compiler.
  
  PR: 13246
  
  Revision  Changes    Path
  1.108     +5 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
  retrieving revision 1.107
  retrieving revision 1.108
  diff -u -r1.107 -r1.108
  --- Javac.java	25 Jul 2002 15:21:05 -0000	1.107
  +++ Javac.java	4 Oct 2002 10:06:27 -0000	1.108
  @@ -755,8 +755,10 @@
           String compilerImpl = getCompilerVersion();
           if (fork) {
               if (isJdkCompiler(compilerImpl)) {
  -                log("Since fork is true, ignoring compiler setting.",
  -                    Project.MSG_WARN);
  +                if (facade.hasBeenSet()) {
  +                    log("Since fork is true, ignoring compiler setting.",
  +                        Project.MSG_WARN);
  +                }
                   compilerImpl = "extJavac";
               } else {
                   log("Since compiler setting isn't classic or modern,"
  
  
  
  1.3       +11 -1     jakarta-ant/src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java
  
  Index: FacadeTaskHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FacadeTaskHelper.java	18 Apr 2002 14:19:00 -0000	1.2
  +++ FacadeTaskHelper.java	4 Oct 2002 10:06:28 -0000	1.3
  @@ -164,4 +164,14 @@
           tmp.copyInto(res);
           return res;
       }
  +
  +    /**
  +     * Tests whether the implementation has been chosen by the user
  +     * (either via a magic property or explicitly.
  +     *
  +     * @since Ant 1.5.2
  +     */
  +    public boolean hasBeenSet() {
  +        return userChoice != null || magicValue != null;
  +    }
   }
  
  
  
  1.3       +13 -0     jakarta-ant/src/testcases/org/apache/tools/ant/util/facade/FacadeTaskHelperTest.java
  
  Index: FacadeTaskHelperTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/util/facade/FacadeTaskHelperTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FacadeTaskHelperTest.java	15 Apr 2002 13:20:26 -0000	1.2
  +++ FacadeTaskHelperTest.java	4 Oct 2002 10:06:28 -0000	1.3
  @@ -84,4 +84,17 @@
           fth.setImplementation("baz");
           assertEquals("baz", fth.getImplementation());
       }
  +
  +    public void testHasBeenSet() {
  +        FacadeTaskHelper fth = new FacadeTaskHelper("foo");
  +        assertTrue("nothing set", !fth.hasBeenSet());
  +        fth.setMagicValue(null);
  +        assertTrue("magic has not been set", !fth.hasBeenSet());
  +        fth.setMagicValue("foo");
  +        assertTrue("magic has been set", fth.hasBeenSet());
  +        fth.setMagicValue(null);
  +        assertTrue(!fth.hasBeenSet());
  +        fth.setImplementation("baz");
  +        assertTrue("set explicitly", fth.hasBeenSet());
  +    }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message