Program: 29889
Project: 29889
Buggy source:
/** 
 * Given a byte[] containing session data, return a session object
 * @param state The byte[] with the session attribute data
 * @return A newly created object for the given session attribute data
 */
protected Object getAttributeValueCollection(byte[] state) throws IOException, ClassNotFoundException {
  Collection attributeValueList=new ArrayList();
  Object attributeValue=null;
  BufferedInputStream bis=null;
  ByteArrayInputStream bais=null;
  Loader loader=null;
  ClassLoader classLoader=null;
  ObjectInputStream ois=null;
  Container container=manager.getContainer();
  try {
    bais=new ByteArrayInputStream(state);
    bis=new BufferedInputStream(bais);
    if (container != null) {
      loader=container.getLoader();
    }
    if (loader != null) {
      classLoader=loader.getClassLoader();
    }
    if (classLoader != null) {
      try {
        ois=ioUtils.createObjectInputStream(bis,true,classLoader);
      }
 catch (      Exception ex) {
      }
    }
    if (ois == null) {
      ois=new ObjectInputStream(bis);
    }
    if (ois != null) {
      try {
        Object whatIsIt=ois.readObject();
        int entriesSize=0;
        if (whatIsIt instanceof Integer) {
          entriesSize=((Integer)whatIsIt).intValue();
        }
        for (int i=0; i < entriesSize; i++) {
          Object nextAttributeValue=ois.readObject();
          attributeValueList.add(nextAttributeValue);
        }
      }
  finally {
        if (ois != null) {
          try {
            ois.close();
            bis=null;
          }
 catch (          IOException e) {
          }
        }
      }
    }
  }
 catch (  ClassNotFoundException e) {
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str",e);
    }
    throw e;
  }
catch (  IOException e) {
    throw e;
  }
  return attributeValueList;
}

Fixed version (ground truth):
/** 
 * Given a byte[] containing session data, return a session object
 * @param state The byte[] with the session attribute data
 * @return A newly created object for the given session attribute data
 */
protected Object getAttributeValueCollection(byte[] state) throws IOException, ClassNotFoundException {
  Collection attributeValueList=new ArrayList();
  Object attributeValue=null;
  BufferedInputStream bis=null;
  ByteArrayInputStream bais=null;
  Loader loader=null;
  ClassLoader classLoader=null;
  ObjectInputStream ois=null;
  Container container=manager.getContainer();
  try {
    bais=new ByteArrayInputStream(state);
    bis=new BufferedInputStream(bais);
    if (container != null) {
      loader=container.getLoader();
    }
    if (loader != null) {
      classLoader=loader.getClassLoader();
    }
    if (classLoader != null) {
      try {
        ois=ioUtils.createObjectInputStream(bis,true,classLoader);
      }
 catch (      Exception ex) {
      }
    }
    if (ois == null) {
      ois=new ObjectInputStream(bis);
    }
    if (ois != null) {
      try {
        Object whatIsIt=ois.readObject();
        int entriesSize=0;
        if (whatIsIt instanceof Integer) {
          entriesSize=((Integer)whatIsIt).intValue();
        }
        for (int i=0; i < entriesSize; i++) {
          Object nextAttributeValue=ois.readObject();
          attributeValueList.add(nextAttributeValue);
        }
      }
  finally {
        try {
          ois.close();
          bis=null;
        }
 catch (        IOException e) {
        }
      }
    }
  }
 catch (  ClassNotFoundException e) {
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str",e);
    }
    throw e;
  }
catch (  IOException e) {
    throw e;
  }
  return attributeValueList;
}