nus-yam/ex-repair huggingface dataset:
Program: 167931
Project: 167931
Buggy source:
private void writeServerDeployments(final XMLExtendedStreamWriter writer,final ModelNode modelNode) throws XMLStreamException {
  Set<String> deploymentNames=modelNode.keys();
  if (deploymentNames.size() > 0) {
    boolean deploymentWritten=false;
    for (    String uniqueName : deploymentNames) {
      final ModelNode deployment=modelNode.get(uniqueName);
      if (!deployment.get(PERSISTENT).asBoolean()) {
        continue;
      }
      if (!deploymentWritten) {
        writer.writeStartElement(Element.DEPLOYMENTS.getLocalName());
        deploymentWritten=true;
      }
      final String runtimeName=deployment.get(RUNTIME_NAME).asString();
      boolean enabled=deployment.get(ENABLED).asBoolean();
      writer.writeStartElement(Element.DEPLOYMENT.getLocalName());
      writeAttribute(writer,Attribute.NAME,uniqueName);
      writeAttribute(writer,Attribute.RUNTIME_NAME,runtimeName);
      if (!enabled) {
        writeAttribute(writer,Attribute.ENABLED,"String_Node_Str");
      }
      final List<ModelNode> contentItems=deployment.require(CONTENT).asList();
      for (      ModelNode contentItem : contentItems) {
        writeContentItem(writer,contentItem);
      }
      writer.writeEndElement();
    }
    if (deploymentWritten) {
      writer.writeEndElement();
    }
  }
}

Fixed version (ground truth):
private void writeServerDeployments(final XMLExtendedStreamWriter writer,final ModelNode modelNode) throws XMLStreamException {
  Set<String> deploymentNames=modelNode.keys();
  if (deploymentNames.size() > 0) {
    boolean deploymentWritten=false;
    for (    String uniqueName : deploymentNames) {
      final ModelNode deployment=modelNode.get(uniqueName);
      if (deployment.hasDefined(PERSISTENT) && !deployment.get(PERSISTENT).asBoolean()) {
        continue;
      }
      if (!deploymentWritten) {
        writer.writeStartElement(Element.DEPLOYMENTS.getLocalName());
        deploymentWritten=true;
      }
      final String runtimeName=deployment.get(RUNTIME_NAME).asString();
      boolean enabled=deployment.get(ENABLED).asBoolean();
      writer.writeStartElement(Element.DEPLOYMENT.getLocalName());
      writeAttribute(writer,Attribute.NAME,uniqueName);
      writeAttribute(writer,Attribute.RUNTIME_NAME,runtimeName);
      if (!enabled) {
        writeAttribute(writer,Attribute.ENABLED,"String_Node_Str");
      }
      final List<ModelNode> contentItems=deployment.require(CONTENT).asList();
      for (      ModelNode contentItem : contentItems) {
        writeContentItem(writer,contentItem);
      }
      writer.writeEndElement();
    }
    if (deploymentWritten) {
      writer.writeEndElement();
    }
  }
}
Program: 167934
Project: 167934
Buggy source:
public static void addService(final ServiceTarget serviceTarget,final Bootstrap.Configuration configuration){
  ServerService service=new ServerService(null);
  ServiceBuilder<?> serviceBuilder=serviceTarget.addService(Services.JBOSS_SERVER_CONTROLLER,service);
  serviceBuilder.install();
}

Fixed version (ground truth):
public static void addService(final ServiceTarget serviceTarget,final Bootstrap.Configuration configuration){
  ServerService service=new ServerService(null,null);
  ServiceBuilder<?> serviceBuilder=serviceTarget.addService(Services.JBOSS_SERVER_CONTROLLER,service);
  serviceBuilder.install();
}
Program: 167935
Project: 167935
Buggy source:
/** 
 * Construct a new instance.
 * @param configurationPersister the configuration persister for this server
 */
ServerService(final ConfigurationPersister configurationPersister){
  super(NewOperationContext.Type.SERVER,configurationPersister,ServerDescriptionProviders.ROOT_PROVIDER,prepareStep);
}

Fixed version (ground truth):
/** 
 * Construct a new instance.
 * @param configurationPersister the configuration persister for this server
 */
ServerService(final ConfigurationPersister configurationPersister,final NewStepHandler prepareStep){
  super(NewOperationContext.Type.SERVER,configurationPersister,ServerDescriptionProviders.ROOT_PROVIDER,prepareStep);
}
Program: 167941
Project: 167941
Buggy source:
/** 
 * Requests that the content with the given unique name and hash be mounted in VFS at the given   {@code mountPoint}.
 * @param name unique name for the content as provided by the end user. Cannot be <code>null</code>
 * @param runtimeName the name the deployment file should be known as to the runtime. Cannot be <code>null</code>
 * @param deploymentContents the deployment contents. Cannot be <code>null</code>
 * @param mountPoint VFS location where the content should be mounted. Cannot be <code>null</code>
 * @param mountExpanded
 * @return {@link java.io.Closeable} that can be used to close the mount
 * @throws IOException
 */
Closeable mountDeploymentContent(String name,String runtimeName,VirtualFile deploymentContents,VirtualFile mountPoint,boolean mountExpanded) throws IOException ;

Fixed version (ground truth):
/** 
 * Requests that the content with the given unique name and hash be mounted in VFS at the given   {@code mountPoint}.
 * @param deploymentContents the deployment contents. Cannot be <code>null</code>
 * @param mountPoint VFS location where the content should be mounted. Cannot be <code>null</code>
 * @param mountExpanded
 * @return {@link java.io.Closeable} that can be used to close the mount
 * @throws IOException
 */
Closeable mountDeploymentContent(VirtualFile deploymentContents,VirtualFile mountPoint,boolean mountExpanded) throws IOException ;
Program: 167942
Project: 167942
Buggy source:
public static void addService(final ServiceTarget serviceTarget,final File repoRoot,final File systemDeployDir,final ContentRepositoryImpl contentRepository){
  serviceTarget.addService(ServerDeploymentRepository.SERVICE_NAME,new ServerDeploymentRepositoryImpl(repoRoot,systemDeployDir,contentRepository)).install();
}

