Program: 52274
Project: 52274
Buggy source:
/** 
 * Determine which type of adatper to use for this object, either a community, collection, item, or repository adatpter. The decisios is based upon the two supplied identifiers: a handle or an internal id. If the handle is supplied then this is resolved and the approprate adapter is picked. Otherwise the internal identifier is used to resolve the correct type of adapter. The internal identifier must be of the form "type:id" i.g. item:255 or collection:99. In the case of a repository the handle prefix must be used.
 * @return Return the correct adaptor or null if none found.
 */
private AbstractAdapter resolveAdapter(Context context) throws SQLException {
  Request request=ObjectModelHelper.getRequest(objectModel);
  String contextPath=request.getContextPath();
  String handle=parameters.getParameter("String_Node_Str",null);
  String internal=parameters.getParameter("String_Node_Str",null);
  AbstractAdapter adapter=null;
  if (handle != null) {
    DSpaceObject dso=HandleManager.resolveToObject(context,handle);
    if (dso instanceof Item)     adapter=new ItemAdapter((Item)dso,contextPath);
 else     if (dso instanceof Collection || dso instanceof Community)     adapter=new ContainerAdapter(context,dso,contextPath);
  }
 else   if (internal != null) {
    String[] parts=internal.split("String_Node_Str");
    if (parts.length == 2) {
      String type=parts[0];
      int id=Integer.valueOf(parts[1]);
      if ("String_Node_Str".equals(type)) {
        Item item=Item.find(context,id);
        if (item != null)         adapter=new ItemAdapter(item,contextPath);
      }
 else       if ("String_Node_Str".equals(type)) {
        Collection collection=Collection.find(context,id);
        if (collection != null)         adapter=new ContainerAdapter(context,collection,contextPath);
      }
 else       if ("String_Node_Str".equals(type)) {
        Community community=Community.find(context,id);
        if (community != null)         adapter=new ContainerAdapter(context,community,contextPath);
      }
 else       if ("String_Node_Str".equals(type)) {
        if (ConfigurationManager.getProperty("String_Node_Str").equals(id))         adapter=new RepositoryAdapter(context,contextPath);
      }
    }
  }
  return adapter;
}

Fixed version (ground truth):
/** 
 * Determine which type of adatper to use for this object, either a community, collection, item, or repository adatpter. The decisios is based upon the two supplied identifiers: a handle or an internal id. If the handle is supplied then this is resolved and the approprate adapter is picked. Otherwise the internal identifier is used to resolve the correct type of adapter. The internal identifier must be of the form "type:id" i.g. item:255 or collection:99. In the case of a repository the handle prefix must be used.
 * @return Return the correct adaptor or null if none found.
 */
private AbstractAdapter resolveAdapter(Context context) throws SQLException {
  Request request=ObjectModelHelper.getRequest(objectModel);
  String contextPath=request.getContextPath();
  String handle=parameters.getParameter("String_Node_Str",null);
  String internal=parameters.getParameter("String_Node_Str",null);
  AbstractAdapter adapter=null;
  if (handle != null) {
    DSpaceObject dso=HandleManager.resolveToObject(context,handle);
    if (dso instanceof Item)     adapter=new ItemAdapter((Item)dso,contextPath);
 else     if (dso instanceof Collection || dso instanceof Community)     adapter=new ContainerAdapter(context,dso,contextPath);
  }
 else   if (internal != null) {
    String[] parts=internal.split("String_Node_Str");
    if (parts.length == 2) {
      String type=parts[0];
      int id=Integer.valueOf(parts[1]);
      if ("String_Node_Str".equals(type)) {
        Item item=Item.find(context,id);
        if (item != null)         adapter=new ItemAdapter(item,contextPath);
      }
 else       if ("String_Node_Str".equals(type)) {
        Collection collection=Collection.find(context,id);
        if (collection != null)         adapter=new ContainerAdapter(context,collection,contextPath);
      }
 else       if ("String_Node_Str".equals(type)) {
        Community community=Community.find(context,id);
        if (community != null)         adapter=new ContainerAdapter(context,community,contextPath);
      }
 else       if ("String_Node_Str".equals(type)) {
        if (ConfigurationManager.getProperty("String_Node_Str").equals(String.valueOf(id)))         adapter=new RepositoryAdapter(context,contextPath);
      }
    }
  }
  return adapter;
}