Program: 47645
Project: 47645
Buggy source:
private static void initializePermissionsArray(){
  if (null == PentahoAclEntry.validPermissions) {
    int maxPower=-1;
    Field[] fields=IPentahoAclEntry.class.getDeclaredFields();
    for (    Field field : fields) {
      if ((int.class == field.getType()) && Modifier.isPublic(field.getModifiers()) && Modifier.isStatic(field.getModifiers())&& Modifier.isFinal(field.getModifiers())&& field.getName().startsWith(PERMISSION_PREFIX)) {
        if (PentahoAclEntry.logger.isDebugEnabled()) {
          PentahoAclEntry.logger.debug("String_Node_Str" + field.getName());
        }
        double powerOfTwo=-1;
        try {
          powerOfTwo=Math.log(field.getInt(null)) / Math.log(2);
        }
 catch (        IllegalArgumentException e) {
        }
catch (        IllegalAccessException e) {
        }
        if (powerOfTwo == (int)powerOfTwo) {
          if (powerOfTwo > maxPower) {
            if (PentahoAclEntry.logger.isDebugEnabled()) {
              PentahoAclEntry.logger.debug("String_Node_Str");
            }
            maxPower=(int)powerOfTwo;
          }
        }
      }
    }
    if (PentahoAclEntry.logger.isDebugEnabled()) {
      PentahoAclEntry.logger.debug("String_Node_Str" + maxPower);
    }
    int numberOfPermutations=(int)Math.pow(2,maxPower + 1);
    PentahoAclEntry.validPermissions=new int[numberOfPermutations + 1];
    for (int i=0; i < numberOfPermutations; i++) {
      PentahoAclEntry.validPermissions[i]=i;
    }
    PentahoAclEntry.validPermissions[PentahoAclEntry.validPermissions.length - 1]=PentahoAclEntry.PERM_FULL_CONTROL;
  }
}

Fixed version (ground truth):
private static void initializePermissionsArray(){
  if (null == PentahoAclEntry.validPermissions) {
    int maxPower=-1;
    Field[] fields=IPentahoAclEntry.class.getDeclaredFields();
    for (    Field field : fields) {
      if (int.class == field.getType() && Modifier.isPublic(field.getModifiers()) && Modifier.isStatic(field.getModifiers()) && Modifier.isFinal(field.getModifiers()) && field.getName().startsWith(PERMISSION_PREFIX)) {
        if (PentahoAclEntry.logger.isDebugEnabled()) {
          PentahoAclEntry.logger.debug("String_Node_Str" + field.getName());
        }
        double powerOfTwo=-1;
        try {
          powerOfTwo=Math.log(field.getInt(null)) / Math.log(2);
        }
 catch (        IllegalArgumentException e) {
        }
catch (        IllegalAccessException e) {
        }
        if (powerOfTwo == (int)powerOfTwo) {
          if (powerOfTwo > maxPower) {
            if (PentahoAclEntry.logger.isDebugEnabled()) {
              PentahoAclEntry.logger.debug("String_Node_Str");
            }
            maxPower=(int)powerOfTwo;
          }
        }
      }
    }
    if (PentahoAclEntry.logger.isDebugEnabled()) {
      PentahoAclEntry.logger.debug("String_Node_Str" + maxPower);
    }
    int numberOfPermutations=(int)Math.pow(2,maxPower + 1);
    PentahoAclEntry.validPermissions=new int[numberOfPermutations + 1];
    for (int i=0; i < numberOfPermutations; i++) {
      PentahoAclEntry.validPermissions[i]=i;
    }
    PentahoAclEntry.validPermissions[PentahoAclEntry.validPermissions.length - 1]=PentahoAclEntry.PERM_FULL_CONTROL;
  }
}