Program: 14130
Project: 14130
Buggy source:
/** 
 * Process each of the quota authorizations. If any of them is exceeded, deny access.
 * @param quotas The quota authorizations
 * @param action The request action.
 * @param resourceType The resource type for allocation
 * @param resourceName The resource associated with the allocation
 * @param quantity The quantity to allocate.
 * @throws AuthException for any error.
 */
private void processQuotas(final List<Pair<PolicyVersion,Authorization>> quotas,final String accountId,final String userId,final String action,final String resourceType,final String resourceName,final Long quantity) throws AuthException {
  NumericGreaterThan ngt=new NumericGreaterThan();
  for (  Pair<PolicyVersion,Authorization> quota : quotas) {
    final PolicyVersion policy=quota.getLeft();
    final Authorization auth=quota.getRight();
    if (!matchActions(auth,action)) {
      LOG.debug("String_Node_Str" + action + "String_Node_Str");
      continue;
    }
    if (!matchResources(auth,resourceName)) {
      LOG.debug("String_Node_Str" + resourceName + "String_Node_Str");
      continue;
    }
    PolicyScope scope=policy.getPolicyScope();
    String principalId=getAuthorizationPrincipalId(scope,accountId,userId);
    for (    Condition cond : auth.getConditions()) {
      Key key=Keys.getKeyInstance(Keys.getKeyClass(cond.getKey()));
      if (!(key instanceof QuotaKey)) {
        LOG.debug("String_Node_Str" + cond.getKey() + "String_Node_Str");
        continue;
      }
      QuotaKey quotaKey=(QuotaKey)key;
      if (!key.canApply(action)) {
        LOG.debug("String_Node_Str" + cond.getKey() + "String_Node_Str"+ action+ "String_Node_Str"+ resourceType);
        continue;
      }
      String usageValue=quotaKey.value(scope,principalId,resourceName,quantity);
      if (QuotaKey.NOT_SUPPORTED.equals(usageValue)) {
        LOG.debug("String_Node_Str" + cond.getKey() + "String_Node_Str"+ scope);
        continue;
      }
      String quotaValue=Iterables.getFirst(cond.getValues(),null);
      if (ngt.check(usageValue,quotaValue)) {
        LOG.error("String_Node_Str" + key.getClass().getName() + "String_Node_Str"+ quotaValue+ "String_Node_Str"+ usageValue);
        throw new AuthException(AuthException.QUOTA_EXCEEDED);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Process each of the quota authorizations. If any of them is exceeded, deny access.
 * @param quotas The quota authorizations
 * @param action The request action.
 * @param resourceType The resource type for allocation
 * @param resourceName The resource associated with the allocation
 * @param quantity The quantity to allocate.
 * @throws AuthException for any error.
 */
private void processQuotas(final List<Pair<PolicyVersion,Authorization>> quotas,final String accountId,final String userId,final String action,final String resourceType,final String resourceName,final Long quantity) throws AuthException {
  NumericGreaterThan ngt=new NumericGreaterThan();
  for (  Pair<PolicyVersion,Authorization> quota : quotas) {
    final PolicyVersion policy=quota.getLeft();
    final Authorization auth=quota.getRight();
    if (!matchActions(auth,action)) {
      LOG.debug("String_Node_Str" + action + "String_Node_Str");
      continue;
    }
    if (!matchResources(auth,resourceName)) {
      LOG.debug("String_Node_Str" + resourceName + "String_Node_Str");
      continue;
    }
    PolicyScope scope=policy.getPolicyScope();
    String principalId=getAuthorizationPrincipalId(scope,accountId,userId);
    for (    Condition cond : auth.getConditions()) {
      Key key=Keys.getKeyInstance(Keys.getKeyClass(cond.getKey()));
      if (!(key instanceof QuotaKey)) {
        LOG.debug("String_Node_Str" + cond.getKey() + "String_Node_Str");
        continue;
      }
      QuotaKey quotaKey=(QuotaKey)key;
      if (!quotaKey.canApply(action,resourceType)) {
        LOG.debug("String_Node_Str" + cond.getKey() + "String_Node_Str"+ action+ "String_Node_Str"+ resourceType);
        continue;
      }
      String usageValue=quotaKey.value(scope,principalId,resourceName,quantity);
      if (QuotaKey.NOT_SUPPORTED.equals(usageValue)) {
        LOG.debug("String_Node_Str" + cond.getKey() + "String_Node_Str"+ scope);
        continue;
      }
      String quotaValue=Iterables.getFirst(cond.getValues(),null);
      if (ngt.check(usageValue,quotaValue)) {
        LOG.error("String_Node_Str" + key.getClass().getName() + "String_Node_Str"+ quotaValue+ "String_Node_Str"+ usageValue);
        throw new AuthException(AuthException.QUOTA_EXCEEDED);
      }
    }
  }
}