Program: 180305
Project: 180305
Buggy source:
@Override public VerificationResult getObject(Node source) throws XMLFormatException {
  NodeList children=source.getChildNodes();
  int size=children.getLength();
  if (size == 0) {
    return new ArrayVerificationResult(0,new PointWithNeighborhood[0],new Robustness[0]);
  }
  Map<Point,Robustness> robustnesses=new HashMap<>();
  Map<Integer,Point> memory=new HashMap<>();
  Map<Point,Collection<Integer>> neighbors=new HashMap<>();
  int dimension=Integer.parseInt(source.getAttributes().getNamedItem(DIMENSION_NAME).getNodeValue());
  for (int i=0; i < size; i++) {
    Node pointNode=children.item(i);
    float[] dims=null;
    Collection<Integer> currentNeighbors=null;
    for (int j=0; j < pointNode.getChildNodes().getLength(); j++) {
switch (pointNode.getChildNodes().item(j).getNodeName()) {
case DATA_NAME:
        Node dataNode=pointNode.getChildNodes().item(j);
      if (dataNode.getChildNodes().getLength() != dimension) {
        throw new XMLFormatException("String_Node_Str");
      }
    dims=new float[dimension];
  for (int d=0; d < dataNode.getChildNodes().getLength(); d++) {
    dims[d]=FloatFactory.getObject(dataNode.getChildNodes().item(d).getFirstChild());
  }
break;
case NEIGHBORS_NAME:
currentNeighbors=new ArrayList<>();
Node neighborsNode=pointNode.getChildNodes().item(j);
for (int n=0; n < neighborsNode.getChildNodes().getLength(); n++) {
Node neighborNode=neighborsNode.getChildNodes().item(n);
currentNeighbors.add(Integer.parseInt(neighborNode.getAttributes().getNamedItem(ID_NAME).getNodeValue()));
}
break;
}
Point point=new ArrayPoint(0,dims);
if (pointNode.getAttributes().getNamedItem(ROBUSTNESS_NAME) != null) {
robustnesses.put(point,new SimpleRobustness(FloatFactory.getObject(pointNode.getAttributes().getNamedItem(ROBUSTNESS_NAME))));
}
if (currentNeighbors != null) {
neighbors.put(point,currentNeighbors);
}
}
}
PointWithNeighborhood[] points=new PointWithNeighborhood[robustnesses.size()];
Robustness[] robustnessesFinal=new Robustness[robustnesses.size()];
int index=0;
for (Entry<Point,Robustness> entry : robustnesses.entrySet()) {
PointWithNeighborhood point;
if (neighbors.containsKey(entry.getKey())) {
Collection<Point> neighborhood=new ArrayList<>();
for (Integer id : neighbors.get(entry.getKey())) {
neighborhood.add(memory.get(id));
}
point=new PointWithNeigborhoodWrapper(entry.getKey(),neighborhood);
}
 else {
point=new PointWithNeigborhoodWrapper(entry.getKey(),Collections.EMPTY_LIST);
}
points[index]=point;
robustnessesFinal[index]=entry.getValue();
index++;
}
return new ArrayVerificationResult(robustnesses.size(),points,robustnessesFinal);
}

Fixed version (ground truth):
@Override public VerificationResult getObject(Node source) throws XMLFormatException {
  NodeList children=source.getChildNodes();
  int size=children.getLength();
  if (size == 0) {
    return new ArrayVerificationResult(0,new PointWithNeighborhood[0],new Robustness[0]);
  }
  Map<Point,Robustness> robustnesses=new HashMap<>();
  Map<Integer,Point> memory=new HashMap<>();
  Map<Point,Collection<Integer>> neighbors=new HashMap<>();
  int dimension=Integer.parseInt(source.getAttributes().getNamedItem(DIMENSION_NAME).getNodeValue());
  for (int i=0; i < size; i++) {
    Node pointNode=children.item(i);
    float[] dims=null;
    Collection<Integer> currentNeighbors=null;
    for (int j=0; j < pointNode.getChildNodes().getLength(); j++) {
switch (pointNode.getChildNodes().item(j).getNodeName()) {
case DATA_NAME:
        Node dataNode=pointNode.getChildNodes().item(j);
      if (dataNode.getChildNodes().getLength() != dimension) {
        throw new XMLFormatException("String_Node_Str");
      }
    dims=new float[dimension];
  for (int d=0; d < dataNode.getChildNodes().getLength(); d++) {
    dims[d]=FloatFactory.getObject(dataNode.getChildNodes().item(d).getFirstChild());
  }
break;
case NEIGHBORS_NAME:
currentNeighbors=new ArrayList<>();
Node neighborsNode=pointNode.getChildNodes().item(j);
for (int n=0; n < neighborsNode.getChildNodes().getLength(); n++) {
Node neighborNode=neighborsNode.getChildNodes().item(n);
currentNeighbors.add(Integer.parseInt(neighborNode.getAttributes().getNamedItem(ID_NAME).getNodeValue()));
}
break;
}
Point point=new ArrayPoint(0,dims);
if (pointNode.getAttributes().getNamedItem(ROBUSTNESS_NAME) != null) {
robustnesses.put(point,new SimpleRobustness(FloatFactory.getObject(pointNode.getAttributes().getNamedItem(ROBUSTNESS_NAME))));
}
if (currentNeighbors != null) {
neighbors.put(point,currentNeighbors);
}
memory.put(Integer.parseInt(pointNode.getAttributes().getNamedItem(ID_NAME).getNodeValue()),point);
}
}
PointWithNeighborhood[] points=new PointWithNeighborhood[robustnesses.size()];
Robustness[] robustnessesFinal=new Robustness[robustnesses.size()];
int index=0;
for (Entry<Point,Robustness> entry : robustnesses.entrySet()) {
PointWithNeighborhood point;
if (neighbors.containsKey(entry.getKey())) {
Collection<Point> neighborhood=new ArrayList<>();
for (Integer id : neighbors.get(entry.getKey())) {
neighborhood.add(memory.get(id));
}
point=new PointWithNeigborhoodWrapper(entry.getKey(),neighborhood);
}
 else {
point=new PointWithNeigborhoodWrapper(entry.getKey(),Collections.EMPTY_LIST);
}
points[index]=point;
robustnessesFinal[index]=entry.getValue();
index++;
}
return new ArrayVerificationResult(robustnesses.size(),points,robustnessesFinal);
}