nus-yam/ex-repair huggingface dataset:
Program: 177496
Project: 177496
Buggy source:
public int readInt() throws IOException {
  int i=0;
  i|=(readCacheByte() & 0xFF) << 24;
  i|=(readCacheByte() & 0xFF) << 16;
  i|=(readCacheByte() & 0xFF) << 8;
  i|=(readCacheByte() & 0xFF) << 0;
  return i;
}

Fixed version (ground truth):
public int readInt() throws IOException {
  timeStart();
  try {
    int i=0;
    i|=(readCacheByte() & 0xFF) << 24;
    i|=(readCacheByte() & 0xFF) << 16;
    i|=(readCacheByte() & 0xFF) << 8;
    i|=(readCacheByte() & 0xFF) << 0;
    return i;
  }
  finally {
    timeEnd();
  }
}
Program: 177497
Project: 177497
Buggy source:
public void close() throws IOException {
  file.close();
}

Fixed version (ground truth):
public void close() throws IOException {
  timeStart();
  try {
    file.close();
  }
  finally {
    timeEnd();
  }
}
Program: 177498
Project: 177498
Buggy source:
public void seek(long pos) throws IOException {
  file.seek(pos);
  this.pos=pos;
}

Fixed version (ground truth):
public void seek(long pos) throws IOException {
  timeStart();
  try {
    file.seek(pos);
    this.pos=pos;
    posDirty=false;
  }
  finally {
    timeEnd();
  }
}
Program: 177499
Project: 177499
Buggy source:
public void write(byte[] b,int off,int len) throws IOException {
  int pageIndex=(int)(pos >> PAGE_SHIFT);
  int offset=(int)(pos & PAGE_MASK);
  int endPageOne=Math.min(b.length + offset,PAGE_SIZE);
  byte[] page=getPage(pageIndex);
  int j=0;
  for (int i=offset; i < endPageOne; i++) {
    page[i]=b[off + (j++)];
  }
  while (b.length > j) {
    pageIndex++;
    page=getPage(pageIndex);
    if (b.length - j > PAGE_SIZE) {
      for (int i=0; i < PAGE_SIZE; i++) {
        page[i]=b[off + (j++)];
      }
    }
 else {
      for (int i=0; j < b.length; i++) {
        page[i]=b[off + (j++)];
      }
    }
  }
  file.seek(pos);
  file.write(b,off,len);
  pos+=b.length;
}

Fixed version (ground truth):
public void write(byte[] b,int off,int len) throws IOException {
  timeStart();
  try {
    int pageIndex=(int)(pos >> PAGE_SHIFT);
    int offset=(int)(pos & PAGE_MASK);
    int endPageOne=Math.min(len + offset,PAGE_SIZE);
    byte[] page=getPage(pageIndex);
    int j=0;
    for (int i=offset; i < endPageOne; i++) {
      page[i]=b[off + (j++)];
    }
    while (len > j) {
      pageIndex++;
      page=getPage(pageIndex);
      if (len - j > PAGE_SIZE) {
        for (int i=0; i < PAGE_SIZE; i++) {
          page[i]=b[off + (j++)];
        }
      }
 else {
        for (int i=0; j < len; i++) {
          page[i]=b[off + (j++)];
        }
      }
    }
    if (posDirty) {
      file.seek(pos);
      posDirty=false;
    }
    file.write(b,off,len);
    pos+=b.length;
  }
  finally {
    timeEnd();
  }
}
Program: 177500
Project: 177500
Buggy source:
public void writeCacheByte(byte b) throws IOException {
  int pageIndex=(int)(pos >> PAGE_SHIFT);
  int offset=(int)(pos & PAGE_MASK);
  byte[] page=getPage(pageIndex);
  page[offset]=b;
  file.seek(pos);
  file.writeByte(b & 0xFF);
  pos++;
}

Fixed version (ground truth):
private void writeCacheByte(byte b) throws IOException {
  int pageIndex=(int)(pos >> PAGE_SHIFT);
  int offset=(int)(pos & PAGE_MASK);
  byte[] page=getPage(pageIndex);
  page[offset]=b;
  if (posDirty) {
    file.seek(pos);
    posDirty=false;
  }
  file.writeByte(b & 0xFF);
  pos++;
}
Program: 177502
Project: 177502
Buggy source:
public static void main(String[] args){
  FileSystem.init();
  SpoutServer server=new SpoutServer();
  Spout.setEngine(server);
  server.init(args);
  server.start();
}

Fixed version (ground truth):
public static void main(String[] args){
  SpoutServer server=new SpoutServer();
  Spout.setEngine(server);
  FileSystem.init();
  server.init(args);
  server.start();
}
Program: 177503
Project: 177503
Buggy source:
@Override public ConfigurationNode getChild(String name){
  return children.get(name);
}

Fixed version (ground truth):
public ConfigurationNode getChild(String name,boolean add){
  ConfigurationNode node=children.get(name);
  if (node == null) {
    node=createConfigurationNode(ArrayUtils.add(getPathElements(),name),null,!add);
    if (add) {
      addChild(node);
    }
  }
  return node;
}
Program: 177504
Project: 177504
Buggy source:
@Override public ConfigurationNode removeChild(ConfigurationNode node){
  if (node != null) {
    if (node.getParent() != this) {
      return null;
    }
    if (children.remove(node.getPathEntries()[node.getPathEntries().length - 1]) == null) {
      return null;
    }
    detachChild(node);
  }
  return node;
}

Fixed version (ground truth):
@Override public ConfigurationNode removeChild(ConfigurationNode node){
  if (node != null) {
    if (node.getParent() != this) {
      return null;
    }
    if (children.remove(node.getPathElements()[node.getPathElements().length - 1]) == null) {
      return null;
    }
    detachChild(node);
  }
  return node;
}
Program: 177505
Project: 177505
Buggy source:
public ConfigurationNode getNode(String... path){
  if (path.length == 0) {
    return createConfigurationNode(path,null,true);
  }
  ConfigurationNode node=getChild(path[0]);
  for (int i=1; i < path.length && node != null && node.isAttached(); ++i) {
    node=node.getChild(path[i]);
  }
  return node == null ? createConfigurationNode(path,null,true) : node;
}

