nus-yam/ex-repair huggingface dataset:
Program: 167851
Project: 167851
Buggy source:
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  context.completeStep();
  final boolean isDomain=isDomainOperation(operation);
  boolean shouldContinue=collectDomainFailure(context,isDomain);
  shouldContinue=shouldContinue && collectContextFailure(context,isDomain);
  shouldContinue=shouldContinue && collectHostFailures(context,isDomain);
  if (shouldContinue) {
    ModelNode contextResult=context.getResult();
    contextResult.setEmptyObject();
    contextResult.set(getDomainResults(operation));
    if (domainOperationContext.getServerResults().size() > 0) {
      populateServerGroupResults(context,context.getResult());
    }
  }
}

Fixed version (ground truth):
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  context.completeStep();
  final boolean isDomain=isDomainOperation(operation);
  boolean shouldContinue=collectDomainFailure(context,isDomain);
  shouldContinue=shouldContinue && collectContextFailure(context,isDomain);
  shouldContinue=shouldContinue && collectHostFailures(context,isDomain);
  if (shouldContinue) {
    ModelNode contextResult=context.getResult();
    contextResult.setEmptyObject();
    contextResult.set(getDomainResults(operation));
    if (domainOperationContext.getServerResults().size() > 0) {
      populateServerGroupResults(context,context.getResult());
    }
 else {
      context.getServerResults();
    }
  }
}
Program: 167852
Project: 167852
Buggy source:
@Override public ModelNode getDomainOperation(){
  List<ModelNode> domainSteps=new ArrayList<ModelNode>();
  for (  HostControllerExecutionSupport step : steps) {
    ModelNode stepNode=step.getDomainOperation();
    if (stepNode != null) {
      domainSteps.add(stepNode);
    }
  }
  ModelNode stepsParam=new ModelNode();
  for (  ModelNode stepNode : domainSteps) {
    stepsParam.add(stepNode);
  }
  ModelNode result=Util.getEmptyOperation(COMPOSITE,new ModelNode());
  result.get(STEPS).set(stepsParam);
  return result;
}

Fixed version (ground truth):
@Override public ModelNode getDomainOperation(){
  List<ModelNode> domainSteps=new ArrayList<ModelNode>();
  for (  HostControllerExecutionSupport step : steps) {
    ModelNode stepNode=step.getDomainOperation();
    if (stepNode != null) {
      domainSteps.add(stepNode);
    }
  }
  if (domainSteps.size() == 0) {
    return null;
  }
  ModelNode stepsParam=new ModelNode();
  for (  ModelNode stepNode : domainSteps) {
    stepsParam.add(stepNode);
  }
  ModelNode result=Util.getEmptyOperation(COMPOSITE,new ModelNode());
  result.get(STEPS).set(stepsParam);
  return result;
}
Program: 167854
Project: 167854
Buggy source:
private ModelNode parseClientMapping(XMLExtendedStreamReader reader) throws XMLStreamException {
  final ModelNode mapping=new ModelNode();
  final ModelNode sourceNetwork=mapping.get(SOURCE_NETWORK);
  final ModelNode destination=mapping.get(DESTINATION_ADDRESS);
  final ModelNode destinationPort=mapping.get(DESTINATION_PORT);
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    final String value=reader.getAttributeValue(i);
    if (!isNoNamespaceAttribute(reader,i)) {
      throw unexpectedAttribute(reader,i);
    }
    final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case SOURCE_NETWORK:
      validateAddressMask(value,reader.getLocation());
    sourceNetwork.set(value);
  break;
case DESTINATION_ADDRESS:
if (value == null || value.isEmpty()) {
  throw invalidAttributeValue(reader,i);
}
destination.set(value);
break;
case DESTINATION_PORT:
{
destinationPort.set(parseBoundedIntegerAttribute(reader,i,0,65535,true));
break;
}
}
}
if (!destination.isDefined()) {
throw MESSAGES.missingRequiredAttributes(new StringBuilder(DESTINATION_PORT),reader.getLocation());
}
requireNoContent(reader);
return mapping;
}

