nus-yam/ex-repair huggingface dataset:
Program: 167792
Project: 167792
Buggy source:
protected void recoverServices(OperationContext context,ModelNode operation,ModelNode model) throws OperationFailedException {
  PathAddress address=PathAddress.pathAddress(operation.require(OP_ADDR));
  String name=address.getLastElement().getValue();
  ServiceName svcName=SocketBinding.JBOSS_BINDING_NAME.append(name);
  ServiceRegistry registry=context.getServiceRegistry(true);
  ServiceController<?> controller=registry.getService(svcName);
  if (controller != null) {
    context.revertReloadRequired();
  }
 else {
    try {
      BindingAddHandler.installBindingService(context,model,name);
    }
 catch (    UnknownHostException e) {
      throw new OperationFailedException(new ModelNode().set(e.toString()));
    }
  }
}

Fixed version (ground truth):
protected void recoverServices(OperationContext context,ModelNode operation,ModelNode model) throws OperationFailedException {
  PathAddress address=PathAddress.pathAddress(operation.require(OP_ADDR));
  String name=address.getLastElement().getValue();
  ServiceName svcName=SocketBinding.JBOSS_BINDING_NAME.append(name);
  ServiceRegistry registry=context.getServiceRegistry(true);
  ServiceController<?> controller=registry.getService(svcName);
  if (controller != null) {
    context.revertReloadRequired();
  }
 else {
    try {
      BindingAddHandler.installBindingService(context,model,name,null);
    }
 catch (    UnknownHostException e) {
      throw new OperationFailedException(new ModelNode().set(e.toString()));
    }
  }
}
Program: 167796
Project: 167796
Buggy source:
@Override protected void performRuntime(final OperationContext context,final ModelNode operation,final ModelNode model,final ServiceVerificationHandler verificationHandler,final List<ServiceController<?>> newControllers) throws OperationFailedException {
  final PathAddress address=PathAddress.pathAddress(operation.get(OP_ADDR));
  final String name=address.getLastElement().getValue();
  final String deploymentOverlay=address.getElement(address.size() - 2).getValue();
  final Boolean regularExpression=DeploymentOverlayDeploymentDefinition.REGULAR_EXPRESSION.resolveModelAttribute(context,model).asBoolean();
  installServices(context,verificationHandler,newControllers,name,deploymentOverlay,regularExpression,priority);
}

Fixed version (ground truth):
@Override protected void performRuntime(final OperationContext context,final ModelNode operation,final ModelNode model,final ServiceVerificationHandler verificationHandler,final List<ServiceController<?>> newControllers) throws OperationFailedException {
  final PathAddress address=PathAddress.pathAddress(operation.get(OP_ADDR));
  final String name=address.getLastElement().getValue();
  final String deploymentOverlay=address.getElement(address.size() - 2).getValue();
  installServices(context,verificationHandler,newControllers,name,deploymentOverlay,priority);
}
Program: 167797
Project: 167797
Buggy source:
static void installServices(final OperationContext context,final ServiceVerificationHandler verificationHandler,final List<ServiceController<?>> newControllers,final String name,final String deploymentOverlay,final boolean regularExpression,final DeploymentOverlayPriority priority){
  final DeploymentOverlayLinkService service=new DeploymentOverlayLinkService(name,regularExpression,priority);
  final ServiceName serviceName=DeploymentOverlayLinkService.SERVICE_NAME.append(deploymentOverlay).append(name);
  ServiceBuilder<DeploymentOverlayLinkService> builder=context.getServiceTarget().addService(serviceName,service).addDependency(DeploymentOverlayIndexService.SERVICE_NAME,DeploymentOverlayIndexService.class,service.getDeploymentOverlayIndexServiceInjectedValue()).addDependency(DeploymentOverlayService.SERVICE_NAME.append(deploymentOverlay),DeploymentOverlayService.class,service.getDeploymentOverlayServiceInjectedValue());
  if (verificationHandler != null) {
    builder.addListener(verificationHandler);
  }
  final ServiceController<DeploymentOverlayLinkService> controller=builder.install();
  if (newControllers != null) {
    newControllers.add(controller);
  }
}

Fixed version (ground truth):
static void installServices(final OperationContext context,final ServiceVerificationHandler verificationHandler,final List<ServiceController<?>> newControllers,final String name,final String deploymentOverlay,final DeploymentOverlayPriority priority){
  final DeploymentOverlayLinkService service=new DeploymentOverlayLinkService(name,priority);
  final ServiceName serviceName=DeploymentOverlayLinkService.SERVICE_NAME.append(deploymentOverlay).append(name);
  ServiceBuilder<DeploymentOverlayLinkService> builder=context.getServiceTarget().addService(serviceName,service).addDependency(DeploymentOverlayIndexService.SERVICE_NAME,DeploymentOverlayIndexService.class,service.getDeploymentOverlayIndexServiceInjectedValue()).addDependency(DeploymentOverlayService.SERVICE_NAME.append(deploymentOverlay),DeploymentOverlayService.class,service.getDeploymentOverlayServiceInjectedValue());
  if (verificationHandler != null) {
    builder.addListener(verificationHandler);
  }
  final ServiceController<DeploymentOverlayLinkService> controller=builder.install();
  if (newControllers != null) {
    newControllers.add(controller);
  }
}
Program: 167798
Project: 167798
Buggy source:
@Override protected void recoverServices(final OperationContext context,final ModelNode operation,final ModelNode model) throws OperationFailedException {
  final PathAddress address=PathAddress.pathAddress(operation.get(OP_ADDR));
  final String name=address.getLastElement().getValue();
  final String deploymentOverlay=address.getElement(address.size() - 2).getValue();
  final Boolean regularExpression=DeploymentOverlayDeploymentDefinition.REGULAR_EXPRESSION.resolveModelAttribute(context,model).asBoolean();
  DeploymentOverlayDeploymentAdd.installServices(context,null,null,name,deploymentOverlay,regularExpression,priority);
}

