Program: 7259
Project: 7259
Buggy source:
protected void setPreferences(String[] programIdParts,PrintStream printStream,Map<String,String> args) throws Exception {
switch (type) {
case INSTANCE:
    if (programIdParts.length != 0) {
      throw new CommandInputError(this);
    }
  client.setInstancePreferences(args);
printSuccessMessage(printStream,type);
break;
case NAMESPACE:
if (programIdParts.length != 0) {
throw new CommandInputError(this);
}
client.setNamespacePreferences(cliConfig.getCurrentNamespace(),args);
printSuccessMessage(printStream,type);
break;
case APP:
if (programIdParts.length != 1) {
throw new CommandInputError(this);
}
client.setApplicationPreferences(cliConfig.getCurrentNamespace(),programIdParts[0],args);
printSuccessMessage(printStream,type);
break;
case FLOW:
if (programIdParts.length != 2) {
throw new CommandInputError(this);
}
client.setProgramPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),type.getPluralName(),programIdParts[1],args);
printSuccessMessage(printStream,type);
break;
case PROCEDURE:
if (programIdParts.length != 2) {
throw new CommandInputError(this);
}
client.setProgramPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),type.getPluralName(),programIdParts[1],args);
printSuccessMessage(printStream,type);
break;
case MAPREDUCE:
if (programIdParts.length != 2) {
throw new CommandInputError(this);
}
client.setProgramPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),type.getPluralName(),programIdParts[1],args);
printSuccessMessage(printStream,type);
break;
case WORKFLOW:
if (programIdParts.length != 2) {
throw new CommandInputError(this);
}
client.setProgramPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),type.getPluralName(),programIdParts[1],args);
printSuccessMessage(printStream,type);
break;
case SERVICE:
if (programIdParts.length != 2) {
throw new CommandInputError(this);
}
client.setProgramPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),type.getPluralName(),programIdParts[1],args);
printSuccessMessage(printStream,type);
break;
case SPARK:
if (programIdParts.length != 2) {
throw new CommandInputError(this);
}
client.setProgramPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),type.getPluralName(),programIdParts[1],args);
printSuccessMessage(printStream,type);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + type.getPrettyName());
}
}

Fixed version (ground truth):
protected void setPreferences(String[] programIdParts,PrintStream printStream,Map<String,String> args) throws Exception {
switch (type) {
case INSTANCE:
    if (programIdParts.length != 0) {
      throw new CommandInputError(this);
    }
  client.setInstancePreferences(args);
printSuccessMessage(printStream,type);
break;
case NAMESPACE:
if (programIdParts.length != 0) {
throw new CommandInputError(this);
}
client.setNamespacePreferences(cliConfig.getCurrentNamespace(),args);
printSuccessMessage(printStream,type);
break;
case APP:
if (programIdParts.length != 1) {
throw new CommandInputError(this);
}
client.setApplicationPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),args);
printSuccessMessage(printStream,type);
break;
case FLOW:
if (programIdParts.length != 2) {
throw new CommandInputError(this);
}
client.setProgramPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),type.getPluralName(),programIdParts[1],args);
printSuccessMessage(printStream,type);
break;
case PROCEDURE:
if (programIdParts.length != 2) {
throw new CommandInputError(this);
}
client.setProgramPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),type.getPluralName(),programIdParts[1],args);
printSuccessMessage(printStream,type);
break;
case MAPREDUCE:
if (programIdParts.length != 2) {
throw new CommandInputError(this);
}
client.setProgramPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),type.getPluralName(),programIdParts[1],args);
printSuccessMessage(printStream,type);
break;
case WORKFLOW:
if (programIdParts.length != 2) {
throw new CommandInputError(this);
}
client.setProgramPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),type.getPluralName(),programIdParts[1],args);
printSuccessMessage(printStream,type);
break;
case SERVICE:
if (programIdParts.length != 2) {
throw new CommandInputError(this);
}
client.setProgramPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),type.getPluralName(),programIdParts[1],args);
printSuccessMessage(printStream,type);
break;
case SPARK:
if (programIdParts.length != 2) {
throw new CommandInputError(this);
}
client.setProgramPreferences(Id.Application.from(cliConfig.getCurrentNamespace(),programIdParts[0]),type.getPluralName(),programIdParts[1],args);
printSuccessMessage(printStream,type);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + type.getPrettyName());
}
}