Fixed version (ground truth):
private ModelNode parseClientMapping(XMLExtendedStreamReader reader) throws XMLStreamException {
  final ModelNode mapping=new ModelNode();
  final ModelNode sourceNetwork=mapping.get(SOURCE_NETWORK);
  final ModelNode destination=mapping.get(DESTINATION_ADDRESS);
  final ModelNode destinationPort=mapping.get(DESTINATION_PORT);
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    final String value=reader.getAttributeValue(i);
    if (!isNoNamespaceAttribute(reader,i)) {
      throw unexpectedAttribute(reader,i);
    }
    final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case SOURCE_NETWORK:
      validateAddressMask(value,reader.getLocation());
    sourceNetwork.set(value);
  break;
case DESTINATION_ADDRESS:
if (value == null || value.isEmpty()) {
  throw invalidAttributeValue(reader,i);
}
destination.set(value);
break;
case DESTINATION_PORT:
{
destinationPort.set(parseBoundedIntegerAttribute(reader,i,0,65535,true));
break;
}
}
}
if (!destination.isDefined()) {
throw MESSAGES.missingRequiredAttributes(new StringBuilder(DESTINATION_ADDRESS),reader.getLocation());
}
requireNoContent(reader);
return mapping;
}
Program: 167857
Project: 167857
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void initializeParsers(ExtensionParsingContext context){
  context.setSubsystemXmlMapping(Namespace.REMOTING_1_0.getUriString(),NewRemotingSubsystemParser.INSTANCE);
  context.setSubsystemXmlMapping(Namespace.REMOTING_1_1.getUriString(),RemotingSubsystem11Parser.INSTANCE);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void initializeParsers(ExtensionParsingContext context){
  context.setSubsystemXmlMapping(Namespace.REMOTING_1_0.getUriString(),RemotingSubsystem10Parser.INSTANCE);
  context.setSubsystemXmlMapping(Namespace.REMOTING_1_1.getUriString(),RemotingSubsystem11Parser.INSTANCE);
}
Program: 167858
Project: 167858
Buggy source:
private void parseProperties(XMLExtendedStreamReader reader,final ModelNode address,final List<ModelNode> list) throws XMLStreamException {
  while (reader.nextTag() != END_ELEMENT) {
    reader.require(START_ELEMENT,Namespace.CURRENT.getUriString(),Element.PROPERTY.getLocalName());
    final Property property=readProperty(reader);
    ModelNode propertyOp=new ModelNode();
    propertyOp.get(OP).set(ADD);
    propertyOp.get(OP_ADDR).set(address).add(PROPERTY,property.getName());
    propertyOp.get(VALUE).set(property.getValue());
    list.add(propertyOp);
  }
}

Fixed version (ground truth):
private void parseProperties(XMLExtendedStreamReader reader,final ModelNode address,final List<ModelNode> list) throws XMLStreamException {
  while (reader.nextTag() != END_ELEMENT) {
    reader.require(START_ELEMENT,Namespace.REMOTING_1_0.getUriString(),Element.PROPERTY.getLocalName());
    final Property property=readProperty(reader);
    ModelNode propertyOp=new ModelNode();
    propertyOp.get(OP).set(ADD);
    propertyOp.get(OP_ADDR).set(address).add(PROPERTY,property.getName());
    propertyOp.get(VALUE).set(property.getValue());
    list.add(propertyOp);
  }
}
Program: 167859
Project: 167859
Buggy source:
/** 
 * Finds and returns methods corresponding to the passed method <code>name</code> and method <code>paramTypes</code>. The passed <code>classReflectionIndex</code> will be used to traverse the class hierarchy while finding the method. <p/> Returns empty collection if no such method is found
 * @param deploymentReflectionIndex The deployment reflection index
 * @param classReflectionIndex      The class reflection index which will be used to traverse the class hierarchy to find the method
 * @param methodName                The name of the method
 * @param paramTypes                The param types accepted by the method
 * @return
 */
public static Collection<Method> findMethods(final DeploymentReflectionIndex deploymentReflectionIndex,final ClassReflectionIndex classReflectionIndex,final String methodName,final String... paramTypes){
  Collection<Method> methods=classReflectionIndex.getMethods(methodName,paramTypes);
  if (!methods.isEmpty()) {
    return methods;
  }
  Class<?> superClass=classReflectionIndex.getIndexedClass().getSuperclass();
  if (superClass != null) {
    ClassReflectionIndex<?> superClassIndex=deploymentReflectionIndex.getClassIndex(superClass);
    if (superClassIndex != null) {
      return findMethods(deploymentReflectionIndex,superClassIndex,methodName,paramTypes);
    }
  }
  return methods;
}

Fixed version (ground truth):
/** 
 * Finds and returns methods corresponding to the passed method <code>name</code> and method <code>paramTypes</code>. The passed <code>classReflectionIndex</code> will be used to traverse the class hierarchy while finding the method. <p/> Returns empty collection if no such method is found
 * @param deploymentReflectionIndex The deployment reflection index
 * @param classReflectionIndex      The class reflection index which will be used to traverse the class hierarchy to find the method
 * @param methodName                The name of the method
 * @param paramTypes                The param types accepted by the method
 * @return
 */
public static Collection<Method> findMethods(final DeploymentReflectionIndex deploymentReflectionIndex,final ClassReflectionIndex classReflectionIndex,final String methodName,final String... paramTypes){
  final Collection<Method> methods=classReflectionIndex.getMethods(methodName,paramTypes);
  if (!methods.isEmpty()) {
    return methods;
  }
  Class<?> superClass=classReflectionIndex.getIndexedClass().getSuperclass();
  if (superClass != null) {
    ClassReflectionIndex<?> superClassIndex=deploymentReflectionIndex.getClassIndex(superClass);
    if (superClassIndex != null) {
      return findMethods(deploymentReflectionIndex,superClassIndex,methodName,paramTypes);
    }
  }
  return methods;
}
Program: 167860
Project: 167860
Buggy source:
/** 
 * Finds and returns a method corresponding to the passed <code>method</code>, which may be declared in the super class of the passed <code>classReflectionIndex</code>. <p/> <p/>
 * @param deploymentReflectionIndex The deployment reflection index
 * @param classReflectionIndex      The class reflection index which will be used to traverse the class hierarchy to find the method
 * @param method                    The method being searched for
 * @return
 */
public static Method findMethod(final DeploymentReflectionIndex deploymentReflectionIndex,final ClassReflectionIndex classReflectionIndex,final Method method){
  if (method == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  MethodIdentifier methodIdentifier=MethodIdentifier.getIdentifierForMethod(method);
  return findMethod(deploymentReflectionIndex,classReflectionIndex,methodIdentifier);
}

Fixed version (ground truth):
/** 
 * Finds and returns a method corresponding to the passed <code>method</code>, which may be declared in the super class of the passed <code>classReflectionIndex</code>. <p/> <p/>
 * @param deploymentReflectionIndex The deployment reflection index
 * @param clazz                     The class
 * @param method                    The method being searched for
 * @return
 */
public static Method findMethod(final DeploymentReflectionIndex deploymentReflectionIndex,final Class<?> clazz,final Method method){
  if (method == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  MethodIdentifier methodIdentifier=MethodIdentifier.getIdentifierForMethod(method);
  return findMethod(deploymentReflectionIndex,clazz,methodIdentifier);
}
Program: 167861
Project: 167861
Buggy source:
/** 
 * Finds and returns a method corresponding to the passed <code>method</code>, which may be declared in the super class of the passed <code>classReflectionIndex</code>. <p/> <p/> Throws   {@link org.jboss.as.server.deployment.DeploymentUnitProcessingException} if no such method is found.
 * @param deploymentReflectionIndex The deployment reflection index
 * @param classReflectionIndex      The class reflection index which will be used to traverse the class hierarchy to find the method
 * @param method                    The method being searched for
 * @return
 * @throws org.jboss.as.server.deployment.DeploymentUnitProcessingException If no such method is found
 */
public static Method findRequiredMethod(final DeploymentReflectionIndex deploymentReflectionIndex,final ClassReflectionIndex classReflectionIndex,final Method method) throws DeploymentUnitProcessingException {
  if (method == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  MethodIdentifier methodIdentifier=MethodIdentifier.getIdentifierForMethod(method);
  return findRequiredMethod(deploymentReflectionIndex,classReflectionIndex,methodIdentifier);
}

Fixed version (ground truth):
/** 
 * Finds and returns a method corresponding to the passed <code>method</code>, which may be declared in the super class of the passed <code>classReflectionIndex</code>. <p/> <p/> Throws   {@link org.jboss.as.server.deployment.DeploymentUnitProcessingException} if no such method is found.
 * @param deploymentReflectionIndex The deployment reflection index
 * @param clazz                     The class
 * @param method                    The method being searched for
 * @return
 * @throws org.jboss.as.server.deployment.DeploymentUnitProcessingException If no such method is found
 */
public static Method findRequiredMethod(final DeploymentReflectionIndex deploymentReflectionIndex,final Class<?> clazz,final Method method) throws DeploymentUnitProcessingException {
  if (method == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final MethodIdentifier methodIdentifier=MethodIdentifier.getIdentifierForMethod(method);
  return findRequiredMethod(deploymentReflectionIndex,clazz,methodIdentifier);
}
Program: 167862
Project: 167862
Buggy source:
/** 
 * Updates the handlers to be assigned. Checks to see if the handler already exists and throws an  {@link OperationFailedException exception} if it does.
 * @param handlerAttribute the handler attribute.
 * @param operation        the operation.
 * @param model            the new model
 * @throws OperationFailedException if an error occurs.
 */
protected void updateHandlersForAssign(final AttributeDefinition handlerAttribute,final ModelNode operation,final ModelNode model) throws OperationFailedException {
  final String handlerName=getHandlerName(operation);
  final ModelNode parent=getParent(model);
  if (handlerExists(handlerName,handlerAttribute,parent)) {
    throw createFailureMessage(MESSAGES.handlerAlreadyDefined(handlerName));
  }
  parent.get(handlerAttribute.getName()).add(handlerName);
}

Fixed version (ground truth):
/** 
 * Updates the handlers to be assigned. Checks to see if the handler already exists and throws an  {@link OperationFailedException exception} if it does.
 * @param handlerAttribute the handler attribute.
 * @param operation        the operation.
 * @param model            the new model
 * @throws OperationFailedException if an error occurs.
 */
protected void updateHandlersForAssign(final AttributeDefinition handlerAttribute,final ModelNode operation,final ModelNode model) throws OperationFailedException {
  final String handlerName=getHandlerName(operation);
  if (handlerExists(handlerName,handlerAttribute,model)) {
    throw createFailureMessage(MESSAGES.handlerAlreadyDefined(handlerName));
  }
  model.get(handlerAttribute.getName()).add(handlerName);
}
Program: 167863
Project: 167863
Buggy source:
/** 
 * Updates the handlers to be unassigned. Checks to see if the handler exists and creates a new list of handlers removing the handler to be unassigned. If the handler to be unassigned does not exist an  {@link OperationFailedException exception} is thrown.
 * @param handlerAttribute the handler attribute.
 * @param operation        the operation.
 * @param model            the new model
 * @throws OperationFailedException if an error occurs.
 */
protected void updateHandlersForUnassign(final AttributeDefinition handlerAttribute,final ModelNode operation,final ModelNode model) throws OperationFailedException {
  final String handlerName=getHandlerName(operation);
  final ModelNode parent=getParent(model);
  if (handlerExists(handlerName,handlerAttribute,parent)) {
    final ModelNode currentSubhandlers=handlerAttribute.validateOperation(parent);
    final List<ModelNode> newSubhandlers=new ArrayList<ModelNode>();
    for (    ModelNode node : currentSubhandlers.asList()) {
      if (node.asString().equals(handlerName)) {
        continue;
      }
      newSubhandlers.add(node);
    }
    parent.get(handlerAttribute.getName()).set(newSubhandlers);
  }
 else {
    throw createFailureMessage(MESSAGES.cannotUnassignHandler(handlerName));
  }
}

Fixed version (ground truth):
/** 
 * Updates the handlers to be unassigned. Checks to see if the handler exists and creates a new list of handlers removing the handler to be unassigned. If the handler to be unassigned does not exist an  {@link OperationFailedException exception} is thrown.
 * @param handlerAttribute the handler attribute.
 * @param operation        the operation.
 * @param model            the new model
 * @throws OperationFailedException if an error occurs.
 */
protected void updateHandlersForUnassign(final AttributeDefinition handlerAttribute,final ModelNode operation,final ModelNode model) throws OperationFailedException {
  final String handlerName=getHandlerName(operation);
  if (handlerExists(handlerName,handlerAttribute,model)) {
    final ModelNode currentSubhandlers=handlerAttribute.resolveModelAttribute(context,model);
    final List<ModelNode> newSubhandlers=new ArrayList<ModelNode>();
    for (    ModelNode node : currentSubhandlers.asList()) {
      if (node.asString().equals(handlerName)) {
        continue;
      }
      newSubhandlers.add(node);
    }
    model.get(handlerAttribute.getName()).set(newSubhandlers);
  }
 else {
    throw createFailureMessage(MESSAGES.cannotUnassignHandler(handlerName));
  }
}
Program: 167864
Project: 167864
Buggy source:
protected AbstractLoggerService(final String name){
  this.name=name;
}

Fixed version (ground truth):
protected AbstractLoggerService(final String name){
  if (CommonAttributes.ROOT_LOGGER_NAME.equals(name)) {
    this.name="String_Node_Str";
  }
 else {
    this.name=name;
  }
}
Program: 167865
Project: 167865
Buggy source:
static Collection<ServiceController<?>> installLoggerHandlers(final ServiceTarget serviceTarget,final String loggerName,final ModelNode handlers,final ServiceVerificationHandler verificationHandler){
  final List<ServiceController<?>> controllers=new ArrayList<ServiceController<?>>();
  for (  final ModelNode handler : handlers.asList()) {
    final String handlerName=handler.asString();
    final LoggerHandlerService service=new LoggerHandlerService(loggerName);
    final Injector<Handler> injector=service.getHandlerInjector();
    controllers.add(serviceTarget.addService(LogServices.loggerHandlerName(loggerName,handlerName),service).addDependency(LogServices.loggerName(loggerName)).addDependency(LogServices.handlerName(handlerName),Handler.class,injector).addListener(verificationHandler).install());
  }
  return controllers;
}

Fixed version (ground truth):
static Collection<ServiceController<?>> installLoggerHandlers(final ServiceTarget serviceTarget,final String loggerName,final ModelNode handlers,final ServiceVerificationHandler verificationHandler){
  final List<ServiceController<?>> controllers=new ArrayList<ServiceController<?>>();
  for (  final ModelNode handler : handlers.asList()) {
    final String handlerName=handler.asString();
    final LoggerHandlerService service=new LoggerHandlerService(loggerName);
    final Injector<Handler> injector=service.getHandlerInjector();
    final ServiceName serviceName=LogServices.loggerHandlerName(loggerName,handlerName);
    final ServiceName dep1=LogServices.loggerName(loggerName);
    final ServiceName dep2=LogServices.handlerName(handlerName);
    LoggingLogger.ROOT_LOGGER.debugf("String_Node_Str",serviceName,dep1,dep2);
    controllers.add(serviceTarget.addService(serviceName,service).addDependency(dep1).addDependency(dep2,Handler.class,injector).addListener(verificationHandler).install());
  }
  return controllers;
}
Program: 167866
Project: 167866
Buggy source:
public static ServiceName loggerHandlerName(final String loggerName,final String handlerName){
  return loggerName.length() == 0 ? ROOT_LOGGER_HANDLER.append(handlerName) : LOGGER_HANDLER.append(loggerName,handlerName);
}

Fixed version (ground truth):
public static ServiceName loggerHandlerName(final String loggerName,final String handlerName){
  return CommonAttributes.ROOT_LOGGER_NAME.equals(loggerName) ? ROOT_LOGGER_HANDLER.append(CommonAttributes.ROOT_LOGGER_NAME,handlerName) : LOGGER_HANDLER.append(loggerName,handlerName);
}
Program: 167867
Project: 167867
Buggy source:
@Override protected void updateRuntime(final ModelNode operation,final ExtHandler handler) throws OperationFailedException {
  final ModelNode autoflush=AUTOFLUSH.validateResolvedOperation(operation);
  if (autoflush.isDefined()) {
    handler.setAutoFlush(autoflush.asBoolean());
  }
}

Fixed version (ground truth):
@Override protected void updateRuntime(final ModelNode operation,final T handler) throws OperationFailedException {
  final ModelNode autoflush=AUTOFLUSH.validateResolvedOperation(operation);
  if (autoflush.isDefined()) {
    handler.setAutoFlush(autoflush.asBoolean());
  }
}
Program: 167868
Project: 167868
Buggy source:
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  final ModelNode result=context.getResult();
  for (  String attribute : PlatformMBeanConstants.COMPILATION_READ_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      CompilationMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.COMPILATION_METRICS) {
    final ModelNode store=result.get(attribute);
    try {
      CompilationMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    UnsupportedOperationException ignored) {
    }
  }
  context.completeStep();
}

Fixed version (ground truth):
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  final ModelNode result=context.getResult();
  for (  String attribute : PlatformMBeanConstants.COMPILATION_READ_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      CompilationMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.COMPILATION_METRICS) {
    final ModelNode store=result.get(attribute);
    try {
      CompilationMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    UnsupportedOperationException ignored) {
    }
  }
  if (PlatformMBeanUtil.JVM_MAJOR_VERSION > 6) {
    final ModelNode store=result.get(PlatformMBeanConstants.OBJECT_NAME);
    CompilationMXBeanAttributeHandler.storeResult(PlatformMBeanConstants.OBJECT_NAME,store);
  }
  context.completeStep();
}
Program: 167869
Project: 167869
Buggy source:
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  final String memPoolName=PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue();
  MemoryPoolMXBean memoryPoolMXBean=MemoryPoolMXBeanAttributeHandler.getMemoryPoolMXBean(memPoolName);
  final ModelNode result=context.getResult();
  for (  String attribute : PlatformMBeanConstants.MEMORY_POOL_READ_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      MemoryPoolMXBeanAttributeHandler.storeResult(attribute,store,memoryPoolMXBean,memPoolName);
    }
 catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.MEMORY_POOL_READ_WRITE_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      MemoryPoolMXBeanAttributeHandler.storeResult(attribute,store,memoryPoolMXBean,memPoolName);
    }
 catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.MEMORY_POOL_METRICS) {
    final ModelNode store=result.get(attribute);
    try {
      MemoryPoolMXBeanAttributeHandler.storeResult(attribute,store,memoryPoolMXBean,memPoolName);
    }
 catch (    UnsupportedOperationException ignored) {
    }
  }
  context.completeStep();
}