Fixed version (ground truth):
@Override protected void recoverServices(final OperationContext context,final ModelNode operation,final ModelNode model) throws OperationFailedException {
  final PathAddress address=PathAddress.pathAddress(operation.get(OP_ADDR));
  final String name=address.getLastElement().getValue();
  final String deploymentOverlay=address.getElement(address.size() - 2).getValue();
  DeploymentOverlayDeploymentAdd.installServices(context,null,null,name,deploymentOverlay,priority);
}
Program: 167799
Project: 167799
Buggy source:
@Override public int compare(final DeploymentOverlayLinkService o1,final DeploymentOverlayLinkService o2){
  int res=o1.getPriority().ordinal() - o2.getPriority().ordinal();
  if (res != 0) {
    return res;
  }
  if (o2.isRegex() && !o1.isRegex()) {
    return -1;
  }
 else   if (o1.isRegex() && !o2.isRegex()) {
    return 1;
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compare(final DeploymentOverlayLinkService o1,final DeploymentOverlayLinkService o2){
  int res=o1.getPriority().ordinal() - o2.getPriority().ordinal();
  if (res != 0) {
    return res;
  }
  if (o2.isWildcard() && !o1.isWildcard()) {
    return -1;
  }
 else   if (o1.isWildcard() && !o2.isWildcard()) {
    return 1;
  }
  return 0;
}
Program: 167800
Project: 167800
Buggy source:
/** 
 * Returns all the deployment overlays that should be applied to a deployment, with the highest priority first.
 * @param deploymentName The deployment name
 * @return
 */
public synchronized List<DeploymentOverlayService> getOverrides(final String deploymentName){
  final List<DeploymentOverlayLinkService> matched=new ArrayList<DeploymentOverlayLinkService>();
  for (  final DeploymentOverlayLinkService service : services) {
    if (service.isRegex()) {
      if (service.getPattern().matcher(deploymentName).matches()) {
        matched.add(service);
      }
    }
 else     if (service.getDeployment().equals(deploymentName)) {
      matched.add(service);
    }
  }
  Collections.sort(matched,new Comparator<DeploymentOverlayLinkService>(){
    @Override public int compare(    final DeploymentOverlayLinkService o1,    final DeploymentOverlayLinkService o2){
      int res=o1.getPriority().ordinal() - o2.getPriority().ordinal();
      if (res != 0) {
        return res;
      }
      if (o2.isRegex() && !o1.isRegex()) {
        return -1;
      }
 else       if (o1.isRegex() && !o2.isRegex()) {
        return 1;
      }
      return 0;
    }
  }
);
  final List<DeploymentOverlayService> ret=new ArrayList<DeploymentOverlayService>();
  for (  final DeploymentOverlayLinkService i : matched) {
    ret.add(i.getDeploymentOverlayServiceInjectedValue().getValue());
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Returns all the deployment overlays that should be applied to a deployment, with the highest priority first.
 * @param deploymentName The deployment name
 * @return
 */
public synchronized List<DeploymentOverlayService> getOverrides(final String deploymentName){
  final List<DeploymentOverlayLinkService> matched=new ArrayList<DeploymentOverlayLinkService>();
  for (  final DeploymentOverlayLinkService service : services) {
    if (service.isWildcard()) {
      if (service.getPattern().matcher(deploymentName).matches()) {
        matched.add(service);
      }
    }
 else     if (service.getDeployment().equals(deploymentName)) {
      matched.add(service);
    }
  }
  Collections.sort(matched,new Comparator<DeploymentOverlayLinkService>(){
    @Override public int compare(    final DeploymentOverlayLinkService o1,    final DeploymentOverlayLinkService o2){
      int res=o1.getPriority().ordinal() - o2.getPriority().ordinal();
      if (res != 0) {
        return res;
      }
      if (o2.isWildcard() && !o1.isWildcard()) {
        return -1;
      }
 else       if (o1.isWildcard() && !o2.isWildcard()) {
        return 1;
      }
      return 0;
    }
  }
);
  final List<DeploymentOverlayService> ret=new ArrayList<DeploymentOverlayService>();
  for (  final DeploymentOverlayLinkService i : matched) {
    ret.add(i.getDeploymentOverlayServiceInjectedValue().getValue());
  }
  return ret;
}
Program: 167801
Project: 167801
Buggy source:
public DeploymentOverlayLinkService(final String deployment,final boolean regex,final DeploymentOverlayPriority priority){
  this.deployment=deployment;
  this.priority=priority;
  this.regex=regex;
  if (regex) {
    this.pattern=Pattern.compile(wildcardToJavaRegexp(deployment));
  }
 else {
    this.pattern=null;
  }
}

Fixed version (ground truth):
public DeploymentOverlayLinkService(final String deployment,final DeploymentOverlayPriority priority){
  this.deployment=deployment;
  this.priority=priority;
  this.pattern=Pattern.compile(wildcardToJavaRegexp(deployment));
  wildcard=deployment.contains("String_Node_Str") || deployment.contains("String_Node_Str");
}
Program: 167802
Project: 167802
Buggy source:
protected void parseDeploymentOverlay(final XMLExtendedStreamReader reader,final ModelNode baseAddress,final List<ModelNode> list) throws XMLStreamException {
  final EnumSet<Attribute> required=EnumSet.of(Attribute.NAME);
  String name=null;
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    requireNoNamespaceAttribute(reader,i);
    final String value=reader.getAttributeValue(i);
    final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
    required.remove(attribute);
switch (attribute) {
case NAME:
{
        name=value;
        break;
      }
default :
    throw unexpectedAttribute(reader,i);
}
}
if (required.size() > 0) {
throw missingRequired(reader,required);
}
ModelNode addr=baseAddress.clone();
addr.add(DEPLOYMENT_OVERLAY,name);
final ModelNode op=new ModelNode();
op.get(OP).set(ADD);
op.get(OP_ADDR).set(addr);
list.add(op);
while (reader.nextTag() != END_ELEMENT) {
final Element element=Element.forName(reader.getLocalName());
switch (element) {
case CONTENT:
  parseContentOverride(name,reader,baseAddress,list);
break;
case DEPLOYMENT:
parseDeploymentOverlayDeployment(name,reader,baseAddress,list);
break;
default :
throw unexpectedElement(reader);
}
}
}

Fixed version (ground truth):
protected void parseDeploymentOverlay(final XMLExtendedStreamReader reader,final ModelNode baseAddress,final List<ModelNode> list,final boolean allowContent,final boolean allowDeployment) throws XMLStreamException {
  final EnumSet<Attribute> required=EnumSet.of(Attribute.NAME);
  String name=null;
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    requireNoNamespaceAttribute(reader,i);
    final String value=reader.getAttributeValue(i);
    final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
    required.remove(attribute);
switch (attribute) {
case NAME:
{
        name=value;
        break;
      }
default :
    throw unexpectedAttribute(reader,i);
}
}
if (required.size() > 0) {
throw missingRequired(reader,required);
}
ModelNode addr=baseAddress.clone();
addr.add(DEPLOYMENT_OVERLAY,name);
final ModelNode op=new ModelNode();
op.get(OP).set(ADD);
op.get(OP_ADDR).set(addr);
list.add(op);
while (reader.nextTag() != END_ELEMENT) {
final Element element=Element.forName(reader.getLocalName());
if (element == Element.CONTENT && allowContent) {
  parseContentOverride(name,reader,baseAddress,list);
}
 else if (element == Element.DEPLOYMENT && allowDeployment) {
  parseDeploymentOverlayDeployment(name,reader,baseAddress,list);
}
 else {
  throw unexpectedElement(reader);
}
}
}
Program: 167803
Project: 167803
Buggy source:
protected void parseDeploymentOverlayDeployment(final String name,final XMLExtendedStreamReader reader,final ModelNode baseAddress,final List<ModelNode> list) throws XMLStreamException {
  final EnumSet<Attribute> required=EnumSet.of(Attribute.NAME);
  String depName=null;
  boolean regEx=false;
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    requireNoNamespaceAttribute(reader,i);
    final String value=reader.getAttributeValue(i);
    final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
    required.remove(attribute);
switch (attribute) {
case NAME:
{
        depName=value;
        break;
      }
case REGULAR_EXPRESSION:
{
      regEx=Boolean.parseBoolean(value);
      break;
    }
default :
  throw unexpectedAttribute(reader,i);
}
}
requireNoContent(reader);
if (required.size() > 0) {
throw missingRequired(reader,required);
}
final ModelNode address=baseAddress.clone();
address.add(DEPLOYMENT_OVERLAY,name);
address.add(DEPLOYMENT,depName);
final ModelNode op=new ModelNode();
op.get(OP).set(ADD);
op.get(OP_ADDR).set(address);
op.get(REGULAR_EXPRESSION).set(regEx);
list.add(op);
}

Fixed version (ground truth):
protected void parseDeploymentOverlayDeployment(final String name,final XMLExtendedStreamReader reader,final ModelNode baseAddress,final List<ModelNode> list) throws XMLStreamException {
  final EnumSet<Attribute> required=EnumSet.of(Attribute.NAME);
  String depName=null;
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    requireNoNamespaceAttribute(reader,i);
    final String value=reader.getAttributeValue(i);
    final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
    required.remove(attribute);
switch (attribute) {
case NAME:
{
        depName=value;
        break;
      }
default :
    throw unexpectedAttribute(reader,i);
}
}
requireNoContent(reader);
if (required.size() > 0) {
throw missingRequired(reader,required);
}
final ModelNode address=baseAddress.clone();
address.add(DEPLOYMENT_OVERLAY,name);
address.add(DEPLOYMENT,depName);
final ModelNode op=new ModelNode();
op.get(OP).set(ADD);
op.get(OP_ADDR).set(address);
list.add(op);
}
Program: 167805
Project: 167805
Buggy source:
protected void parseDeploymentOverlays(final XMLExtendedStreamReader reader,final Namespace namespace,final ModelNode baseAddress,final List<ModelNode> list) throws XMLStreamException {
  requireNoAttributes(reader);
  while (reader.nextTag() != END_ELEMENT) {
    requireNamespace(reader,namespace);
    final Element element=Element.forName(reader.getLocalName());
switch (element) {
case DEPLOYMENT_OVERLAY:
      parseDeploymentOverlay(reader,baseAddress,list);
    break;
default :
  throw unexpectedElement(reader);
}
}
}

