Program: 15598
Project: 15598
Buggy source:
protected Map<String,Set<Permission>> getAuthorizationInfoInternal(final OAuthorizationCredentials credentials,final String targetClientId) throws AccessTokenExpiredException {
  Map<String,Set<Permission>> map=new HashMap<String,Set<Permission>>();
  final String body=sendRequestForPermissions(credentials,targetClientId);
  JsonNode json=JsonHelper.getFirstNode(body);
  if (json != null) {
    JsonNode errorNode=json.get(ERROR);
    if (errorNode != null) {
      logger.info("String_Node_Str",errorNode.asText());
      if (EXPIRED_ACCESS_TOKEN.equals(errorNode.asText()))       accessTokenExpired=true;
    }
 else {
      accessTokenExpired=false;
      json=json.get(ROLE_PERMISSIONS);
      if (json != null) {
        final Iterator<JsonNode> nodes=json.iterator();
        while (nodes.hasNext()) {
          for (Iterator<Entry<String,JsonNode>> fields=nodes.next().fields(); fields.hasNext(); ) {
            Entry<String,JsonNode> next=fields.next();
            logger.debug("String_Node_Str",next.getKey());
            final HashSet<Permission> permissionsSet=new HashSet<Permission>();
            map.put(next.getKey(),permissionsSet);
            Iterator<JsonNode> permIter=next.getValue().iterator();
            while (permIter.hasNext()) {
              json=permIter.next();
              String permission=json.asText();
              permissionsSet.add(permissionResolver.resolvePermission(permission));
              logger.debug("String_Node_Str",permission);
            }
          }
        }
      }
    }
  }
  return map;
}

Fixed version (ground truth):
protected Map<String,Set<Permission>> getAuthorizationInfoInternal(final OAuthorizationCredentials credentials,final String targetClientId) throws AccessTokenExpiredException {
  Map<String,Set<Permission>> map=new HashMap<String,Set<Permission>>();
  final String body=sendRequestForPermissions(credentials,targetClientId);
  JsonNode json=JsonHelper.getFirstNode(body);
  if (json != null) {
    JsonNode errorNode=json.get(ERROR);
    if (errorNode != null) {
      String errorMsg=errorNode.asText();
      logger.info("String_Node_Str",errorMsg);
      if (errorMsg.startsWith(EXPIRED_ACCESS_TOKEN)) {
        String token=credentials.getAccessToken();
        if (errorMsg.endsWith("String_Node_Str"))         token=credentials.getCallerCredentials().getAccessToken();
 else         if (errorMsg.endsWith("String_Node_Str"))         if (credentials.getCallerCredentials().getCallerCredentials() == null)         token=credentials.getCallerCredentials().getAccessToken();
 else         token=credentials.getCallerCredentials().getCallerCredentials().getAccessToken();
        throw new AccessTokenExpiredException(token,errorMsg);
      }
    }
 else {
      json=json.get(ROLE_PERMISSIONS);
      if (json != null) {
        final Iterator<JsonNode> nodes=json.iterator();
        while (nodes.hasNext()) {
          for (Iterator<Entry<String,JsonNode>> fields=nodes.next().fields(); fields.hasNext(); ) {
            Entry<String,JsonNode> next=fields.next();
            logger.debug("String_Node_Str",next.getKey());
            final HashSet<Permission> permissionsSet=new HashSet<Permission>();
            map.put(next.getKey(),permissionsSet);
            Iterator<JsonNode> permIter=next.getValue().iterator();
            while (permIter.hasNext()) {
              json=permIter.next();
              String permission=json.asText();
              permissionsSet.add(permissionResolver.resolvePermission(permission));
              logger.debug("String_Node_Str",permission);
            }
          }
        }
      }
    }
  }
  return map;
}