Fixed version (ground truth):
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  final String memPoolName=PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue();
  MemoryPoolMXBean memoryPoolMXBean=MemoryPoolMXBeanAttributeHandler.getMemoryPoolMXBean(memPoolName);
  final ModelNode result=context.getResult();
  for (  String attribute : PlatformMBeanConstants.MEMORY_POOL_READ_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      MemoryPoolMXBeanAttributeHandler.storeResult(attribute,store,memoryPoolMXBean,memPoolName);
    }
 catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.MEMORY_POOL_READ_WRITE_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      MemoryPoolMXBeanAttributeHandler.storeResult(attribute,store,memoryPoolMXBean,memPoolName);
    }
 catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.MEMORY_POOL_METRICS) {
    final ModelNode store=result.get(attribute);
    try {
      MemoryPoolMXBeanAttributeHandler.storeResult(attribute,store,memoryPoolMXBean,memPoolName);
    }
 catch (    UnsupportedOperationException ignored) {
    }
  }
  if (PlatformMBeanUtil.JVM_MAJOR_VERSION > 6) {
    final ModelNode store=result.get(PlatformMBeanConstants.OBJECT_NAME);
    MemoryPoolMXBeanAttributeHandler.storeResult(PlatformMBeanConstants.OBJECT_NAME,store,memoryPoolMXBean,memPoolName);
  }
  context.completeStep();
}
Program: 167870
Project: 167870
Buggy source:
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  final ModelNode result=context.getResult();
  for (  String attribute : PlatformMBeanConstants.OPERATING_SYSTEM_READ_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      OperatingSystemMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.OPERATING_SYSTEM_METRICS) {
    final ModelNode store=result.get(attribute);
    try {
      OperatingSystemMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  context.completeStep();
}

Fixed version (ground truth):
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  final ModelNode result=context.getResult();
  for (  String attribute : PlatformMBeanConstants.OPERATING_SYSTEM_READ_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      OperatingSystemMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.OPERATING_SYSTEM_METRICS) {
    final ModelNode store=result.get(attribute);
    try {
      OperatingSystemMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  if (PlatformMBeanUtil.JVM_MAJOR_VERSION > 6) {
    final ModelNode store=result.get(PlatformMBeanConstants.OBJECT_NAME);
    OperatingSystemMXBeanAttributeHandler.storeResult(PlatformMBeanConstants.OBJECT_NAME,store);
  }
  context.completeStep();
}
Program: 167871
Project: 167871
Buggy source:
public static ModelNode getGetLoggerLevelDescription(Locale locale){
  final ResourceBundle bundle=getResourceBundle(locale);
  final ModelNode node=new ModelNode();
  node.get(DESCRIPTION).set(bundle.getString("String_Node_Str"));
  addLoggerNameParam(node.get(REQUEST_PROPERTIES),bundle);
  node.get(REPLY_PROPERTIES);
  return node;
}

Fixed version (ground truth):
public static ModelNode getGetLoggerLevelDescription(Locale locale){
  final ResourceBundle bundle=getResourceBundle(locale);
  final ModelNode node=new ModelNode();
  node.get(OPERATION_NAME).set(GET_LOGGER_LEVEL);
  node.get(DESCRIPTION).set(bundle.getString("String_Node_Str"));
  addLoggerNameParam(node.get(REQUEST_PROPERTIES),bundle);
  node.get(REPLY_PROPERTIES);
  node.get(REPLY_PROPERTIES,TYPE).set(ModelType.STRING);
  node.get(REPLY_PROPERTIES,NILLABLE).set(true);
  return node;
}
Program: 167872
Project: 167872
Buggy source:
public static ModelNode getBufferPoolResource(Locale locale){
  final ResourceBundle bundle=getResourceBundle(locale);
  final ModelNode node=new ModelNode();
  node.get(DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.BUFFER_POOL));
  for (  String attr : PlatformMBeanConstants.BUFFER_POOL_READ_ATTRIBUTES) {
    node.get(ATTRIBUTES,attr,DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.BUFFER_POOL + "String_Node_Str" + attr));
  }
  for (  String attr : PlatformMBeanConstants.BUFFER_POOL_METRICS) {
    node.get(ATTRIBUTES,attr,DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.BUFFER_POOL + "String_Node_Str" + attr));
  }
  final ModelNode attrs=node.get(ATTRIBUTES);
  addObjectNameAttribute(attrs,bundle);
  populateAttribute(attrs,NAME,ModelType.STRING,true,null);
  populateAttribute(attrs,COUNT,ModelType.LONG,true,MeasurementUnit.NONE);
  populateAttribute(attrs,MEMORY_USED,ModelType.LONG,true,MeasurementUnit.BYTES);
  populateAttribute(attrs,TOTAL_CAPACITY,ModelType.LONG,true,MeasurementUnit.BYTES);
  node.get(OPERATIONS).setEmptyObject();
  node.get(CHILDREN).setEmptyObject();
  return node;
}

