Program: 25063
Project: 25063
Buggy source:
@Override public void init(final ServletConfig config) throws ServletException {
  if (tap != null)   return;
  String tapConfPath=config.getInitParameter(TAP_CONF_PARAMETER);
  if (tapConfPath == null || tapConfPath.trim().length() == 0)   tapConfPath=null;
  InputStream input=null;
  if (tapConfPath == null)   input=searchFile(DEFAULT_TAP_CONF_FILE,config);
 else {
    File f=new File(tapConfPath);
    if (f.exists()) {
      try {
        input=new FileInputStream(f);
      }
 catch (      IOException ioe) {
        throw new ServletException("String_Node_Str" + tapConfPath + "String_Node_Str",ioe);
      }
    }
 else     input=searchFile(tapConfPath,config);
  }
  if (input == null)   throw new ServletException("String_Node_Str" + ((tapConfPath == null) ? DEFAULT_TAP_CONF_FILE : tapConfPath) + "String_Node_Str"+ TAP_CONF_PARAMETER+ "String_Node_Str"+ DEFAULT_TAP_CONF_FILE+ "String_Node_Str");
  Properties tapConf=new Properties();
  try {
    tapConf.load(input);
  }
 catch (  IOException ioe) {
    throw new ServletException("String_Node_Str" + tapConfPath + "String_Node_Str",ioe);
  }
 finally {
    try {
      input.close();
    }
 catch (    IOException ioe2) {
    }
  }
  ServiceConnection serviceConn=null;
  try {
    serviceConn=new ConfigurableServiceConnection(tapConf,config.getServletContext().getRealPath("String_Node_Str"));
    tap=new TAP(serviceConn);
  }
 catch (  Exception ex) {
    tap=null;
    if (ex instanceof TAPException)     throw new ServletException(ex.getMessage(),ex.getCause());
 else     throw new ServletException("String_Node_Str",ex);
  }
  String propValue=getProperty(tapConf,KEY_HOME_PAGE);
  if (propValue != null) {
    if (isClassName(propValue)) {
      try {
        tap.setHomePage(newInstance(propValue,KEY_HOME_PAGE,HomePage.class,new Class<?>[]{TAP.class},new Object[]{tap}));
      }
 catch (      TAPException te) {
        throw new ServletException(te.getMessage(),te.getCause());
      }
    }
 else {
      tap.setHomePageURI(propValue);
      propValue=getProperty(tapConf,KEY_HOME_PAGE_MIME_TYPE);
      if (propValue != null)       tap.setHomePageMimeType(propValue);
    }
  }
  propValue=getProperty(tapConf,KEY_ADD_TAP_RESOURCES);
  if (propValue != null) {
    String[] lstResources=propValue.split("String_Node_Str");
    for (    String addRes : lstResources) {
      addRes=addRes.trim();
      if (addRes.length() > 0) {
        try {
          TAPResource newRes=newInstance(addRes,KEY_ADD_TAP_RESOURCES,TAPResource.class,new Class<?>[]{TAP.class},new Object[]{tap});
          if (newRes.getName() == null || newRes.getName().trim().length() == 0)           throw new TAPException("String_Node_Str" + addRes + "String_Node_Str"+ KEY_ADD_TAP_RESOURCES+ "String_Node_Str");
          tap.addResource(newRes);
        }
 catch (        TAPException te) {
          throw new ServletException(te.getMessage(),te.getCause());
        }
      }
    }
  }
  super.init(config);
  serviceConn.setAvailable(true,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void init(final ServletConfig config) throws ServletException {
  if (tap != null)   return;
  String tapConfPath=config.getInitParameter(TAP_CONF_PARAMETER);
  if (tapConfPath == null || tapConfPath.trim().length() == 0)   tapConfPath=null;
  InputStream input=null;
  if (tapConfPath == null)   input=searchFile(DEFAULT_TAP_CONF_FILE,config);
 else {
    File f=new File(tapConfPath);
    if (f.exists()) {
      try {
        input=new FileInputStream(f);
      }
 catch (      IOException ioe) {
        throw new ServletException("String_Node_Str" + tapConfPath + "String_Node_Str",ioe);
      }
    }
 else     input=searchFile(tapConfPath,config);
  }
  if (input == null)   throw new ServletException("String_Node_Str" + ((tapConfPath == null) ? DEFAULT_TAP_CONF_FILE : tapConfPath) + "String_Node_Str"+ TAP_CONF_PARAMETER+ "String_Node_Str"+ DEFAULT_TAP_CONF_FILE+ "String_Node_Str");
  Properties tapConf=new Properties();
  try {
    tapConf.load(input);
  }
 catch (  IOException ioe) {
    throw new ServletException("String_Node_Str" + tapConfPath + "String_Node_Str",ioe);
  }
 finally {
    try {
      input.close();
    }
 catch (    IOException ioe2) {
    }
  }
  ServiceConnection serviceConn=null;
  try {
    serviceConn=new ConfigurableServiceConnection(tapConf,config.getServletContext().getRealPath("String_Node_Str"));
    tap=new TAP(serviceConn);
  }
 catch (  Exception ex) {
    tap=null;
    if (ex instanceof TAPException)     throw new ServletException(ex.getMessage(),ex.getCause());
 else     throw new ServletException("String_Node_Str",ex);
  }
  String propValue=getProperty(tapConf,KEY_HOME_PAGE);
  if (propValue != null) {
    if (isClassName(propValue)) {
      try {
        tap.setHomePage(newInstance(propValue,KEY_HOME_PAGE,HomePage.class,new Class<?>[]{TAP.class},new Object[]{tap}));
      }
 catch (      TAPException te) {
        throw new ServletException(te.getMessage(),te.getCause());
      }
    }
 else {
      tap.setHomePageURI(propValue);
      propValue=getProperty(tapConf,KEY_HOME_PAGE_MIME_TYPE);
      if (propValue != null)       tap.setHomePageMimeType(propValue);
    }
  }
  propValue=getProperty(tapConf,KEY_ADD_TAP_RESOURCES);
  if (propValue != null) {
    String[] lstResources=propValue.split("String_Node_Str");
    for (    String addRes : lstResources) {
      addRes=addRes.trim();
      if (addRes.length() > 0) {
        try {
          TAPResource newRes=newInstance(addRes,KEY_ADD_TAP_RESOURCES,TAPResource.class,new Class<?>[]{TAP.class},new Object[]{tap});
          if (newRes.getName() == null || newRes.getName().trim().length() == 0)           throw new TAPException("String_Node_Str" + addRes + "String_Node_Str"+ KEY_ADD_TAP_RESOURCES+ "String_Node_Str");
          tap.addResource(newRes);
        }
 catch (        TAPException te) {
          throw new ServletException(te.getMessage(),te.getCause());
        }
      }
    }
  }
  super.init(config);
  tap.init(config);
  serviceConn.setAvailable(true,"String_Node_Str");
}