Fixed version (ground truth):
public static void addService(final ServiceTarget serviceTarget,final ContentRepositoryImpl contentRepository){
  serviceTarget.addService(ServerDeploymentRepository.SERVICE_NAME,new ServerDeploymentRepositoryImpl(contentRepository)).install();
}
Program: 167943
Project: 167943
Buggy source:
/** 
 * Creates a new ServerDeploymentRepositoryImpl.
 */
public ServerDeploymentRepositoryImpl(final File repoRoot,final File systemDeployDir,final ContentRepositoryImpl contentRepository){
  this.systemDeployDir=systemDeployDir;
  this.contentRepository=contentRepository;
}

Fixed version (ground truth):
/** 
 * Creates a new ServerDeploymentRepositoryImpl.
 */
public ServerDeploymentRepositoryImpl(final ContentRepositoryImpl contentRepository){
  this.contentRepository=contentRepository;
}
Program: 167944
Project: 167944
Buggy source:
@Override public Closeable mountDeploymentContent(String name,String runtimeName,final VirtualFile contents,VirtualFile mountPoint,boolean mountExpanded) throws IOException {
  if (contents == null)   throw new IllegalArgumentException("String_Node_Str");
  if (mountExpanded) {
    return VFS.mountZipExpanded(contents,mountPoint,tempFileProvider);
  }
 else {
    return VFS.mountZip(contents,mountPoint,tempFileProvider);
  }
}