Fixed version (ground truth):
public static ModelNode getBufferPoolResource(Locale locale){
  final ResourceBundle bundle=getResourceBundle(locale);
  final ModelNode node=new ModelNode();
  node.get(DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.BUFFER_POOL));
  for (  String attr : PlatformMBeanConstants.BUFFER_POOL_READ_ATTRIBUTES) {
    node.get(ATTRIBUTES,attr,DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.BUFFER_POOL + "String_Node_Str" + attr));
  }
  for (  String attr : PlatformMBeanConstants.BUFFER_POOL_METRICS) {
    node.get(ATTRIBUTES,attr,DESCRIPTION).set(bundle.getString(PlatformMBeanConstants.BUFFER_POOL + "String_Node_Str" + attr));
  }
  final ModelNode attrs=node.get(ATTRIBUTES);
  addObjectNameAttribute(attrs,bundle);
  populateAttribute(attrs,NAME,ModelType.STRING,true,null);
  populateAttribute(attrs,COUNT,ModelType.LONG,true,MeasurementUnit.NONE);
  populateAttribute(attrs,MEMORY_USED,ModelType.LONG,true,MeasurementUnit.BYTES);
  populateAttribute(attrs,TOTAL_CAPACITY,ModelType.LONG,true,MeasurementUnit.BYTES);
  attrs.get(NAME,DESCRIPTION).set(bundle.getString("String_Node_Str"));
  node.get(OPERATIONS).setEmptyObject();
  node.get(CHILDREN).setEmptyObject();
  return node;
}
Program: 167873
Project: 167873
Buggy source:
public static ModelNode getSetLoggerLevelDescription(Locale locale){
  final ResourceBundle bundle=getResourceBundle(locale);
  final ModelNode node=new ModelNode();
  node.get(DESCRIPTION).set(bundle.getString("String_Node_Str"));
  final ModelNode reqProps=node.get(REQUEST_PROPERTIES);
  addLoggerNameParam(reqProps,bundle);
  final ModelNode level=reqProps.get(LEVEL_NAME);
  level.get(DESCRIPTION).set(bundle.getString(LOGGING + "String_Node_Str" + LEVEL_NAME));
  level.get(TYPE).set(ModelType.STRING);
  level.get(REQUIRED).set(false);
  node.get(REPLY_PROPERTIES).setEmptyObject();
  return node;
}

