nus-yam/ex-repair huggingface dataset:
Program: 167693
Project: 167693
Buggy source:
private int completeHeader(Map<String,OperationRequestHeader> headers,CommandContext ctx,ParsedCommandLine parsedCmd,String buffer,int cursor,List<String> candidates){
  final OperationRequestHeader header=headers.get(parsedCmd.getLastHeaderName());
  if (header == null) {
    return -1;
  }
  final CommandLineCompleter headerCompleter=header.getCompleter();
  if (headerCompleter == null) {
    return -1;
  }
  int valueResult=headerCompleter.complete(ctx,buffer.substring(parsedCmd.getLastChunkIndex()),cursor,candidates);
  if (valueResult < 0) {
    return -1;
  }
  return parsedCmd.getLastChunkIndex() + valueResult;
}

Fixed version (ground truth):
private int completeHeader(Map<String,OperationRequestHeader> headers,CommandContext ctx,ParsedCommandLine parsedCmd,String buffer,int cursor,List<String> candidates){
  final OperationRequestHeader header=headers.get(parsedCmd.getLastHeaderName());
  if (header == null) {
    return -1;
  }
  final CommandLineCompleter headerCompleter=header.getCompleter();
  if (headerCompleter == null) {
    return -1;
  }
  int valueResult=headerCompleter.complete(ctx,buffer.substring(parsedCmd.getLastChunkOriginalIndex()),cursor,candidates);
  if (valueResult < 0) {
    return -1;
  }
  return parsedCmd.getOriginalOffset(parsedCmd.getLastChunkIndex() + valueResult);
}
Program: 167698
Project: 167698
Buggy source:
private boolean getSimpleValues(ModelNode propType,String name,String radical,List<String> candidates){
  if (name != null) {
    propType=propType.get(name);
  }
  final List<ModelNode> allowed;
  if (!propType.has(Util.ALLOWED)) {
    if (isBoolean(propType)) {
      allowed=BOOLEAN_LIST;
    }
 else     if (isBytes(propType)) {
      if (radical.endsWith("String_Node_Str")) {
        return true;
      }
 else {
        BytesCompleter.INSTANCE.complete(ctx,radical,0,candidates);
        return false;
      }
    }
 else {
      List<String> c=getCandidatesFromMetadata(propType,radical);
      if (c != null) {
        candidates.addAll(c);
      }
      return false;
    }
  }
 else {
    allowed=propType.get(Util.ALLOWED).asList();
  }
  boolean isComplete=false;
  for (  ModelNode candidate : allowed) {
    String c=candidate.asString();
    if (c.startsWith(radical)) {
      if (c.equals(radical)) {
        isComplete=true;
        break;
      }
      candidates.add(candidate.asString());
    }
  }
  Collections.sort(candidates);
  return isComplete;
}

Fixed version (ground truth):
private boolean getSimpleValues(ModelNode propType,String name,String radical,List<String> candidates){
  if (name != null) {
    propType=propType.get(name);
  }
  final List<ModelNode> allowed;
  if (!propType.has(Util.ALLOWED)) {
    if (isBoolean(propType)) {
      allowed=BOOLEAN_LIST;
    }
 else     if (isBytes(propType)) {
      if (radical.endsWith("String_Node_Str")) {
        return true;
      }
 else {
        BytesCompleter.INSTANCE.complete(ctx,radical,0,candidates);
        return false;
      }
    }
 else {
      List<String> c=getCandidatesFromMetadata(propType,radical);
      if (c != null) {
        if (c.isEmpty()) {
          return true;
        }
        candidates.addAll(c);
      }
      return false;
    }
  }
 else {
    allowed=propType.get(Util.ALLOWED).asList();
  }
  boolean isComplete=false;
  for (  ModelNode candidate : allowed) {
    String c=candidate.asString();
    if (c.startsWith(radical)) {
      if (c.equals(radical)) {
        isComplete=true;
        break;
      }
      candidates.add(candidate.asString());
    }
  }
  Collections.sort(candidates);
  return isComplete;
}
Program: 167700
Project: 167700
Buggy source:
private DefaultStateWithEndCharacter(String id,final char leaveStateChar,boolean endRequired,boolean enterLeaveContent,CharacterHandlerMap enterStateHandlers,boolean resolveSystemProperties){
  super(id,enterLeaveContent,enterStateHandlers,resolveSystemProperties);
  this.leaveStateChar=leaveStateChar;
  if (enterLeaveContent) {
    setLeaveHandler(new CharacterHandler(){
      @Override public void handle(      ParsingContext ctx) throws CommandFormatException {
        if (ctx.getCharacter() == leaveStateChar) {
          GlobalCharacterHandlers.CONTENT_CHARACTER_HANDLER.handle(ctx);
        }
      }
    }
);
  }
  if (endRequired) {
    this.setEndContentHandler(new ErrorCharacterHandler(("String_Node_Str" + leaveStateChar + "String_Node_Str")));
  }
 else {
    this.setEndContentHandler(new CharacterHandler(){
      @Override public void handle(      ParsingContext ctx) throws CommandFormatException {
        ctx.setError(new ArgumentValueNotFinishedException("String_Node_Str" + leaveStateChar + "String_Node_Str"));
      }
    }
);
  }
  this.setDefaultHandler(GlobalCharacterHandlers.CONTENT_CHARACTER_HANDLER);
}

Fixed version (ground truth):
private DefaultStateWithEndCharacter(String id,final char leaveStateChar,boolean endRequired,boolean enterLeaveContent,CharacterHandlerMap enterStateHandlers,boolean resolveSystemProperties){
  super(id,enterLeaveContent,enterStateHandlers,resolveSystemProperties);
  this.leaveStateChar=leaveStateChar;
  if (enterLeaveContent) {
    setLeaveHandler(new CharacterHandler(){
      @Override public void handle(      ParsingContext ctx) throws CommandFormatException {
        if (ctx.getCharacter() == leaveStateChar && !ctx.isEndOfContent()) {
          GlobalCharacterHandlers.CONTENT_CHARACTER_HANDLER.handle(ctx);
        }
      }
    }
);
  }
  if (endRequired) {
    this.setEndContentHandler(new ErrorCharacterHandler(("String_Node_Str" + leaveStateChar + "String_Node_Str")));
  }
 else {
    this.setEndContentHandler(new CharacterHandler(){
      @Override public void handle(      ParsingContext ctx) throws CommandFormatException {
        ctx.setError(new ArgumentValueNotFinishedException("String_Node_Str" + leaveStateChar + "String_Node_Str"));
      }
    }
);
  }
  this.setDefaultHandler(GlobalCharacterHandlers.CONTENT_CHARACTER_HANDLER);
}
Program: 167701
Project: 167701
Buggy source:
public CipherSuiteFilterValidator(){
  super(ModelType.STRING,true,true,false);
}

