Program: 73929
Project: 73929
Buggy source:
/** 
 * Add choices to the parameter where the choices are subdirectories of the directoryPath. DirectoryPaths in the file system and in Jar URLs are handled.
 * @param parameter The parameter to be updated with the subdirectories
 * @param directoryPath The directory to be searched for subdirectories.
 * @exception IllegalActionException If there is a problem reading thedirectory as a file or JAR URL.
 */
protected void _addChoices(Parameter parameter,String directoryPath) throws IllegalActionException {
  try {
    URI directoryURI=new URI(FileUtilities.nameToURL(directoryPath,null,null).toExternalForm().replaceAll("String_Node_Str","String_Node_Str"));
    File directory=null;
    try {
      try {
        directory=new File(directoryURI);
      }
 catch (      Throwable throwable) {
        throw new InternalErrorException(this,throwable,"String_Node_Str" + directoryURI + "String_Node_Str");
      }
      DirectoryNameFilter filter=new DirectoryNameFilter();
      File[] directories=directory.listFiles(filter);
      if (directories == null) {
        throw new InternalErrorException(this,null,"String_Node_Str" + directoryPath + "String_Node_Str");
      }
 else {
        for (        File element : directories) {
          String directoryName=element.getName();
          parameter.addChoice(directoryName);
        }
      }
    }
 catch (    Throwable throwable) {
      try {
        if (!directoryURI.toString().startsWith("String_Node_Str")) {
          throw throwable;
        }
 else {
          List<String> directories=ClassUtilities.jarURLDirectories(directoryURI.toURL());
          for (          String directoryFullPath : directories) {
            String directoryName=directoryFullPath;
            if (directoryName.lastIndexOf("String_Node_Str") > -1) {
              if (directoryName.lastIndexOf("String_Node_Str") == directoryName.length() - 1) {
                directoryName=directoryName.substring(0,directoryName.length() - 1);
              }
              directoryName=directoryName.substring(directoryName.lastIndexOf("String_Node_Str") + 1);
            }
            parameter.addChoice(directoryName);
          }
        }
      }
 catch (      Throwable throwable2) {
        System.err.println("String_Node_Str");
        throwable2.printStackTrace();
        throw new IllegalActionException(this,throwable,"String_Node_Str" + directoryURI);
      }
    }
  }
 catch (  Exception ex) {
    throw new InternalErrorException(this,ex,"String_Node_Str" + directoryPath + "String_Node_Str"+ parameter.getFullName()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Add choices to the parameter where the choices are subdirectories of the directoryPath. DirectoryPaths in the file system and in Jar URLs are handled.
 * @param parameter The parameter to be updated with the subdirectories
 * @param directoryPath The directory to be searched for subdirectories.
 * @exception IllegalActionException If there is a problem reading thedirectory as a file or JAR URL.
 */
protected void _addChoices(Parameter parameter,String directoryPath) throws IllegalActionException {
  try {
    URI directoryURI=new URI(FileUtilities.nameToURL(directoryPath,null,null).toExternalForm().replaceAll("String_Node_Str","String_Node_Str"));
    File directory=null;
    try {
      try {
        directory=new File(directoryURI);
      }
 catch (      Throwable throwable) {
        throw new InternalErrorException(this,throwable,"String_Node_Str" + directoryURI + "String_Node_Str");
      }
      DirectoryNameFilter filter=new DirectoryNameFilter();
      File[] directories=directory.listFiles(filter);
      if (directories == null) {
        throw new InternalErrorException(this,null,"String_Node_Str" + directoryPath + "String_Node_Str");
      }
 else {
        for (        File element : directories) {
          String directoryName=element.getName();
          parameter.addChoice(directoryName);
        }
      }
    }
 catch (    Throwable throwable) {
      try {
        if (!directoryURI.toString().startsWith("String_Node_Str")) {
          throw throwable;
        }
 else {
          List<String> directories=ClassUtilities.jarURLDirectories(directoryURI.toURL());
          for (          String directoryFullPath : directories) {
            String directoryName=directoryFullPath;
            if (directoryName.lastIndexOf("String_Node_Str") > -1) {
              if (directoryName.lastIndexOf("String_Node_Str") == directoryName.length() - 1) {
                directoryName=directoryName.substring(0,directoryName.length() - 1);
              }
              directoryName=directoryName.substring(directoryName.lastIndexOf("String_Node_Str") + 1);
            }
            parameter.addChoice(directoryName);
          }
        }
      }
 catch (      Throwable throwable2) {
        System.err.println("String_Node_Str");
        throwable2.printStackTrace();
        throw new IllegalActionException(this,throwable,"String_Node_Str" + directoryURI);
      }
    }
  }
 catch (  Throwable ex) {
    throw new InternalErrorException(this,ex,"String_Node_Str" + directoryPath + "String_Node_Str"+ parameter.getFullName()+ "String_Node_Str");
  }
}