Fixed version (ground truth):
public static ModelNode getSetLoggerLevelDescription(Locale locale){
  final ResourceBundle bundle=getResourceBundle(locale);
  final ModelNode node=new ModelNode();
  node.get(OPERATION_NAME).set(SET_LOGGER_LEVEL);
  node.get(DESCRIPTION).set(bundle.getString("String_Node_Str"));
  final ModelNode reqProps=node.get(REQUEST_PROPERTIES);
  addLoggerNameParam(reqProps,bundle);
  final ModelNode level=reqProps.get(LEVEL_NAME);
  level.get(DESCRIPTION).set(bundle.getString(LOGGING + "String_Node_Str" + LEVEL_NAME));
  level.get(TYPE).set(ModelType.STRING);
  level.get(REQUIRED).set(false);
  node.get(REPLY_PROPERTIES).setEmptyObject();
  return node;
}
Program: 167874
Project: 167874
Buggy source:
public static ModelNode getGetParentLoggerNameDescription(Locale locale){
  final ResourceBundle bundle=getResourceBundle(locale);
  final ModelNode node=new ModelNode();
  node.get(DESCRIPTION).set(bundle.getString("String_Node_Str"));
  addLoggerNameParam(node.get(REQUEST_PROPERTIES),bundle);
  node.get(REPLY_PROPERTIES);
  return node;
}

