Program: 30418
Project: 30418
Buggy source:
/** 
 * Read the repository directory name, create the directory, and  save the name in 'repository'
 */
private String initializeRepository(){
  try {
    repository=System.getProperty(REPOSITORY_HOME_PROP);
    if (repository == null) {
      String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str");
      logger.log(Level.SEVERE,msg);
    }
 else {
      if (logger.isLoggable(Level.FINE)) {
        logger.fine("String_Node_Str" + repository);
      }
      File rf=new File(repository);
      if (rf.exists()) {
        if (!rf.isDirectory()) {
          String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str" + repository,new Object[]{repository});
          logger.log(Level.SEVERE,msg);
        }
 else {
          File[] appsInService=rf.listFiles();
          if (appsInService != null) {
            for (int i=0; i < appsInService.length; i++) {
              File[] contextsInService=appsInService[i].listFiles(new FileFilter(){
                public boolean accept(                File pathname){
                  return pathname.isDirectory();
                }
              }
);
              if (contextsInService != null) {
                for (int j=0; j < contextsInService.length; j++) {
                  try {
                    PolicyConfigurationImpl pc=new PolicyConfigurationImpl(contextsInService[j],false,false,this);
                    putPolicyConfigurationImpl(pc.CONTEXT_ID,pc);
                  }
 catch (                  Exception ex) {
                    String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str",new Object[]{contextsInService[i].toString()});
                    logger.log(Level.WARNING,msg,ex);
                  }
                }
              }
            }
          }
        }
      }
 else {
        if (logger.isLoggable(Level.FINE)) {
          logger.fine("String_Node_Str");
        }
        rf.mkdirs();
      }
    }
  }
 catch (  Exception e) {
    String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str",new Object[]{e});
    logger.log(Level.SEVERE,msg);
    repository=null;
  }
  return repository;
}

Fixed version (ground truth):
/** 
 * Read the repository directory name, create the directory, and  save the name in 'repository'
 */
private String initializeRepository(){
  try {
    repository=System.getProperty(REPOSITORY_HOME_PROP);
    if (repository == null) {
      String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str");
      logger.log(Level.SEVERE,msg);
    }
 else {
      if (logger.isLoggable(Level.FINE)) {
        logger.fine("String_Node_Str" + repository);
      }
      File rf=new File(repository);
      if (rf.exists()) {
        if (!rf.isDirectory()) {
          String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str" + repository,new Object[]{repository});
          logger.log(Level.SEVERE,msg);
        }
 else {
          File[] appsInService=rf.listFiles();
          if (appsInService != null) {
            for (int i=0; i < appsInService.length; i++) {
              File[] contextsInService=appsInService[i].listFiles(new FileFilter(){
                public boolean accept(                File pathname){
                  return pathname.isDirectory();
                }
              }
);
              if (contextsInService != null) {
                for (int j=0; j < contextsInService.length; j++) {
                  try {
                    PolicyConfigurationImpl pc=new PolicyConfigurationImpl(contextsInService[j],false,false,this);
                    putPolicyConfigurationImpl(pc.CONTEXT_ID,pc);
                  }
 catch (                  Exception ex) {
                    String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str",new Object[]{contextsInService[i].toString()});
                    logger.log(Level.WARNING,msg,ex);
                  }
                }
              }
            }
          }
        }
      }
 else {
        if (logger.isLoggable(Level.FINE)) {
          logger.fine("String_Node_Str");
        }
        if (!rf.mkdirs()) {
          throw new IOException();
        }
      }
    }
  }
 catch (  Exception e) {
    String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str",new Object[]{e});
    logger.log(Level.SEVERE,msg);
    repository=null;
  }
  return repository;
}