Program: 178595
Project: 178595
Buggy source:
/** 
 * from org.apache.tools.ant.PropertyHelper
 */
private final String resolveProperties(final String value,final Map<String,String> properties){
  final Vector<String> fragments=new Vector<String>();
  final Vector<String> propertyRefs=new Vector<String>();
  final Vector<String> propertyArgs=new Vector<String>();
  parsePropertyString(value,fragments,propertyRefs,propertyArgs);
  final StringBuffer sb=new StringBuffer();
  final Enumeration<String> i=fragments.elements();
  final Enumeration<String> j=propertyRefs.elements();
  final Enumeration<String> k=propertyArgs.elements();
  while (i.hasMoreElements()) {
    String fragment=i.nextElement();
    if (fragment == null) {
      final String propertyName=j.nextElement();
      final String propertyArg=k.nextElement();
      Object replacement=null;
      if (properties != null) {
        if ("String_Node_Str".equals(propertyName)) {
          replacement=properties.get(propertyName);
          if ((propertyArg != null) && (propertyArg.length() > 0)) {
            replacement=replacement + File.separator + propertyArg;
          }
        }
 else         if ("String_Node_Str".equals(propertyName)) {
          if ((propertyArg != null) && (propertyArg.length() > 0)) {
            replacement=System.getProperty(propertyArg);
          }
        }
 else {
          replacement=properties.get(propertyName);
        }
      }
      final String arg=propertyArg != null ? "String_Node_Str" + propertyArg : "String_Node_Str";
      fragment=(replacement != null) ? replacement.toString() : "String_Node_Str" + propertyName + arg+ "String_Node_Str";
    }
    sb.append(fragment);
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * <p> </p>
 * @param value
 * @param properties
 * @return
 */
private final String resolveProperties(final String value,final Map<String,String> properties){
  final Vector<String> fragments=new Vector<String>();
  final Vector<String> propertyRefs=new Vector<String>();
  final Vector<String> propertyArgs=new Vector<String>();
  parsePropertyString(value,fragments,propertyRefs,propertyArgs);
  final StringBuffer sb=new StringBuffer();
  final Enumeration<String> i=fragments.elements();
  final Enumeration<String> j=propertyRefs.elements();
  final Enumeration<String> k=propertyArgs.elements();
  while (i.hasMoreElements()) {
    String fragment=i.nextElement();
    if (fragment == null) {
      final String propertyName=j.nextElement();
      final String propertyArg=k.nextElement();
      Object replacement=null;
      if (properties != null) {
        if ("String_Node_Str".equals(propertyName)) {
          replacement=properties.get(propertyName);
          if ((propertyArg != null) && (propertyArg.length() > 0)) {
            replacement=replacement + File.separator + propertyArg;
          }
        }
 else         if ("String_Node_Str".equals(propertyName)) {
          if ((propertyArg != null) && (propertyArg.length() > 0)) {
            replacement=System.getProperty(propertyArg);
          }
        }
 else {
          replacement=properties.get(propertyName);
        }
      }
      final String arg=propertyArg != null ? "String_Node_Str" + propertyArg : "String_Node_Str";
      fragment=(replacement != null) ? replacement.toString() : "String_Node_Str" + propertyName + arg+ "String_Node_Str";
    }
    sb.append(fragment);
  }
  return sb.toString();
}