@@ -0,0 +1,2779 @@
+/**%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.formic.ant.condition;%0A%0Aimport org.apache.tools.ant.BuildException;%0Aimport org.apache.tools.ant.ProjectComponent;%0A%0Aimport org.apache.tools.ant.taskdefs.condition.Condition;%0A%0A/**%0A * Version of &lt;equals&gt; that only supports propery names which are not%0A * looked up until evaluation time.%3Cbr/%3E%0A * Ex.%3Cbr/%3E%0A * &lt;formic:equals arg1=%22myproperty%22 arg2=%22otherproperty%22/&gt;%3Cbr/%3E%0A * vs%3Cbr/%3E%0A * &lt;equals arg1=%22$%7Bmyproperty%7D%22 arg2=%22$%7Botherproperty%7D%22/&gt;%0A *%0A * @author Eric Van Dewoestine%0A * @version $Revision$%0A */%0Apublic class Equals%0A  extends ProjectComponent%0A  implements Condition%0A%7B%0A  private String arg1, arg2;%0A  private boolean trim = false;%0A  private boolean caseSensitive = true;%0A%0A  /**%0A   * Set the first string%0A   *%0A   * @param a1 the first string%0A   */%0A  public void setArg1(String a1) %7B%0A    arg1 = a1;%0A  %7D%0A%0A  /**%0A   * Set the second string%0A   *%0A   * @param a2 the second string%0A   */%0A  public void setArg2(String a2) %7B%0A    arg2 = a2;%0A  %7D%0A%0A  /**%0A   * Should we want to trim the arguments before comparing them?%0A   * @param b if true trim the arguments%0A   * @since Ant 1.5%0A   */%0A  public void setTrim(boolean b) %7B%0A    trim = b;%0A  %7D%0A%0A  /**%0A   * Should the comparison be case sensitive?%0A   * @param b if true use a case sensitive comparison (this is the%0A   *          default)%0A   * @since Ant 1.5%0A   */%0A  public void setCasesensitive(boolean b) %7B%0A    caseSensitive = b;%0A  %7D%0A%0A  /**%0A   * @return true if the two strings are equal%0A   * @exception BuildException if the attributes are not set correctly%0A   */%0A  public boolean eval() throws BuildException %7B%0A    if (arg1 == null %7C%7C arg2 == null) %7B%0A      throw new BuildException(%22both arg1 and arg2 are required in %22%0A          + %22equals%22);%0A    %7D%0A%0A    String _arg1 = getProject().getProperty(arg1);%0A    String _arg2 = getProject().getProperty(arg2);%0A    if (trim) %7B%0A      _arg1 = _arg1.trim();%0A      _arg2 = _arg2.trim();%0A    %7D%0A%0A    return caseSensitive ? _arg1.equals(_arg2) : _arg1.equalsIgnoreCase(_arg2);%0A  %7D%0A%7D%0A

version of Equals condition that uses property names resolved and eval time