Program: 167774
Project: 167774
Buggy source:
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  final PathAddress address=PathAddress.pathAddress(operation.get(OP_ADDR));
  final String childType=GlobalOperationHandlers.CHILD_TYPE.resolveModelAttribute(context,operation).asString();
  final Resource resource=context.readResource(PathAddress.EMPTY_ADDRESS,false);
  ImmutableManagementResourceRegistration registry=context.getResourceRegistration();
  Map<String,Set<String>> childAddresses=GlobalOperationHandlers.getChildAddresses(context,address,registry,resource,childType);
  Set<String> childNames=childAddresses.get(childType);
  if (childNames == null) {
    throw new OperationFailedException(new ModelNode().set(MESSAGES.unknownChildType(childType)));
  }
  childNames=new TreeSet<String>(childNames);
  ModelNode result=context.getResult();
  result.setEmptyList();
  PathAddress childAddress=address.append(PathElement.pathElement(childType));
  ModelNode op=Util.createEmptyOperation(READ_RESOURCE_OPERATION,childAddress);
  op.get(OPERATION_HEADERS).set(operation.get(OPERATION_HEADERS));
  ModelNode opAddr=op.get(OP_ADDR);
  ModelNode childProperty=opAddr.require(address.size());
  Set<Action.ActionEffect> actionEffects=EnumSet.of(Action.ActionEffect.ADDRESS);
  FilteredData fd=null;
  for (  String childName : childNames) {
    childProperty.set(childType,new ModelNode(childName));
    if (context.authorize(op,actionEffects).getDecision() == AuthorizationResult.Decision.PERMIT) {
      result.add(childName);
    }
 else {
      if (fd == null) {
        fd=new FilteredData(address);
      }
      fd.addAccessRestrictedResource(PathAddress.pathAddress(opAddr));
    }
  }
  if (fd != null) {
    context.getResponseHeaders().get(ACCESS_CONTROL).set(fd.toModelNode());
  }
  context.stepCompleted();
}

Fixed version (ground truth):
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  final PathAddress address=PathAddress.pathAddress(operation.get(OP_ADDR));
  final String childType=CHILD_TYPE.resolveModelAttribute(context,operation).asString();
  final Resource resource=context.readResource(PathAddress.EMPTY_ADDRESS,false);
  ImmutableManagementResourceRegistration registry=context.getResourceRegistration();
  Map<String,Set<String>> childAddresses=GlobalOperationHandlers.getChildAddresses(context,address,registry,resource,childType);
  Set<String> childNames=childAddresses.get(childType);
  if (childNames == null) {
    throw new OperationFailedException(new ModelNode().set(MESSAGES.unknownChildType(childType)));
  }
  childNames=new TreeSet<String>(childNames);
  ModelNode result=context.getResult();
  result.setEmptyList();
  PathAddress childAddress=address.append(PathElement.pathElement(childType));
  ModelNode op=Util.createEmptyOperation(READ_RESOURCE_OPERATION,childAddress);
  op.get(OPERATION_HEADERS).set(operation.get(OPERATION_HEADERS));
  ModelNode opAddr=op.get(OP_ADDR);
  ModelNode childProperty=opAddr.require(address.size());
  Set<Action.ActionEffect> actionEffects=EnumSet.of(Action.ActionEffect.ADDRESS);
  FilteredData fd=null;
  for (  String childName : childNames) {
    childProperty.set(childType,new ModelNode(childName));
    if (context.authorize(op,actionEffects).getDecision() == AuthorizationResult.Decision.PERMIT) {
      result.add(childName);
    }
 else {
      if (fd == null) {
        fd=new FilteredData(address);
      }
      fd.addAccessRestrictedResource(PathAddress.pathAddress(opAddr));
    }
  }
  if (fd != null) {
    context.getResponseHeaders().get(ACCESS_CONTROL).set(fd.toModelNode());
  }
  context.stepCompleted();
}