Fixed version (ground truth):
CipherSuiteFilterValidator(){
  super(ModelType.STRING,true,true,false);
}
Program: 167702
Project: 167702
Buggy source:
/** 
 * Connect to the server using a specified host and port.
 * @param protocol The protocol
 * @param controllerHost The host name.
 * @param controllerPort The port.
 * @param username The user name for logging in.
 * @param password The password for logging in.
 */
public void connect(String protocol,String controllerHost,int controllerPort,String username,char[] password,String clientBindAddress){
  doConnect(() -> {
    return CommandContextFactory.getInstance().newCommandContext(new CommandContextConfiguration.Builder().setController(constructUri(protocol,controllerHost,controllerPort)).setUsername(username).setPassword(password).setClientBindAddress(clientBindAddress).build());
  }
);
}

Fixed version (ground truth):
/** 
 * Connect to the server using a specified host and port.
 * @param protocol The protocol
 * @param controllerHost The host name.
 * @param controllerPort The port.
 * @param username The user name for logging in.
 * @param password The password for logging in.
 */
public void connect(String protocol,String controllerHost,int controllerPort,String username,char[] password,String clientBindAddress){
  doConnect(() -> {
    return CommandContextFactory.getInstance().newCommandContext(new CommandContextConfiguration.Builder().setController(constructUri(protocol,controllerHost,controllerPort)).setUsername(username).setPassword(password).setErrorOnInteract(false).setClientBindAddress(clientBindAddress).build());
  }
);
}
Program: 167703
Project: 167703
Buggy source:
public static String getMessagesFromThrowable(Throwable t){
  final StringBuilder buf=new StringBuilder();
  if (t.getLocalizedMessage() != null) {
    buf.append(t.getLocalizedMessage());
  }
 else {
    buf.append(t.getClass().getName());
  }
  Throwable t1=t.getCause();
  while (t1 != null) {
    if (t1.getLocalizedMessage() != null) {
      buf.append("String_Node_Str").append(t1.getLocalizedMessage());
    }
 else {
      buf.append("String_Node_Str").append(t1.getClass().getName());
    }
    t1=t1.getCause();
  }
  for (  Throwable suppressed : t.getSuppressed()) {
    if (suppressed.getLocalizedMessage() != null) {
      buf.append("String_Node_Str").append(suppressed.getLocalizedMessage());
    }
 else {
      buf.append("String_Node_Str").append(suppressed.getClass().getName());
    }
  }
  return buf.toString();
}

Fixed version (ground truth):
public static String getMessagesFromThrowable(Throwable t){
  final StringBuilder buf=new StringBuilder();
  if (t.getLocalizedMessage() != null) {
    buf.append(t.getLocalizedMessage());
  }
 else {
    buf.append(t.getClass().getName());
  }
  boolean encodingSeen=false;
  if (t instanceof CharacterCodingException) {
    encodingSeen=true;
    buf.append("String_Node_Str" + ENCODING_EXCEPTION_MESSAGE);
  }
  Throwable t1=t.getCause();
  while (t1 != null) {
    if (t1.getLocalizedMessage() != null) {
      buf.append("String_Node_Str").append(t1.getLocalizedMessage());
    }
 else {
      buf.append("String_Node_Str").append(t1.getClass().getName());
    }
    if (!encodingSeen && t1 instanceof CharacterCodingException) {
      encodingSeen=true;
      buf.append("String_Node_Str" + ENCODING_EXCEPTION_MESSAGE);
    }
    t1=t1.getCause();
  }
  for (  Throwable suppressed : t.getSuppressed()) {
    if (suppressed.getLocalizedMessage() != null) {
      buf.append("String_Node_Str").append(suppressed.getLocalizedMessage());
    }
 else {
      buf.append("String_Node_Str").append(suppressed.getClass().getName());
    }
  }
  return buf.toString();
}
Program: 167704
Project: 167704
Buggy source:
private List<String> getCommandLines(File file){
  try {
    return Files.readAllLines(file.toPath(),StandardCharsets.UTF_8);
  }
 catch (  IOException e) {
    throw new IllegalStateException("String_Node_Str" + file.getAbsolutePath(),e);
  }
}

Fixed version (ground truth):
private List<String> getCommandLines(File file){
  List<String> lines=new ArrayList<>();
  try (BufferedReader reader=new BufferedReader(new FileReader(file))){
    String line=reader.readLine();
    while (line != null) {
      lines.add(line);
      line=reader.readLine();
    }
  }
 catch (  Throwable e) {
    throw new IllegalStateException("String_Node_Str" + file.getAbsolutePath(),e);
  }
  return lines;
}
Program: 167710
Project: 167710
Buggy source:
private static void processFile(File file,final CommandContext cmdCtx){
  BufferedReader reader=null;
  try {
    reader=Files.newBufferedReader(file.toPath(),StandardCharsets.UTF_8);
    String line=reader.readLine();
    while (cmdCtx.getExitCode() == 0 && !cmdCtx.isTerminated() && line != null) {
      cmdCtx.handleSafe(line.trim());
      line=reader.readLine();
    }
  }
 catch (  Throwable e) {
    throw new IllegalStateException("String_Node_Str" + file.getAbsolutePath() + "String_Node_Str",e);
  }
 finally {
    StreamUtils.safeClose(reader);
  }
}

