Program: 151463
Project: 151463
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public CommandResult execute(CommandInvocation commandInvocation) throws IOException {
  boolean failure=true;
  if (interaction.getController().isValid()) {
    Result result=null;
    try {
      result=interaction.getController().execute();
    }
 catch (    Exception e) {
      log.log(Level.SEVERE,"String_Node_Str" + interaction.getName() + "String_Node_Str",e);
      result=Results.fail(e.getMessage(),e);
    }
    if (result != null && result.getMessage() != null && !result.getMessage().isEmpty()) {
      if (result instanceof Failed) {
        ShellMessages.error(shell.getConsole().getShell().err(),result.getMessage());
      }
 else {
        failure=false;
        ShellMessages.success(shell.getConsole().getShell().out(),result.getMessage());
      }
    }
    ShellContext context=interaction.getContext().getSelection();
    Object selection=context.getSelection();
    if (selection != null) {
      if (selection instanceof Iterable<?>) {
        for (        FileResource<?> item : (Iterable<FileResource<?>>)selection) {
          if (item != null) {
            shell.setCurrentResource(item);
            break;
          }
        }
      }
 else {
        shell.setCurrentResource((FileResource<?>)selection);
      }
    }
  }
 else {
    List<UIValidationMessage> messages=interaction.getController().validate();
    for (    UIValidationMessage message : messages) {
      if (message.getSeverity() == Severity.ERROR)       ShellMessages.error(shell.getConsole().getShell().err(),message.getDescription());
    }
  }
  return failure ? CommandResult.FAILURE : CommandResult.SUCCESS;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public CommandResult execute(CommandInvocation commandInvocation) throws IOException {
  boolean failure=false;
  if (interaction.getController().isValid()) {
    Result result=null;
    try {
      result=interaction.getController().execute();
    }
 catch (    Exception e) {
      log.log(Level.SEVERE,"String_Node_Str" + interaction.getName() + "String_Node_Str",e);
      result=Results.fail(e.getMessage(),e);
    }
    if (result != null && result.getMessage() != null && !result.getMessage().isEmpty()) {
      if (result instanceof Failed) {
        ShellMessages.error(shell.getConsole().getShell().err(),result.getMessage());
        failure=true;
      }
 else {
        ShellMessages.success(shell.getConsole().getShell().out(),result.getMessage());
        failure=false;
      }
    }
    Object selection=interaction.getContext().getSelection();
    if (selection != null) {
      if (selection instanceof Iterable<?>) {
        for (        FileResource<?> item : (Iterable<FileResource<?>>)selection) {
          if (item != null) {
            shell.setCurrentResource(item);
            break;
          }
        }
      }
 else {
        shell.setCurrentResource((FileResource<?>)selection);
      }
    }
  }
 else {
    List<UIValidationMessage> messages=interaction.getController().validate();
    for (    UIValidationMessage message : messages) {
      if (message.getSeverity() == Severity.ERROR)       ShellMessages.error(shell.getConsole().getShell().err(),message.getDescription());
    }
  }
  return failure ? CommandResult.FAILURE : CommandResult.SUCCESS;
}