Fixed version (ground truth):
protected void parseDeploymentOverlays(final XMLExtendedStreamReader reader,final Namespace namespace,final ModelNode baseAddress,final List<ModelNode> list,final boolean allowContent,final boolean allowDeployment) throws XMLStreamException {
  requireNoAttributes(reader);
  while (reader.nextTag() != END_ELEMENT) {
    requireNamespace(reader,namespace);
    final Element element=Element.forName(reader.getLocalName());
switch (element) {
case DEPLOYMENT_OVERLAY:
      parseDeploymentOverlay(reader,baseAddress,list,allowContent,allowDeployment);
    break;
default :
  throw unexpectedElement(reader);
}
}
}
Program: 167807
Project: 167807
Buggy source:
@Override public ModelNode transform(final OperationContext context,final ModelNode operation){
  if (operation.get(OP).asString().equals(COMPOSITE)) {
    ModelNode ret=operation.clone();
    final List<ModelNode> list=new ArrayList<ModelNode>(ret.get(STEPS).asList());
    ListIterator<ModelNode> it=list.listIterator();
    while (it.hasNext()) {
      final ModelNode subOperation=it.next();
      transform(context,subOperation);
    }
    ret.get(STEPS).set(list);
    return ret;
  }
 else {
    if (matches(operation,newOperation)) {
      return newOperation;
    }
 else {
      return operation;
    }
  }
}

Fixed version (ground truth):
@Override public ModelNode transform(final OperationContext context,final ModelNode operation){
  if (operation.get(OP).asString().equals(COMPOSITE)) {
    ModelNode ret=operation.clone();
    final List<ModelNode> list=new ArrayList<ModelNode>();
    ListIterator<ModelNode> it=ret.get(STEPS).asList().listIterator();
    while (it.hasNext()) {
      final ModelNode subOperation=it.next();
      list.add(transform(context,subOperation));
    }
    ret.get(STEPS).set(list);
    return ret;
  }
 else {
    if (matches(operation,newOperation)) {
      return newOperation;
    }
 else {
      return operation;
    }
  }
}
Program: 167808
Project: 167808
Buggy source:
/** 
 * Create the metadata which gets send to the DC when registering.
 * @param hostInfo the local host info
 * @param productConfig the product config
 * @param ignoredResourceRegistry registry of ignored resources
 * @return the host info
 */
