Program: 30257
Project: 30257
Buggy source:
/** 
 * The ExtendedConfigFile subclass was created because the Configuration interface does not provide a way to do what this method does; i.e. get all the app names from the config.
 * @param authModuleClass an Array of Class objects or null. When thisparameter is not null, the appnames are filtered by removing all names that are not associated via an AppConfigurationEntry with at least one LoginModule that implements an authModuleClass.
 * @return String[] containing all the AppNames appearing in the config file.
 * @throws SecurityException
 */
public String[] getAppNames(final Class[] authModuleClass){
  final Set<String> nameSet;
  try {
    nameSet=(Set<String>)AccessController.doPrivileged(new PrivilegedExceptionAction(){
      @Override public Object run() throws Exception {
        HashMap map;
        Field field=ConfigFile.class.getDeclaredField("String_Node_Str");
        field.setAccessible(true);
        map=(HashMap)field.get(ExtendedConfigFile.this);
        return (Set<String>)map.keySet();
      }
    }
);
  }
 catch (  PrivilegedActionException pae) {
    throw new SecurityException(pae.getCause());
  }
  if (authModuleClass != null) {
    try {
      AccessController.doPrivileged(new PrivilegedExceptionAction(){
        @Override public Object run() throws Exception {
          ClassLoader loader=Thread.currentThread().getContextClassLoader();
          String[] names=nameSet.toArray(new String[0]);
          for (          String id : names) {
            boolean hasAuthModule=false;
            AppConfigurationEntry[] entry=getAppConfigurationEntry(id);
            for (int i=0; i < entry.length && !hasAuthModule; i++) {
              String clazz=entry[i].getLoginModuleName();
              try {
                Class c=Class.forName(clazz,true,loader);
                for (                Class required : authModuleClass) {
                  if (required.isAssignableFrom(c)) {
                    hasAuthModule=true;
                    break;
                  }
                }
              }
 catch (              Throwable t) {
                String msg="String_Node_Str" + clazz + "String_Node_Str"+ id;
                logger.log(Level.WARNING,msg);
              }
            }
            if (!hasAuthModule) {
              nameSet.remove(id);
            }
          }
          return null;
        }
      }
);
    }
 catch (    java.security.PrivilegedActionException pae) {
      throw new SecurityException(pae.getCause());
    }
  }
  return nameSet.toArray(new String[0]);
}

Fixed version (ground truth):
/** 
 * The ExtendedConfigFile subclass was created because the Configuration interface does not provide a way to do what this method does; i.e. get all the app names from the config.
 * @param authModuleClass an Array of Class objects or null. When thisparameter is not null, the appnames are filtered by removing all names that are not associated via an AppConfigurationEntry with at least one LoginModule that implements an authModuleClass.
 * @return String[] containing all the AppNames appearing in the config file.
 * @throws SecurityException
 */
public String[] getAppNames(final Class[] authModuleClass){
  final Set<String> nameSet;
  try {
    nameSet=(Set<String>)AccessController.doPrivileged(new PrivilegedExceptionAction(){
      @Override public Object run() throws Exception {
        HashMap map;
        Field field=ConfigFile.class.getDeclaredField("String_Node_Str");
        field.setAccessible(true);
        map=(HashMap)field.get(ExtendedConfigFile.this);
        return (Set<String>)map.keySet();
      }
    }
);
  }
 catch (  PrivilegedActionException pae) {
    throw new SecurityException(pae.getCause());
  }
  if (authModuleClass != null) {
    try {
      AccessController.doPrivileged(new PrivilegedExceptionAction(){
        @Override public Object run() throws Exception {
          ClassLoader loader=Thread.currentThread().getContextClassLoader();
          String[] names=nameSet.toArray(new String[nameSet.size()]);
          for (          String id : names) {
            boolean hasAuthModule=false;
            AppConfigurationEntry[] entry=getAppConfigurationEntry(id);
            for (int i=0; i < entry.length && !hasAuthModule; i++) {
              String clazz=entry[i].getLoginModuleName();
              try {
                Class c=Class.forName(clazz,true,loader);
                for (                Class required : authModuleClass) {
                  if (required.isAssignableFrom(c)) {
                    hasAuthModule=true;
                    break;
                  }
                }
              }
 catch (              Throwable t) {
                String msg="String_Node_Str" + clazz + "String_Node_Str"+ id;
                logger.log(Level.WARNING,msg);
              }
            }
            if (!hasAuthModule) {
              nameSet.remove(id);
            }
          }
          return null;
        }
      }
);
    }
 catch (    java.security.PrivilegedActionException pae) {
      throw new SecurityException(pae.getCause());
    }
  }
  return nameSet.toArray(new String[nameSet.size()]);
}