Fixed version (ground truth):
private static void processFile(File file,final CommandContext cmdCtx){
  BufferedReader reader=null;
  try {
    reader=new BufferedReader(new FileReader(file));
    String line=reader.readLine();
    while (cmdCtx.getExitCode() == 0 && !cmdCtx.isTerminated() && line != null) {
      cmdCtx.handleSafe(line.trim());
      line=reader.readLine();
    }
  }
 catch (  Throwable e) {
    throw new IllegalStateException("String_Node_Str" + file.getAbsolutePath() + "String_Node_Str",e);
  }
 finally {
    StreamUtils.safeClose(reader);
  }
}
Program: 167711
Project: 167711
Buggy source:
protected void setOutputTarget(String filePath){
  if (filePath == null) {
    this.outputTarget=null;
    return;
  }
  try {
    this.outputTarget=Files.newBufferedWriter(Paths.get(filePath),StandardCharsets.UTF_8);
  }
 catch (  IOException e) {
    error(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
protected void setOutputTarget(String filePath){
  if (filePath == null) {
    this.outputTarget=null;
    return;
  }
  FileWriter writer;
  try {
    writer=new FileWriter(filePath,false);
  }
 catch (  IOException e) {
    error(e.getLocalizedMessage());
    return;
  }
  this.outputTarget=new BufferedWriter(writer);
}
Program: 167712
Project: 167712
Buggy source:
@Override protected void doHandle(CommandContext ctx) throws CommandLineException {
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  final String action=this.action.getValue(args);
  if (action == null) {
    throw new CommandFormatException("String_Node_Str");
  }
  if (action.equals("String_Node_Str")) {
    ctx.printColumns(getExistingCommands());
    return;
  }
  if (action.equals("String_Node_Str")) {
    final String nodePath=this.nodePath.getValue(args,true);
    final String propName=this.idProperty.getValue(args,false);
    final String cmdName=this.commandName.getValue(args,true);
    validateInput(ctx,nodePath,propName);
    if (cmdRegistry.getCommandHandler(cmdName) != null) {
      throw new CommandFormatException("String_Node_Str" + cmdName + "String_Node_Str");
    }
    cmdRegistry.registerHandler(new GenericTypeOperationHandler(ctx,nodePath,propName),cmdName);
    return;
  }
  if (action.equals("String_Node_Str")) {
    final String cmdName=this.commandName.getValue(args,true);
    CommandHandler handler=cmdRegistry.getCommandHandler(cmdName);
    if (!(handler instanceof GenericTypeOperationHandler)) {
      throw new CommandFormatException("String_Node_Str" + cmdName + "String_Node_Str");
    }
    cmdRegistry.remove(cmdName);
    return;
  }
  throw new CommandFormatException("String_Node_Str" + action);
}

Fixed version (ground truth):
@Override protected void doHandle(CommandContext ctx) throws CommandLineException {
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  final String action=this.action.getValue(args);
  if (action == null) {
    throw new CommandFormatException("String_Node_Str");
  }
  if (action.equals("String_Node_Str")) {
    ctx.printColumns(getExistingCommands());
    return;
  }
  if (action.equals("String_Node_Str")) {
    final String nodePath=this.nodePath.getValue(args,true);
    final String propName=this.idProperty.getValue(args,false);
    final String cmdName=this.commandName.getValue(args,true);
    validateInput(ctx,nodePath,propName);
    if (cmdRegistry.getCommandHandler(cmdName) != null) {
      throw new CommandFormatException("String_Node_Str" + cmdName + "String_Node_Str");
    }
    cmdRegistry.registerHandler(new GenericTypeOperationHandler(cmdName,ctx,nodePath,propName),cmdName);
    return;
  }
  if (action.equals("String_Node_Str")) {
    final String cmdName=this.commandName.getValue(args,true);
    CommandHandler handler=cmdRegistry.getCommandHandler(cmdName);
    if (!(handler instanceof GenericTypeOperationHandler)) {
      throw new CommandFormatException("String_Node_Str" + cmdName + "String_Node_Str");
    }
    cmdRegistry.remove(cmdName);
    return;
  }
  throw new CommandFormatException("String_Node_Str" + action);
}
Program: 167715
Project: 167715
Buggy source:
protected void listLinks(CommandContext ctx) throws CommandLineException {
  final ModelControllerClient client=ctx.getModelControllerClient();
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  assertNotPresent(allRelevantServerGroups,args);
  assertNotPresent(content,args);
  assertNotPresent(deployments,args);
  assertNotPresent(redeployAffected,args);
  final String name=this.name.getValue(args,true);
  if (name == null) {
    throw new CommandFormatException(this.name + "String_Node_Str");
  }
  final String sg=serverGroups.getValue(ctx.getParsedCommandLine());
  if (ctx.isDomainMode()) {
    final List<String> groups;
    if (sg == null) {
      groups=Util.getServerGroups(client);
    }
 else {
      groups=Arrays.asList(sg.split("String_Node_Str"));
    }
    if (groups.size() == 0) {
      throw new CommandFormatException(serverGroups.getFullName() + "String_Node_Str");
    }
    for (    String group : groups) {
      final List<String> links=loadLinks(client,name,group);
      if (!links.isEmpty()) {
        ctx.printLine("String_Node_Str" + group + Util.LINE_SEPARATOR);
        ctx.printColumns(links);
        ctx.printLine("String_Node_Str");
      }
    }
  }
 else {
    final List<String> content=loadLinks(client,name,sg);
    if (l.isPresent(args)) {
      for (      String contentPath : content) {
        ctx.printLine(contentPath);
      }
    }
 else {
      ctx.printColumns(content);
    }
  }
}

Fixed version (ground truth):
protected void listLinks(CommandContext ctx) throws CommandLineException {
  final ModelControllerClient client=ctx.getModelControllerClient();
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  assertNotPresent(allRelevantServerGroups,args);
  assertNotPresent(content,args);
  assertNotPresent(deployments,args);
  assertNotPresent(redeployAffected,args);
  final String name=getName(ctx,true);
  final String sg=serverGroups.getValue(ctx.getParsedCommandLine());
  if (ctx.isDomainMode()) {
    final List<String> groups;
    if (sg == null) {
      groups=Util.getServerGroups(client);
    }
 else {
      groups=Arrays.asList(sg.split("String_Node_Str"));
    }
    if (groups.size() == 0) {
      throw new CommandFormatException(serverGroups.getFullName() + "String_Node_Str");
    }
    for (    String group : groups) {
      final List<String> links=loadLinks(client,name,group);
      if (!links.isEmpty()) {
        ctx.printLine("String_Node_Str" + group + Util.LINE_SEPARATOR);
        ctx.printColumns(links);
        ctx.printLine("String_Node_Str");
      }
    }
  }
 else {
    final List<String> content=loadLinks(client,name,sg);
    if (l.isPresent(args)) {
      for (      String contentPath : content) {
        ctx.printLine(contentPath);
      }
    }
 else {
      ctx.printColumns(content);
    }
  }
}
Program: 167717
Project: 167717
Buggy source:
protected ModelNode link(CommandContext ctx) throws CommandLineException {
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  assertNotPresent(allRelevantServerGroups,args);
  final String name=this.name.getValue(args,true);
  final String[] deployments=getLinks(this.deployments,args);
  if (deployments == null) {
    throw new CommandFormatException(this.deployments.getFullName() + "String_Node_Str");
  }
  final ModelNode composite=new ModelNode();
  composite.get(Util.OPERATION).set(Util.COMPOSITE);
  composite.get(Util.ADDRESS).setEmptyList();
  final ModelNode steps=composite.get(Util.STEPS);
  final ModelControllerClient client=ctx.getModelControllerClient();
  if (ctx.isDomainMode()) {
    final List<String> sg=getServerGroupsToLink(ctx);
    for (    String group : sg) {
      if (!Util.isValidPath(client,Util.SERVER_GROUP,group,Util.DEPLOYMENT_OVERLAY,name)) {
        final ModelNode op=new ModelNode();
        final ModelNode address=op.get(Util.ADDRESS);
        address.add(Util.SERVER_GROUP,group);
        address.add(Util.DEPLOYMENT_OVERLAY,name);
        op.get(Util.OPERATION).set(Util.ADD);
        steps.add(op);
      }
      addAddRedeployLinksSteps(ctx,steps,name,group,deployments,false);
    }
  }
 else {
    addAddRedeployLinksSteps(ctx,steps,name,null,deployments,false);
  }
  return composite;
}

Fixed version (ground truth):
protected ModelNode link(CommandContext ctx) throws CommandLineException {
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  assertNotPresent(allRelevantServerGroups,args);
  final String name=getName(ctx,false);
  final String[] deployments=getLinks(this.deployments,args);
  if (deployments == null) {
    throw new CommandFormatException(this.deployments.getFullName() + "String_Node_Str");
  }
  final ModelNode composite=new ModelNode();
  composite.get(Util.OPERATION).set(Util.COMPOSITE);
  composite.get(Util.ADDRESS).setEmptyList();
  final ModelNode steps=composite.get(Util.STEPS);
  final ModelControllerClient client=ctx.getModelControllerClient();
  if (ctx.isDomainMode()) {
    final List<String> sg=getServerGroupsToLink(ctx);
    for (    String group : sg) {
      if (!Util.isValidPath(client,Util.SERVER_GROUP,group,Util.DEPLOYMENT_OVERLAY,name)) {
        final ModelNode op=new ModelNode();
        final ModelNode address=op.get(Util.ADDRESS);
        address.add(Util.SERVER_GROUP,group);
        address.add(Util.DEPLOYMENT_OVERLAY,name);
        op.get(Util.OPERATION).set(Util.ADD);
        steps.add(op);
      }
      addAddRedeployLinksSteps(ctx,steps,name,group,deployments,false);
    }
  }
 else {
    addAddRedeployLinksSteps(ctx,steps,name,null,deployments,false);
  }
  return composite;
}
Program: 167719
Project: 167719
Buggy source:
protected ModelNode redeployAffected(CommandContext ctx) throws CommandLineException {
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  assertNotPresent(serverGroups,args);
  assertNotPresent(allServerGroups,args);
  assertNotPresent(allRelevantServerGroups,args);
  assertNotPresent(content,args);
  assertNotPresent(deployments,args);
  assertNotPresent(redeployAffected,args);
  final String overlay=name.getValue(args,true);
  final ModelControllerClient client=ctx.getModelControllerClient();
  final ModelNode redeployOp=new ModelNode();
  redeployOp.get(Util.OPERATION).set(Util.COMPOSITE);
  redeployOp.get(Util.ADDRESS).setEmptyList();
  final ModelNode steps=redeployOp.get(Util.STEPS);
  if (ctx.isDomainMode()) {
    for (    String group : Util.getServerGroupsReferencingOverlay(overlay,client)) {
      addRemoveRedeployLinksSteps(ctx,client,steps,overlay,group,null,false,REDEPLOY_ALL);
    }
  }
 else {
    addRemoveRedeployLinksSteps(ctx,client,steps,overlay,null,null,false,REDEPLOY_ALL);
  }
  if (!steps.isDefined() || steps.asList().isEmpty()) {
    throw new CommandFormatException("String_Node_Str");
  }
  return redeployOp;
}

Fixed version (ground truth):
protected ModelNode redeployAffected(CommandContext ctx) throws CommandLineException {
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  assertNotPresent(serverGroups,args);
  assertNotPresent(allServerGroups,args);
  assertNotPresent(allRelevantServerGroups,args);
  assertNotPresent(content,args);
  assertNotPresent(deployments,args);
  assertNotPresent(redeployAffected,args);
  final String overlay=getName(ctx,false);
  final ModelControllerClient client=ctx.getModelControllerClient();
  final ModelNode redeployOp=new ModelNode();
  redeployOp.get(Util.OPERATION).set(Util.COMPOSITE);
  redeployOp.get(Util.ADDRESS).setEmptyList();
  final ModelNode steps=redeployOp.get(Util.STEPS);
  if (ctx.isDomainMode()) {
    for (    String group : Util.getServerGroupsReferencingOverlay(overlay,client)) {
      addRemoveRedeployLinksSteps(ctx,client,steps,overlay,group,null,false,REDEPLOY_ALL);
    }
  }
 else {
    addRemoveRedeployLinksSteps(ctx,client,steps,overlay,null,null,false,REDEPLOY_ALL);
  }
  if (!steps.isDefined() || steps.asList().isEmpty()) {
    throw new CommandFormatException("String_Node_Str");
  }
  return redeployOp;
}
Program: 167720
Project: 167720
Buggy source:
protected void listContent(CommandContext ctx) throws CommandLineException {
  final ModelControllerClient client=ctx.getModelControllerClient();
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  assertNotPresent(serverGroups,args);
  assertNotPresent(allServerGroups,args);
  assertNotPresent(allRelevantServerGroups,args);
  assertNotPresent(deployments,args);
  assertNotPresent(content,args);
  assertNotPresent(redeployAffected,args);
  final String name=this.name.getValue(args,true);
  if (name == null) {
    throw new CommandFormatException(this.name.getFullName() + "String_Node_Str");
  }
  final List<String> content=loadContentFor(client,name);
  if (l.isPresent(args)) {
    for (    String contentPath : content) {
      ctx.printLine(contentPath);
    }
  }
 else {
    ctx.printColumns(content);
  }
}

Fixed version (ground truth):
protected void listContent(CommandContext ctx) throws CommandLineException {
  final ModelControllerClient client=ctx.getModelControllerClient();
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  assertNotPresent(serverGroups,args);
  assertNotPresent(allServerGroups,args);
  assertNotPresent(allRelevantServerGroups,args);
  assertNotPresent(deployments,args);
  assertNotPresent(content,args);
  assertNotPresent(redeployAffected,args);
  final String name=getName(ctx,true);
  final List<String> content=loadContentFor(client,name);
  if (l.isPresent(args)) {
    for (    String contentPath : content) {
      ctx.printLine(contentPath);
    }
  }
 else {
    ctx.printColumns(content);
  }
}
Program: 167722
Project: 167722
Buggy source:
@Test public void testRollbackBatch() throws Exception {
  addProperty("String_Node_Str","String_Node_Str");
  cli.sendLine("String_Node_Str");
  addProperty("String_Node_Str","String_Node_Str");
  addProperty("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",readProperty("String_Node_Str"));
  assertFalse(cli.isValidPath("String_Node_Str","String_Node_Str"));
  cli.sendLine("String_Node_Str",true);
  String line=cli.readOutput();
  String expectedErrorCode=ControllerLogger.ROOT_LOGGER.compositeOperationFailed();
  expectedErrorCode=expectedErrorCode.substring(0,expectedErrorCode.indexOf(':'));
  assertTrue("String_Node_Str",line.contains(expectedErrorCode));
  assertEquals("String_Node_Str",readProperty("String_Node_Str"));
  assertFalse(cli.isValidPath("String_Node_Str","String_Node_Str"));
  cli.sendLine("String_Node_Str");
  removeProperty("String_Node_Str");
  assertFalse(cli.isValidPath("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testRollbackBatch() throws Exception {
  addProperty("String_Node_Str","String_Node_Str");
  cli.sendLine("String_Node_Str");
  addProperty("String_Node_Str","String_Node_Str");
  addProperty("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",readProperty("String_Node_Str"));
  assertFalse(cli.isValidPath("String_Node_Str","String_Node_Str"));
  cli.sendLine("String_Node_Str",true);
  String line=cli.readOutput();
  String expectedErrorCode=ControllerLogger.ROOT_LOGGER.compositeOperationFailed();
  expectedErrorCode=expectedErrorCode.substring(0,expectedErrorCode.indexOf(':'));
  assertTrue("String_Node_Str",line.contains(expectedErrorCode));
  assertTrue("String_Node_Str",line.contains("String_Node_Str"));
  assertEquals("String_Node_Str",readProperty("String_Node_Str"));
  assertFalse(cli.isValidPath("String_Node_Str","String_Node_Str"));
  cli.sendLine("String_Node_Str");
  removeProperty("String_Node_Str");
  assertFalse(cli.isValidPath("String_Node_Str","String_Node_Str"));
}
Program: 167723
Project: 167723
Buggy source:
/** 
 * Create an alias in interactive mode and verify it was persisted in .aesh_aliases file at the end of the session <a href="https://issues.jboss.org/browse/WFCORE-1294">WFCORE-1294</a>
 * @throws Exception
 */
@Test @Ignore("String_Node_Str") public void testAliasPersistence() throws Exception {
  final File aliasFile=temporaryUserHome.newFile("String_Node_Str");
  CliProcessWrapper cli=new CliProcessWrapper().addCliArgument("String_Node_Str").addJavaOption("String_Node_Str" + temporaryUserHome.getRoot().toPath().toString()).addCliArgument("String_Node_Str" + temporaryUserHome.getRoot().toPath().toString());
  try {
    cli.executeInteractive();
    cli.pushLineAndWaitForResults("String_Node_Str" + VALID_ALIAS_NAME + "String_Node_Str"+ VALID_ALIAS_COMMAND);
    cli.ctrlCAndWaitForClose();
  }
 catch (  Exception ex) {
    fail(ex.getLocalizedMessage());
  }
 finally {
    cli.destroyProcess();
  }
  List<String> aliasesInFile=Files.readAllLines(aliasFile.toPath(),Charset.defaultCharset());
  boolean found=false;
  for (  String line : aliasesInFile) {
    if (line.contains("String_Node_Str" + VALID_ALIAS_NAME + "String_Node_Str"+ VALID_ALIAS_COMMAND)) {
      found=true;
      break;
    }
  }
  assertTrue("String_Node_Str",found);
}

Fixed version (ground truth):
/** 
 * Create an alias in interactive mode and verify it was persisted in .aesh_aliases file at the end of the session <a href="https://issues.jboss.org/browse/WFCORE-1294">WFCORE-1294</a>
 * @throws Exception
 */
@Test public void testAliasPersistence() throws Exception {
  final File aliasFile=temporaryUserHome.newFile("String_Node_Str");
  CliProcessWrapper cli=new CliProcessWrapper().addCliArgument("String_Node_Str").addJavaOption("String_Node_Str" + temporaryUserHome.getRoot().toPath().toString()).addCliArgument("String_Node_Str" + temporaryUserHome.getRoot().toPath().toString());
  try {
    cli.executeInteractive();
    cli.pushLineAndWaitForResults("String_Node_Str" + VALID_ALIAS_NAME + "String_Node_Str"+ VALID_ALIAS_COMMAND);
    cli.pushLineAndWaitForResults("String_Node_Str");
  }
 catch (  Exception ex) {
    fail(ex.getLocalizedMessage());
  }
 finally {
    cli.destroyProcess();
  }
  assertAliasSaved(aliasFile);
}
Program: 167725
Project: 167725
Buggy source:
@Test public void testBatchFile() throws Exception {
  CLIWrapper cli=new CLIWrapper(true);
  File f=new File(System.currentTimeMillis() + "String_Node_Str");
  File f2=new File(f.getAbsolutePath() + "String_Node_Str");
  assertFalse(f.exists());
  assertFalse(f2.exists());
  File batchFile=new File(System.currentTimeMillis() + "String_Node_Str");
  String cmd="String_Node_Str" + "String_Node_Str" + f.getAbsolutePath() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ f.getAbsolutePath()+ "String_Node_Str";
  Files.write(batchFile.toPath(),cmd.getBytes());
  try {
    cli.sendLine("String_Node_Str" + batchFile + "String_Node_Str");
    assertTrue(f.exists() && f.length() != 0);
    assertTrue(f2.exists() && f2.length() == 0);
  }
  finally {
    batchFile.delete();
    f.delete();
    f2.delete();
    cli.quit();
  }
}

Fixed version (ground truth):
@Test public void testBatchFile() throws Exception {
  CLIWrapper cli=new CLIWrapper(true);
  File f=new File(System.currentTimeMillis() + "String_Node_Str");
  File f2=new File(f.getAbsolutePath() + "String_Node_Str");
  assertFalse(f.exists());
  assertFalse(f2.exists());
  File batchFile=new File(System.currentTimeMillis() + "String_Node_Str");
  String cmd="String_Node_Str" + "String_Node_Str" + f.getAbsolutePath() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ f.getAbsolutePath()+ "String_Node_Str";
  Files.write(batchFile.toPath(),cmd.getBytes());
  try {
    cli.sendLine("String_Node_Str" + batchFile + "String_Node_Str");
    assertTrue(f.exists() && f.length() != 0);
    assertTrue(f2.exists() && f2.length() != 0);
  }
  finally {
    batchFile.delete();
    f.delete();
    f2.delete();
    cli.quit();
  }
}
Program: 167726
Project: 167726
Buggy source:
@Test public void testBatch() throws Exception {
  CLIWrapper cli=new CLIWrapper(true);
  File f=new File(System.currentTimeMillis() + "String_Node_Str");
  File f2=new File(f.getAbsolutePath() + "String_Node_Str");
  assertFalse(f.exists());
  assertFalse(f2.exists());
  try {
    cli.sendLine("String_Node_Str");
    cli.sendLine("String_Node_Str" + "String_Node_Str" + f.getAbsolutePath());
    cli.sendLine("String_Node_Str" + "String_Node_Str" + f.getAbsolutePath());
    cli.sendLine("String_Node_Str");
    assertTrue(f.exists() && f.length() != 0);
    assertTrue(f2.exists() && f2.length() == 0);
  }
  finally {
    f.delete();
    f2.delete();
    cli.quit();
  }
}

Fixed version (ground truth):
@Test public void testBatch() throws Exception {
  CLIWrapper cli=new CLIWrapper(true);
  File f=new File(System.currentTimeMillis() + "String_Node_Str");
  File f2=new File(f.getAbsolutePath() + "String_Node_Str");
  assertFalse(f.exists());
  assertFalse(f2.exists());
  try {
    cli.sendLine("String_Node_Str");
    cli.sendLine("String_Node_Str" + "String_Node_Str" + f.getAbsolutePath());
    cli.sendLine("String_Node_Str" + "String_Node_Str" + f.getAbsolutePath());
    cli.sendLine("String_Node_Str");
    assertTrue(f.exists() && f.length() != 0);
    assertTrue(f2.exists() && f2.length() != 0);
  }
  finally {
    f.delete();
    f2.delete();
    cli.quit();
  }
}
Program: 167727
Project: 167727
Buggy source:
@Override public void addCompleter(final CommandLineCompleter completer){
  console.addCompletion(new Completion(){
    @Override public void complete(    CompleteOperation co){
      List<String> candidates=new ArrayList<>();
      int offset=completer.complete(cmdCtx,co.getBuffer(),co.getCursor(),candidates);
      co.setOffset(offset);
      co.setCompletionCandidates(candidates);
      if (co.getCompletionCandidates().size() == 1 && co.getCompletionCandidates().get(0).getCharacters().startsWith(co.getBuffer()))       co.doAppendSeparator(true);
 else       co.doAppendSeparator(false);
    }
  }
);
}

Fixed version (ground truth):
@Override public void addCompleter(final CommandLineCompleter completer){
  console.addCompletion(new Completion(){
    @Override public void complete(    CompleteOperation co){
      List<String> candidates=new ArrayList<>();
      int offset=completer.complete(cmdCtx,co.getBuffer(),co.getCursor(),candidates);
      co.setOffset(offset);
      co.setCompletionCandidates(candidates);
      String buffer=cmdCtx.getArgumentsString() == null ? co.getBuffer() : ctx.getArgumentsString() + co.getBuffer();
      if (co.getCompletionCandidates().size() == 1 && co.getCompletionCandidates().get(0).getCharacters().startsWith(buffer))       co.doAppendSeparator(true);
 else       co.doAppendSeparator(false);
    }
  }
);
}
Program: 167729
Project: 167729
Buggy source:
@Override public void complete(CompleteOperation co){
  List<String> candidates=new ArrayList<>();
  int offset=completer.complete(cmdCtx,co.getBuffer(),co.getCursor(),candidates);
  co.setOffset(offset);
  co.setCompletionCandidates(candidates);
  if (co.getCompletionCandidates().size() == 1 && co.getCompletionCandidates().get(0).getCharacters().startsWith(co.getBuffer()))   co.doAppendSeparator(true);
 else   co.doAppendSeparator(false);
}

Fixed version (ground truth):
@Override public void complete(CompleteOperation co){
  List<String> candidates=new ArrayList<>();
  int offset=completer.complete(cmdCtx,co.getBuffer(),co.getCursor(),candidates);
  co.setOffset(offset);
  co.setCompletionCandidates(candidates);
  String buffer=cmdCtx.getArgumentsString() == null ? co.getBuffer() : ctx.getArgumentsString() + co.getBuffer();
  if (co.getCompletionCandidates().size() == 1 && co.getCompletionCandidates().get(0).getCharacters().startsWith(buffer))   co.doAppendSeparator(true);
 else   co.doAppendSeparator(false);
}
Program: 167730
Project: 167730
Buggy source:
protected OperationRequestAddress getAddress(CommandContext ctx) throws CommandFormatException {
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  final OperationRequestAddress address;
  if (node.isPresent(args)) {
    address=new DefaultOperationRequestAddress(ctx.getCurrentNodePath());
    CommandLineParser.CallbackHandler handler=new DefaultCallbackHandler(address);
    String nodePath=args.getSubstitutedLine();
    int nodeArgInd=nodePath.indexOf("String_Node_Str");
    if (nodeArgInd < 0) {
      throw new CommandFormatException("String_Node_Str" + nodePath + "String_Node_Str");
    }
    int nodeArgEndInd=nodeArgInd + 8;
    do {
      nodeArgEndInd=nodePath.indexOf(' ',nodeArgEndInd);
      if (nodeArgEndInd < 0) {
        nodeArgEndInd=nodePath.length();
      }
 else       if (nodePath.charAt(nodeArgEndInd - 1) == '\\') {
        ++nodeArgEndInd;
      }
 else {
        break;
      }
    }
 while (nodeArgEndInd < nodePath.length());
    nodePath=nodePath.substring(nodeArgInd + 8,nodeArgEndInd);
    ctx.getCommandLineParser().parse(nodePath,handler);
  }
 else {
    address=new DefaultOperationRequestAddress(ctx.getCurrentNodePath());
  }
  return address;
}

Fixed version (ground truth):
protected OperationRequestAddress getAddress(CommandContext ctx) throws CommandFormatException {
  final ParsedCommandLine args=ctx.getParsedCommandLine();
  final OperationRequestAddress address;
  if (node.isPresent(args) && node.isValueComplete(args)) {
    address=new DefaultOperationRequestAddress(ctx.getCurrentNodePath());
    CommandLineParser.CallbackHandler handler=new DefaultCallbackHandler(address);
    String nodePath=args.getSubstitutedLine();
    int nodeArgInd=nodePath.indexOf("String_Node_Str");
    if (nodeArgInd < 0) {
      throw new CommandFormatException("String_Node_Str" + nodePath + "String_Node_Str");
    }
    int nodeArgEndInd=nodeArgInd + 8;
    do {
      nodeArgEndInd=nodePath.indexOf(' ',nodeArgEndInd);
      if (nodeArgEndInd < 0) {
        nodeArgEndInd=nodePath.length();
      }
 else       if (nodePath.charAt(nodeArgEndInd - 1) == '\\') {
        ++nodeArgEndInd;
      }
 else {
        break;
      }
    }
 while (nodeArgEndInd < nodePath.length());
    nodePath=nodePath.substring(nodeArgInd + 8,nodeArgEndInd);
    ctx.getCommandLineParser().parse(nodePath,handler);
  }
 else {
    address=new DefaultOperationRequestAddress(ctx.getCurrentNodePath());
  }
  return address;
}
Program: 167731
Project: 167731
Buggy source:
@Override public boolean isValueRequired(){
  return true;
}

Fixed version (ground truth):
/** 
 * Argument can only appear if not already present in the parsed command BUT this is not all the time true, for example, an argument cannot appear AFTER some other arguments. This logic is in the parent implementation. That is why, although we would like to redefine the method at this point we can't.
 */
@Override public boolean isValueRequired(){
  return true;
}
Program: 167732
Project: 167732
Buggy source:
@Override public boolean canAppearNext(CommandContext ctx) throws CommandFormatException {
  if (!access.isSatisfied(ctx)) {
    return false;
  }
  ParsedCommandLine args=ctx.getParsedCommandLine();
  if (exclusive) {
    final Set<String> propertyNames=args.getPropertyNames();
    if (propertyNames.isEmpty()) {
      final List<String> values=args.getOtherProperties();
      if (values.isEmpty()) {
        return true;
      }
      if (index == -1) {
        return false;
      }
      return !(index == 0 && values.size() == 1);
    }
    if (propertyNames.size() != 1) {
      return false;
    }
    if (args.getLastParsedPropertyName() == null) {
      return false;
    }
    final List<String> values=args.getOtherProperties();
    if (!values.isEmpty()) {
      return false;
    }
    return fullName.startsWith(args.getLastParsedPropertyName()) || (shortName != null && shortName.startsWith(args.getLastParsedPropertyName()));
  }
  if (isPresent(args)) {
    return !isValueComplete(args);
  }
  for (  CommandArgument arg : cantAppearAfter) {
    if (arg.isPresent(args)) {
      return false;
    }
  }
  if (requiredPreceding != null) {
    for (    CommandArgument arg : requiredPreceding) {
      if (arg.isPresent(args)) {
        return true;
      }
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean canAppearNext(CommandContext ctx) throws CommandFormatException {
  if (!access.isSatisfied(ctx)) {
    return false;
  }
  ParsedCommandLine args=ctx.getParsedCommandLine();
  if (exclusive) {
    final Set<String> propertyNames=args.getPropertyNames();
    if (propertyNames.isEmpty()) {
      final List<String> values=args.getOtherProperties();
      if (values.isEmpty()) {
        return true;
      }
      if (index == -1) {
        return false;
      }
      return !(index == 0 && values.size() == 1);
    }
    if (propertyNames.size() != 1) {
      return false;
    }
    if (args.getLastParsedPropertyName() == null) {
      return false;
    }
    final List<String> values=args.getOtherProperties();
    if (!values.isEmpty()) {
      return false;
    }
    if (fullName.equals(args.getLastParsedPropertyName())) {
      return false;
    }
    return fullName.startsWith(args.getLastParsedPropertyName()) || (shortName != null && shortName.startsWith(args.getLastParsedPropertyName()));
  }
  if (isPresent(args)) {
    return false;
  }
  for (  CommandArgument arg : cantAppearAfter) {
    if (arg.isPresent(args)) {
      return false;
    }
  }
  if (requiredPreceding != null) {
    for (    CommandArgument arg : requiredPreceding) {
      if (arg.isPresent(args)) {
        return true;
      }
    }
    return false;
  }
  return true;
}
Program: 167734
Project: 167734
Buggy source:
@Override public void marshallAsElement(AttributeDefinition attribute,ModelNode resourceModel,boolean marshallDefault,XMLStreamWriter writer) throws XMLStreamException {
  String wrapper=wrapperElement == null ? attribute.getName() : wrapperElement;
  resourceModel=resourceModel.get(attribute.getName());
  if (!resourceModel.isDefined()) {
    writer.writeEmptyElement(wrapper);
    return;
  }
  if (wrapElement) {
    writer.writeStartElement(wrapper);
  }
  for (  ModelNode property : resourceModel.asList()) {
    writer.writeEmptyElement(elementName);
    writer.writeAttribute(org.jboss.as.controller.parsing.Attribute.NAME.getLocalName(),property.asProperty().getName());
    writer.writeAttribute(org.jboss.as.controller.parsing.Attribute.VALUE.getLocalName(),property.asProperty().getValue().asString());
  }
  if (wrapElement) {
    writer.writeEndElement();
  }
}

Fixed version (ground truth):
@Override public void marshallAsElement(AttributeDefinition attribute,ModelNode resourceModel,boolean marshallDefault,XMLStreamWriter writer) throws XMLStreamException {
  resourceModel=resourceModel.get(attribute.getName());
  if (!resourceModel.isDefined()) {
    return;
  }
  String wrapper=wrapperElement == null ? attribute.getName() : wrapperElement;
  List<ModelNode> elementList=resourceModel.asList();
  if (elementList.isEmpty()) {
    if (wrapElement) {
      writer.writeEmptyElement(wrapper);
    }
 else {
      ControllerLogger.MGMT_OP_LOGGER.debugf("String_Node_Str",getClass().getSimpleName(),attribute.getName());
    }
    return;
  }
  if (wrapElement) {
    writer.writeStartElement(wrapper);
  }
  for (  ModelNode property : elementList) {
    writer.writeEmptyElement(elementName);
    writer.writeAttribute(org.jboss.as.controller.parsing.Attribute.NAME.getLocalName(),property.asProperty().getName());
    writer.writeAttribute(org.jboss.as.controller.parsing.Attribute.VALUE.getLocalName(),property.asProperty().getValue().asString());
  }
  if (wrapElement) {
    writer.writeEndElement();
  }
}
Program: 167735
Project: 167735
Buggy source:
private void parseGroup(XMLExtendedStreamReader reader,ModelNode op,boolean wildcard) throws XMLStreamException {
  parseAttributes(reader,op,attributesByGroup.get(reader.getLocalName()),wildcard);
  if (reader.hasNext()) {
    if (reader.nextTag() == START_ELEMENT && attributeElements.containsKey(reader.getLocalName())) {
      AttributeDefinition ad=attributeElements.get(reader.getLocalName());
      ad.getParser().parseElement(ad,reader,op);
      ParseUtils.requireNoContent(reader);
    }
 else     if (reader.getEventType() != END_ELEMENT) {
      throw ParseUtils.unexpectedElement(reader);
    }
  }
}

Fixed version (ground truth):
private void parseGroup(XMLExtendedStreamReader reader,ModelNode op,boolean wildcard) throws XMLStreamException {
  Map<String,AttributeDefinition> groupAttrs=attributesByGroup.get(reader.getLocalName());
  parseAttributes(reader,op,groupAttrs,wildcard);
  while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
    String attrName=reader.getLocalName();
    if (attributeElements.containsKey(attrName) && groupAttrs.containsKey(attrName)) {
      AttributeDefinition ad=attributeElements.get(reader.getLocalName());
      ad.getParser().parseElement(ad,reader,op);
    }
 else {
      throw ParseUtils.unexpectedElement(reader);
    }
  }
}
Program: 167736
Project: 167736
Buggy source:
@Override public void interact(){
  interact=true;
  if (cmdCompleter == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (this.client == null) {
    printLine("String_Node_Str" + "String_Node_Str");
  }
  console.setPrompt(getPrompt());
  while (!isTerminated()) {
    try {
      Thread.sleep(10);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void interact(){
  interact=true;
  if (cmdCompleter == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (this.client == null) {
    printLine("String_Node_Str" + "String_Node_Str");
  }
  console.setPrompt(getPrompt());
  while (!isTerminated() && console.running()) {
    try {
      Thread.sleep(10);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
}
Program: 167738
Project: 167738
Buggy source:
private Index calculateModuleIndex(final Module module) throws ModuleLoadException, IOException {
  final Indexer indexer=new Indexer();
  final PathFilter filter=PathFilters.getDefaultImportFilter();
  final Iterator<Resource> iterator=module.iterateResources(filter);
  while (iterator.hasNext()) {
    Resource resource=iterator.next();
    indexer.index(resource.openStream());
  }
  return indexer.complete();
}

Fixed version (ground truth):
private Index calculateModuleIndex(final Module module) throws ModuleLoadException, IOException {
  final Indexer indexer=new Indexer();
  final PathFilter filter=PathFilters.getDefaultImportFilter();
  final Iterator<Resource> iterator=module.iterateResources(filter);
  while (iterator.hasNext()) {
    Resource resource=iterator.next();
    if (resource.getName().endsWith("String_Node_Str")) {
      try (InputStream in=resource.openStream()){
        indexer.index(in);
      }
 catch (      Exception e) {
        ServerLogger.DEPLOYMENT_LOGGER.cannotIndexClass(resource.getName(),resource.getURL().toExternalForm(),e);
      }
    }
  }
  return indexer.complete();
}
Program: 167739
Project: 167739
Buggy source:
@Override public Object resolveValue(CommandContext ctx,ModelNode response) throws CommandLineException {
  final List<Operand> operands=getOperands();
  if (operands.isEmpty()) {
    throw new CommandLineException(getName() + "String_Node_Str");
  }
  if (operands.size() != 2) {
    throw new CommandLineException(getName() + "String_Node_Str" + operands.size());
  }
  final Object left=operands.get(0).resolveValue(ctx,response);
  if (left == null) {
    return false;
  }
  final Object right=operands.get(1).resolveValue(ctx,response);
  if (right == null) {
    return false;
  }
  if (!(left instanceof ModelNode) || !(right instanceof ModelNode)) {
    throw new CommandLineException("String_Node_Str" + left.getClass().getName() + "String_Node_Str"+ right.getClass().getName());
  }
  if (((ModelNode)left).getType() != ((ModelNode)right).getType()) {
    return false;
  }
  return compare(left,right);
}

Fixed version (ground truth):
@Override public Object resolveValue(CommandContext ctx,ModelNode response) throws CommandLineException {
  final List<Operand> operands=getOperands();
  if (operands.isEmpty()) {
    throw new CommandLineException(getName() + "String_Node_Str");
  }
  if (operands.size() != 2) {
    throw new CommandLineException(getName() + "String_Node_Str" + operands.size());
  }
  final Object left=operands.get(0).resolveValue(ctx,response);
  if (left == null) {
    return false;
  }
  final Object right=operands.get(1).resolveValue(ctx,response);
  if (right == null) {
    return false;
  }
  if (!(left instanceof ModelNode) || !(right instanceof ModelNode)) {
    throw new CommandLineException("String_Node_Str" + left.getClass().getName() + "String_Node_Str"+ right.getClass().getName());
  }
  return compare(left,right);
}
Program: 167740
Project: 167740
Buggy source:
@Override public Object resolveValue(CommandContext ctx,ModelNode response) throws CommandLineException {
  ModelNode targetValue=response;
  for (  String name : path) {
    if (!targetValue.has(name)) {
      break;
    }
 else {
      targetValue=targetValue.get(name);
    }
  }
  return targetValue == null ? null : targetValue;
}

Fixed version (ground truth):
@Override public Object resolveValue(CommandContext ctx,ModelNode response) throws CommandLineException {
  ModelNode targetValue=response;
  for (  String name : path) {
    if (!targetValue.has(name)) {
      return null;
    }
 else {
      targetValue=targetValue.get(name);
    }
  }
  return targetValue == null ? null : targetValue;
}