nus-yam/ex-repair huggingface dataset:
Program: 823
Project: 823
Buggy source:
private static void handleLaunchArguments(String[] args){
  Path homePath=null;
  for (  String arg : args) {
    boolean recognized=true;
    if (arg.startsWith(USE_SPECIFIED_DIR_AS_HOME)) {
      homePath=Paths.get(arg.substring(USE_SPECIFIED_DIR_AS_HOME.length()));
    }
 else     if (arg.equals(USE_CURRENT_DIR_AS_HOME)) {
      homePath=Paths.get("String_Node_Str");
    }
 else     if (arg.equals(START_HEADLESS)) {
      isHeadless=true;
      crashReportEnabled=false;
    }
 else     if (arg.equals(NO_SAVE_GAMES)) {
      writeSaveGamesEnabled=false;
    }
 else     if (arg.equals(NO_CRASH_REPORT)) {
      crashReportEnabled=false;
    }
 else     if (arg.equals(NO_SOUND)) {
      soundEnabled=false;
    }
 else     if (arg.equals(LOAD_LAST_GAME)) {
      loadLastGame=true;
    }
 else     if (arg.startsWith(SERVER_PORT)) {
      try {
        serverPort=Integer.parseInt(arg.substring(SERVER_PORT.length()));
      }
 catch (      NumberFormatException e) {
        reportException(e);
      }
    }
 else {
      recognized=false;
    }
    System.out.println((recognized ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + arg);
  }
  try {
    if (homePath != null) {
      PathManager.getInstance().useOverrideHomePath(homePath);
    }
 else {
      PathManager.getInstance().useDefaultHomePath();
    }
  }
 catch (  IOException e) {
    if (!isHeadless) {
      reportException(e);
    }
    System.exit(0);
  }
}

Fixed version (ground truth):
private static void handleLaunchArguments(String[] args){
  Path homePath=null;
  for (  String arg : args) {
    boolean recognized=true;
    if (arg.startsWith(USE_SPECIFIED_DIR_AS_HOME)) {
      homePath=Paths.get(arg.substring(USE_SPECIFIED_DIR_AS_HOME.length()));
    }
 else     if (arg.equals(USE_CURRENT_DIR_AS_HOME)) {
      homePath=Paths.get("String_Node_Str");
    }
 else     if (arg.equals(START_HEADLESS)) {
      isHeadless=true;
      crashReportEnabled=false;
    }
 else     if (arg.equals(NO_SAVE_GAMES)) {
      writeSaveGamesEnabled=false;
    }
 else     if (arg.equals(NO_CRASH_REPORT)) {
      crashReportEnabled=false;
    }
 else     if (arg.equals(NO_SOUND)) {
      soundEnabled=false;
    }
 else     if (arg.equals(LOAD_LAST_GAME)) {
      loadLastGame=true;
    }
 else     if (arg.startsWith(SERVER_PORT)) {
      serverPort=arg.substring(SERVER_PORT.length());
    }
 else {
      recognized=false;
    }
    System.out.println((recognized ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + arg);
  }
  try {
    if (homePath != null) {
      PathManager.getInstance().useOverrideHomePath(homePath);
    }
 else {
      PathManager.getInstance().useDefaultHomePath();
    }
  }
 catch (  IOException e) {
    reportException(e);
    System.exit(0);
  }
}
Program: 825
Project: 825
Buggy source:
public static void main(String[] args){
  SplashScreen.getInstance().post("String_Node_Str" + System.getProperty("String_Node_Str") + "String_Node_Str");
  handlePrintUsageRequest(args);
  handleLaunchArguments(args);
  setupLogging();
  try (final TerasologyEngine engine=new TerasologyEngine(createSubsystemList())){
    Config config=CoreRegistry.get(Config.class);
    if (!writeSaveGamesEnabled) {
      config.getTransients().setWriteSaveGamesEnabled(writeSaveGamesEnabled);
    }
    if (serverPort != -1) {
      config.getTransients().setServerPort(serverPort);
    }
    if (isHeadless) {
      engine.subscribeToStateChange(new HeadlessStateChangeListener());
      engine.run(new StateHeadlessSetup());
    }
 else {
      if (loadLastGame) {
        engine.submitTask("String_Node_Str",new Runnable(){
          @Override public void run(){
            GameManifest gameManifest=getLatestGameManifest();
            if (gameManifest != null) {
              engine.changeState(new StateLoading(gameManifest,NetworkMode.NONE));
            }
          }
        }
);
      }
      SplashScreen.getInstance().close();
      engine.run(new StateMainMenu());
    }
  }
 catch (  Throwable e) {
    if (!GraphicsEnvironment.isHeadless()) {
      reportException(e);
    }
  }
 finally {
    SplashScreen.getInstance().close();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  SplashScreen.getInstance().post("String_Node_Str" + System.getProperty("String_Node_Str") + "String_Node_Str");
  handlePrintUsageRequest(args);
  handleLaunchArguments(args);
  setupLogging();
  try (final TerasologyEngine engine=new TerasologyEngine(createSubsystemList())){
    Config config=CoreRegistry.get(Config.class);
    if (!writeSaveGamesEnabled) {
      config.getTransients().setWriteSaveGamesEnabled(writeSaveGamesEnabled);
    }
    if (serverPort != null) {
      config.getTransients().setServerPort(Integer.parseInt(serverPort));
    }
    if (isHeadless) {
      engine.subscribeToStateChange(new HeadlessStateChangeListener());
      engine.run(new StateHeadlessSetup());
    }
 else {
      if (loadLastGame) {
        engine.submitTask("String_Node_Str",new Runnable(){
          @Override public void run(){
            GameManifest gameManifest=getLatestGameManifest();
            if (gameManifest != null) {
              engine.changeState(new StateLoading(gameManifest,NetworkMode.NONE));
            }
          }
        }
);
      }
      SplashScreen.getInstance().close();
      engine.run(new StateMainMenu());
    }
  }
 catch (  Throwable e) {
    SplashScreen.getInstance().close();
    reportException(e);
  }
}
Program: 826
Project: 826
Buggy source:
private static void reportException(Throwable throwable){
  Path logPath=Paths.get("String_Node_Str");
  try {
    Path gameLogPath=PathManager.getInstance().getLogPath();
    if (gameLogPath != null) {
      logPath=gameLogPath;
    }
  }
 catch (  Exception pathManagerConstructorFailure) {
    throwable.addSuppressed(pathManagerConstructorFailure);
  }
  if (crashReportEnabled) {
    CrashReporter.report(throwable,logPath);
  }
}

Fixed version (ground truth):
private static void reportException(Throwable throwable){
  Path logPath=Paths.get("String_Node_Str");
  try {
    Path gameLogPath=PathManager.getInstance().getLogPath();
    if (gameLogPath != null) {
      logPath=gameLogPath;
    }
  }
 catch (  Exception pathManagerConstructorFailure) {
    throwable.addSuppressed(pathManagerConstructorFailure);
  }
  if (!GraphicsEnvironment.isHeadless() && crashReportEnabled) {
    CrashReporter.report(throwable,logPath);
  }
 else {
    throwable.printStackTrace();
    System.err.println("String_Node_Str" + logPath.toAbsolutePath().normalize());
  }
}
Program: 827
Project: 827
Buggy source:
private EntityRef createFakeEntityWith(LocationComponent locationComponent){
  EntityRef entity=mock(EntityRef.class);
  when(entity.getComponent(LocationComponent.class)).thenReturn(locationComponent);
  when(entity.exists()).thenReturn(true);
  when(entity.getId()).thenReturn(nextFakeEntityId++);
  return entity;
}

Fixed version (ground truth):
private EntityRef createFakeEntityWith(LocationComponent locationComponent){
  EntityRef entRef=mock(EntityRef.class);
  when(entRef.getComponent(LocationComponent.class)).thenReturn(locationComponent);
  when(entRef.exists()).thenReturn(true);
  when(entRef.getId()).thenReturn(nextFakeEntityId++);
  return entRef;
}
Program: 828
Project: 828
Buggy source:
/** 
 * Registers a   {@link org.terasology.logic.console.commandSystem.ConsoleCommand}.
 * @param command The command to be registered
 */
@Override public void registerCommand(ConsoleCommand command){
  Name commandName=command.getName();
  if (commandRegistry.containsKey(commandName)) {
    logger.warn("String_Node_Str",commandName,commandRegistry.get(commandName).getSource().getClass().getCanonicalName(),command.getClass().getCanonicalName());
  }
 else {
    commandRegistry.put(commandName,command);
    logger.debug("String_Node_Str",commandName,command.getSource().getClass().getCanonicalName());
  }
}

Fixed version (ground truth):
/** 
 * Registers a   {@link org.terasology.logic.console.commandSystem.ConsoleCommand}.
 * @param command The command to be registered
 */
@Override public void registerCommand(ConsoleCommand command){
  Name commandName=command.getName();
  if (commandRegistry.containsKey(commandName)) {
    logger.warn("String_Node_Str",commandName,commandRegistry.get(commandName).getSource().getClass().getCanonicalName(),command.getSource().getClass().getCanonicalName());
  }
 else {
    commandRegistry.put(commandName,command);
    logger.debug("String_Node_Str",commandName,command.getSource().getClass().getCanonicalName());
  }
}
Program: 829
Project: 829
Buggy source:
@Command(value="String_Node_Str",shortDescription="String_Node_Str",runOnServer=true,requiredPermission=PermissionManager.CHEAT_PERMISSION) public String teleportCommand(@Sender EntityRef sender,@CommandParam("String_Node_Str") float x,@CommandParam("String_Node_Str") float y,@CommandParam("String_Node_Str") float z){
  ClientComponent clientComp=sender.getComponent(ClientComponent.class);
  LocationComponent location=clientComp.character.getComponent(LocationComponent.class);
  if (location != null) {
    location.setWorldPosition(new Vector3f(x,y,z));
    clientComp.character.saveComponent(location);
  }
  return "String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ z;
}

Fixed version (ground truth):
@Command(value="String_Node_Str",shortDescription="String_Node_Str",runOnServer=true,requiredPermission=PermissionManager.CHEAT_PERMISSION) public String teleportCommand(@Sender EntityRef sender,@CommandParam("String_Node_Str") float x,@CommandParam("String_Node_Str") float y,@CommandParam("String_Node_Str") float z){
  ClientComponent clientComp=sender.getComponent(ClientComponent.class);
  LocationComponent location=clientComp.character.getComponent(LocationComponent.class);
  if (location != null) {
    clientComp.character.send(BeforeDeactivateComponent.newInstance());
    location.setWorldPosition(new Vector3f(x,y,z));
    clientComp.character.saveComponent(location);
    clientComp.character.send(OnActivatedComponent.newInstance());
  }
  return "String_Node_Str" + x + "String_Node_Str"+ y+ "String_Node_Str"+ z;
}
Program: 830
Project: 830
Buggy source:
@Override public ScreenshotFormat get(){
  if (config.getScreenshotFormat() == "String_Node_Str") {
    return ScreenshotFormat.PNG;
  }
 else   if (config.getScreenshotFormat() == "String_Node_Str") {
    return ScreenshotFormat.JPEG;
  }
 else {
    return ScreenshotFormat.PNG;
  }
}

Fixed version (ground truth):
@Override public ScreenshotFormat get(){
switch (config.getScreenshotFormat()) {
case "String_Node_Str":
    return ScreenshotFormat.PNG;
case "String_Node_Str":
  return ScreenshotFormat.JPEG;
default :
return ScreenshotFormat.PNG;
}
}
Program: 831
Project: 831
Buggy source:
private static void reportException(Throwable throwable){
  Path logPath=Paths.get("String_Node_Str");
  try {
    Path gameLogPath=PathManager.getInstance().getLogPath();
    if (gameLogPath != null) {
      logPath=gameLogPath;
    }
  }
 catch (  Exception pathManagerConstructorFailure) {
    throwable.addSuppressed(pathManagerConstructorFailure);
  }
  if (crashReportEnabled) {
    Path logFile=logPath.resolve("String_Node_Str");
    CrashReporter.report(throwable,logFile);
  }
}

Fixed version (ground truth):
private static void reportException(Throwable throwable){
  Path logPath=Paths.get("String_Node_Str");
  try {
    Path gameLogPath=PathManager.getInstance().getLogPath();
    if (gameLogPath != null) {
      logPath=gameLogPath;
    }
  }
 catch (  Exception pathManagerConstructorFailure) {
    throwable.addSuppressed(pathManagerConstructorFailure);
  }
  if (crashReportEnabled) {
    CrashReporter.report(throwable,logPath);
  }
}
Program: 832
Project: 832
Buggy source:
@Override public void process(GeneratingRegion region){
  SurfaceHeightFacet surface=region.getRegionFacet(SurfaceHeightFacet.class);
  BiomeFacet biome=region.getRegionFacet(BiomeFacet.class);
  SeaLevelFacet seaLevel=region.getRegionFacet(SeaLevelFacet.class);
  List<Predicate<Vector3i>> filters=Lists.newArrayList();
  filters.add(PositionFilters.minHeight(seaLevel.getSeaLevel()));
  filters.add(PositionFilters.probability(densityNoiseGen,configuration.density * 0.1f));
  filters.add(PositionFilters.flatness(surface,1,0));
  int maxRad=13;
  int maxHeight=32;
  Border3D borderForTreeFacet=region.getBorderForFacet(TreeFacet.class);
  TreeFacet facet=new TreeFacet(region.getRegion(),borderForTreeFacet.extendBy(0,maxHeight,maxRad));
  populateFacet(facet,surface,biome,filters);
  region.setRegionFacet(TreeFacet.class,facet);
}

Fixed version (ground truth):
@Override public void process(GeneratingRegion region){
  SurfaceHeightFacet surface=region.getRegionFacet(SurfaceHeightFacet.class);
  BiomeFacet biome=region.getRegionFacet(BiomeFacet.class);
  SeaLevelFacet seaLevel=region.getRegionFacet(SeaLevelFacet.class);
  List<Predicate<Vector3i>> filters=Lists.newArrayList();
  filters.add(PositionFilters.minHeight(seaLevel.getSeaLevel()));
  filters.add(PositionFilters.probability(densityNoiseGen,configuration.density * 0.05f));
  filters.add(PositionFilters.flatness(surface,1,0));
  int maxRad=13;
  int maxHeight=32;
  Border3D borderForTreeFacet=region.getBorderForFacet(TreeFacet.class);
  TreeFacet facet=new TreeFacet(region.getRegion(),borderForTreeFacet.extendBy(0,maxHeight,maxRad));
  populateFacet(facet,surface,biome,filters);
  region.setRegionFacet(TreeFacet.class,facet);
}
Program: 833
Project: 833
Buggy source:
@Override public boolean apply(Vector3i input){
  return noiseGen.noise(input.getX(),input.getY(),input.getZ()) < density;
}

Fixed version (ground truth):
@Override public boolean apply(Vector3i input){
  return Math.abs(noiseGen.noise(input.getX(),input.getY(),input.getZ())) < density;
}
Program: 834
Project: 834
Buggy source:
/** 
 * Filters based on a random noise
 * @param noiseGen the noise generator that produces noise in [0..1]
 * @param density the threshold in [0..1]
 * @return true if the noise value is <b>below</b> the threshold
 */
public static Predicate<Vector3i> probability(final Noise noiseGen,final float density){
  return new Predicate<Vector3i>(){
    @Override public boolean apply(    Vector3i input){
      return noiseGen.noise(input.getX(),input.getY(),input.getZ()) < density;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Filters based on a random noise
 * @param noiseGen the noise generator that produces noise in [0..1]
 * @param density the threshold in [0..1]
 * @return true if the noise value is <b>below</b> the threshold
 */
public static Predicate<Vector3i> probability(final Noise noiseGen,final float density){
  return new Predicate<Vector3i>(){
    @Override public boolean apply(    Vector3i input){
      return Math.abs(noiseGen.noise(input.getX(),input.getY(),input.getZ())) < density;
    }
  }
;
}
Program: 835
Project: 835
Buggy source:
/** 
 * @param x the x coordinate
 * @param z the z coordinate
 * @param objs a map (objType -> probability)
 * @return a random pick from the map or <code>null</code>
 */
protected T getType(int x,int z,Map<T,Float> objs){
  float random=typeNoiseGen.noise(x,z);
  for (  T generator : objs.keySet()) {
    Float threshold=objs.get(generator);
    if (threshold != null) {
      if (random < threshold) {
        return generator;
      }
 else {
        random-=threshold;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param x the x coordinate
 * @param z the z coordinate
 * @param objs a map (objType -> probability)
 * @return a random pick from the map or <code>null</code>
 */
protected T getType(int x,int z,Map<T,Float> objs){
  float random=Math.abs(typeNoiseGen.noise(x,z));
  for (  T generator : objs.keySet()) {
    Float threshold=objs.get(generator);
    if (threshold != null) {
      if (random < threshold) {
        return generator;
      }
 else {
        random-=threshold;
      }
    }
  }
  return null;
}
Program: 836
Project: 836
Buggy source:
@Override public AssetUri getPrefabURI(){
  if (exists()) {
    EntityInfoComponent info=getComponent(EntityInfoComponent.class);
    if (info != null && !info.parentPrefab.exists()) {
      return new AssetUri(AssetType.PREFAB,info.parentPrefab.getName());
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public AssetUri getPrefabURI(){
  if (exists()) {
    EntityInfoComponent info=getComponent(EntityInfoComponent.class);
    if (info != null && info.parentPrefab.exists()) {
      return new AssetUri(AssetType.PREFAB,info.parentPrefab.getName());
    }
  }
  return null;
}
Program: 837
Project: 837
Buggy source:
public String execute(EntityRef sender,String sound,Float xOffset,Float yOffset,Float zOffset){
  Vector3f position=localPlayer.getPosition();
  StaticSound foundSound=Assets.getSound(sound != null ? sound : "String_Node_Str");
  if (foundSound == null) {
    return "String_Node_Str" + sound + "String_Node_Str";
  }
  position.x+=xOffset != null ? xOffset : 0;
  position.y+=yOffset != null ? yOffset : 0;
  position.z+=zOffset != null ? zOffset : 0;
  audioManager.playSound(foundSound,position);
  return "String_Node_Str" + sound + "String_Node_Str";
}

Fixed version (ground truth):
public String execute(EntityRef sender,String nullableSound,Float xOffset,Float yOffset,Float zOffset){
  Vector3f position=localPlayer.getPosition();
  String soundName=nullableSound != null ? nullableSound : "String_Node_Str";
  StaticSound sound=Assets.getSound(soundName);
  if (sound == null) {
    return "String_Node_Str" + soundName + "String_Node_Str";
  }
  position.x+=xOffset != null ? xOffset : 0;
  position.y+=yOffset != null ? yOffset : 0;
  position.z+=zOffset != null ? zOffset : 0;
  audioManager.playSound(sound,position);
  return "String_Node_Str" + soundName + "String_Node_Str";
}
Program: 838
Project: 838
Buggy source:
/** 
 * Get a group of commands by their name. These will vary by the number of parameters they accept
 * @param name The name of the command.
 * @return An iterator over the commands.
 */
org.terasology.logic.console.dynamic.ICommand[] getCommand(String name);

Fixed version (ground truth):
/** 
 * Get a group of commands by their name. These will vary by the number of parameters they accept
 * @param name The name of the command.
 * @return An iterator over the commands.
 */
ICommand getCommand(String name);
Program: 839
Project: 839
Buggy source:
private List<Method> findMethods(String methodName){
  Class<?> clazz=getClass();
  Method[] methods=clazz.getDeclaredMethods();
  LoggerFactory.getLogger("String_Node_Str").debug("String_Node_Str",Arrays.toString(methods));
  List<Method> result=Lists.newArrayList();
  for (  Method method : methods) {
    String currentMethodName=method.getName();
    if (currentMethodName.equals(methodName)) {
      result.add(method);
    }
  }
  return result;
}

Fixed version (ground truth):
private List<Method> findMethods(String methodName){
  Class<?> clazz=getClass();
  Method[] methods=clazz.getDeclaredMethods();
  List<Method> result=Lists.newArrayList();
  for (  Method method : methods) {
    String currentMethodName=method.getName();
    if (currentMethodName.equals(methodName)) {
      result.add(method);
    }
  }
  return result;
}
Program: 840
Project: 840
Buggy source:
@Nullable protected abstract CommandParameter[] constructParameters();

Fixed version (ground truth):
protected abstract CommandParameter[] constructParameters();
Program: 841
Project: 841
Buggy source:
private void checkArgumentCompatibility(Method method) throws CommandInitializationException {
  Class<?>[] methodParameters=method.getParameterTypes();
  if (methodParameters[0] != EntityRef.class) {
    throw new CommandInitializationException("String_Node_Str" + method.getName() + "String_Node_Str"+ "String_Node_Str");
  }
  int passableParameterCount=methodParameters.length - 1;
  for (int i=0; i < passableParameterCount || i < parameters.length; i++) {
    if (i >= passableParameterCount) {
      throw new CommandInitializationException("String_Node_Str" + (parameters.length - passableParameterCount) + "String_Node_Str"+ method.getName()+ "String_Node_Str"+ "String_Node_Str");
    }
 else     if (i >= parameters.length) {
      throw new CommandInitializationException("String_Node_Str" + (parameters.length - passableParameterCount) + "String_Node_Str"+ method.getName()+ "String_Node_Str"+ "String_Node_Str");
    }
    Class<?> expectedType=parameters[i].getTypeRaw();
    Class<?> providedType=methodParameters[i - 1];
    if (!expectedType.isAssignableFrom(providedType)) {
      throw new CommandInitializationException("String_Node_Str" + providedType.getSimpleName() + "String_Node_Str"+ expectedType.getSimpleName()+ "String_Node_Str"+ "String_Node_Str"+ i);
    }
  }
}

Fixed version (ground truth):
private void checkArgumentCompatibility(Method method) throws CommandInitializationException {
  Class<?>[] methodParameters=method.getParameterTypes();
  if (methodParameters[0] != EntityRef.class) {
    throw new CommandInitializationException("String_Node_Str" + method.getName() + "String_Node_Str"+ "String_Node_Str");
  }
  int passableParameterCount=methodParameters.length - 1;
  for (int i=0; i < passableParameterCount || i < parameters.length; i++) {
    if (i >= passableParameterCount) {
      throw new CommandInitializationException("String_Node_Str" + (parameters.length - passableParameterCount) + "String_Node_Str"+ method.getName()+ "String_Node_Str"+ "String_Node_Str");
    }
 else     if (i >= parameters.length) {
      throw new CommandInitializationException("String_Node_Str" + (parameters.length - passableParameterCount) + "String_Node_Str"+ method.getName()+ "String_Node_Str"+ "String_Node_Str");
    }
    Class<?> expectedType=parameters[i].getTypeRaw();
    Class<?> providedType=methodParameters[i + 1];
    if (!expectedType.isAssignableFrom(providedType)) {
      throw new CommandInitializationException("String_Node_Str" + providedType.getSimpleName() + "String_Node_Str"+ expectedType.getSimpleName()+ "String_Node_Str"+ "String_Node_Str"+ i);
    }
  }
}
Program: 842
Project: 842
Buggy source:
private List<String> unescape(String rawParameter,boolean split) throws CommandParameterParseException {
  String string=rawParameter;
  List<String> params=new ArrayList<>();
  int i=-1;
  while (i < string.length()) {
    i++;
    char c=string.charAt(i);
    if (c == Command.ARRAY_DELIMITER_ESCAPE_CHARACTER) {
      if (i >= string.length() - 1) {
        throw new CommandParameterParseException("String_Node_Str",rawParameter);
      }
      string=string.substring(0,i) + string.substring(i + 1);
      char following=string.charAt(i);
      if (following != Command.ARRAY_DELIMITER_ESCAPE_CHARACTER && (!split || following != arrayDelimiter)) {
        throw new CommandParameterParseException("String_Node_Str" + following + "String_Node_Str",rawParameter);
      }
      continue;
    }
    if (split && c == arrayDelimiter) {
      String param=string.substring(0,i);
      string=string.substring(i + 1);
      i=-1;
      params.add(param);
    }
  }
  if (string.length() > 0) {
    params.add(string);
  }
  return params;
}

Fixed version (ground truth):
private List<String> unescape(String rawParameter,boolean split) throws CommandParameterParseException {
  String string=rawParameter;
  List<String> params=new ArrayList<>();
  int i=0;
  while (i < string.length()) {
    char c=string.charAt(i);
    if (c == Command.ARRAY_DELIMITER_ESCAPE_CHARACTER) {
      if (i >= string.length() - 1) {
        throw new CommandParameterParseException("String_Node_Str",rawParameter);
      }
      string=string.substring(0,i) + string.substring(i + 1);
      char following=string.charAt(i);
      if (following != Command.ARRAY_DELIMITER_ESCAPE_CHARACTER && (!split || following != arrayDelimiter)) {
        throw new CommandParameterParseException("String_Node_Str" + following + "String_Node_Str",rawParameter);
      }
      i++;
      continue;
    }
    if (split && c == arrayDelimiter) {
      String param=string.substring(0,i);
      string=string.substring(i + 1);
      i=0;
      params.add(param);
      continue;
    }
    i++;
  }
  if (string.length() > 0) {
    params.add(string);
  }
  return params;
}
Program: 843
Project: 843
Buggy source:
/** 
 * A hacky way to get the array class of a class. <pre>  {@code Class<? extends String[]> = getArrayClass(String.class);}</pre>
 * @param clazz The child class of the array class returned
 * @param param Do not fill any parameters, leave blank.
 * @return The array class of {@code clazz}
 */
@SafeVarargs @SuppressWarnings("String_Node_Str") private static <T>Class<? extends T[]> getArrayClass(Class<T> clazz,T... param){
  Preconditions.checkArgument(param.length <= 0,"String_Node_Str");
  return (Class<T[]>)param.getClass();
}

Fixed version (ground truth):
/** 
 * @param clazz The child class of the array class returned
 * @return The array class of {@code clazz}
 */
@SuppressWarnings("String_Node_Str") private static <T>Class<T[]> getArrayClass(Class<T> clazz){
  return (Class<T[]>)Array.newInstance(clazz).getClass();
}
Program: 844
Project: 844
Buggy source:
/** 
 * The name must not be null or empty.
 * @return The name of this command
 */
@NotNull String getName();

Fixed version (ground truth):
/** 
 * The name must not be null or empty.
 * @return The name of this command
 */
String getName();
Program: 845
Project: 845
Buggy source:
/** 
 * Executes the command
 * @param parameters Parameters in an Object[] array as defined in {@link org.terasology.logic.console.dynamic.Command#getParameters()}.
 * @return A reply to the sender.
 */
@Nullable String executeRaw(List<String> parameters,EntityRef sender) throws CommandExecutionException ;

Fixed version (ground truth):
/** 
 * Executes the command
 * @param parameters Parameters in an Object[] array as defined in {@link org.terasology.logic.console.dynamic.Command#getParameters()}.
 * @return A reply to the sender.
 */
String executeRaw(List<String> parameters,EntityRef sender) throws CommandExecutionException ;
Program: 846
Project: 846
Buggy source:
/** 
 * Suggests valid parameters.
 * @param parameters Currently provided parameters in an Object[] array.
 * @return A reply to the sender.
 */
@Nullable String[] suggestRaw(List<String> parameters,EntityRef sender) throws CommandSuggestionException ;

Fixed version (ground truth):
/** 
 * Suggests valid parameters.
 * @param parameters Currently provided parameters in an Object[] array.
 * @return A reply to the sender.
 */
String[] suggestRaw(List<String> parameters,EntityRef sender) throws CommandSuggestionException ;
Program: 847
Project: 847
Buggy source:
/** 
 * @return The parameter definitions of this command
 */
@NotNull CommandParameter[] getParameters();

Fixed version (ground truth):
/** 
 * @return The parameter definitions of this command
 */
CommandParameter[] getParameters();
Program: 848
Project: 848
Buggy source:
/** 
 * The usage must not be null or empty.
 * @return The usage hint of this command
 */
@NotNull String getUsage();

Fixed version (ground truth):
/** 
 * The usage must not be null or empty.
 * @return The usage hint of this command
 */
String getUsage();
Program: 849
Project: 849
Buggy source:
@Override public TreeMultiset<ICommand> get(Object key){
  return super.get(key.toString().toLowerCase());
}

Fixed version (ground truth):
@Override public ICommand get(Object key){
  return super.get(key.toString().toLowerCase());
}
Program: 850
Project: 850
Buggy source:
@Override public TreeMultiset<ICommand> put(String key,TreeMultiset<ICommand> value){
  return super.put(key.toLowerCase(),value);
}

Fixed version (ground truth):
@Override public ICommand put(String key,ICommand value){
  return super.put(key.toLowerCase(),value);
}
Program: 851
Project: 851
Buggy source:
@Override public TreeMultiset<ICommand> remove(Object key){
  return super.remove(key.toString().toLowerCase());
}

Fixed version (ground truth):
@Override public ICommand remove(Object key){
  return super.remove(key.toString().toLowerCase());
}
Program: 852
Project: 852
Buggy source:
/** 
 * Get a group of commands by their name. These will vary by the number of parameters they accept
 * @param name The name of the command.
 * @return An array of commands with given name
 */
@Override public ICommand[] getCommand(String name){
  TreeMultiset<ICommand> correspondingCommands=commandRegistry.get(name);
  if (correspondingCommands == null) {
    return new Command[0];
  }
  return correspondingCommands.toArray(new ICommand[correspondingCommands.size()]);
}

Fixed version (ground truth):
/** 
 * Get a group of commands by their name. These will vary by the number of parameters they accept
 * @param name The name of the command.
 * @return An array of commands with given name
 */
@Override public ICommand getCommand(String name){
  return commandRegistry.get(name);
}
Program: 853
Project: 853
Buggy source:
@Override public boolean execute(String commandName,List<String> params,EntityRef callingClient){
  if (commandName.isEmpty()) {
    return false;
  }
  ICommand cmd=findBestCommand(commandName,params.size());
  if (cmd == null) {
    if (commandRegistry.containsKey(commandName)) {
      addErrorMessage("String_Node_Str");
      for (      ICommand ci : commandRegistry.get(commandName)) {
        addMessage(ci.getUsage());
      }
    }
 else {
      addErrorMessage("String_Node_Str" + commandName + "String_Node_Str");
    }
    return false;
  }
  if (cmd.isRunOnServer() && !networkSystem.getMode().isAuthority()) {
    callingClient.send(new CommandEvent(commandName,params));
    return true;
  }
 else {
    try {
      String result=cmd.executeRaw(params,callingClient);
      if (result != null && !result.isEmpty()) {
        if (callingClient.exists()) {
          callingClient.send(new ConsoleMessageEvent(result));
        }
 else {
          addMessage(result);
        }
      }
      return true;
    }
 catch (    CommandExecutionException e) {
      String msgText=e.getLocalizedMessage();
      if (msgText != null && !msgText.isEmpty()) {
        if (callingClient.exists()) {
          callingClient.send(new ConsoleMessageEvent(e.getLocalizedMessage()));
        }
 else {
          addErrorMessage(e.getLocalizedMessage());
        }
      }
      return false;
    }
  }
}

Fixed version (ground truth):
@Override public boolean execute(String commandName,List<String> params,EntityRef callingClient){
  if (commandName.isEmpty()) {
    return false;
  }
  ICommand cmd=getCommand(commandName);
  if (cmd == null) {
    if (commandRegistry.containsKey(commandName)) {
      ICommand command=commandRegistry.get(commandName);
      addErrorMessage("String_Node_Str");
      addMessage(command.getUsage());
    }
 else {
      addErrorMessage("String_Node_Str" + commandName + "String_Node_Str");
    }
    return false;
  }
  if (cmd.isRunOnServer() && !networkSystem.getMode().isAuthority()) {
    callingClient.send(new CommandEvent(commandName,params));
    return true;
  }
 else {
    try {
      String result=cmd.executeRaw(params,callingClient);
      if (result != null && !result.isEmpty()) {
        if (callingClient.exists()) {
          callingClient.send(new ConsoleMessageEvent(result));
        }
 else {
          addMessage(result);
        }
      }
      return true;
    }
 catch (    CommandExecutionException e) {
      String msgText=e.getLocalizedMessage();
      if (msgText != null && !msgText.isEmpty()) {
        if (callingClient.exists()) {
          callingClient.send(new ConsoleMessageEvent(e.getLocalizedMessage()));
        }
 else {
          addErrorMessage(e.getLocalizedMessage());
        }
      }
      return false;
    }
  }
}
Program: 854
Project: 854
Buggy source:
/** 
 * Get the list of all loaded commands.
 * @return Returns the command list.
 */
@Override public Collection<ICommand> getCommands(){
  return commands;
}

Fixed version (ground truth):
/** 
 * Get the list of all loaded commands.
 * @return Returns the command list.
 */
@Override public Collection<ICommand> getCommands(){
  return commandRegistry.values();
}
Program: 855
Project: 855
Buggy source:
/** 
 * Registers a   {@link ICommand}.
 * @param command The command to be registered
 */
@Override public void registerCommand(ICommand command){
  String commandName=command.getName();
  logger.debug("String_Node_Str",command.getName());
  if (isCommandRegistered(command)) {
    logger.warn("String_Node_Str" + "String_Node_Str",commandName,command.getRequiredParameterCount(),command.endsWithVarargs());
  }
 else {
    commands.add(command);
    TreeMultiset<ICommand> cmdList=commandRegistry.get(commandName);
    if (cmdList == null) {
      cmdList=TreeMultiset.create();
      commandRegistry.put(commandName,cmdList);
    }
 else {
      logger.warn("String_Node_Str",commandName,cmdList.iterator().next().getClass().getCanonicalName(),command.getClass().getCanonicalName());
    }
    cmdList.add(command);
  }
}

Fixed version (ground truth):
/** 
 * Registers a   {@link ICommand}.
 * @param command The command to be registered
 */
@Override public void registerCommand(ICommand command){
  String commandName=command.getName();
  logger.debug("String_Node_Str",command.getName());
  if (commandRegistry.containsKey(commandName)) {
    logger.warn("String_Node_Str",commandName,commandRegistry.get(commandName).getClass().getCanonicalName(),command.getClass().getCanonicalName());
  }
 else {
    commandRegistry.put(commandName,command);
    logger.info("String_Node_Str",commandName,command.getClass().getCanonicalName());
  }
}
Program: 856
Project: 856
Buggy source:
@Override public void dispose(){
  commands.clear();
  commandRegistry.clear();
  messageHistory.clear();
}

Fixed version (ground truth):
@Override public void dispose(){
  commandRegistry.clear();
  messageHistory.clear();
}
Program: 857
Project: 857
Buggy source:
@ReceiveEvent(components=ClientComponent.class,netFilter=RegisterMode.AUTHORITY) public void onCommand(CommandEvent event,EntityRef entity){
  List<String> params=event.getParams();
  for (  ICommand cmd : console.getCommand(event.getCommand())) {
    if (cmd.getRequiredParameterCount() == params.size() && cmd.isRunOnServer()) {
      console.execute(event.getCommand(),event.getParams(),entity);
      break;
    }
  }
}

Fixed version (ground truth):
@ReceiveEvent(components=ClientComponent.class,netFilter=RegisterMode.AUTHORITY) public void onCommand(CommandEvent event,EntityRef entity){
  List<String> params=event.getParams();
  ICommand cmd=console.getCommand(event.getCommand());
  if (cmd.getRequiredParameterCount() == params.size() && cmd.isRunOnServer()) {
    console.execute(event.getCommand(),event.getParams(),entity);
  }
}
Program: 858
Project: 858
Buggy source:
@Test public void testIsUnitVector(){
  assertFalse(Vector3i.zero().isUnitVector());
  assertTrue(Vector3i.unitX().isUnitVector());
  assertTrue(Vector3i.unitY().isUnitVector());
  assertTrue(Vector3i.unitZ().isUnitVector());
  Vector3i v=Vector3i.unitX();
  v.negate();
  assertTrue(v.isUnitVector());
  assertFalse(Vector3i.one().isUnitVector());
}

Fixed version (ground truth):
@Test public void testIsUnitVector(){
  assertFalse(Vector3i.zero().isUnitVector());
  assertTrue(Vector3i.unitX().isUnitVector());
  assertTrue(Vector3i.unitY().isUnitVector());
  assertTrue(Vector3i.unitZ().isUnitVector());
  Vector3i v=Vector3i.unitX();
  v.scale(-1);
  assertTrue(v.isUnitVector());
  assertFalse(Vector3i.one().isUnitVector());
}
Program: 859
Project: 859
Buggy source:
public static void assertEquals(Tuple4f expected,Tuple4f actual,float error){
  if (expected == null) {
    assertNull(actual);
  }
 else {
    assertNotNull(actual);
    String errorMessage="String_Node_Str" + expected + "String_Node_Str"+ actual;
    org.junit.Assert.assertEquals(errorMessage,expected.x,actual.x,error);
    org.junit.Assert.assertEquals(errorMessage,expected.y,actual.y,error);
    org.junit.Assert.assertEquals(errorMessage,expected.z,actual.z,error);
    org.junit.Assert.assertEquals(errorMessage,expected.w,actual.w,error);
  }
}

Fixed version (ground truth):
public static void assertEquals(Quat4f expected,Quat4f actual,float error){
  if (expected == null) {
    assertNull(actual);
  }
 else {
    assertNotNull(actual);
    String errorMessage="String_Node_Str" + expected + "String_Node_Str"+ actual;
    org.junit.Assert.assertEquals(errorMessage,expected.x,actual.x,error);
    org.junit.Assert.assertEquals(errorMessage,expected.y,actual.y,error);
    org.junit.Assert.assertEquals(errorMessage,expected.z,actual.z,error);
    org.junit.Assert.assertEquals(errorMessage,expected.w,actual.w,error);
  }
}
Program: 862
Project: 862
Buggy source:
@Override public void generate(CoreChunk view,Random rand,int posX,int posY,int posZ){
  Vector3f position=new Vector3f(0f,0f,0f);
  Matrix4f rotation=new Matrix4f();
  rotation.setIdentity();
  rotation.setRotation(new AxisAngle4f(0f,0f,1f,(float)Math.PI / 2f));
  float angleOffset=rand.nextFloat(-MAX_ANGLE_OFFSET,MAX_ANGLE_OFFSET);
  recurse(view,rand,posX,posY,posZ,angleOffset,new CharSequenceIterator(initialAxiom),position,rotation,0);
}

Fixed version (ground truth):
@Override public void generate(CoreChunk view,Random rand,int posX,int posY,int posZ){
  Vector3f position=new Vector3f(0f,0f,0f);
  Matrix4f rotation=new Matrix4f(new AxisAngle4f(0f,0f,1f,(float)Math.PI / 2f));
  float angleOffset=rand.nextFloat(-MAX_ANGLE_OFFSET,MAX_ANGLE_OFFSET);
  recurse(view,rand,posX,posY,posZ,angleOffset,new CharSequenceIterator(initialAxiom),position,rotation,0);
}
Program: 863
Project: 863
Buggy source:
@Before public void setup() throws Exception {
  ModuleManager moduleManager=ModuleManagerFactory.create();
  AssetManager assetManager=new AssetManager(moduleManager.getEnvironment());
  CoreRegistry.put(ModuleManager.class,moduleManager);
  CoreRegistry.put(AssetManager.class,assetManager);
  AssetType.registerAssetTypes(assetManager);
  URL url=getClass().getClassLoader().getResource("String_Node_Str");
  url=new URL(url.toString().substring(0,url.toString().length() - "String_Node_Str".length() - 1));
  assetManager.setAssetFactory(AssetType.PREFAB,new AssetFactory<PrefabData,Prefab>(){
    @Override public Prefab buildAsset(    AssetUri uri,    PrefabData data){
      return new PojoPrefab(uri,data);
    }
  }
);
  NetworkSystem networkSystem=mock(NetworkSystem.class);
  when(networkSystem.getMode()).thenReturn(NetworkMode.NONE);
  EntityManager em=new EntitySystemBuilder().build(moduleManager.getEnvironment(),networkSystem,new ReflectionReflectFactory());
  prefabManager=new PojoPrefabManager();
}

Fixed version (ground truth):
@Before public void setup() throws Exception {
  ModuleManager moduleManager=ModuleManagerFactory.create();
  AssetManager assetManager=new AssetManager(moduleManager.getEnvironment());
  CoreRegistry.put(ModuleManager.class,moduleManager);
  CoreRegistry.put(AssetManager.class,assetManager);
  AssetType.registerAssetTypes(assetManager);
  assetManager.setAssetFactory(AssetType.PREFAB,new AssetFactory<PrefabData,Prefab>(){
    @Override public Prefab buildAsset(    AssetUri uri,    PrefabData data){
      return new PojoPrefab(uri,data);
    }
  }
);
  NetworkSystem networkSystem=mock(NetworkSystem.class);
  when(networkSystem.getMode()).thenReturn(NetworkMode.NONE);
  EntityManager em=new EntitySystemBuilder().build(moduleManager.getEnvironment(),networkSystem,new ReflectionReflectFactory());
  prefabManager=new PojoPrefabManager();
}
Program: 864
Project: 864
Buggy source:
@Test public void testSaveLoad() throws IOException {
  AssetManager assetManager=mock(AssetManager.class);
  CoreRegistry.put(AssetManager.class,assetManager);
  BehaviorNodeFactory nodeFactory=mock(BehaviorNodeFactory.class);
  CoreRegistry.put(BehaviorNodeFactory.class,nodeFactory);
  BehaviorTreeLoader loader=new BehaviorTreeLoader();
  BehaviorTreeData data=buildSample();
  OutputStream os=new ByteArrayOutputStream(10000);
  loader.save(os,data);
  String jsonExpected=os.toString();
  data=loader.load(null,new ByteArrayInputStream(jsonExpected.getBytes()),null,null);
  os=new ByteArrayOutputStream(10000);
  loader=new BehaviorTreeLoader();
  loader.save(os,data);
  String jsonActual=os.toString();
  Assert.assertEquals(jsonActual,jsonExpected);
}

Fixed version (ground truth):
@Test public void testSaveLoad() throws IOException {
  AssetManager assetManager=mock(AssetManager.class);
  CoreRegistry.put(AssetManager.class,assetManager);
  BehaviorNodeFactory nodeFactory=mock(BehaviorNodeFactory.class);
  CoreRegistry.put(BehaviorNodeFactory.class,nodeFactory);
  BehaviorTreeLoader loader=new BehaviorTreeLoader();
  BehaviorTreeData data=buildSample();
  ByteArrayOutputStream os=new ByteArrayOutputStream(10000);
  loader.save(os,data);
  byte[] jsonExpected=os.toByteArray();
  data=loader.load(null,new ByteArrayInputStream(jsonExpected),null,null);
  os=new ByteArrayOutputStream(10000);
  loader=new BehaviorTreeLoader();
  loader.save(os,data);
  byte[] jsonActual=os.toByteArray();
  Assert.assertArrayEquals(jsonActual,jsonExpected);
}
Program: 865
Project: 865
Buggy source:
private EntityData.GlobalStore persistAndRetrieve(EntityData.GlobalStore world) throws IOException {
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(baos));
  EntityDataJSONFormat.write(world,writer);
  writer.flush();
  ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
  return EntityDataJSONFormat.readWorld(new BufferedReader(new InputStreamReader(bais)));
}

Fixed version (ground truth):
private EntityData.GlobalStore persistAndRetrieve(EntityData.GlobalStore world) throws IOException {
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(baos,TerasologyConstants.CHARSET));
  EntityDataJSONFormat.write(world,writer);
  writer.flush();
  ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
  return EntityDataJSONFormat.readWorld(new BufferedReader(new InputStreamReader(bais,TerasologyConstants.CHARSET)));
}
Program: 866
Project: 866
Buggy source:
public static ModuleManager create() throws Exception {
  ModuleManager moduleManager=new ModuleManager();
  try (Reader reader=new InputStreamReader(ModuleManagerFactory.class.getResourceAsStream("String_Node_Str"))){
    ModuleMetadata metadata=new ModuleMetadataReader().read(reader);
    moduleManager.getRegistry().add(ClasspathModule.create(metadata,ModuleManagerFactory.class));
  }
   moduleManager.loadEnvironment(Sets.newHashSet(moduleManager.getRegistry().getLatestModuleVersion(new Name("String_Node_Str")),moduleManager.getRegistry().getLatestModuleVersion(new Name("String_Node_Str"))),true);
  return moduleManager;
}

Fixed version (ground truth):
public static ModuleManager create() throws Exception {
  ModuleManager moduleManager=new ModuleManager();
  try (Reader reader=new InputStreamReader(ModuleManagerFactory.class.getResourceAsStream("String_Node_Str"),TerasologyConstants.CHARSET)){
    ModuleMetadata metadata=new ModuleMetadataReader().read(reader);
    moduleManager.getRegistry().add(ClasspathModule.create(metadata,ModuleManagerFactory.class));
  }
   moduleManager.loadEnvironment(Sets.newHashSet(moduleManager.getRegistry().getLatestModuleVersion(new Name("String_Node_Str")),moduleManager.getRegistry().getLatestModuleVersion(new Name("String_Node_Str"))),true);
  return moduleManager;
}
Program: 867
Project: 867
Buggy source:
@Test public void testBoxedGetSet(){
  facet.set(0,1,3,new Integer(4));
  Assert.assertEquals(4.0f,facet.get(0,1,3),0.0);
}

Fixed version (ground truth):
@Test public void testBoxedGetSet(){
  facet.set(0,1,3,4f);
  Assert.assertEquals(4.0f,facet.get(0,1,3),0.0);
}
Program: 868
Project: 868
Buggy source:
@Test public void testBoxedWorldGetSet(){
  facet.set(0,1,4,new Integer(8));
  Assert.assertEquals(8.0f,facet.get(0,1,4),0.0);
}

Fixed version (ground truth):
@Test public void testBoxedWorldGetSet(){
  facet.set(0,1,4,8f);
  Assert.assertEquals(8.0f,facet.get(0,1,4),0.0);
}
Program: 869
Project: 869
Buggy source:
@Test public void testMixedGetSet1(){
  facet.set(0,1,5,new Integer(16));
  Assert.assertEquals(16.0f,facet.getWorld(10,21,35),0.0);
}

Fixed version (ground truth):
@Test public void testMixedGetSet1(){
  facet.set(0,1,5,16f);
  Assert.assertEquals(16.0f,facet.getWorld(10,21,35),0.0);
}
Program: 870
Project: 870
Buggy source:
@Test public void testMixedGetSet2(){
  facet.setWorld(24,35,46,new Integer(32));
  Assert.assertEquals(32.0f,facet.get(14,15,16),0.0);
}

Fixed version (ground truth):
@Test public void testMixedGetSet2(){
  facet.setWorld(24,35,46,32f);
  Assert.assertEquals(32.0f,facet.get(14,15,16),0.0);
}
Program: 871
Project: 871
Buggy source:
@Test public void testMixedOnBorder(){
  facet.set(-5,-6,-7,new Integer(64));
  Assert.assertEquals(64.0f,facet.getWorld(5,14,23),0.0);
}

Fixed version (ground truth):
@Test public void testMixedOnBorder(){
  facet.set(-5,-6,-7,64f);
  Assert.assertEquals(64.0f,facet.getWorld(5,14,23),0.0);
}
Program: 872
Project: 872
Buggy source:
@Test public void testBoxedGetSet(){
  facet.set(0,1,3,new Integer(4));
  Assert.assertEquals(new Integer(4),facet.get(0,1,3));
}

Fixed version (ground truth):
@Test public void testBoxedGetSet(){
  facet.set(0,1,3,Integer.valueOf(4));
  Assert.assertEquals(Integer.valueOf(4),facet.get(0,1,3));
}
Program: 873
Project: 873
Buggy source:
@Test public void testBoxedWorldGetSet(){
  facet.set(0,1,4,new Integer(8));
  Assert.assertEquals(new Integer(8),facet.get(0,1,4));
}

Fixed version (ground truth):
@Test public void testBoxedWorldGetSet(){
  facet.set(0,1,4,Integer.valueOf(8));
  Assert.assertEquals(Integer.valueOf(8),facet.get(0,1,4));
}
Program: 874
Project: 874
Buggy source:
@Test public void testMixedGetSet1(){
  facet.set(0,1,5,new Integer(16));
  Assert.assertEquals(new Integer(16),facet.getWorld(10,21,35));
}

Fixed version (ground truth):
@Test public void testMixedGetSet1(){
  facet.set(0,1,5,Integer.valueOf(16));
  Assert.assertEquals(Integer.valueOf(16),facet.getWorld(10,21,35));
}
Program: 875
Project: 875
Buggy source:
@Test public void testMixedGetSet2(){
  facet.setWorld(24,35,46,new Integer(32));
  Assert.assertEquals(new Integer(32),facet.get(14,15,16));
}

Fixed version (ground truth):
@Test public void testMixedGetSet2(){
  facet.setWorld(24,35,46,Integer.valueOf(32));
  Assert.assertEquals(Integer.valueOf(32),facet.get(14,15,16));
}
Program: 876
Project: 876
Buggy source:
@Test public void testMixedOnBorder(){
  facet.set(-5,-6,-7,new Integer(64));
  Assert.assertEquals(new Integer(64),facet.getWorld(5,14,23));
}

Fixed version (ground truth):
@Test public void testMixedOnBorder(){
  facet.set(-5,-6,-7,Integer.valueOf(64));
  Assert.assertEquals(Integer.valueOf(64),facet.getWorld(5,14,23));
}
Program: 877
Project: 877
Buggy source:
@Test public void testBoxedGetSetSparse(){
  facet.set(0,1,3,new Integer(64));
  Assert.assertEquals(64.0f,facet.get(0,1,3),0.0);
}

Fixed version (ground truth):
@Test public void testBoxedGetSetSparse(){
  facet.set(0,1,3,Integer.valueOf(64));
  Assert.assertEquals(64.0f,facet.get(0,1,3),0.0);
}