public static ModelNode createLocalHostHostInfo(final LocalHostControllerInfo hostInfo,final ProductConfig productConfig,final IgnoredDomainResourceRegistry ignoredResourceRegistry){
  final ModelNode info=new ModelNode();
  info.get(NAME).set(hostInfo.getLocalHostName());
  info.get(RELEASE_VERSION).set(Version.AS_VERSION);
  info.get(RELEASE_CODENAME).set(Version.AS_RELEASE_CODENAME);
  info.get(MANAGEMENT_MAJOR_VERSION).set(Version.MANAGEMENT_MAJOR_VERSION);
  info.get(MANAGEMENT_MINOR_VERSION).set(Version.MANAGEMENT_MINOR_VERSION);
  info.get(MANAGEMENT_MICRO_VERSION).set(Version.MANAGEMENT_MICRO_VERSION);
  final String productName=productConfig.getProductName();
  final String productVersion=productConfig.getProductVersion();
  if (productName != null) {
    info.get(PRODUCT_NAME).set(productName);
  }
  if (productVersion != null) {
    info.get(PRODUCT_VERSION).set(productVersion);
  }
  ModelNode ignoredModel=Resource.Tools.readModel(ignoredResourceRegistry.getRootResource());
  info.get(IGNORED_RESOURCES).set(ignoredModel);
  return info;
}

Fixed version (ground truth):
/** 
 * Create the metadata which gets send to the DC when registering.
 * @param hostInfo the local host info
 * @param productConfig the product config
 * @param ignoredResourceRegistry registry of ignored resources
 * @return the host info
 */
