diff options
author | bodewig <[email protected]> | 2007-09-11 08:52:26 +0000 |
---|---|---|
committer | bodewig <[email protected]> | 2007-09-11 08:52:26 +0000 |
commit | a875b1160a9eea7b28eb61610a13674a8cf8fb3b (patch) | |
tree | eda236b2d19f0c50544e7c8450205368be8a0a82 /src/main/java/net/sf/antcontrib/logic/condition/IsPropertyTrue.java | |
parent | 933512f12c9208d078782b74fc9fd53a1cccba66 (diff) |
Don't derive from Ant conditions when we don't use the base class at all
git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/ant-contrib/trunk@144 32d7a393-a5a9-423c-abd3-5d954feb1f2f
Diffstat (limited to 'src/main/java/net/sf/antcontrib/logic/condition/IsPropertyTrue.java')
-rw-r--r-- | src/main/java/net/sf/antcontrib/logic/condition/IsPropertyTrue.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/net/sf/antcontrib/logic/condition/IsPropertyTrue.java b/src/main/java/net/sf/antcontrib/logic/condition/IsPropertyTrue.java index d1060ab..d31f2bc 100644 --- a/src/main/java/net/sf/antcontrib/logic/condition/IsPropertyTrue.java +++ b/src/main/java/net/sf/antcontrib/logic/condition/IsPropertyTrue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved. + * Copyright (c) 2001-2004, 2007 Ant-Contrib project. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,16 +16,18 @@ package net.sf.antcontrib.logic.condition; import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.taskdefs.condition.IsTrue; +import org.apache.tools.ant.ProjectComponent; +import org.apache.tools.ant.taskdefs.condition.Condition; /** - * Extends IsTrue condition to check the value of a specified property. + * Checks the value of a specified property. * <p>Developed for use with Antelope, migrated to ant-contrib Oct 2003. * * @author Dale Anson, [email protected] * @version $Revision: 1.3 $ */ -public class IsPropertyTrue extends IsTrue { +public final class IsPropertyTrue + extends ProjectComponent implements Condition { private String name = null; @@ -37,9 +39,7 @@ public class IsPropertyTrue extends IsTrue { if ( name == null ) throw new BuildException( "Property name must be set." ); String value = getProject().getProperty( name ); - if ( value == null ) - return false; - return getProject().toBoolean( value ); + return value != null && getProject().toBoolean( value ); } } |