Fixed version (ground truth):
public static ModelNode getGetParentLoggerNameDescription(Locale locale){
  final ResourceBundle bundle=getResourceBundle(locale);
  final ModelNode node=new ModelNode();
  node.get(OPERATION_NAME).set(GET_PARENT_LOGGER_NAME);
  node.get(DESCRIPTION).set(bundle.getString("String_Node_Str"));
  addLoggerNameParam(node.get(REQUEST_PROPERTIES),bundle);
  node.get(REPLY_PROPERTIES);
  node.get(REPLY_PROPERTIES,TYPE).set(ModelType.STRING);
  node.get(REPLY_PROPERTIES,NILLABLE).set(true);
  return node;
}
Program: 167875
Project: 167875
Buggy source:
public static ModelNode getBufferPoolRootResource(Locale locale){
  final ResourceBundle bundle=getResourceBundle(locale);
  final ModelNode node=new ModelNode();
  node.get(DESCRIPTION).set(bundle.getString("String_Node_Str"));
  node.get(ATTRIBUTES).setEmptyObject();
  node.get(OPERATIONS).setEmptyObject();
  node.get(CHILDREN,NAME,DESCRIPTION).set(bundle.getString("String_Node_Str"));
  node.get(CHILDREN,NAME,MIN_OCCURS).set(0);
  node.get(CHILDREN,NAME,MODEL_DESCRIPTION);
  return node;
}