public static ModelNode createLocalHostHostInfo(final LocalHostControllerInfo hostInfo,final ProductConfig productConfig,final IgnoredDomainResourceRegistry ignoredResourceRegistry){
  final ModelNode info=new ModelNode();
  info.get(NAME).set(hostInfo.getLocalHostName());
  info.get(RELEASE_VERSION).set(Version.AS_VERSION);
  info.get(RELEASE_CODENAME).set(Version.AS_RELEASE_CODENAME);
  info.get(MANAGEMENT_MAJOR_VERSION).set(Version.MANAGEMENT_MAJOR_VERSION);
  info.get(MANAGEMENT_MINOR_VERSION).set(Version.MANAGEMENT_MINOR_VERSION);
  info.get(MANAGEMENT_MICRO_VERSION).set(Version.MANAGEMENT_MICRO_VERSION);
  final String productName=productConfig.getProductName();
  final String productVersion=productConfig.getProductVersion();
  if (productName != null) {
    info.get(PRODUCT_NAME).set(productName);
  }
  if (productVersion != null) {
    info.get(PRODUCT_VERSION).set(productVersion);
  }
  ModelNode ignoredModel=ignoredResourceRegistry.getIgnoredResourcesAsModel();
  if (ignoredModel.hasDefined(IGNORED_RESOURCE_TYPE)) {
    info.get(IGNORED_RESOURCES).set(ignoredModel.require(IGNORED_RESOURCE_TYPE));
  }
  return info;
}
Program: 167809
Project: 167809
Buggy source:
public ProductConfig(ModuleLoader loader,String home){
  String productName=null;
  String productVersion=null;
  String consoleSlot=null;
  try {
    FileReader reader=new FileReader(home + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str");
    Properties props=new Properties();
    props.load(reader);
    String slot=(String)props.get("String_Node_Str");
    if (slot != null) {
      Module module=loader.loadModule(ModuleIdentifier.create("String_Node_Str",slot));
      InputStream stream=module.getClassLoader().getResourceAsStream("String_Node_Str");
      Manifest manifest=null;
      if (stream != null) {
        manifest=new Manifest(stream);
      }
      if (manifest != null) {
        productName=manifest.getMainAttributes().getValue("String_Node_Str");
        productVersion=manifest.getMainAttributes().getValue("String_Node_Str");
        consoleSlot=manifest.getMainAttributes().getValue("String_Node_Str");
      }
    }
  }
 catch (  Exception e) {
  }
  name=productName;
  version=productVersion;
  this.consoleSlot=consoleSlot;
}

Fixed version (ground truth):
/** 
 * Solely for use in unit testing 
 */
public ProductConfig(final String productName,final String productVersion,final String consoleSlot){
  this.name=productName;
  this.version=productVersion;
  this.consoleSlot=consoleSlot;
}
Program: 167812
Project: 167812
Buggy source:
/** 
 * Instructions for the   {@link org.jboss.as.server.CommandLineArgument#DEBUG} command line argument.
 * @return the message.
 */
@Message(id=Message.NONE,value="String_Node_Str") String argDebugPort();

Fixed version (ground truth):
/** 
 * Instructions for the   {@link CommandLineConstants#DEBUG} command line argument.
 * @return the message.
 */
@Message(id=Message.NONE,value="String_Node_Str") String argDebugPort();
Program: 167816
Project: 167816
Buggy source:
static void installServices(final OperationContext context,final ServiceVerificationHandler verificationHandler,final List<ServiceController<?>> newControllers,final String name,final String deploymentOverlay,final boolean regularExpression,final DeploymentOverlayPriority priority){
  final DeploymentOverlayLinkService service=new DeploymentOverlayLinkService(name,regularExpression,priority);
  final ServiceName serviceName=DeploymentOverlayLinkService.SERVICE_NAME.append(name);
  ServiceBuilder<DeploymentOverlayLinkService> builder=context.getServiceTarget().addService(serviceName,service).addDependency(DeploymentOverlayIndexService.SERVICE_NAME,DeploymentOverlayIndexService.class,service.getDeploymentOverlayIndexServiceInjectedValue()).addDependency(DeploymentOverlayService.SERVICE_NAME.append(deploymentOverlay),DeploymentOverlayService.class,service.getDeploymentOverlayServiceInjectedValue());
  if (verificationHandler != null) {
    builder.addListener(verificationHandler);
  }
  final ServiceController<DeploymentOverlayLinkService> controller=builder.install();
  if (newControllers != null) {
    newControllers.add(controller);
  }
}

Fixed version (ground truth):
static void installServices(final OperationContext context,final ServiceVerificationHandler verificationHandler,final List<ServiceController<?>> newControllers,final String name,final String deploymentOverlay,final boolean regularExpression,final DeploymentOverlayPriority priority){
  final DeploymentOverlayLinkService service=new DeploymentOverlayLinkService(name,regularExpression,priority);
  final ServiceName serviceName=DeploymentOverlayLinkService.SERVICE_NAME.append(deploymentOverlay).append(name);
  ServiceBuilder<DeploymentOverlayLinkService> builder=context.getServiceTarget().addService(serviceName,service).addDependency(DeploymentOverlayIndexService.SERVICE_NAME,DeploymentOverlayIndexService.class,service.getDeploymentOverlayIndexServiceInjectedValue()).addDependency(DeploymentOverlayService.SERVICE_NAME.append(deploymentOverlay),DeploymentOverlayService.class,service.getDeploymentOverlayServiceInjectedValue());
  if (verificationHandler != null) {
    builder.addListener(verificationHandler);
  }
  final ServiceController<DeploymentOverlayLinkService> controller=builder.install();
  if (newControllers != null) {
    newControllers.add(controller);
  }
}
Program: 167817
Project: 167817
Buggy source:
@Override protected void performRuntime(final OperationContext context,final ModelNode operation,final ModelNode model) throws OperationFailedException {
  final PathAddress address=PathAddress.pathAddress(operation.get(OP_ADDR));
  final String name=address.getLastElement().getValue();
  final ServiceName serviceName=DeploymentOverlayLinkService.SERVICE_NAME.append(name);
  context.removeService(serviceName);
}

Fixed version (ground truth):
@Override protected void performRuntime(final OperationContext context,final ModelNode operation,final ModelNode model) throws OperationFailedException {
  final PathAddress address=PathAddress.pathAddress(operation.get(OP_ADDR));
  final String name=address.getLastElement().getValue();
  final String deploymentOverlay=address.getElement(address.size() - 2).getValue();
  final ServiceName serviceName=DeploymentOverlayLinkService.SERVICE_NAME.append(deploymentOverlay).append(name);
  context.removeService(serviceName);
}
Program: 167821
Project: 167821
Buggy source:
@Override protected ModelNode transformModel(TransformationContext context,ModelNode model){
  boolean showModel=model.get(CommonAttributes.EXPOSE_MODEL,CommonAttributes.RESOLVED).isDefined();
  ModelNode result=model.clone();
  result.get(CommonAttributes.SHOW_MODEL).set(showModel);
  return result;
}

Fixed version (ground truth):
@Override protected ModelNode transformModel(TransformationContext context,ModelNode model){
  boolean showModel=model.get(CommonAttributes.EXPOSE_MODEL,CommonAttributes.RESOLVED).isDefined();
  ModelNode result=model.clone();
  result.get(CommonAttributes.SHOW_MODEL).set(showModel);
  result.remove(CommonAttributes.EXPOSE_MODEL);
  return result;
}
Program: 167822
Project: 167822
Buggy source:
/** 
 * Marshalls the value from the given   {@code resourceModel} as an xml element, if it{@link #isMarshallable(org.jboss.dmr.ModelNode,boolean) is marshallable}.
 * @param resourceModel the model, a non-null node of {@link org.jboss.dmr.ModelType#OBJECT}.
 * @param writer        stream writer to use for writing the attribute
 * @throws javax.xml.stream.XMLStreamException if thrown by  {@code writer}
 */
public abstract void marshallAsElement(final ModelNode resourceModel,final boolean marshallDefault,final XMLStreamWriter writer) throws XMLStreamException ;

Fixed version (ground truth):
/** 
 * Marshalls the value from the given   {@code resourceModel} as an xml element, if it{@link #isMarshallable(org.jboss.dmr.ModelNode,boolean) is marshallable}.
 * @param resourceModel the model, a non-null node of {@link org.jboss.dmr.ModelType#OBJECT}.
 * @param writer        stream writer to use for writing the attribute
 * @throws javax.xml.stream.XMLStreamException if thrown by  {@code writer}
 */
public void marshallAsElement(final ModelNode resourceModel,final boolean marshallDefault,final XMLStreamWriter writer) throws XMLStreamException {
  throw ControllerMessages.MESSAGES.couldNotMarshalAttributeAsElement(getName());
}
Program: 167824
Project: 167824
Buggy source:
private ContentRepository createContentRepository(){
  return new ContentRepository(){
    @Override public void removeContent(    byte[] hash){
    }
    @Override public boolean hasContent(    byte[] hash){
      return false;
    }
    @Override public VirtualFile getContent(    byte[] hash){
      return null;
    }
    @Override public byte[] addContent(    InputStream stream) throws IOException {
      return null;
    }
  }
;
}

Fixed version (ground truth):
private ContentRepository createContentRepository(){
  return new ContentRepository(){
    @Override public void removeContent(    byte[] hash){
    }
    @Override public boolean hasContent(    byte[] hash){
      return false;
    }
    @Override public VirtualFile getContent(    byte[] hash){
      return null;
    }
    @Override public byte[] addContent(    InputStream stream) throws IOException {
      return null;
    }
    @Override public boolean syncContent(    byte[] hash){
      return false;
    }
  }
;
}
Program: 167825
Project: 167825
Buggy source:
@Message(id=18772,value="String_Node_Str") XMLStreamException duplicateJBossXmlNamespace(String namespace,@Param Location location);

Fixed version (ground truth):
@Message(id=18772,value="String_Node_Str") XMLStreamException duplicateJBossXmlNamespace(QName namespace,@Param Location location);
Program: 167826
Project: 167826
Buggy source:
@Message(id=18773,value="String_Node_Str") DeploymentUnitProcessingException equivilentNamespacesInJBossXml(String key,String s);

Fixed version (ground truth):
@Message(id=18773,value="String_Node_Str") DeploymentUnitProcessingException equivilentNamespacesInJBossXml(QName key,QName s);
Program: 167827
Project: 167827
Buggy source:
@Override public void readElement(final XMLExtendedStreamReader xmlExtendedStreamReader,final JBossAllXmlParseContext jBossXmlParseContext) throws XMLStreamException {
  final Location nsLocation=xmlExtendedStreamReader.getLocation();
  final Object result=parserDescription.getParser().parse(xmlExtendedStreamReader,jBossXmlParseContext.getDeploymentUnit());
  jBossXmlParseContext.addResult(xmlExtendedStreamReader.getNamespaceURI(),result,nsLocation);
}

Fixed version (ground truth):
@Override public void readElement(final XMLExtendedStreamReader xmlExtendedStreamReader,final JBossAllXmlParseContext jBossXmlParseContext) throws XMLStreamException {
  final Location nsLocation=xmlExtendedStreamReader.getLocation();
  final QName elementName=xmlExtendedStreamReader.getName();
  final Object result=parserDescription.getParser().parse(xmlExtendedStreamReader,jBossXmlParseContext.getDeploymentUnit());
  jBossXmlParseContext.addResult(elementName,result,nsLocation);
}
Program: 167829
Project: 167829
Buggy source:
public Map<String,Object> getParseResults(){
  return Collections.unmodifiableMap(parseResults);
}

Fixed version (ground truth):
public Map<QName,Object> getParseResults(){
  return Collections.unmodifiableMap(parseResults);
}
Program: 167830
Project: 167830
Buggy source:
public void addResult(final String namespace,final Object result,final Location location) throws XMLStreamException {
  if (parseResults.containsKey(namespace)) {
    throw ServerMessages.MESSAGES.duplicateJBossXmlNamespace(namespace,location);
  }
  parseResults.put(namespace,result);
}

Fixed version (ground truth):
public void addResult(final QName namespace,final Object result,final Location location) throws XMLStreamException {
  if (parseResults.containsKey(namespace)) {
    throw ServerMessages.MESSAGES.duplicateJBossXmlNamespace(namespace,location);
  }
  parseResults.put(namespace,result);
}
Program: 167831
Project: 167831
Buggy source:
public XmlAuthenticationResourceDefinition(){
  super(PathElement.pathElement(ModelDescriptionConstants.AUTHENTICATION,ModelDescriptionConstants.USER),ManagementDescription.getResourceDescriptionResolver("String_Node_Str"),new SecurityRealmChildAddHandler(true),new SecurityRealmChildRemoveHandler(true),OperationEntry.Flag.RESTART_RESOURCE_SERVICES,OperationEntry.Flag.RESTART_RESOURCE_SERVICES);
}

Fixed version (ground truth):
public XmlAuthenticationResourceDefinition(){
  super(PathElement.pathElement(ModelDescriptionConstants.AUTHENTICATION,ModelDescriptionConstants.USERS),ManagementDescription.getResourceDescriptionResolver("String_Node_Str"),new SecurityRealmChildAddHandler(true),new SecurityRealmChildRemoveHandler(true),OperationEntry.Flag.RESTART_RESOURCE_SERVICES,OperationEntry.Flag.RESTART_RESOURCE_SERVICES);
}
Program: 167833
Project: 167833
Buggy source:
public ConfirmationChoice(ConsoleWrapper theConsole,final String message,final String prompt,final State yesState,final State noState){
  this.theConsole=theConsole;
  this.message=message;
  this.prompt=prompt;
  this.yesState=yesState;
  this.noState=noState;
}

Fixed version (ground truth):
public ConfirmationChoice(ConsoleWrapper theConsole,final String message,final String prompt,final State yesState,final State noState){
  this.theConsole=theConsole;
  this.message=message;
  this.prompt=prompt;
  this.yesState=yesState;
  this.noState=noState;
  if (theConsole.getConsole() == null) {
    throw MESSAGES.noConsoleAvailable();
  }
}
Program: 167834
Project: 167834
Buggy source:
@Override public State execute(){
  if (message != null) {
    theConsole.printf(message);
    theConsole.printf(NEW_LINE);
  }
  theConsole.printf(prompt);
  String temp=theConsole.readLine(SPACE);
switch (convertResponse(temp)) {
case YES:
    return yesState;
case NO:
  return noState;
default :
return new ErrorState(null,MESSAGES.invalidConfirmationResponse(),this);
}
}

Fixed version (ground truth):
@Override public State execute(){
  if (message != null) {
    theConsole.printf(message);
    theConsole.printf(NEW_LINE);
  }
  theConsole.printf(prompt);
  String temp=theConsole.readLine(SPACE);
switch (convertResponse(temp)) {
case YES:
    return yesState;
case NO:
  return noState;
default :
return new ErrorState(theConsole,MESSAGES.invalidConfirmationResponse(),this);
}
}
Program: 167835
Project: 167835
Buggy source:
public DuplicateUserCheckState(final ConsoleWrapper theConsole,final StateValues stateValues){
  this.theConsole=theConsole;
  this.stateValues=stateValues;
}

Fixed version (ground truth):
public DuplicateUserCheckState(final ConsoleWrapper theConsole,final StateValues stateValues){
  this.theConsole=theConsole;
  this.stateValues=stateValues;
  if (theConsole.getConsole() == null) {
    throw MESSAGES.noConsoleAvailable();
  }
}
Program: 167836
Project: 167836
Buggy source:
public ErrorState(ConsoleWrapper theConsole,String errorMessage,State nextState,StateValues stateValues){
  this.errorMessage=errorMessage;
  this.nextState=nextState;
  this.stateValues=stateValues;
  this.theConsole=theConsole;
}

Fixed version (ground truth):
public ErrorState(ConsoleWrapper theConsole,String errorMessage,State nextState,StateValues stateValues){
  this.errorMessage=errorMessage;
  this.nextState=nextState;
  this.stateValues=stateValues;
  this.theConsole=theConsole;
  if (theConsole.getConsole() == null) {
    throw MESSAGES.noConsoleAvailable();
  }
}
Program: 167837
Project: 167837
Buggy source:
public PromptNewUserState(ConsoleWrapper theConsole,final StateValues stateValues){
  this.theConsole=theConsole;
  this.stateValues=stateValues;
}

Fixed version (ground truth):
public PromptNewUserState(ConsoleWrapper theConsole,final StateValues stateValues){
  this.theConsole=theConsole;
  this.stateValues=stateValues;
  if (theConsole.getConsole() == null) {
    throw MESSAGES.noConsoleAvailable();
  }
}
Program: 167838
Project: 167838
Buggy source:
public PromptPasswordState(ConsoleWrapper theConsole,StateValues stateValues){
  this.theConsole=theConsole;
  this.stateValues=stateValues;
}

Fixed version (ground truth):
public PromptPasswordState(ConsoleWrapper theConsole,StateValues stateValues){
  this.theConsole=theConsole;
  this.stateValues=stateValues;
  if (theConsole.getConsole() == null) {
    throw MESSAGES.noConsoleAvailable();
  }
}
Program: 167839
Project: 167839
Buggy source:
@Override public State execute(){
  State continuingState=new WeakCheckState(theConsole,stateValues);
  if (stateValues.isSilentOrNonInteractive() == false) {
    theConsole.printf(MESSAGES.passwordPrompt());
    char[] tempChar=theConsole.readPassword("String_Node_Str");
    if (tempChar == null || tempChar.length == 0) {
      return new ErrorState(theConsole,MESSAGES.noPasswordExiting());
    }
    theConsole.printf(MESSAGES.passwordConfirmationPrompt());
    char[] secondTempChar=theConsole.readPassword("String_Node_Str");
    if (secondTempChar == null) {
      secondTempChar=new char[0];
    }
    if (Arrays.equals(tempChar,secondTempChar) == false) {
      return new ErrorState(null,MESSAGES.passwordMisMatch(),this);
    }
    stateValues.setPassword(tempChar);
    if (!stateValues.isManagement()) {
      theConsole.printf(MESSAGES.rolesPrompt());
      String userRoles=stateValues.getKnownRoles().get(stateValues.getUserName());
      stateValues.setRoles(theConsole.readLine("String_Node_Str",(userRoles == null ? "String_Node_Str" : userRoles)));
    }
  }
  return continuingState;
}

Fixed version (ground truth):
@Override public State execute(){
  State continuingState=new WeakCheckState(theConsole,stateValues);
  if (stateValues.isSilentOrNonInteractive() == false) {
    theConsole.printf(MESSAGES.passwordPrompt());
    char[] tempChar=theConsole.readPassword("String_Node_Str");
    if (tempChar == null || tempChar.length == 0) {
      return new ErrorState(theConsole,MESSAGES.noPasswordExiting());
    }
    theConsole.printf(MESSAGES.passwordConfirmationPrompt());
    char[] secondTempChar=theConsole.readPassword("String_Node_Str");
    if (secondTempChar == null) {
      secondTempChar=new char[0];
    }
    if (Arrays.equals(tempChar,secondTempChar) == false) {
      return new ErrorState(theConsole,MESSAGES.passwordMisMatch(),this);
    }
    stateValues.setPassword(tempChar);
    if (!stateValues.isManagement()) {
      theConsole.printf(MESSAGES.rolesPrompt());
      String userRoles=stateValues.getKnownRoles().get(stateValues.getUserName());
      stateValues.setRoles(theConsole.readLine("String_Node_Str",(userRoles == null ? "String_Node_Str" : userRoles)));
    }
  }
  return continuingState;
}
Program: 167840
Project: 167840
Buggy source:
public PropertyFileFinder(ConsoleWrapper theConsole,final StateValues stateValues){
  this.theConsole=theConsole;
  this.stateValues=stateValues;
}

Fixed version (ground truth):
public PropertyFileFinder(ConsoleWrapper theConsole,final StateValues stateValues){
  this.theConsole=theConsole;
  this.stateValues=stateValues;
  if (theConsole.getConsole() == null) {
    throw MESSAGES.noConsoleAvailable();
  }
}
Program: 167841
Project: 167841
Buggy source:
public PropertyFilePrompt(ConsoleWrapper theConsole){
  this.theConsole=theConsole;
}

Fixed version (ground truth):
public PropertyFilePrompt(ConsoleWrapper theConsole){
  this.theConsole=theConsole;
  if (theConsole.getConsole() == null) {
    throw MESSAGES.noConsoleAvailable();
  }
}
Program: 167842
Project: 167842
Buggy source:
@Override public State execute(){
  StateValues stateValues=new StateValues();
  theConsole.printf(AddPropertiesUser.NEW_LINE);
  theConsole.printf(MESSAGES.filePrompt());
  theConsole.printf(AddPropertiesUser.NEW_LINE);
  while (true) {
    String temp=theConsole.readLine("String_Node_Str");
    if (temp == null) {
      theConsole.printf(AddPropertiesUser.NEW_LINE);
      return null;
    }
    if (temp.length() > 0) {
switch (convertResponse(temp)) {
case MANAGEMENT:
        stateValues.setManagement(true);
      stateValues.setRealm(DEFAULT_MANAGEMENT_REALM);
    return new PropertyFileFinder(theConsole,stateValues);
case APPLICATION:
  stateValues.setManagement(false);
stateValues.setRealm(DEFAULT_APPLICATION_REALM);
return new PropertyFileFinder(theConsole,stateValues);
default :
return new ErrorState(null,MESSAGES.invalidChoiceResponse(),this);
}
}
 else {
stateValues.setManagement(true);
stateValues.setRealm(DEFAULT_MANAGEMENT_REALM);
return new PropertyFileFinder(theConsole,stateValues);
}
}
}

Fixed version (ground truth):
@Override public State execute(){
  StateValues stateValues=new StateValues();
  theConsole.printf(AddPropertiesUser.NEW_LINE);
  theConsole.printf(MESSAGES.filePrompt());
  theConsole.printf(AddPropertiesUser.NEW_LINE);
  while (true) {
    String temp=theConsole.readLine("String_Node_Str");
    if (temp == null) {
      theConsole.printf(AddPropertiesUser.NEW_LINE);
      return null;
    }
    if (temp.length() > 0) {
switch (convertResponse(temp)) {
case MANAGEMENT:
        stateValues.setManagement(true);
      stateValues.setRealm(DEFAULT_MANAGEMENT_REALM);
    return new PropertyFileFinder(theConsole,stateValues);
case APPLICATION:
  stateValues.setManagement(false);
stateValues.setRealm(DEFAULT_APPLICATION_REALM);
return new PropertyFileFinder(theConsole,stateValues);
default :
return new ErrorState(theConsole,MESSAGES.invalidChoiceResponse(),this);
}
}
 else {
stateValues.setManagement(true);
stateValues.setRealm(DEFAULT_MANAGEMENT_REALM);
return new PropertyFileFinder(theConsole,stateValues);
}
}
}
Program: 167843
Project: 167843
Buggy source:
public WeakCheckState(ConsoleWrapper theConsole,StateValues stateValues){
  this.theConsole=theConsole;
  this.stateValues=stateValues;
}

Fixed version (ground truth):
public WeakCheckState(ConsoleWrapper theConsole,StateValues stateValues){
  this.theConsole=theConsole;
  this.stateValues=stateValues;
  if (theConsole.getConsole() == null) {
    throw MESSAGES.noConsoleAvailable();
  }
}
Program: 167844
Project: 167844
Buggy source:
@Override public State execute(){
  State retryState=stateValues.isSilentOrNonInteractive() ? null : new PromptNewUserState(theConsole,stateValues);
  if (Arrays.equals(stateValues.getUserName().toCharArray(),stateValues.getPassword())) {
    return new ErrorState(null,MESSAGES.usernamePasswordMatch(),retryState);
  }
  for (  char currentChar : stateValues.getUserName().toCharArray()) {
    if ((!isValidPunctuation(currentChar)) && (Character.isLetter(currentChar) || Character.isDigit(currentChar)) == false) {
      return new ErrorState(null,MESSAGES.usernameNotAlphaNumeric(),retryState);
    }
  }
  boolean weakUserName=false;
  for (  String current : BAD_USER_NAMES) {
    if (current.equals(stateValues.getUserName().toLowerCase())) {
      weakUserName=true;
      break;
    }
  }
  State continuingState=new DuplicateUserCheckState(theConsole,stateValues);
  if (weakUserName && stateValues.isSilentOrNonInteractive() == false) {
    String message=MESSAGES.usernameEasyToGuess(stateValues.getUserName());
    String prompt=MESSAGES.sureToAddUser(stateValues.getUserName());
    State noState=new PromptNewUserState(theConsole,stateValues);
    return new ConfirmationChoice(theConsole,message,prompt,continuingState,noState);
  }
  return continuingState;
}

Fixed version (ground truth):
@Override public State execute(){
  State retryState=stateValues.isSilentOrNonInteractive() ? null : new PromptNewUserState(theConsole,stateValues);
  if (Arrays.equals(stateValues.getUserName().toCharArray(),stateValues.getPassword())) {
    return new ErrorState(theConsole,MESSAGES.usernamePasswordMatch(),retryState);
  }
  for (  char currentChar : stateValues.getUserName().toCharArray()) {
    if ((!isValidPunctuation(currentChar)) && (Character.isLetter(currentChar) || Character.isDigit(currentChar)) == false) {
      return new ErrorState(theConsole,MESSAGES.usernameNotAlphaNumeric(),retryState);
    }
  }
  boolean weakUserName=false;
  for (  String current : BAD_USER_NAMES) {
    if (current.equals(stateValues.getUserName().toLowerCase())) {
      weakUserName=true;
      break;
    }
  }
  State continuingState=new DuplicateUserCheckState(theConsole,stateValues);
  if (weakUserName && stateValues.isSilentOrNonInteractive() == false) {
    String message=MESSAGES.usernameEasyToGuess(stateValues.getUserName());
    String prompt=MESSAGES.sureToAddUser(stateValues.getUserName());
    State noState=new PromptNewUserState(theConsole,stateValues);
    return new ConfirmationChoice(theConsole,message,prompt,continuingState,noState);
  }
  return continuingState;
}
Program: 167845
Project: 167845
Buggy source:
@Override public Object getConsole(){
  return null;
}

Fixed version (ground truth):
@Override public Object getConsole(){
  return this;
}
Program: 167846
Project: 167846
Buggy source:
/** 
 * Generates and returns the URI that corresponds to the remote outbound connection. If the URI has already been generated in a previous request, then it returns that back. Else the URI is constructed out of the outbound socket binding's destination address and destination port.
 * @return
 * @throws IOException
 * @throws URISyntaxException
 */
private synchronized URI getConnectionURI() throws IOException, URISyntaxException {
  if (this.connectionURI != null) {
    return this.connectionURI;
  }
  final OutboundSocketBinding destinationOutboundSocket=this.destinationOutboundSocketBindingInjectedValue.getValue();
  final InetAddress destinationAddress=destinationOutboundSocket.getDestinationAddress();
  final int port=destinationOutboundSocket.getDestinationPort();
  this.connectionURI=new URI(REMOTE_URI_SCHEME + destinationAddress.getHostAddress() + "String_Node_Str"+ port);
  return this.connectionURI;
}

Fixed version (ground truth):
/** 
 * Generates and returns the URI that corresponds to the remote outbound connection. If the URI has already been generated in a previous request, then it returns that back. Else the URI is constructed out of the outbound socket binding's destination address and destination port.
 * @return
 * @throws IOException
 * @throws URISyntaxException
 */
private synchronized URI getConnectionURI() throws IOException, URISyntaxException {
  if (this.connectionURI != null) {
    return this.connectionURI;
  }
  final OutboundSocketBinding destinationOutboundSocket=this.destinationOutboundSocketBindingInjectedValue.getValue();
  final InetAddress destinationAddress=destinationOutboundSocket.getDestinationAddress();
  final int port=destinationOutboundSocket.getDestinationPort();
  this.connectionURI=new URI(REMOTE_URI_SCHEME + NetworkUtils.formatPossibleIpv6Address(destinationAddress.getHostAddress()) + "String_Node_Str"+ port);
  return this.connectionURI;
}
Program: 167847
Project: 167847
Buggy source:
/** 
 * Create the SystemPropertyRemoveHandler
 * @param processEnvironment
 */
public SystemPropertyRemoveHandler(ProcessEnvironment processEnvironment){
  this.processEnvironment=processEnvironment;
}

Fixed version (ground truth):
/** 
 * Create the SystemPropertyRemoveHandler
 * @param processEnvironment the process environment to use to validate changes. May be {@code null}
 */
public SystemPropertyRemoveHandler(ProcessEnvironment processEnvironment){
  this.processEnvironment=processEnvironment;
}
Program: 167848
Project: 167848
Buggy source:
protected boolean requiresRuntime(OperationContext context){
  return context.isNormalServer();
}

Fixed version (ground truth):
protected boolean requiresRuntime(OperationContext context){
  return true;
}
Program: 167849
Project: 167849
Buggy source:
@Override protected boolean requiresRuntime(OperationContext context){
  return context.isNormalServer();
}

Fixed version (ground truth):
@Override protected boolean requiresRuntime(OperationContext context){
  return true;
}