Program: 79828
Project: 79828
Buggy source:
/** 
 * {@inheritDoc}
 */
public Map<String,Object> getUserInfo(CoreToken token){
  Set<String> scopes=token.getScope();
  Map<String,Object> response=new HashMap<String,Object>();
  AMIdentity id=null;
  try {
    id=identityManager.getResourceOwnerIdentity(token.getUserID(),token.getRealm());
  }
 catch (  UnauthorizedClientException e) {
    throw OAuthProblemException.OAuthError.UNAUTHORIZED_CLIENT.handle(null,e.getMessage());
  }
  response.put("String_Node_Str",token.getUserID());
  for (  String scope : scopes) {
    Object attributes=scopeToUserUserProfileAttributes.get(scope);
    if (attributes == null) {
      logger.error("String_Node_Str" + scope);
    }
 else     if (attributes instanceof String) {
      Set<String> attr=null;
      try {
        attr=id.getAttribute((String)attributes);
      }
 catch (      IdRepoException e) {
        logger.error("String_Node_Str",e);
      }
catch (      SSOException e) {
        logger.error("String_Node_Str",e);
      }
      if (attr != null && attr.size() == 1) {
        response.put(scope,attr.iterator().next());
      }
 else       if (attr != null && attr.size() > 1) {
        response.put(scope,attr);
      }
 else {
        logger.error("String_Node_Str" + scope);
      }
    }
 else     if (attributes instanceof Map) {
      if (attributes != null && !((Map<String,String>)attributes).isEmpty()) {
        for (        Map.Entry<String,String> entry : ((Map<String,String>)attributes).entrySet()) {
          String attribute;
          attribute=entry.getValue();
          Set<String> attr=null;
          try {
            attr=id.getAttribute(attribute);
          }
 catch (          IdRepoException e) {
            logger.error("String_Node_Str",e);
          }
catch (          SSOException e) {
            logger.error("String_Node_Str",e);
          }
          if (attr != null && attr.size() == 1) {
            response.put(entry.getKey(),attr.iterator().next());
          }
 else           if (attr != null && attr.size() > 1) {
            response.put(entry.getKey(),attr);
          }
 else {
            logger.error("String_Node_Str" + scope);
          }
        }
      }
    }
  }
  return response;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Map<String,Object> getUserInfo(CoreToken token){
  Set<String> scopes=token.getScope();
  Map<String,Object> response=new HashMap<String,Object>();
  AMIdentity id=null;
  try {
    id=identityManager.getResourceOwnerIdentity(token.getUserID(),token.getRealm());
  }
 catch (  UnauthorizedClientException e) {
    throw OAuthProblemException.OAuthError.UNAUTHORIZED_CLIENT.handle(null,e.getMessage());
  }
  response.put("String_Node_Str",token.getUserID());
  for (  String scope : scopes) {
    if (OPENID_SCOPE.equals(scope)) {
      continue;
    }
    Object attributes=scopeToUserUserProfileAttributes.get(scope);
    if (attributes == null) {
      logger.error("String_Node_Str" + scope);
    }
 else     if (attributes instanceof String) {
      Set<String> attr=null;
      try {
        attr=id.getAttribute((String)attributes);
      }
 catch (      IdRepoException e) {
        logger.warning("String_Node_Str" + attributes,e);
      }
catch (      SSOException e) {
        logger.warning("String_Node_Str" + attributes,e);
      }
      if (attr != null && attr.size() == 1) {
        response.put(scope,attr.iterator().next());
      }
 else       if (attr != null && attr.size() > 1) {
        response.put(scope,attr);
      }
 else {
        logger.warning("String_Node_Str" + attributes + "String_Node_Str"+ scope);
      }
    }
 else     if (attributes instanceof Map) {
      if (attributes != null && !((Map<String,String>)attributes).isEmpty()) {
        for (        Map.Entry<String,String> entry : ((Map<String,String>)attributes).entrySet()) {
          String attribute;
          attribute=entry.getValue();
          Set<String> attr=null;
          try {
            attr=id.getAttribute(attribute);
          }
 catch (          IdRepoException e) {
            logger.warning("String_Node_Str",e);
          }
catch (          SSOException e) {
            logger.warning("String_Node_Str",e);
          }
          if (attr != null && attr.size() == 1) {
            response.put(entry.getKey(),attr.iterator().next());
          }
 else           if (attr != null && attr.size() > 1) {
            response.put(entry.getKey(),attr);
          }
 else {
            logger.warning("String_Node_Str" + scope);
          }
        }
      }
    }
  }
  return response;
}