Fixed version (ground truth):
public ConfigurationNode getNode(String... path){
  if (path.length == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ConfigurationNode node=getChild(path[0]);
  for (int i=1; i < path.length && node != null && node.isAttached(); ++i) {
    node=node.getChild(path[i]);
  }
  return node == null || !node.isAttached() ? createConfigurationNode(path,null,true) : node;
}
Program: 177506
Project: 177506
Buggy source:
@Override public ConfigurationNode addChild(ConfigurationNode node){
  ConfigurationNode ret=children.put(node.getPathEntries()[node.getPathEntries().length - 1],node);
  node.setAttached(true);
  node.setParent(this);
  return ret;
}

Fixed version (ground truth):
@Override public ConfigurationNode addChild(ConfigurationNode node){
  ConfigurationNode ret=children.put(node.getPathElements()[node.getPathElements().length - 1],node);
  node.setAttached(true);
  node.setParent(this);
  return ret;
}
Program: 177507
Project: 177507
Buggy source:
public Configuration(){
  super(null);
  this.config=this;
  setPathSeparator("String_Node_Str");
}

Fixed version (ground truth):
public Configuration(){
  super(null);
  this.config=this;
  setPathSeparator("String_Node_Str");
  setWritesDefaults(true);
}
Program: 177508
Project: 177508
Buggy source:
public void setNode(ConfigurationNode node){
  String[] path=node.getPathEntries();
  if (path == null || path.length == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ConfigurationNode parent=null;
  ConfigurationNodeSource oldParent=this;
  for (  String item : path) {
    if (parent == null) {
      parent=getChild(item);
    }
 else {
      oldParent=parent;
      parent=oldParent.getChild(item);
    }
    if (!parent.isAttached()) {
      oldParent.addChild(parent);
    }
  }
  oldParent.addChild(node);
}

Fixed version (ground truth):
public void setNode(ConfigurationNode node){
  String[] path=node.getPathElements();
  if (path == null || path.length == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ConfigurationNode parent=getChild(path[0],true);
  ConfigurationNodeSource oldParent;
  for (int i=1; i < path.length - 1; ++i) {
    oldParent=parent;
    parent=oldParent.getChild(path[i],true);
    if (i != path.length - 2 && !parent.isAttached()) {
      oldParent.addChild(parent);
    }
  }
  parent.addChild(node);
}
Program: 177509
Project: 177509
Buggy source:
/** 
 * @return The path, joined by the {@link Configuration#getPathSeparator()} of the attached configuration
 * @see #getPathEntries()
 */
public String getPath(){
  return StringUtils.join(path,getConfiguration().getPathSeparator());
}

Fixed version (ground truth):
/** 
 * @return The path, joined by the {@link Configuration#getPathSeparator()} of the attached configuration
 * @see #getPathElements
 */
public String getPath(){
  return StringUtils.join(getPathElements(),getConfiguration().getPathSeparator());
}
Program: 177510
Project: 177510
Buggy source:
@Override public Object setValue(Object value){
  Object old=this.getValue();
  if (value instanceof Map<?,?>) {
    this.value=null;
    removeChildren();
    for (    Map.Entry<?,?> entry : ((Map<?,?>)value).entrySet()) {
      addChild(new ConfigurationNodeBase(getConfiguration(),entry.getValue(),ArrayUtils.add(getPathEntries(),entry.getKey().toString())));
    }
  }
 else {
    if (value != null) {
      removeChildren();
    }
    this.value=value;
  }
  return old;
}

Fixed version (ground truth):
@Override public Object setValue(Object value){
  Object old=this.getValue();
  if (value instanceof Map<?,?>) {
    this.value=null;
    removeChildren();
    for (    Map.Entry<?,?> entry : ((Map<?,?>)value).entrySet()) {
      addChild(createConfigurationNode(ArrayUtils.add(getPathElements(),entry.getKey().toString()),entry.getValue(),false));
    }
  }
 else {
    if (value != null) {
      removeChildren();
    }
    this.value=value;
  }
  return old;
}
Program: 177511
Project: 177511
Buggy source:
public ConfigurationNode getChild(String name);

Fixed version (ground truth):
public ConfigurationNode getChild(String name,boolean add);
Program: 177512
Project: 177512
Buggy source:
private void checkAdded(){
  if (isAttached()) {
    getConfiguration().setNode(this);
    setAttached(true);
  }
}

Fixed version (ground truth):
private void checkAdded(){
  if (!isAttached()) {
    getConfiguration().setNode(this);
    setAttached(true);
  }
}
Program: 177513
Project: 177513
Buggy source:
@Test public void testPathSeparator(){
  String value=config.getNode("String_Node_Str").getString();
  assertEquals("String_Node_Str",value);
  config.setPathSeparator("String_Node_Str");
  value=config.getNode("String_Node_Str").getString();
  assertEquals("String_Node_Str",value);
}

Fixed version (ground truth):
@Test public void testPathSeparator(){
  String value=config.getNode("String_Node_Str").getString();
  assertEquals("String_Node_Str",value);
  config.setPathSeparator("String_Node_Str");
  value=config.getNode("String_Node_Str").getString();
  assertEquals("String_Node_Str",value);
  config.setPathSeparator("String_Node_Str");
}
Program: 177514
Project: 177514
Buggy source:
/** 
 * Attempts to lock the store.<br> <br> The lock will fail if the first element is already locked.  <br> <br> Once the first element is successfully locked, it will keep attempting to lock the rest of the store until all elements are locked, or the number of times it fails to lock exceeds maxFails. <br> NOTE:  The store using spinning locks, so it must only be locked for a very short period of time
 * @param maxFails the maximum number of lock failures before the method returns false
 * @return true if the store is locked
 */
public boolean tryLock(int maxFails){
  int lockedIndexes=0;
  int firstSeq;
  firstSeq=seqArray.get().getAndSet(0,DatatableSequenceNumber.UNSTABLE);
  if (firstSeq == DatatableSequenceNumber.UNSTABLE) {
    return false;
  }
  lockedIndexes++;
  int fails=0;
  for (int i=1; i < length.get(); i++) {
    int seq;
    do {
      if (fails > maxFails && maxFails > 0) {
        unlock(lockedIndexes);
        return false;
      }
 else {
        fails++;
        seq=seqArray.get().getAndSet(i,DatatableSequenceNumber.UNSTABLE);
      }
    }
 while (seq == DatatableSequenceNumber.UNSTABLE);
    lockedIndexes++;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Attempts to lock the store.<br> <br> The lock will fail if the first element is already locked.  <br> <br> Once the first element is successfully locked, it will keep attempting to lock the rest of the store until all elements are locked, or the number of times it fails to lock exceeds maxFails. <br> NOTE:  The store using spinning locks, so it must only be locked for a very short period of time
 * @param maxFails the maximum number of lock failures before the method returns false
 * @return true if the store is locked
 */
public boolean tryLock(int maxFails){
  int lockedIndexes=0;
  int firstSeq;
  firstSeq=seqArray.get().getAndSet(0,DatatableSequenceNumber.UNSTABLE);
  if (firstSeq == DatatableSequenceNumber.UNSTABLE) {
    return false;
  }
  lockedIndexes++;
  int fails=0;
  for (int i=1; i < length.get(); i++) {
    int seq;
    do {
      if (fails > maxFails && maxFails > 0) {
        unlock(lockedIndexes);
        return false;
      }
 else {
        seq=seqArray.get().getAndSet(i,DatatableSequenceNumber.UNSTABLE);
        if (seq == DatatableSequenceNumber.UNSTABLE) {
          fails++;
        }
      }
    }
 while (seq == DatatableSequenceNumber.UNSTABLE);
    lockedIndexes++;
  }
  return true;
}
Program: 177515
Project: 177515
Buggy source:
/** 
 * Resizes the arrays, if required. The array length is doubled if needsResize returns true.
 */
private void resizeArrays(){
  boolean locked=false;
  while (needsResize() && !(locked=tryLock(MAX_FAIL_THRESHOLD)))   ;
  if (!locked) {
    return;
  }
  try {
    int newLength=length.get() << 1;
    if (newLength > maxLength || !needsResize()) {
      return;
    }
    int[] newIntArray=new int[newLength];
    @SuppressWarnings("String_Node_Str") T[] newAuxArray=(T[])new Object[newLength];
    AtomicIntegerArray newSeqArray=new AtomicIntegerArray(newLength);
    emptyFill(newAuxArray,null);
    for (int i=0; i < length.get(); i++) {
      newIntArray[i]=intArray.get()[i];
      newAuxArray[i]=auxArray.get()[i];
      newSeqArray.set(i,DatatableSequenceNumber.UNSTABLE);
    }
    for (int i=length.get(); i < newLength; i++) {
      newSeqArray.set(i,DatatableSequenceNumber.UNSTABLE);
      newAuxArray[i]=EMPTY;
    }
    intArray.set(newIntArray);
    auxArray.set(newAuxArray);
    seqArray.set(newSeqArray);
    int oldLength=length.get();
    length.set(newLength);
    for (int i=oldLength; i < newLength; i++) {
      if (!seqArray.get().compareAndSet(i,DatatableSequenceNumber.UNSTABLE,DatatableSequenceNumber.get())) {
        throw new IllegalStateException("String_Node_Str" + i + "String_Node_Str");
      }
    }
  }
  finally {
    unlock();
  }
}

Fixed version (ground truth):
/** 
 * Resizes the arrays, if required. The array length is doubled if needsResize returns true.
 */
private void resizeArrays(){
  boolean locked=false;
  while (needsResize() && !(locked=tryLock(MAX_FAIL_THRESHOLD)))   ;
  if (!locked) {
    return;
  }
  int lockedIndexes=length.get();
  try {
    int newLength=length.get() << 1;
    if (newLength > maxLength || !needsResize()) {
      return;
    }
    int[] newIntArray=new int[newLength];
    @SuppressWarnings("String_Node_Str") T[] newAuxArray=(T[])new Object[newLength];
    AtomicIntegerArray newSeqArray=new AtomicIntegerArray(newLength);
    emptyFill(newAuxArray,null);
    for (int i=0; i < length.get(); i++) {
      newIntArray[i]=intArray.get()[i];
      newAuxArray[i]=auxArray.get()[i];
      newSeqArray.set(i,DatatableSequenceNumber.UNSTABLE);
    }
    for (int i=length.get(); i < newLength; i++) {
      newSeqArray.set(i,DatatableSequenceNumber.UNSTABLE);
      newAuxArray[i]=EMPTY;
    }
    intArray.set(newIntArray);
    auxArray.set(newAuxArray);
    seqArray.set(newSeqArray);
    int oldLength=length.get();
    length.set(newLength);
    for (int i=oldLength; i < newLength; i++) {
      if (!seqArray.get().compareAndSet(i,DatatableSequenceNumber.UNSTABLE,DatatableSequenceNumber.get())) {
        throw new IllegalStateException("String_Node_Str" + i + "String_Node_Str");
      }
    }
  }
  finally {
    unlock(lockedIndexes);
  }
}
Program: 177516
Project: 177516
Buggy source:
@Override public void rotate(Quaternion rot){
  if (!isValidAccess()) {
    if (Spout.getGame().debugMode())     throw new IllegalAccessError("String_Node_Str" + Thread.currentThread().getPriority() + "String_Node_Str"+ owningThread.getName()+ "String_Node_Str");
    return;
  }
  Quaternion q=this.transform.getRotation().multiply(rot);
  this.transform.setRotation(q);
}

Fixed version (ground truth):
@Override public void rotate(Quaternion rot){
  if (!isValidAccess()) {
    if (Spout.getGame().debugMode())     throw new IllegalAccessError("String_Node_Str" + Thread.currentThread().getPriority() + "String_Node_Str"+ owningThread.getName()+ "String_Node_Str");
    return;
  }
  setRotation(getRotation().multiply(rot));
}
Program: 177517
Project: 177517
Buggy source:
/** 
 * Called when the tick is finished and collisions need to be resolved and move events fired
 */
public void resolve(){
  if (this.collision == null || this.getWorld() == null)   return;
  final Point location=this.transform.getPosition();
  this.collision.setPosition(location);
  List<CollisionVolume> colliding=((SpoutWorld)location.getWorld()).getCollidingObject(this.collision);
  Vector3 offset=this.lastTransform.getPosition().subtract(location);
  for (  CollisionVolume box : colliding) {
    Vector3 collision=this.collision.resolve(box);
    if (collision != null) {
      collision=collision.subtract(location);
      System.out.println("String_Node_Str" + collision);
      if (collision.getX() != 0F) {
        offset=new Vector3(collision.getX(),offset.getY(),offset.getZ());
      }
      if (collision.getY() != 0F) {
        offset=new Vector3(offset.getX(),collision.getY(),offset.getZ());
      }
      if (collision.getZ() != 0F) {
        offset=new Vector3(offset.getX(),offset.getY(),collision.getZ());
      }
    }
  }
  this.setPosition(location.add(offset));
}

Fixed version (ground truth):
/** 
 * Called when the tick is finished and collisions need to be resolved and move events fired
 */
public void resolve(){
  if (this.collision == null || this.getWorld() == null)   return;
  final Point location=this.transform.getPosition();
  this.collision.setPosition(location);
  List<CollisionVolume> colliding=((SpoutWorld)location.getWorld()).getCollidingObject(this.collision);
  Vector3 offset=this.lastTransform.getPosition().subtract(location);
  for (  CollisionVolume box : colliding) {
    Vector3 collision=this.collision.resolve(box);
    if (collision != null) {
      collision=collision.subtract(location);
      System.out.println("String_Node_Str" + collision);
      if (collision.getX() != 0F) {
        offset=new Vector3(collision.getX(),offset.getY(),offset.getZ());
      }
      if (collision.getY() != 0F) {
        offset=new Vector3(offset.getX(),collision.getY(),offset.getZ());
      }
      if (collision.getZ() != 0F) {
        offset=new Vector3(offset.getX(),offset.getY(),collision.getZ());
      }
    }
  }
}
Program: 177518
Project: 177518
Buggy source:
@Override public void translate(float x,float y,float z){
  if (!isValidAccess()) {
    if (Spout.getGame().debugMode())     throw new IllegalAccessError("String_Node_Str" + Thread.currentThread().getPriority() + "String_Node_Str"+ owningThread.getName()+ "String_Node_Str");
    return;
  }
  Vector3 p=this.transform.getPosition().add(x,y,z);
  Point s=new Point(p,this.transform.getPosition().getWorld());
  this.transform.setPosition(s);
}

Fixed version (ground truth):
@Override public void translate(float x,float y,float z){
  translate(new Vector3(x,y,z));
}
Program: 177519
Project: 177519
Buggy source:
@Override public void scale(float x,float y,float z){
  Vector3 s=new Vector3(x,y,z);
  scale(s);
}

Fixed version (ground truth):
@Override public void scale(float x,float y,float z){
  scale(new Vector3(x,y,z));
}
Program: 177520
Project: 177520
Buggy source:
/** 
 * Saves the configuration to disk. All errors are clobbered.
 * @return true if it was successful
 */
public boolean save(){
  FileOutputStream stream=null;
  File parent=file.getParentFile();
  if (parent != null) {
    parent.mkdirs();
  }
  try {
    stream=new FileOutputStream(file);
    OutputStreamWriter writer=new OutputStreamWriter(stream,"String_Node_Str");
    if (header != null) {
      writer.append(header);
      writer.append("String_Node_Str");
    }
    for (    ConfigurationNode node : nodes) {
      node.setConfiguration(this);
    }
    yaml.dump(root,writer);
    return true;
  }
 catch (  IOException e) {
  }
 finally {
    try {
      if (stream != null) {
        stream.close();
      }
    }
 catch (    IOException e) {
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Saves the configuration to disk. All errors are clobbered.
 * @return true if it was successful
 */
public boolean save(){
  FileOutputStream stream=null;
  File parent=file.getParentFile();
  if (parent != null) {
    parent.mkdirs();
  }
  try {
    stream=new FileOutputStream(file);
    OutputStreamWriter writer=new OutputStreamWriter(stream,"String_Node_Str");
    if (header != null) {
      writer.append(header);
      writer.append("String_Node_Str");
    }
    for (    ConfigurationNode node : nodes) {
      setValue(node.getPath(),node.getValue());
    }
    yaml.dump(root,writer);
    return true;
  }
 catch (  IOException e) {
  }
 finally {
    try {
      if (stream != null) {
        stream.close();
      }
    }
 catch (    IOException e) {
    }
  }
  return false;
}
Program: 177521
Project: 177521
Buggy source:
/** 
 * Returns a double from the value, default value if not a double.
 * @return double
 */
public double getDouble(double def){
  Double d=MathHelper.castDouble(value);
  if (d != null) {
    return d;
  }
  if (value == null) {
    this.setValue(def,true);
  }
  return def;
}

Fixed version (ground truth):
/** 
 * Returns a double from the value, default value if not a double.
 * @return double
 */
public double getDouble(double def){
  Double d=MathHelper.castDouble(value);
  if (d != null) {
    return d;
  }
  return def;
}
Program: 177522
Project: 177522
Buggy source:
/** 
 * Returns a integer from the value, default value if not a integer.
 * @return integer
 */
public int getInteger(int def){
  Integer i=MathHelper.castInt(value);
  if (i != null) {
    return i;
  }
  if (value == null) {
    this.setValue(def,true);
  }
  return def;
}

Fixed version (ground truth):
/** 
 * Returns a integer from the value, default value if not a integer.
 * @return integer
 */
public int getInteger(int def){
  Integer i=MathHelper.castInt(value);
  if (i != null) {
    return i;
  }
  return def;
}
Program: 177523
Project: 177523
Buggy source:
/** 
 * Returns a string from the value, default value if not a string.
 * @return string
 */
public String getString(String def){
  if (value == null) {
    this.setValue(def,true);
  }
 else {
    return value.toString();
  }
  return def;
}

Fixed version (ground truth):
/** 
 * Returns a string from the value.
 * @return string
 */
public String getString(){
  return value.toString();
}
Program: 177524
Project: 177524
Buggy source:
/** 
 * Gets the current value of the node.
 * @return the value of the node.
 */
public Object getValue(){
  if (value != null) {
    return value;
  }
  this.setValue(def,true);
  return def;
}

Fixed version (ground truth):
/** 
 * Gets the current value of the node.
 * @return the value of the node.
 */
public Object getValue(){
  if (value != null) {
    return value;
  }
  return def;
}
Program: 177525
Project: 177525
Buggy source:
/** 
 * Returns a list from the value, default value if not a list.
 * @return list
 */
public List<Object> getList(List<Object> def){
  if (value != null && value instanceof List) {
    return (List<Object>)value;
  }
  if (value == null) {
    this.setValue(def,true);
  }
  return def;
}

Fixed version (ground truth):
/** 
 * Returns a list from the value, default value if not a list.
 * @return list
 */
public List<Object> getList(List<Object> def){
  if (value != null && value instanceof List) {
    return (List<Object>)value;
  }
  return def;
}
Program: 177526
Project: 177526
Buggy source:
/** 
 * Sets the un-staged value of the node. The actually configuration will not be updated until 'MemoryConfiguration.setProperty()'
 * @param value
 */
public void setValue(Object value,boolean toMemoryConfig){
  this.value=value;
  if (config != null && toMemoryConfig) {
    config.addNode(this);
  }
}

Fixed version (ground truth):
/** 
 * Sets the un-staged value of the node. The actually configuration will not be updated until 'MemoryConfiguration.setProperty()'
 * @param value
 */
public void setValue(Object value){
  this.value=value;
  if (config != null) {
    config.addNode(this);
  }
}
Program: 177527
Project: 177527
Buggy source:
/** 
 * Returns a boolean from the value, default value if not a boolean.
 * @return boolean
 */
public boolean getBoolean(boolean def){
  Boolean b=MathHelper.castBoolean(value);
  if (b != null) {
    return b;
  }
  if (value == null) {
    this.setValue(def,true);
  }
  return def;
}

Fixed version (ground truth):
/** 
 * Returns a boolean from the value, default value if not a boolean.
 * @return boolean
 */
public boolean getBoolean(boolean def){
  Boolean b=MathHelper.castBoolean(value);
  if (b != null) {
    return b;
  }
  return def;
}
Program: 177528
Project: 177528
Buggy source:
/** 
 * Sets the configuration the node will be saved to.
 * @param config
 */
public void setConfiguration(MemoryConfiguration config){
  config.addNode(this);
}

Fixed version (ground truth):
/** 
 * Sets the configuration the node will be saved to.
 * @param config
 */
public void setConfiguration(MemoryConfiguration config){
  this.config=config;
}
Program: 177529
Project: 177529
Buggy source:
public Set<ConfigurationNode> getNodes(){
  return nodes;
}

Fixed version (ground truth):
/** 
 * Gets the set of nodes in the configuration; only contains nodes assigned.
 * @return node set
 */
public Set<ConfigurationNode> getNodes(){
  return nodes;
}
Program: 177530
Project: 177530
Buggy source:
/** 
 * Adds a node to the configuration given the path and value.
 * @param path
 * @param value
 * @return new node
 */
public ConfigurationNode addNode(String path,Object value){
  ConfigurationNode node=new ConfigurationNode(path,value);
  node.setConfiguration(this);
  return node;
}

Fixed version (ground truth):
/** 
 * Adds a node to the configuration given the path and value.
 * @param path
 * @param value
 * @return true if node exists
 */
public boolean addNode(String path,Object value){
  return addNode(new ConfigurationNode(path,value));
}
Program: 177531
Project: 177531
Buggy source:
/** 
 * Returns a double from the value, default value if not a double.
 * @return double
 */
public double getDouble(String path,double def){
  Object value=getValue(path);
  Double d=MathHelper.castDouble(value);
  if (d != null) {
    return d;
  }
  if (value == null) {
    this.setValue(path,def);
  }
  return def;
}

Fixed version (ground truth):
/** 
 * Returns a double from the value, default value if not a double.
 * @return double
 */
public double getDouble(String path,double def){
  Object value=getValue(path);
  Double d=MathHelper.castDouble(value);
  if (d != null) {
    return d;
  }
  return def;
}
Program: 177532
Project: 177532
Buggy source:
/** 
 * Returns a integer from the value, default value if not a integer.
 * @return integer
 */
public int getInteger(String path,int def){
  Object value=getValue(path);
  Integer i=MathHelper.castInt(value);
  if (i != null) {
    return i;
  }
  if (value == null) {
    this.setValue(path,def);
  }
  return def;
}

Fixed version (ground truth):
/** 
 * Returns a integer from the value, default value if not a integer.
 * @return integer
 */
public int getInteger(String path,int def){
  Object value=getValue(path);
  Integer i=MathHelper.castInt(value);
  if (i != null) {
    return i;
  }
  return def;
}
Program: 177533
Project: 177533
Buggy source:
/** 
 * Returns a string from the value, default value if not a string.
 * @return string
 */
public String getString(String path,String def){
  Object value=getValue(path);
  if (value instanceof String) {
    return (String)value;
  }
  if (value == null) {
    this.setValue(path,def);
  }
  return def;
}

Fixed version (ground truth):
/** 
 * Returns a string from the value, default given if not a string.
 * @return string
 */
public String getString(String path,String def){
  Object value=getValue(path);
  if (value instanceof String) {
    return (String)value;
  }
  return def;
}
Program: 177534
Project: 177534
Buggy source:
/** 
 * Returns a Set of the keys under that parent
 * @param path
 * @return Set String
 */
public Set<String> getKeys(String path){
  Set<String> keys=new HashSet<String>();
  String[] sections=path.split(pathSeperator);
  Map<String,Object> section=this.root;
  for (int i=0; i < sections.length && section != null; i++) {
    String sec=sections[i];
    try {
      section=(Map<String,Object>)section.get(sec);
    }
 catch (    Exception e) {
      System.err.println("String_Node_Str");
      e.printStackTrace();
    }
  }
  if (section != null) {
    keys=section.keySet();
  }
  return keys;
}

Fixed version (ground truth):
/** 
 * Returns a Set of the keys under that parent
 * @param path
 * @return Set String
 */
public Set<String> getKeys(String path){
  Set<String> keys=new HashSet<String>();
  String[] sections=path.split(pathSeparator);
  Map<String,Object> section=this.root;
  for (int i=0; i < sections.length && section != null; i++) {
    String sec=sections[i];
    try {
      section=(Map<String,Object>)section.get(sec);
    }
 catch (    Exception e) {
      System.err.println("String_Node_Str");
      e.printStackTrace();
    }
  }
  if (section != null) {
    keys=section.keySet();
  }
  return keys;
}
Program: 177535
Project: 177535
Buggy source:
/** 
 * Gets the value at a given path
 * @param path
 * @return the object from the path
 */
public Object getValue(String path){
  if (!path.contains(pathSeperator)) {
    Object val=root.get(path);
    if (val == null) {
      return null;
    }
    return val;
  }
  String[] parts=path.split(pathSeperator);
  Map<String,Object> node=root;
  for (int i=0; i < parts.length; i++) {
    Object o=node.get(parts[i]);
    if (o == null) {
      return null;
    }
    if (i == parts.length - 1) {
      return o;
    }
    try {
      node=(Map<String,Object>)o;
    }
 catch (    ClassCastException e) {
      return null;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the value at a given path
 * @param path
 * @return the object from the path
 */
public Object getValue(String path){
  if (!path.contains(pathSeparator)) {
    Object val=root.get(path);
    if (val == null) {
      return null;
    }
    return val;
  }
  String[] parts=path.split(pathSeparator);
  Map<String,Object> node=root;
  for (int i=0; i < parts.length; i++) {
    Object o=node.get(parts[i]);
    if (o == null) {
      return null;
    }
    if (i == parts.length - 1) {
      return o;
    }
    try {
      node=(Map<String,Object>)o;
    }
 catch (    ClassCastException e) {
      return null;
    }
  }
  return null;
}
Program: 177536
Project: 177536
Buggy source:
/** 
 * Adds multiple nodes to the configuration.
 * @param nodes
 */
public void addNodes(ConfigurationNode... nodes){
  for (  ConfigurationNode node : nodes) {
    node.setConfiguration(this);
  }
}

Fixed version (ground truth):
/** 
 * Adds multiple nodes to the configuration.
 * @param nodes
 * @return true if node exists.
 */
public boolean addNodes(ConfigurationNode... nodes){
  for (  ConfigurationNode node : nodes) {
    return addNode(node);
  }
  return false;
}
Program: 177537
Project: 177537
Buggy source:
/** 
 * Returns a list from the value, default value if not a list.
 * @return list
 */
public List<Object> getList(String path,List<Object> def){
  Object value=getValue(path);
  if (value != null && value instanceof List) {
    return (List<Object>)value;
  }
  if (value == null) {
    this.setValue(path,def);
  }
  return def;
}

Fixed version (ground truth):
/** 
 * Returns a list from the value, default value if not a list.
 * @return list
 */
public List<Object> getList(String path,List<Object> def){
  Object value=getValue(path);
  if (value != null && value instanceof List) {
    return (List<Object>)value;
  }
  return def;
}
Program: 177538
Project: 177538
Buggy source:
/** 
 * Sets the object value at the given path.
 * @param path
 * @param value
 */
public void setValue(String path,Object value){
  if (!path.contains(pathSeperator)) {
    root.put(path,value);
    return;
  }
  String[] parts=path.split(pathSeperator);
  Map<String,Object> node=root;
  for (int i=0; i < parts.length; i++) {
    Object o=node.get(parts[i]);
    if (i == parts.length - 1) {
      node.put(parts[i],value);
      return;
    }
    if (o == null || !(o instanceof Map)) {
      o=new HashMap<String,Object>();
      node.put(parts[i],o);
    }
    node=(Map<String,Object>)o;
  }
}

Fixed version (ground truth):
/** 
 * Sets the object value at the given path.
 * @param path
 * @param value
 */
public void setValue(String path,Object value){
  if (!path.contains(pathSeparator)) {
    root.put(path,value);
    return;
  }
  String[] parts=path.split(pathSeparator);
  Map<String,Object> node=root;
  for (int i=0; i < parts.length; i++) {
    Object o=node.get(parts[i]);
    if (i == parts.length - 1) {
      node.put(parts[i],value);
      return;
    }
    if (o == null || !(o instanceof Map)) {
      o=new HashMap<String,Object>();
      node.put(parts[i],o);
    }
    node=(Map<String,Object>)o;
  }
}
Program: 177539
Project: 177539
Buggy source:
/** 
 * Returns a boolean from the value, default value if not a boolean.
 * @return boolean
 */
public boolean getBoolean(String path,boolean def){
  Object value=getValue(path);
  Boolean b=MathHelper.castBoolean(value);
  if (b != null) {
    return b;
  }
  if (value == null) {
    this.setValue(path,def);
  }
  return def;
}

Fixed version (ground truth):
/** 
 * Returns a boolean from the value, default value if not a boolean.
 * @return boolean
 */
public boolean getBoolean(String path,boolean def){
  Object value=getValue(path);
  Boolean b=MathHelper.castBoolean(value);
  if (b != null) {
    return b;
  }
  return def;
}
Program: 177540
Project: 177540
Buggy source:
/** 
 * Gets a node from the configuration, if the path is found, returns a node with the value of the path. If it's null, it returns the default value given.
 * @param path
 * @param def
 * @return
 */
public ConfigurationNode getNode(String path,Object def){
  ConfigurationNode node=new ConfigurationNode(path,def);
  Object value=this.getValue(node.getPath());
  if (value == null) {
    value=def;
  }
  node.setValue(value,true);
  node.setConfiguration(this);
  return node;
}

Fixed version (ground truth):
/** 
 * Gets a node from the configuration, if the path is found, returns a node with the value of the path. Can return null.
 * @param path
 * @return node
 */
public ConfigurationNode getNode(String path){
  return getNode(path,null);
}
Program: 177541
Project: 177541
Buggy source:
/** 
 * Removes a node from memory.
 * @param path
 */
public void removeNode(String path){
  for (  ConfigurationNode node : nodes) {
    if (node.getPath().equalsIgnoreCase(path)) {
      nodes.remove(node);
    }
  }
}

Fixed version (ground truth):
/** 
 * Removes a node from memory.
 * @param node
 * @return true if contained node.
 */
public boolean removeNode(ConfigurationNode node){
  return nodes.remove(node);
}
Program: 177542
Project: 177542
Buggy source:
/** 
 * Called when the tick is finished and collisions need to be resolved and move events fired
 */
public void resolve(){
  if (this.collision == null)   return;
  this.collision.setPosition(this.transform.getPosition());
  final Point location=this.transform.getPosition();
  List<CollisionVolume> colliding=((SpoutWorld)this.getWorld()).getCollidingObject(this.collision);
  Vector3 offset=this.lastTransform.getPosition().subtract(this.transform.getPosition());
  for (  CollisionVolume box : colliding) {
    Vector3 collision=this.collision.resolve(box);
    if (collision != null) {
      collision=collision.subtract(location);
      System.out.println("String_Node_Str" + collision);
      if (collision.getX() != 0F) {
        offset=new Vector3(collision.getX(),offset.getY(),offset.getZ());
      }
      if (collision.getY() != 0F) {
        offset=new Vector3(offset.getX(),collision.getY(),offset.getZ());
      }
      if (collision.getZ() != 0F) {
        offset=new Vector3(offset.getX(),offset.getY(),collision.getZ());
      }
    }
  }
  location.add(offset);
  this.setPosition(location);
}

Fixed version (ground truth):
/** 
 * Called when the tick is finished and collisions need to be resolved and move events fired
 */
public void resolve(){
  if (this.collision == null)   return;
  this.collision.setPosition(this.transform.getPosition());
  final Point location=this.transform.getPosition();
  if (this.getWorld() == null) {
    return;
  }
  List<CollisionVolume> colliding=((SpoutWorld)this.getWorld()).getCollidingObject(this.collision);
  Vector3 offset=this.lastTransform.getPosition().subtract(this.transform.getPosition());
  for (  CollisionVolume box : colliding) {
    Vector3 collision=this.collision.resolve(box);
    if (collision != null) {
      collision=collision.subtract(location);
      System.out.println("String_Node_Str" + collision);
      if (collision.getX() != 0F) {
        offset=new Vector3(collision.getX(),offset.getY(),offset.getZ());
      }
      if (collision.getY() != 0F) {
        offset=new Vector3(offset.getX(),collision.getY(),offset.getZ());
      }
      if (collision.getZ() != 0F) {
        offset=new Vector3(offset.getX(),offset.getY(),collision.getZ());
      }
    }
  }
  location.add(offset);
  this.setPosition(location);
}
Program: 177543
Project: 177543
Buggy source:
public void start(){
  Spout.setGame(this);
  if (debugMode()) {
    getLogger().warning("String_Node_Str");
  }
  CommandRegistrationsFactory<Class<?>> commandRegFactory=new AnnotatedCommandRegistrationFactory(new SimpleInjector(this),new SimpleAnnotatedCommandExecutorFactory());
  getRootCommand().addSubCommands(this,AdministrationCommands.class,commandRegFactory);
  getRootCommand().addSubCommands(this,MessagingCommands.class,commandRegFactory);
  if (Spout.getGame().debugMode())   getRootCommand().addSubCommands(this,TestCommands.class,commandRegFactory);
  consoleManager.setupConsole();
  config.load();
  loadPlugins();
  enablePlugins();
  if (loadedWorlds.getLive().size() == 0) {
    throw new IllegalStateException("String_Node_Str");
  }
  getDefaultWorld();
  if (bootstrapProtocols.size() == 0) {
    getLogger().warning("String_Node_Str");
  }
  getEventManager().registerEvents(new InternalEventListener(this),this);
  scheduler.startMainThread();
}

Fixed version (ground truth):
public void start(){
  Spout.setGame(this);
  if (debugMode()) {
    getLogger().warning("String_Node_Str");
  }
  CommandRegistrationsFactory<Class<?>> commandRegFactory=new AnnotatedCommandRegistrationFactory(new SimpleInjector(this),new SimpleAnnotatedCommandExecutorFactory());
  getRootCommand().addSubCommands(this,AdministrationCommands.class,commandRegFactory);
  getRootCommand().addSubCommands(this,MessagingCommands.class,commandRegFactory);
  if (Spout.getGame().debugMode())   getRootCommand().addSubCommands(this,TestCommands.class,commandRegFactory);
  consoleManager.setupConsole();
  config.load();
  storeQueue.start();
  banManager=new FlatFileBanManager(this);
  banManager.load();
  loadPlugins();
  enablePlugins();
  if (loadedWorlds.getLive().size() == 0) {
    throw new IllegalStateException("String_Node_Str");
  }
  getDefaultWorld();
  if (bootstrapProtocols.size() == 0) {
    getLogger().warning("String_Node_Str");
  }
  getEventManager().registerEvents(new InternalEventListener(this),this);
  scheduler.startMainThread();
}
Program: 177544
Project: 177544
Buggy source:
@SuppressWarnings("String_Node_Str") public void pulse(){
  timeoutCounter++;
  Message message;
  if (state == State.GAME) {
    while ((message=sendQueue.poll()) != null) {
      send(message,true);
    }
  }
  while ((message=messageQueue.poll()) != null) {
    MessageHandler<Message> handler=(MessageHandler<Message>)protocol.get().getHandlerLookupService().find(message.getClass());
    if (handler != null) {
      try {
        handler.handle(this,player,message);
      }
 catch (      Exception e) {
        Spout.getGame().getLogger().log(Level.SEVERE,"String_Node_Str" + message.getClass().getSimpleName() + "String_Node_Str"+ getPlayer().getName());
        e.printStackTrace();
        disconnect("String_Node_Str" + message.getClass().getSimpleName());
      }
    }
    timeoutCounter=0;
  }
  if (timeoutCounter >= TIMEOUT_TICKS) {
    disconnect("String_Node_Str",true);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void pulse(){
  timeoutCounter++;
  Message message;
  if (state == State.GAME) {
    while ((message=sendQueue.poll()) != null) {
      send(message,true);
    }
  }
  while ((message=messageQueue.poll()) != null) {
    MessageHandler<Message> handler=(MessageHandler<Message>)protocol.get().getHandlerLookupService().find(message.getClass());
    if (handler != null) {
      try {
        handler.handle(this,player,message);
      }
 catch (      Exception e) {
        Spout.getGame().getLogger().log(Level.SEVERE,"String_Node_Str" + message.getClass().getSimpleName() + "String_Node_Str"+ (getPlayer() != null ? getPlayer().getName() : "String_Node_Str"));
        e.printStackTrace();
        disconnect("String_Node_Str" + message.getClass().getSimpleName());
      }
    }
    timeoutCounter=0;
  }
  if (timeoutCounter >= TIMEOUT_TICKS) {
    disconnect("String_Node_Str",true);
  }
}
Program: 177545
Project: 177545
Buggy source:
/** 
 * Gets the distance between two Vector3.
 * @param a
 * @param b
 * @return
 */
public static double distance(Vector3 a,Vector3 b){
  double xzDist=Vector2.distance(a.toVector2(),b.toVector2());
  return Math.sqrt(Math.pow(xzDist,2) + Math.pow(Math.abs(Vector3.subtract(a,b).getY()),2));
}

Fixed version (ground truth):
/** 
 * Gets the distance between two Vector3.
 * @param a
 * @param b
 * @return
 */
public static double distance(Vector3 a,Vector3 b){
  double xzDist=Vector2.distance(a.toVector2(),b.toVector2());
  return Math.sqrt(Math.pow(xzDist,2) + Math.pow(Math.abs(Vector3.subtract(a,b).y),2));
}
Program: 177546
Project: 177546
Buggy source:
/** 
 * Returns the dot product of A and B
 * @param a
 * @param b
 * @return
 */
public static float dot(Vector3 a,Vector3 b){
  return a.getX() * b.getX() + a.getY() * b.getY() + a.getZ() * b.getZ();
}

Fixed version (ground truth):
/** 
 * Returns the dot product of A and B
 * @param a
 * @param b
 * @return
 */
public static float dot(Vector3 a,Vector3 b){
  return a.x * b.x + a.y * b.y + a.z * b.z;
}
Program: 177547
Project: 177547
Buggy source:
/** 
 * Returns a Vector3 containing the smallest X, Y, and Z values.
 * @param o1
 * @param o2
 * @return
 */
public static Vector3 min(Vector3 o1,Vector3 o2){
  return new Vector3(Math.min(o1.getX(),o2.getX()),Math.min(o1.getY(),o2.getY()),Math.min(o1.getZ(),o2.getZ()));
}

Fixed version (ground truth):
/** 
 * Returns a Vector3 containing the smallest X, Y, and Z values.
 * @param o1
 * @param o2
 * @return
 */
public static Vector3 min(Vector3 o1,Vector3 o2){
  return new Vector3(Math.min(o1.x,o2.x),Math.min(o1.y,o2.y),Math.min(o1.z,o2.z));
}
Program: 177548
Project: 177548
Buggy source:
/** 
 * Returns a new float array that is {x, y, z}
 * @param a
 * @return
 */
public static float[] toArray(Vector3 a){
  return new float[]{a.getX(),a.getY(),a.getZ()};
}

Fixed version (ground truth):
/** 
 * Returns a new float array that is {x, y, z}
 * @param a
 * @return
 */
public static float[] toArray(Vector3 a){
  return new float[]{a.x,a.y,a.z};
}
Program: 177549
Project: 177549
Buggy source:
/** 
 * Raises the X, Y, and Z values of a Vector3 to the given power.
 * @param o
 * @param power
 * @return
 */
public static Vector3 pow(Vector3 o,double power){
  return new Vector3(Math.pow(o.getX(),power),Math.pow(o.getY(),power),Math.pow(o.getZ(),power));
}

Fixed version (ground truth):
/** 
 * Raises the X, Y, and Z values of a Vector3 to the given power.
 * @param o
 * @param power
 * @return
 */
public static Vector3 pow(Vector3 o,double power){
  return new Vector3(Math.pow(o.x,power),Math.pow(o.y,power),Math.pow(o.z,power));
}
Program: 177550
Project: 177550
Buggy source:
/** 
 * Divides one Vector3 by the other Vector3
 * @param a
 * @param b
 * @return
 */
public static Vector3 divide(Vector3 a,Vector3 b){
  return new Vector3(a.getX() / b.getX(),a.getY() / b.getY(),a.getZ() / b.getZ());
}

Fixed version (ground truth):
/** 
 * Divides one Vector3 by the other Vector3
 * @param a
 * @param b
 * @return
 */
public static Vector3 divide(Vector3 a,Vector3 b){
  return new Vector3(a.x / b.x,a.y / b.y,a.z / b.z);
}
Program: 177551
Project: 177551
Buggy source:
/** 
 * Multiplies one Vector3 by the other Vector3
 * @param a
 * @param b
 * @return
 */
public static Vector3 multiply(Vector3 a,Vector3 b){
  return new Vector3(a.getX() * b.getX(),a.getY() * b.getY(),a.getZ() * b.getZ());
}

Fixed version (ground truth):
/** 
 * Multiplies one Vector3 by the other Vector3
 * @param a
 * @param b
 * @return
 */
public static Vector3 multiply(Vector3 a,Vector3 b){
  return new Vector3(a.x * b.x,a.y * b.y,a.z * b.z);
}
Program: 177552
Project: 177552
Buggy source:
/** 
 * Rounds the X, Y, and Z values of the given Vector3 down to the nearest integer value.
 * @param o Vector3 to use
 * @return
 */
public static Vector3 floor(Vector3 o){
  return new Vector3(Math.floor(o.getX()),Math.floor(o.getY()),Math.floor(o.getZ()));
}

Fixed version (ground truth):
/** 
 * Rounds the X, Y, and Z values of the given Vector3 down to the nearest integer value.
 * @param o Vector3 to use
 * @return
 */
public static Vector3 floor(Vector3 o){
  return new Vector3(Math.floor(o.x),Math.floor(o.y),Math.floor(o.z));
}
Program: 177553
Project: 177553
Buggy source:
/** 
 * Creates a new Vector that is A + B
 * @param a
 * @param b
 * @return
 */
public static Vector3 add(Vector3 a,Vector3 b){
  return new Vector3(a.getX() + b.getX(),a.getY() + b.getY(),a.getZ() + b.getZ());
}

Fixed version (ground truth):
/** 
 * Creates a new Vector that is A + B
 * @param a
 * @param b
 * @return
 */
public static Vector3 add(Vector3 a,Vector3 b){
  return new Vector3(a.x + b.x,a.y + b.y,a.z + b.z);
}
Program: 177554
Project: 177554
Buggy source:
/** 
 * Returns a Vector3 containing the largest X, Y, and Z values.
 * @param o1
 * @param o2
 * @return
 */
public static Vector3 max(Vector3 o1,Vector3 o2){
  return new Vector3(Math.max(o1.getX(),o2.getX()),Math.max(o1.getY(),o2.getY()),Math.max(o1.getZ(),o2.getZ()));
}

Fixed version (ground truth):
/** 
 * Returns a Vector3 containing the largest X, Y, and Z values.
 * @param o1
 * @param o2
 * @return
 */
public static Vector3 max(Vector3 o1,Vector3 o2){
  return new Vector3(Math.max(o1.x,o2.x),Math.max(o1.y,o2.y),Math.max(o1.z,o2.z));
}
Program: 177555
Project: 177555
Buggy source:
/** 
 * Creates a new vector that is A - B
 * @param a
 * @param b
 * @return
 */
public static Vector3 subtract(Vector3 a,Vector3 b){
  return new Vector3(a.getX() - b.getX(),a.getY() - b.getY(),a.getZ() - b.getZ());
}

Fixed version (ground truth):
/** 
 * Creates a new vector that is A - B
 * @param a
 * @param b
 * @return
 */
public static Vector3 subtract(Vector3 a,Vector3 b){
  return new Vector3(a.x - b.x,a.y - b.y,a.z - b.z);
}
Program: 177556
Project: 177556
Buggy source:
/** 
 * Creates a new Vector that is the A x B The Cross Product is the vector orthogonal to both A and B
 * @param a
 * @param b
 * @return
 */
public static Vector3 cross(Vector3 a,Vector3 b){
  return new Vector3(a.getY() * b.getZ() - a.getZ() * b.getY(),a.getZ() * b.getX() - a.getX() * b.getZ(),a.getX() * b.getY() - a.getY() * b.getX());
}

Fixed version (ground truth):
/** 
 * Creates a new Vector that is the A x B The Cross Product is the vector orthogonal to both A and B
 * @param a
 * @param b
 * @return
 */
public static Vector3 cross(Vector3 a,Vector3 b){
  return new Vector3(a.y * b.z - a.z * b.y,a.z * b.x - a.x * b.z,a.x * b.y - a.y * b.x);
}