Fixed version (ground truth):
@Override public Closeable mountDeploymentContent(final VirtualFile contents,VirtualFile mountPoint,boolean mountExpanded) throws IOException {
  if (contents == null)   throw new IllegalArgumentException("String_Node_Str");
  if (mountExpanded) {
    return VFS.mountZipExpanded(contents,mountPoint,tempFileProvider);
  }
 else {
    return VFS.mountZip(contents,mountPoint,tempFileProvider);
  }
}
Program: 167945
Project: 167945
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public Closeable mountDeploymentContent(String name,String runtimeName,VirtualFile contents,VirtualFile mountPoint,boolean mountExploded) throws IOException {
  return new Closeable(){
    @Override public void close() throws IOException {
    }
  }
;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Closeable mountDeploymentContent(VirtualFile contents,VirtualFile mountPoint,boolean mountExploded) throws IOException {
  return new Closeable(){
    @Override public void close() throws IOException {
    }
  }
;
}
Program: 167947
Project: 167947
Buggy source:
/** 
 * Equivalent to default JAVA_OPTS in < AS 7 run.conf file TODO externalize this somewhere if doing this at all is the right thing
 * @param sysProps
 */
static void addStandardProperties(final String serverName,final HostControllerEnvironment environment,Map<String,String> sysProps){
  if (!sysProps.containsKey("String_Node_Str")) {
    sysProps.put("String_Node_Str","String_Node_Str");
  }
  if (!sysProps.containsKey("String_Node_Str")) {
    sysProps.put("String_Node_Str","String_Node_Str");
  }
  sysProps.put(HostControllerEnvironment.HOME_DIR,environment.getHomeDir().getAbsolutePath());
  String key=ServerEnvironment.SERVER_BASE_DIR;
  if (sysProps.get(key) == null) {
    File serverBaseDir=new File(environment.getDomainServersDir(),serverName);
    sysProps.put(key,serverBaseDir.getAbsolutePath());
  }
  key=ServerEnvironment.SERVER_DEPLOY_DIR;
  if (sysProps.get(key) == null) {
    File serverDeploymentDir=environment.getDomainDeploymentDir();
    sysProps.put(key,serverDeploymentDir.getAbsolutePath());
  }
  key=ServerEnvironment.SERVER_SYSTEM_DEPLOY_DIR;
  if (sysProps.get(key) == null) {
    File serverDeploymentDir=environment.getDomainSystemDeploymentDir();
    sysProps.put(key,serverDeploymentDir.getAbsolutePath());
  }
}

Fixed version (ground truth):
/** 
 * Equivalent to default JAVA_OPTS in < AS 7 run.conf file TODO externalize this somewhere if doing this at all is the right thing
 * @param sysProps
 */
static void addStandardProperties(final String serverName,final HostControllerEnvironment environment,Map<String,String> sysProps){
  if (!sysProps.containsKey("String_Node_Str")) {
    sysProps.put("String_Node_Str","String_Node_Str");
  }
  if (!sysProps.containsKey("String_Node_Str")) {
    sysProps.put("String_Node_Str","String_Node_Str");
  }
  sysProps.put(HostControllerEnvironment.HOME_DIR,environment.getHomeDir().getAbsolutePath());
  String key=ServerEnvironment.SERVER_BASE_DIR;
  if (sysProps.get(key) == null) {
    File serverBaseDir=new File(environment.getDomainServersDir(),serverName);
    sysProps.put(key,serverBaseDir.getAbsolutePath());
  }
  key=ServerEnvironment.SERVER_DEPLOY_DIR;
  if (sysProps.get(key) == null) {
    File serverDeploymentDir=environment.getDomainDeploymentDir();
    sysProps.put(key,serverDeploymentDir.getAbsolutePath());
  }
}
Program: 167950
Project: 167950
Buggy source:
void install(){
  SecurityActions.setSystemProperty(QUALIFIED_HOST_NAME,qualifiedHostName);
  SecurityActions.setSystemProperty(HOST_NAME,hostName);
  SecurityActions.setSystemProperty(SERVER_NAME,serverName);
  SecurityActions.setSystemProperty(NODE_NAME,nodeName);
  SecurityActions.setSystemProperty(HOME_DIR,homeDir.getAbsolutePath());
  SecurityActions.setSystemProperty(MODULES_DIR,modulesDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_BASE_DIR,serverBaseDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_CONFIG_DIR,serverConfigurationDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_DATA_DIR,serverDataDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_DEPLOY_DIR,serverDeployDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_SYSTEM_DEPLOY_DIR,serverSystemDeployDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_LOG_DIR,serverLogDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_TEMP_DIR,serverTempDir.getAbsolutePath());
}

Fixed version (ground truth):
void install(){
  SecurityActions.setSystemProperty(QUALIFIED_HOST_NAME,qualifiedHostName);
  SecurityActions.setSystemProperty(HOST_NAME,hostName);
  SecurityActions.setSystemProperty(SERVER_NAME,serverName);
  SecurityActions.setSystemProperty(NODE_NAME,nodeName);
  SecurityActions.setSystemProperty(HOME_DIR,homeDir.getAbsolutePath());
  SecurityActions.setSystemProperty(MODULES_DIR,modulesDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_BASE_DIR,serverBaseDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_CONFIG_DIR,serverConfigurationDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_DATA_DIR,serverDataDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_DEPLOY_DIR,serverDeployDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_LOG_DIR,serverLogDir.getAbsolutePath());
  SecurityActions.setSystemProperty(SERVER_TEMP_DIR,serverTempDir.getAbsolutePath());
}
Program: 167952
Project: 167952
Buggy source:
private static void addMethodByTypeName(Map<String,Map<ParamNameList,Map<String,Method>>> methodsByTypeName,Method method){
  final String name=method.getName();
  Map<ParamNameList,Map<String,Method>> nameMap=methodsByTypeName.get(name);
  if (nameMap == null) {
    methodsByTypeName.put(name,nameMap=new HashMap<ParamNameList,Map<String,Method>>());
  }
  final Class<?>[] types=method.getParameterTypes();
  final ParamNameList list=createParamNameList(types);
  Map<String,Method> paramsMap=nameMap.get(list);
  if (paramsMap == null) {
    nameMap.put(list,paramsMap=new HashMap<String,Method>());
  }
  paramsMap.put(method.getReturnType().getName(),method);
}

Fixed version (ground truth):
private static void addMethodByTypeName(Map<String,Map<ParamNameList,Map<String,Method>>> methodsByTypeName,Method method){
  final String name=method.getName();
  Map<ParamNameList,Map<String,Method>> nameMap=methodsByTypeName.get(name);
  if (nameMap == null) {
    methodsByTypeName.put(name,nameMap=new HashMap<ParamNameList,Map<String,Method>>());
  }
  final Class<?>[] types=method.getParameterTypes();
  final ParamNameList list=createParamNameList(types);
  Map<String,Method> paramsMap=nameMap.get(list);
  if (paramsMap == null) {
    nameMap.put(list,paramsMap=new HashMap<String,Method>());
  }
  if (!paramsMap.containsKey(method.getReturnType().getName())) {
    paramsMap.put(method.getReturnType().getName(),method);
  }
}
Program: 167954
Project: 167954
Buggy source:
private static void addMethod(Map<String,Map<ParamList,Map<Class<?>,Method>>> methods,Method method){
  final String name=method.getName();
  Map<ParamList,Map<Class<?>,Method>> nameMap=methods.get(name);
  if (nameMap == null) {
    methods.put(name,nameMap=new HashMap<ParamList,Map<Class<?>,Method>>());
  }
  final Class<?>[] types=method.getParameterTypes();
  final ParamList list=createParamList(types);
  Map<Class<?>,Method> paramsMap=nameMap.get(list);
  if (paramsMap == null) {
    nameMap.put(list,paramsMap=new HashMap<Class<?>,Method>());
  }
  paramsMap.put(method.getReturnType(),method);
}

Fixed version (ground truth):
private static void addMethod(Map<String,Map<ParamList,Map<Class<?>,Method>>> methods,Method method){
  final String name=method.getName();
  Map<ParamList,Map<Class<?>,Method>> nameMap=methods.get(name);
  if (nameMap == null) {
    methods.put(name,nameMap=new HashMap<ParamList,Map<Class<?>,Method>>());
  }
  final Class<?>[] types=method.getParameterTypes();
  final ParamList list=createParamList(types);
  Map<Class<?>,Method> paramsMap=nameMap.get(list);
  if (paramsMap == null) {
    nameMap.put(list,paramsMap=new HashMap<Class<?>,Method>());
  }
  if (!paramsMap.containsKey(method.getReturnType())) {
    paramsMap.put(method.getReturnType(),method);
  }
}
Program: 167955
Project: 167955
Buggy source:
public ModelNode getModelDescription(final Locale locale){
  return DeploymentSubsystemDescriptions.getScannerDescription(locale);
}

Fixed version (ground truth):
@Override public ModelNode getModelDescription(final Locale locale){
  return DeploymentSubsystemDescriptions.getScannerDescription(locale);
}
Program: 167957
Project: 167957
Buggy source:
DeploymentScannerService(final Integer interval,final TimeUnit unit,final Boolean autoDeployZipped,final Boolean autoDeployExploded,final Boolean enabled,final Long deploymentTimeout){
  this.interval=interval == null ? DEFAULT_INTERVAL : interval.longValue();
  this.unit=unit;
  this.autoDeployZipped=autoDeployZipped == null ? true : autoDeployZipped.booleanValue();
  this.autoDeployExploded=autoDeployExploded == null ? true : autoDeployExploded.booleanValue();
  this.enabled=enabled == null ? true : enabled.booleanValue();
  this.deploymentTimeout=deploymentTimeout;
}

Fixed version (ground truth):
DeploymentScannerService(final Integer interval,final TimeUnit unit,final Boolean autoDeployZipped,final Boolean autoDeployExploded,final Boolean enabled,final Long deploymentTimeout){
  this.interval=interval == null ? DEFAULT_INTERVAL : interval.longValue();
  this.unit=unit;
  this.autoDeployZipped=autoDeployZipped == null ? true : autoDeployZipped.booleanValue();
  this.autoDeployExploded=autoDeployExploded == null ? false : autoDeployExploded.booleanValue();
  this.enabled=enabled == null ? true : enabled.booleanValue();
  this.deploymentTimeout=deploymentTimeout;
}
Program: 167959
Project: 167959
Buggy source:
private void getKnownImplementors(DotName name,Set<ClassInfo> allKnown,Set<DotName> subInterfacesToProcess,Set<DotName> processedClasses){
  for (  Index index : indexes) {
    final List<ClassInfo> list=index.getKnownDirectImplementors(name);
    if (list != null) {
      for (      final ClassInfo clazz : allKnown) {
        final DotName className=clazz.name();
        if (!processedClasses.contains(className)) {
          if (Modifier.isInterface(clazz.flags())) {
            subInterfacesToProcess.add(className);
          }
 else {
            if (!allKnown.contains(clazz)) {
              allKnown.add(clazz);
              processedClasses.add(className);
              getAllKnownSubClasses(className,allKnown,processedClasses);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void getKnownImplementors(DotName name,Set<ClassInfo> allKnown,Set<DotName> subInterfacesToProcess,Set<DotName> processedClasses){
  for (  Index index : indexes) {
    final List<ClassInfo> list=index.getKnownDirectImplementors(name);
    if (list != null) {
      for (      final ClassInfo clazz : list) {
        final DotName className=clazz.name();
        if (!processedClasses.contains(className)) {
          if (Modifier.isInterface(clazz.flags())) {
            subInterfacesToProcess.add(className);
          }
 else {
            if (!allKnown.contains(clazz)) {
              allKnown.add(clazz);
              processedClasses.add(className);
              getAllKnownSubClasses(className,allKnown,processedClasses);
            }
          }
        }
      }
    }
  }
}
Program: 167960
Project: 167960
Buggy source:
private void getAllKnownSubClasses(DotName name,Set<ClassInfo> allKnown,Set<DotName> subClassesToProcess,Set<DotName> processedClasses){
  for (  Index index : indexes) {
    final List<ClassInfo> list=index.getKnownDirectSubclasses(name);
    if (list != null) {
      for (      final ClassInfo clazz : allKnown) {
        final DotName className=clazz.name();
        if (!processedClasses.contains(className)) {
          allKnown.add(clazz);
          subClassesToProcess.add(className);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void getAllKnownSubClasses(DotName name,Set<ClassInfo> allKnown,Set<DotName> subClassesToProcess,Set<DotName> processedClasses){
  for (  Index index : indexes) {
    final List<ClassInfo> list=index.getKnownDirectSubclasses(name);
    if (list != null) {
      for (      final ClassInfo clazz : list) {
        final DotName className=clazz.name();
        if (!processedClasses.contains(className)) {
          allKnown.add(clazz);
          subClassesToProcess.add(className);
        }
      }
    }
  }
}
Program: 167962
Project: 167962
Buggy source:
private void writeServerGroup(final XMLExtendedStreamWriter writer,final String groupName,final ModelNode group) throws XMLStreamException {
  writer.writeStartElement(Element.SERVER_GROUP.getLocalName());
  writer.writeAttribute(Attribute.NAME.getLocalName(),groupName);
  writer.writeAttribute(Attribute.PROFILE.getLocalName(),group.get(PROFILE).asString());
  if (group.hasDefined(JVM)) {
    for (    final Property jvm : group.get(JVM).asPropertyList()) {
      writeJVMElement(writer,jvm.getName(),jvm.getValue());
      break;
    }
  }
  String bindingGroupRef=group.hasDefined(SOCKET_BINDING_GROUP) ? group.get(SOCKET_BINDING_GROUP).asString() : null;
  String portOffset=group.hasDefined(SOCKET_BINDING_PORT_OFFSET) ? group.get(SOCKET_BINDING_PORT_OFFSET).asString() : null;
  if (bindingGroupRef != null || portOffset != null) {
    writer.writeStartElement(Element.SOCKET_BINDING_GROUP.getLocalName());
    if (bindingGroupRef != null) {
      writeAttribute(writer,Attribute.REF,bindingGroupRef);
    }
    if (portOffset != null) {
      writeAttribute(writer,Attribute.PORT_OFFSET,portOffset);
    }
    writer.writeEndElement();
  }
  if (group.hasDefined(DEPLOYMENT)) {
    writeDomainDeployments(writer,group);
  }
  if (group.hasDefined(SYSTEM_PROPERTIES)) {
    writeProperties(writer,group,Element.SYSTEM_PROPERTIES);
  }
  writer.writeEndElement();
}

Fixed version (ground truth):
private void writeServerGroup(final XMLExtendedStreamWriter writer,final String groupName,final ModelNode group) throws XMLStreamException {
  writer.writeStartElement(Element.SERVER_GROUP.getLocalName());
  writer.writeAttribute(Attribute.NAME.getLocalName(),groupName);
  writer.writeAttribute(Attribute.PROFILE.getLocalName(),group.get(PROFILE).asString());
  if (group.hasDefined(JVM)) {
    for (    final Property jvm : group.get(JVM).asPropertyList()) {
      writeJVMElement(writer,jvm.getName(),jvm.getValue());
      break;
    }
  }
  String bindingGroupRef=group.hasDefined(SOCKET_BINDING_GROUP) ? group.get(SOCKET_BINDING_GROUP).asString() : null;
  String portOffset=group.hasDefined(SOCKET_BINDING_PORT_OFFSET) ? group.get(SOCKET_BINDING_PORT_OFFSET).asString() : null;
  if (bindingGroupRef != null || portOffset != null) {
    writer.writeStartElement(Element.SOCKET_BINDING_GROUP.getLocalName());
    if (bindingGroupRef != null) {
      writeAttribute(writer,Attribute.REF,bindingGroupRef);
    }
    if (portOffset != null) {
      writeAttribute(writer,Attribute.PORT_OFFSET,portOffset);
    }
    writer.writeEndElement();
  }
  if (group.hasDefined(DEPLOYMENT)) {
    writeDomainDeployments(writer,group.get(DEPLOYMENT));
  }
  if (group.hasDefined(SYSTEM_PROPERTIES)) {
    writeProperties(writer,group,Element.SYSTEM_PROPERTIES);
  }
  writer.writeEndElement();
}
Program: 167965
Project: 167965
Buggy source:
private byte[] uploadDeploymentContent(String name,String runtimeName,InputStream stream) throws IOException {
  byte[] bytes=streamToByteArray(stream);
  ModelNode op=new ModelNode();
  op.get("String_Node_Str").set("String_Node_Str");
  op.get("String_Node_Str").setEmptyList();
  op.get("String_Node_Str").set(name);
  op.get("String_Node_Str").set(runtimeName);
  op.get("String_Node_Str").set(bytes);
  try {
    try {
      ModelNode response=executeOperation(op).get();
      return response.asBytes();
    }
 catch (    ExecutionException e) {
      throw e.getCause();
    }
  }
 catch (  InterruptedException e) {
    IOException ioe=new InterruptedIOException();
    ioe.initCause(e);
    throw ioe;
  }
catch (  RuntimeException e) {
    throw e;
  }
catch (  IOException e) {
    throw e;
  }
catch (  Error e) {
    throw e;
  }
catch (  Throwable e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private byte[] uploadDeploymentContent(String name,String runtimeName,InputStream stream) throws IOException {
  byte[] bytes=streamToByteArray(stream);
  ModelNode op=new ModelNode();
  op.get("String_Node_Str").set(DeploymentUploadBytesHandler.OPERATION_NAME);
  op.get("String_Node_Str").setEmptyList();
  op.get("String_Node_Str").set(name);
  op.get("String_Node_Str").set(runtimeName);
  op.get("String_Node_Str").set(bytes);
  try {
    try {
      ModelNode response=executeOperation(op).get();
      return response.asBytes();
    }
 catch (    ExecutionException e) {
      throw e.getCause();
    }
  }
 catch (  InterruptedException e) {
    IOException ioe=new InterruptedIOException();
    ioe.initCause(e);
    throw ioe;
  }
catch (  RuntimeException e) {
    throw e;
  }
catch (  IOException e) {
    throw e;
  }
catch (  Error e) {
    throw e;
  }
catch (  Throwable e) {
    throw new RuntimeException(e);
  }
}
Program: 167966
Project: 167966
Buggy source:
protected abstract Future<ModelNode> executeOperation(ModelNode operation);

Fixed version (ground truth):
protected abstract Future<ModelNode> executeOperation(ExecutionContext context);
Program: 167967
Project: 167967
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected Future<ModelNode> executeOperation(ModelNode operation){
  Handler handler=new Handler();
  OperationResult c=client.execute(ExecutionContextBuilder.Factory.create(operation).build(),handler.resultHandler);
  handler.setCancellable(c.getCancellable());
  return handler;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected Future<ModelNode> executeOperation(ExecutionContext executionContext){
  Handler handler=new Handler();
  OperationResult c=client.execute(executionContext,handler.resultHandler);
  handler.setCancellable(c.getCancellable());
  return handler;
}
Program: 167968
Project: 167968
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected Future<ModelNode> executeOperation(ModelNode operation){
  Handler handler=new Handler();
  OperationResult c=client.execute(ExecutionContextBuilder.Factory.create(operation).build(),handler.resultHandler);
  handler.setCancellable(c.getCancellable());
  return handler;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected Future<ModelNode> executeOperation(ExecutionContext executionContext){
  Handler handler=new Handler();
  OperationResult c=client.execute(executionContext,handler.resultHandler);
  handler.setCancellable(c.getCancellable());
  return handler;
}
Program: 167972
Project: 167972
Buggy source:
@Override public void readElement(final XMLExtendedStreamReader reader,final List<ModelNode> operationList) throws XMLStreamException {
  final ModelNode address=new ModelNode().setEmptyList();
  if (reader.nextTag() != START_ELEMENT) {
    throw unexpectedEndElement(reader);
  }
  if (Namespace.forUri(reader.getNamespaceURI()) != Namespace.DOMAIN_1_0 || Element.forName(reader.getLocalName()) != Element.SERVER) {
    throw unexpectedElement(reader);
  }
  readServerElement(reader,address,operationList);
}

Fixed version (ground truth):
@Override public void readElement(final XMLExtendedStreamReader reader,final List<ModelNode> operationList) throws XMLStreamException {
  final ModelNode address=new ModelNode().setEmptyList();
  if (Namespace.forUri(reader.getNamespaceURI()) != Namespace.DOMAIN_1_0 || Element.forName(reader.getLocalName()) != Element.SERVER) {
    throw unexpectedElement(reader);
  }
  readServerElement(reader,address,operationList);
}
Program: 167974
Project: 167974
Buggy source:
public ModelNode getModelDescription(Locale locale){
  return new ModelNode();
}

Fixed version (ground truth):
@Override public ModelNode getModelDescription(final Locale locale){
  return new ModelNode();
}
Program: 167975
Project: 167975
Buggy source:
/** 
 * {@inheritDoc} 
 */
protected ModelNodeRegistration getRegistry(){
  return super.getRegistry();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected ModelNodeRegistration getRegistry(){
  return super.getRegistry();
}
Program: 167976
Project: 167976
Buggy source:
protected TestController(){
  super(model,new NullConfigurationPersister());
}

Fixed version (ground truth):
protected TestController(){
  super(model,new NullConfigurationPersister(),null);
}
Program: 167978
Project: 167978
Buggy source:
Map<String,OperationHandler> getHandlers(final ListIterator<PathElement> iterator,final String child){
  final Map<String,OperationRegistry> snapshot=childRegistriesUpdater.get(this);
  final OperationRegistry childRegistry=snapshot.get(child);
  final OperationRegistry wildcardRegistry=snapshot.get(this);
  if (wildcardRegistry == null) {
    if (childRegistry == null) {
      return Collections.emptyMap();
    }
 else {
      return childRegistry.getHandlers(iterator);
    }
  }
 else {
    if (childRegistry == null) {
      return wildcardRegistry.getHandlers(iterator);
    }
 else {
      final Map<String,OperationHandler> wildcardHandlers=wildcardRegistry.getHandlers(iterator);
      final Map<String,OperationHandler> childHandlers=childRegistry.getHandlers(iterator);
      final FastCopyHashMap<String,OperationHandler> combined=new FastCopyHashMap<String,OperationHandler>(childHandlers);
      combined.putAll(wildcardHandlers);
      return combined;
    }
  }
}

Fixed version (ground truth):
private Map<String,OperationHandler> getHandlers(final ListIterator<PathElement> iterator,final String child){
  final Map<String,OperationRegistry> snapshot=childRegistriesUpdater.get(this);
  final OperationRegistry childRegistry=snapshot.get(child);
  final OperationRegistry wildcardRegistry=snapshot.get(this);
  if (wildcardRegistry == null) {
    if (childRegistry == null) {
      return Collections.emptyMap();
    }
 else {
      return childRegistry.getHandlers(iterator);
    }
  }
 else {
    if (childRegistry == null) {
      return wildcardRegistry.getHandlers(iterator);
    }
 else {
      final Map<String,OperationHandler> wildcardHandlers=wildcardRegistry.getHandlers(iterator);
      final Map<String,OperationHandler> childHandlers=childRegistry.getHandlers(iterator);
      final FastCopyHashMap<String,OperationHandler> combined=new FastCopyHashMap<String,OperationHandler>(childHandlers);
      combined.putAll(wildcardHandlers);
      return combined;
    }
  }
}
Program: 167979
Project: 167979
Buggy source:
String getLocationString(){
  return parent.getLocationString() + "String_Node_Str" + keyName+ "String_Node_Str";
}

Fixed version (ground truth):
private String getLocationString(){
  return parent.getLocationString() + "String_Node_Str" + keyName+ "String_Node_Str";
}
Program: 167980
Project: 167980
Buggy source:
OperationHandler getHandler(final ListIterator<PathElement> iterator,final String child,final String operationName){
  final Map<String,OperationRegistry> snapshot=childRegistriesUpdater.get(this);
  final OperationRegistry childRegistry=snapshot.get(child);
  if (childRegistry != null) {
    return childRegistry.getHandler(iterator,operationName);
  }
 else {
    final OperationRegistry wildcardRegistry=snapshot.get("String_Node_Str");
    if (wildcardRegistry != null) {
      return wildcardRegistry.getHandler(iterator,operationName);
    }
 else {
      return null;
    }
  }
}

Fixed version (ground truth):
private OperationHandler getHandler(final ListIterator<PathElement> iterator,final String child,final String operationName){
  final Map<String,OperationRegistry> snapshot=childRegistriesUpdater.get(this);
  final OperationRegistry childRegistry=snapshot.get(child);
  if (childRegistry != null) {
    return childRegistry.getHandler(iterator,operationName);
  }
 else {
    final OperationRegistry wildcardRegistry=snapshot.get("String_Node_Str");
    if (wildcardRegistry != null) {
      return wildcardRegistry.getHandler(iterator,operationName);
    }
 else {
      return null;
    }
  }
}
Program: 167981
Project: 167981
Buggy source:
OperationRegistry(final String valueString,final OperationSubregistry parent){
  this.valueString=valueString;
  this.parent=parent;
  childrenUpdater.clear(this);
  handlersUpdater.clear(this);
}

Fixed version (ground truth):
private OperationRegistry(final String valueString,final Subregistry parent){
  this.valueString=valueString;
  this.parent=parent;
  childrenUpdater.clear(this);
  handlersUpdater.clear(this);
}
Program: 167982
Project: 167982
Buggy source:
void register(final String elementValue,final ListIterator<PathElement> iterator,final String operationName,final OperationHandler handler){
  OperationRegistry registry=childRegistriesUpdater.get(this,elementValue);
  if (registry == null) {
    final OperationRegistry newRegistry=new OperationRegistry(elementValue,this);
    final OperationRegistry appearingRegistry=childRegistriesUpdater.putIfAbsent(this,elementValue,newRegistry);
    registry=appearingRegistry != null ? appearingRegistry : newRegistry;
  }
  registry.register(iterator,operationName,handler);
}

Fixed version (ground truth):
private void register(final String elementValue,final ListIterator<PathElement> iterator,final String operationName,final OperationHandler handler){
  OperationRegistry registry=childRegistriesUpdater.get(this,elementValue);
  if (registry == null) {
    final OperationRegistry newRegistry=new OperationRegistry(elementValue,this);
    final OperationRegistry appearingRegistry=childRegistriesUpdater.putIfAbsent(this,elementValue,newRegistry);
    registry=appearingRegistry != null ? appearingRegistry : newRegistry;
  }
  registry.register(iterator,operationName,handler);
}
Program: 167983
Project: 167983
Buggy source:
/** 
 * Add the dependencies if the deployment contains a service activator loader entry.
 * @param phaseContext the deployment unit context
 * @throws DeploymentUnitProcessingException
 */
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
  final ResourceRoot deploymentRoot=phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT);
  if (deploymentRoot == null)   return;
  if (!phaseContext.getDeploymentUnit().getAttachment(Attachments.SERVICES).getServiceImplementations(ServiceActivator.class.getName()).isEmpty()) {
    phaseContext.getDeploymentUnit().addToAttachmentList(Attachments.MODULE_DEPENDENCIES,MSC_DEP);
  }
}

Fixed version (ground truth):
/** 
 * Add the dependencies if the deployment contains a service activator loader entry.
 * @param phaseContext the deployment unit context
 * @throws DeploymentUnitProcessingException
 */
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
  final ResourceRoot deploymentRoot=phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT);
  if (deploymentRoot == null)   return;
  final ServicesAttachment servicesAttachments=phaseContext.getDeploymentUnit().getAttachment(Attachments.SERVICES);
  if (servicesAttachments != null && !servicesAttachments.getServiceImplementations(ServiceActivator.class.getName()).isEmpty()) {
    phaseContext.getDeploymentUnit().addToAttachmentList(Attachments.MODULE_DEPENDENCIES,MSC_DEP);
  }
}
Program: 167984
Project: 167984
Buggy source:
/** 
 * If the deployment has a module attached it will ask the module to load the ServiceActivator services.
 * @param phaseContext the deployment unit context
 */
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
  final DeploymentUnit deploymentUnit=phaseContext.getDeploymentUnit();
  if (deploymentUnit.getAttachment(Attachments.SERVICES).getServiceImplementations(ServiceActivator.class.getName()).isEmpty())   return;
  final Module module=deploymentUnit.getAttachment(Attachments.MODULE);
  if (module == null)   return;
  final ServiceActivatorContext serviceActivatorContext=new ServiceActivatorContextImpl(phaseContext.getServiceTarget(),phaseContext.getServiceRegistry());
  for (  ServiceActivator serviceActivator : module.loadService(ServiceActivator.class)) {
    try {
      serviceActivator.activate(serviceActivatorContext);
    }
 catch (    ServiceRegistryException e) {
      throw new DeploymentUnitProcessingException(e);
    }
  }
}

Fixed version (ground truth):
/** 
 * If the deployment has a module attached it will ask the module to load the ServiceActivator services.
 * @param phaseContext the deployment unit context
 */
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
  final DeploymentUnit deploymentUnit=phaseContext.getDeploymentUnit();
  final ServicesAttachment servicesAttachment=deploymentUnit.getAttachment(Attachments.SERVICES);
  if (servicesAttachment == null || servicesAttachment.getServiceImplementations(ServiceActivator.class.getName()).isEmpty())   return;
  final Module module=deploymentUnit.getAttachment(Attachments.MODULE);
  if (module == null)   return;
  final ServiceActivatorContext serviceActivatorContext=new ServiceActivatorContextImpl(phaseContext.getServiceTarget(),phaseContext.getServiceRegistry());
  for (  ServiceActivator serviceActivator : module.loadService(ServiceActivator.class)) {
    try {
      serviceActivator.activate(serviceActivatorContext);
    }
 catch (    ServiceRegistryException e) {
      throw new DeploymentUnitProcessingException(e);
    }
  }
}
Program: 167985
Project: 167985
Buggy source:
public void undeploy(DeploymentUnit context){
  final DeploymentModuleLoader deploymentModuleLoader=context.getAttachment(Attachments.DEPLOYMENT_MODULE_LOADER);
  if (deploymentModuleLoader == null) {
    return;
  }
  final Module module=context.getAttachment(Attachments.MODULE);
  if (module != null) {
    deploymentModuleLoader.removeModuleSpec(module.getIdentifier());
  }
}

Fixed version (ground truth):
public void undeploy(DeploymentUnit context){
  final DeploymentModuleLoader deploymentModuleLoader=context.getAttachment(Attachments.DEPLOYMENT_MODULE_LOADER);
  if (deploymentModuleLoader == null) {
    return;
  }
  final ModuleIdentifier identifier=context.getAttachment(Attachments.MODULE_IDENTIFIER);
  if (identifier != null) {
    deploymentModuleLoader.removeModuleSpec(identifier);
  }
}
Program: 167986
Project: 167986
Buggy source:
public synchronized void stop(final StopContext context){
  final ServiceController<?> controller=context.getController().getServiceContainer().getRequiredService(Services.JBOSS_DEPLOYMENT_UNIT.append(name).append(FIRST_PHASE_NAME));
  controller.setMode(ServiceController.Mode.REMOVE);
  final MultipleRemoveListener<LifecycleContext> listener=MultipleRemoveListener.create(context);
  controller.addListener(listener);
  listener.done();
}

Fixed version (ground truth):
public synchronized void stop(final StopContext context){
  final ServiceController<?> controller=context.getController().getServiceContainer().getService(deploymentUnit.getServiceName().append(FIRST_PHASE_NAME));
  if (controller != null) {
    controller.setMode(ServiceController.Mode.REMOVE);
    final MultipleRemoveListener<LifecycleContext> listener=MultipleRemoveListener.create(context);
    controller.addListener(listener);
    listener.done();
  }
}
Program: 167987
Project: 167987
Buggy source:
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
  final ServerDeploymentRepository serverDeploymentRepository=phaseContext.getDeploymentUnit().getAttachment(Attachments.SERVER_DEPLOYMENT_REPOSITORY);
  if (serverDeploymentRepository == null) {
    throw new DeploymentUnitProcessingException("String_Node_Str");
  }
  final DeploymentUnit deploymentUnit=phaseContext.getDeploymentUnit();
  final String deploymentName=deploymentUnit.getName();
  final String deploymentRuntimeName=deploymentUnit.getAttachment(Attachments.RUNTIME_NAME);
  final byte[] deploymentHash=deploymentUnit.getAttachment(Attachments.DEPLOYMENT_HASH);
  final VirtualFile deploymentRoot=VFS.getChild("String_Node_Str" + deploymentRuntimeName);
  boolean failed=false;
  Closeable handle=null;
  try {
    handle=serverDeploymentRepository.mountDeploymentContent(deploymentName,deploymentRuntimeName,deploymentHash,deploymentRoot);
    final MountHandle mountHandle=new MountHandle(handle);
    final ResourceRoot resourceRoot=new ResourceRoot(deploymentRoot,mountHandle,false);
    deploymentUnit.putAttachment(Attachments.DEPLOYMENT_ROOT,resourceRoot);
    deploymentUnit.putAttachment(Attachments.DEPLOYMENT_ROOT_MOUNT_HANDLE,mountHandle);
  }
 catch (  IOException e) {
    failed=true;
    throw new DeploymentUnitProcessingException("String_Node_Str");
  }
 finally {
    if (failed) {
      VFSUtils.safeClose(handle);
    }
  }
}

Fixed version (ground truth):
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
  final ServerDeploymentRepository serverDeploymentRepository=phaseContext.getDeploymentUnit().getAttachment(Attachments.SERVER_DEPLOYMENT_REPOSITORY);
  if (serverDeploymentRepository == null) {
    throw new DeploymentUnitProcessingException("String_Node_Str");
  }
  final DeploymentUnit deploymentUnit=phaseContext.getDeploymentUnit();
  final String deploymentName=deploymentUnit.getName();
  final String deploymentRuntimeName=deploymentUnit.getAttachment(Attachments.RUNTIME_NAME);
  final byte[] deploymentHash=deploymentUnit.getAttachment(Attachments.DEPLOYMENT_HASH);
  final VirtualFile deploymentRoot=VFS.getChild("String_Node_Str" + deploymentRuntimeName);
  boolean failed=false;
  Closeable handle=null;
  try {
    handle=serverDeploymentRepository.mountDeploymentContent(deploymentName,deploymentRuntimeName,deploymentHash,deploymentRoot);
    final MountHandle mountHandle=new MountHandle(handle);
    final ResourceRoot resourceRoot=new ResourceRoot(deploymentRoot,mountHandle,false);
    deploymentUnit.putAttachment(Attachments.DEPLOYMENT_ROOT,resourceRoot);
    deploymentUnit.putAttachment(Attachments.DEPLOYMENT_ROOT_MOUNT_HANDLE,mountHandle);
  }
 catch (  IOException e) {
    failed=true;
    throw new DeploymentUnitProcessingException("String_Node_Str",e);
  }
 finally {
    if (failed) {
      VFSUtils.safeClose(handle);
    }
  }
}
Program: 167988
Project: 167988
Buggy source:
public void undeploy(DeploymentUnit context){
  final ResourceRoot resourceRoot=context.getAttachment(Attachments.DEPLOYMENT_ROOT);
  final Closeable mountHandle=resourceRoot.getMountHandle();
  VFSUtils.safeClose(mountHandle);
}

Fixed version (ground truth):
public void undeploy(DeploymentUnit context){
  final ResourceRoot resourceRoot=context.getAttachment(Attachments.DEPLOYMENT_ROOT);
  if (resourceRoot != null) {
    final Closeable mountHandle=resourceRoot.getMountHandle();
    VFSUtils.safeClose(mountHandle);
  }
}
Program: 167989
Project: 167989
Buggy source:
@Override protected final void readRequest(final InputStream inputStream) throws IOException {
  final Unmarshaller unmarshaller=getUnmarshaller();
  unmarshaller.start(createByteInput(inputStream));
  unmarshaller.finish();
}

Fixed version (ground truth):
@Override protected void readRequest(InputStream input) throws IOException {
  super.readRequest(input);
}
Program: 167990
Project: 167990
Buggy source:
@Override protected void sendResponse(final OutputStream output) throws IOException {
  final Marshaller marshaller=getMarshaller();
  marshaller.start(createByteOutput(output));
  marshaller.writeObject(serverController.getValue().getServerModel());
  marshaller.finish();
}

Fixed version (ground truth):
@Override protected void sendResponse(final OutputStream output) throws IOException {
  ServerModel sm=serverController.getValue().getServerModel();
  final Marshaller marshaller=getMarshaller();
  marshaller.start(createByteOutput(output));
  marshaller.writeByte(DomainServerProtocol.RETURN_SERVER_MODEL);
  marshaller.writeObject(sm);
  marshaller.finish();
}
Program: 167991
Project: 167991
Buggy source:
protected void writeElements(final XMLExtendedStreamWriter streamWriter) throws XMLStreamException {
  if (levelName != null) {
    streamWriter.writeEmptyElement("String_Node_Str");
    streamWriter.writeAttribute("String_Node_Str",levelName);
  }
  if (formatter != null) {
    streamWriter.writeStartElement("String_Node_Str");
    final QName elementName=formatter.getElementName();
    streamWriter.writeStartElement(elementName.getNamespaceURI(),elementName.getLocalPart());
    formatter.writeContent(streamWriter);
    streamWriter.writeEndElement();
  }
  if (subhandlers != null && subhandlers.length > 0) {
    streamWriter.writeStartElement("String_Node_Str");
    for (    String name : subhandlers) {
      streamWriter.writeEmptyElement("String_Node_Str");
      streamWriter.writeAttribute("String_Node_Str",name);
    }
    streamWriter.writeEndElement();
  }
  if (properties != null) {
    streamWriter.writeStartElement("String_Node_Str");
    properties.writeContent(streamWriter);
  }
}

Fixed version (ground truth):
protected void writeElements(final XMLExtendedStreamWriter streamWriter) throws XMLStreamException {
  if (levelName != null) {
    streamWriter.writeEmptyElement("String_Node_Str");
    streamWriter.writeAttribute("String_Node_Str",levelName);
  }
  if (formatter != null) {
    streamWriter.writeStartElement("String_Node_Str");
    final QName elementName=formatter.getElementName();
    streamWriter.writeStartElement(elementName.getNamespaceURI(),elementName.getLocalPart());
    formatter.writeContent(streamWriter);
    streamWriter.writeEndElement();
  }
  if (subhandlers != null && subhandlers.length > 0) {
    streamWriter.writeStartElement("String_Node_Str");
    for (    String name : subhandlers) {
      streamWriter.writeEmptyElement("String_Node_Str");
      streamWriter.writeAttribute("String_Node_Str",name);
    }
    streamWriter.writeEndElement();
  }
  if (properties != null && properties.size() > 0) {
    streamWriter.writeStartElement("String_Node_Str");
    properties.writeContent(streamWriter);
  }
}
Program: 167992
Project: 167992
Buggy source:
public ServerStartTask(final String serverName,final int portOffset,final Runnable logConfigurator,final List<ServiceActivator> startServices,final List<AbstractServerModelUpdate<?>> updates){
  this.serverName=serverName;
  this.portOffset=portOffset;
  this.logConfigurator=logConfigurator;
  this.startServices=startServices;
  this.updates=updates;
}

Fixed version (ground truth):
/** 
 * Constructor variant for use by StandaloneServer 
 */
public ServerStartTask(final String serverName,final int portOffset,final Runnable logConfigurator,final List<ServiceActivator> startServices,final List<AbstractServerModelUpdate<?>> updates,final ServerEnvironment environment){
  this.serverName=serverName;
  this.portOffset=portOffset;
  this.logConfigurator=logConfigurator;
  this.startServices=startServices;
  this.updates=updates;
  this.providedEnvironment=environment;
}