Fixed version (ground truth):
public static ModelNode getBufferPoolRootResource(Locale locale){
  final ResourceBundle bundle=getResourceBundle(locale);
  final ModelNode node=new ModelNode();
  node.get(DESCRIPTION).set(bundle.getString("String_Node_Str"));
  final ModelNode attrs=node.get(ATTRIBUTES);
  populateAttribute(attrs,NAME,ModelType.STRING,false,null);
  attrs.get(NAME,DESCRIPTION).set(bundle.getString("String_Node_Str"));
  node.get(OPERATIONS).setEmptyObject();
  node.get(CHILDREN,NAME,DESCRIPTION).set(bundle.getString("String_Node_Str"));
  node.get(CHILDREN,NAME,MIN_OCCURS).set(0);
  node.get(CHILDREN,NAME,MODEL_DESCRIPTION);
  return node;
}
Program: 167876
Project: 167876
Buggy source:
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  final ModelNode result=context.getResult();
  for (  String attribute : PlatformMBeanConstants.RUNTIME_READ_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      RuntimeMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.RUNTIME_METRICS) {
    final ModelNode store=result.get(attribute);
    try {
      RuntimeMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  context.completeStep();
}

Fixed version (ground truth):
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  final ModelNode result=context.getResult();
  for (  String attribute : PlatformMBeanConstants.RUNTIME_READ_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      RuntimeMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.RUNTIME_METRICS) {
    final ModelNode store=result.get(attribute);
    try {
      RuntimeMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  if (PlatformMBeanUtil.JVM_MAJOR_VERSION > 6) {
    final ModelNode store=result.get(PlatformMBeanConstants.OBJECT_NAME);
    RuntimeMXBeanAttributeHandler.storeResult(PlatformMBeanConstants.OBJECT_NAME,store);
  }
  context.completeStep();
}
Program: 167877
Project: 167877
Buggy source:
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  final ModelNode result=context.getResult();
  for (  String attribute : PlatformMBeanConstants.THREADING_READ_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      ThreadMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.THREADING_READ_WRITE_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      ThreadMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.THREADING_METRICS) {
    final ModelNode store=result.get(attribute);
    try {
      ThreadMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  context.completeStep();
}

Fixed version (ground truth):
@Override public void execute(OperationContext context,ModelNode operation) throws OperationFailedException {
  final ModelNode result=context.getResult();
  for (  String attribute : PlatformMBeanConstants.THREADING_READ_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      ThreadMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.THREADING_READ_WRITE_ATTRIBUTES) {
    final ModelNode store=result.get(attribute);
    try {
      ThreadMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  for (  String attribute : PlatformMBeanConstants.THREADING_METRICS) {
    final ModelNode store=result.get(attribute);
    try {
      ThreadMXBeanAttributeHandler.storeResult(attribute,store);
    }
 catch (    SecurityException ignored) {
    }
catch (    UnsupportedOperationException ignored) {
    }
  }
  if (PlatformMBeanUtil.JVM_MAJOR_VERSION > 6) {
    final ModelNode store=result.get(PlatformMBeanConstants.OBJECT_NAME);
    ThreadMXBeanAttributeHandler.storeResult(PlatformMBeanConstants.OBJECT_NAME,store);
  }
  context.completeStep();
}
Program: 167880
Project: 167880
Buggy source:
/** 
 * The main method.
 * @param args the command-line arguments
 */
public static void main(String[] args) throws IOException {
  MDC.put("String_Node_Str","String_Node_Str");
  final InputStream in=System.in;
  final PrintStream out=System.out;
  final PrintStream err=System.err;
  final byte[] authKey=new byte[16];
  try {
    StreamUtils.readFully(System.in,authKey);
  }
 catch (  IOException e) {
    System.err.printf("String_Node_Str",e);
    System.exit(1);
    return;
  }
  StdioContext.install();
  final StdioContext context=StdioContext.create(new NullInputStream(),new LoggingOutputStream(Logger.getLogger("String_Node_Str"),Level.INFO),new LoggingOutputStream(Logger.getLogger("String_Node_Str"),Level.ERROR));
  StdioContext.setStdioContextSelector(new SimpleStdioContextSelector(context));
  create(args,in,out,err,authKey);
  while (in.read() != -1) {
  }
  System.exit(0);
}

Fixed version (ground truth):
/** 
 * The main method.
 * @param args the command-line arguments
 */
public static void main(String[] args) throws IOException {
  MDC.put("String_Node_Str","String_Node_Str");
  final InputStream in=System.in;
  final PrintStream out=System.out;
  final PrintStream err=System.err;
  final byte[] authKey=new byte[16];
  try {
    StreamUtils.readFully(System.in,authKey);
  }
 catch (  IOException e) {
    System.err.printf("String_Node_Str",e);
    System.exit(1);
    return;
  }
  try {
    Class.forName(ConsoleHandler.class.getName(),true,ConsoleHandler.class.getClassLoader());
  }
 catch (  Throwable ignored) {
  }
  StdioContext.install();
  final StdioContext context=StdioContext.create(new NullInputStream(),new LoggingOutputStream(Logger.getLogger("String_Node_Str"),Level.INFO),new LoggingOutputStream(Logger.getLogger("String_Node_Str"),Level.ERROR));
  StdioContext.setStdioContextSelector(new SimpleStdioContextSelector(context));
  create(args,in,out,err,authKey);
  while (in.read() != -1) {
  }
  System.exit(0);
}
Program: 167882
Project: 167882
Buggy source:
/** 
 * The main method.
 * @param args the command-line arguments
 */
public static void main(String[] args){
  SecurityActions.setSystemProperty("String_Node_Str","String_Node_Str");
  new BridgeRepositorySelector().start();
  StdioContext.install();
  final StdioContext context=StdioContext.create(new NullInputStream(),new LoggingOutputStream(Logger.getLogger("String_Node_Str"),Level.INFO),new LoggingOutputStream(Logger.getLogger("String_Node_Str"),Level.ERROR));
  StdioContext.setStdioContextSelector(new SimpleStdioContextSelector(context));
  try {
    Module.registerURLStreamHandlerFactoryModule(Module.getBootModuleLoader().loadModule(ModuleIdentifier.create("String_Node_Str")));
    ServerEnvironment serverEnvironment=determineEnvironment(args,new Properties(SecurityActions.getSystemProperties()),SecurityActions.getSystemEnvironment(),ServerEnvironment.LaunchType.STANDALONE);
    if (serverEnvironment == null) {
      abort(null);
    }
 else {
      final Bootstrap bootstrap=Bootstrap.Factory.newInstance();
      final Bootstrap.Configuration configuration=new Bootstrap.Configuration();
      configuration.setServerEnvironment(serverEnvironment);
      configuration.setModuleLoader(Module.getBootModuleLoader());
      bootstrap.bootstrap(configuration,Collections.<ServiceActivator>emptyList()).get();
      return;
    }
  }
 catch (  Throwable t) {
    abort(t);
  }
}

Fixed version (ground truth):
/** 
 * The main method.
 * @param args the command-line arguments
 */
public static void main(String[] args){
  SecurityActions.setSystemProperty("String_Node_Str","String_Node_Str");
  new BridgeRepositorySelector().start();
  try {
    Class.forName(ConsoleHandler.class.getName(),true,ConsoleHandler.class.getClassLoader());
  }
 catch (  Throwable ignored) {
  }
  StdioContext.install();
  final StdioContext context=StdioContext.create(new NullInputStream(),new LoggingOutputStream(Logger.getLogger("String_Node_Str"),Level.INFO),new LoggingOutputStream(Logger.getLogger("String_Node_Str"),Level.ERROR));
  StdioContext.setStdioContextSelector(new SimpleStdioContextSelector(context));
  try {
    Module.registerURLStreamHandlerFactoryModule(Module.getBootModuleLoader().loadModule(ModuleIdentifier.create("String_Node_Str")));
    ServerEnvironment serverEnvironment=determineEnvironment(args,new Properties(SecurityActions.getSystemProperties()),SecurityActions.getSystemEnvironment(),ServerEnvironment.LaunchType.STANDALONE);
    if (serverEnvironment == null) {
      abort(null);
    }
 else {
      final Bootstrap bootstrap=Bootstrap.Factory.newInstance();
      final Bootstrap.Configuration configuration=new Bootstrap.Configuration();
      configuration.setServerEnvironment(serverEnvironment);
      configuration.setModuleLoader(Module.getBootModuleLoader());
      bootstrap.bootstrap(configuration,Collections.<ServiceActivator>emptyList()).get();
      return;
    }
  }
 catch (  Throwable t) {
    abort(t);
  }
}
Program: 167883
Project: 167883
Buggy source:
@Override protected synchronized ManagementClientChannelStrategy getClientChannelStrategy() throws URISyntaxException, IOException {
  if (closed) {
    throw new IllegalStateException(String.format("String_Node_Str",ModelControllerClient.class.getSimpleName()));
  }
  if (strategy == null) {
    this.endpoint=Remoting.createEndpoint("String_Node_Str",executor,OptionMap.EMPTY);
    Xnio xnio=Xnio.getInstance();
    endpoint.addConnectionProvider("String_Node_Str",new RemoteConnectionProviderFactory(xnio),OptionMap.create(Options.SSL_ENABLED,false));
    strategy=ManagementClientChannelStrategy.create(hostName,port,endpoint,this,callbackHandler);
  }
  return strategy;
}

Fixed version (ground truth):
@Override protected synchronized ManagementClientChannelStrategy getClientChannelStrategy() throws URISyntaxException, IOException {
  if (closed) {
    throw new IllegalStateException(String.format("String_Node_Str",ModelControllerClient.class.getSimpleName()));
  }
  if (strategy == null) {
    endpoint=Remoting.createEndpoint("String_Node_Str",OptionMap.EMPTY);
    endpoint.addConnectionProvider("String_Node_Str",new RemoteConnectionProviderFactory(),OptionMap.create(Options.SSL_ENABLED,Boolean.FALSE));
    strategy=ManagementClientChannelStrategy.create(hostName,port,endpoint,this,callbackHandler);
  }
  return strategy;
}
Program: 167887
Project: 167887
Buggy source:
/** 
 * Checks the   {@link ModelNode model}, represented my the model parameter, to see if the handler already exists.
 * @param handlerName      the name of the handler.
 * @param handlerAttribute the handler attribute definition.
 * @param model            the model.
 * @return {@code true} if the handler already exists in the handler listing.
 * @throws OperationFailedException if an operation failure occurs.
 */
protected boolean handlerExists(final String handlerName,final AttributeDefinition handlerAttribute,final ModelNode model) throws OperationFailedException {
  final ModelNode assignedHandlers=model.get(handlerAttribute.getName());
  return (assignedHandlers.isDefined() && assignedHandlers.asList().contains(model.get(handlerName)));
}

Fixed version (ground truth):
/** 
 * Checks the   {@link ModelNode model}, represented my the model parameter, to see if the handler already exists.
 * @param handlerName      the name of the handler.
 * @param handlerAttribute the handler attribute definition.
 * @param model            the model.
 * @return {@code true} if the handler already exists in the handler listing.
 * @throws OperationFailedException if an operation failure occurs.
 */
protected boolean handlerExists(final String handlerName,final AttributeDefinition handlerAttribute,final ModelNode model) throws OperationFailedException {
  final ModelNode assignedHandlers=model.get(handlerAttribute.getName());
  if (assignedHandlers.isDefined()) {
    final List<ModelNode> handlers=assignedHandlers.asList();
    for (    ModelNode handler : handlers) {
      if (handler.asString().equals(handlerName)) {
        return true;
      }
    }
  }
  return false;
}