Program: 59148
Project: 59148
Buggy source:
/** 
 * Reacts on the elements of the pathway tag. An example pathway tag looks like this: <pathway name="path:map00271"  org="map" number="00271"  title="Methionine metabolism"  image="http://www.genome.jp/kegg/pathway/map/map00271.gif"  link="http://www.genome.jp/dbget-bin/show_pathway?map00271">
 */
protected void handlePathwayTag(){
  String sName="String_Node_Str";
  String sTitle="String_Node_Str";
  String sImageLink="String_Node_Str";
  String sExternalLink="String_Node_Str";
  int iKeggId=0;
  for (int iAttributeIndex=0; iAttributeIndex < attributes.getLength(); iAttributeIndex++) {
    sAttributeName=attributes.getLocalName(iAttributeIndex);
    if ("String_Node_Str".equals(sAttributeName)) {
      sAttributeName=attributes.getQName(iAttributeIndex);
    }
    if (sAttributeName.equals("String_Node_Str")) {
      sName=attributes.getValue(iAttributeIndex);
    }
 else     if (sAttributeName.equals("String_Node_Str")) {
      sTitle=attributes.getValue(iAttributeIndex);
    }
 else     if (sAttributeName.equals("String_Node_Str")) {
      iKeggId=new Integer(attributes.getValue(iAttributeIndex));
    }
 else     if (sAttributeName.equals("String_Node_Str")) {
      sImageLink=attributes.getValue(iAttributeIndex);
    }
 else     if (sAttributeName.equals("String_Node_Str")) {
      sExternalLink=attributes.getValue(iAttributeIndex);
    }
  }
  if (sTitle.isEmpty())   sTitle="String_Node_Str";
  String sPathwayTexturePath=sImageLink.substring(sImageLink.lastIndexOf('/') + 1,sImageLink.length());
  sPathwayTexturePath=refGeneralManager.getSingelton().getPathwayManager().getPathwayDatabaseByType(EPathwayDatabaseType.KEGG).getImagePath() + sPathwayTexturePath;
  ImageIcon img=new ImageIcon(sPathwayTexturePath);
  int iWidth=img.getIconWidth();
  int iHeight=img.getIconHeight();
  currentPathway=refGeneralManager.getSingelton().getPathwayManager().createPathway(EPathwayDatabaseType.KEGG,iKeggId,sName,sTitle,sImageLink,sExternalLink,iWidth,iHeight);
}

Fixed version (ground truth):
/** 
 * Reacts on the elements of the pathway tag. An example pathway tag looks like this: <pathway name="path:map00271"  org="map" number="00271"  title="Methionine metabolism"  image="http://www.genome.jp/kegg/pathway/map/map00271.gif"  link="http://www.genome.jp/dbget-bin/show_pathway?map00271">
 */
protected void handlePathwayTag(){
  String sName="String_Node_Str";
  String sTitle="String_Node_Str";
  String sImageLink="String_Node_Str";
  String sExternalLink="String_Node_Str";
  int iKeggId=0;
  for (int iAttributeIndex=0; iAttributeIndex < attributes.getLength(); iAttributeIndex++) {
    sAttributeName=attributes.getLocalName(iAttributeIndex);
    if ("String_Node_Str".equals(sAttributeName)) {
      sAttributeName=attributes.getQName(iAttributeIndex);
    }
    if (sAttributeName.equals("String_Node_Str")) {
      sName=attributes.getValue(iAttributeIndex);
    }
 else     if (sAttributeName.equals("String_Node_Str")) {
      sTitle=attributes.getValue(iAttributeIndex);
    }
 else     if (sAttributeName.equals("String_Node_Str")) {
      iKeggId=new Integer(attributes.getValue(iAttributeIndex));
    }
 else     if (sAttributeName.equals("String_Node_Str")) {
      sImageLink=attributes.getValue(iAttributeIndex);
    }
 else     if (sAttributeName.equals("String_Node_Str")) {
      sExternalLink=attributes.getValue(iAttributeIndex);
    }
  }
  if (sTitle.isEmpty())   sTitle="String_Node_Str";
  String sPathwayTexturePath=sImageLink.substring(sImageLink.lastIndexOf('/') + 1,sImageLink.length());
  sPathwayTexturePath=refGeneralManager.getSingelton().getPathwayManager().getPathwayDatabaseByType(EPathwayDatabaseType.KEGG).getImagePath() + sPathwayTexturePath;
  ImageIcon img=new ImageIcon(sPathwayTexturePath);
  int iWidth=img.getIconWidth();
  int iHeight=img.getIconHeight();
  img=null;
  currentPathway=refGeneralManager.getSingelton().getPathwayManager().createPathway(EPathwayDatabaseType.KEGG,iKeggId,sName,sTitle,sImageLink,sExternalLink,iWidth,iHeight);
}