Program: 160331
Project: 160331
Buggy source:
@SuppressWarnings("String_Node_Str") private Object readList(IdEObject idEObject,EClass originalQueryClass,ByteBuffer buffer,IfcModelInterface model,QueryInterface query,TodoList todoList,EStructuralFeature feature) throws BimserverDatabaseException {
  if (feature.getEType() instanceof EEnum) {
  }
 else   if (feature.getEType() instanceof EClass) {
    if (buffer.capacity() == 1 && buffer.get(0) == -1) {
      buffer.position(buffer.position() + 1);
    }
 else {
      int listSize=buffer.getInt();
      AbstractEList<Object> list=(AbstractEList<Object>)idEObject.eGet(feature);
      for (int i=0; i < listSize; i++) {
        if (feature.getEAnnotation("String_Node_Str") != null) {
          IdEObjectImpl newObject=createInternal((EClass)feature.getEType(),query);
          Object result=readList(newObject,originalQueryClass,buffer,model,query,todoList,newObject.eClass().getEStructuralFeature("String_Node_Str"));
          if (result != null) {
            newObject.eSet(newObject.eClass().getEStructuralFeature("String_Node_Str"),result);
          }
          list.addUnique(newObject);
        }
 else {
          IdEObject referencedObject=null;
          buffer.order(ByteOrder.LITTLE_ENDIAN);
          short cid=buffer.getShort();
          buffer.order(ByteOrder.BIG_ENDIAN);
          if (cid == -1) {
          }
 else           if (cid < 0) {
            EClass referenceClass=database.getEClassForCid((short)(-cid));
            if (referenceClass == null) {
              throw new BimserverDatabaseException("String_Node_Str" + (-cid));
            }
            if (feature.isMany()) {
              referencedObject=readEmbeddedValue(feature,buffer,referenceClass,query);
            }
 else {
              referencedObject=readWrappedValue(feature,buffer,referenceClass,query);
            }
          }
 else           if (cid > 0) {
            EClass referenceClass=database.getEClassForCid(cid);
            if (referenceClass == null) {
              throw new BimserverDatabaseException("String_Node_Str" + cid);
            }
            buffer.position(buffer.position() - 2);
            referencedObject=readReference(originalQueryClass,buffer,model,idEObject,feature,referenceClass,query,todoList);
          }
          if (referencedObject != null) {
            if (!feature.getEType().isInstance(referencedObject)) {
              throw new BimserverDatabaseException(referencedObject.getClass().getSimpleName() + "String_Node_Str" + feature.getEType().getName()+ "String_Node_Str"+ feature.getName());
            }
            if (feature.isUnique()) {
              list.add(referencedObject);
            }
 else {
              list.addUnique(referencedObject);
            }
          }
        }
      }
    }
  }
 else   if (feature.getEType() instanceof EDataType) {
    int listSize=buffer.getInt();
    BasicEList<Object> list=new BasicEList<Object>(listSize);
    for (int i=0; i < listSize; i++) {
      Object reference=readPrimitiveValue(feature.getEType(),buffer,query);
      if (reference != null) {
        list.addUnique(reference);
      }
    }
    return list;
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private Object readList(IdEObject idEObject,EClass originalQueryClass,ByteBuffer buffer,IfcModelInterface model,QueryInterface query,TodoList todoList,EStructuralFeature feature) throws BimserverDatabaseException {
  if (feature.getEType() instanceof EEnum) {
  }
 else   if (feature.getEType() instanceof EClass) {
    if (buffer.capacity() == 1 && buffer.get(0) == -1) {
      buffer.position(buffer.position() + 1);
    }
 else {
      int listSize=buffer.getInt();
      BasicEList<Object> list=(BasicEList<Object>)idEObject.eGet(feature);
      list.grow(listSize);
      for (int i=0; i < listSize; i++) {
        if (feature.getEAnnotation("String_Node_Str") != null) {
          IdEObjectImpl newObject=createInternal((EClass)feature.getEType(),query);
          Object result=readList(newObject,originalQueryClass,buffer,model,query,todoList,newObject.eClass().getEStructuralFeature("String_Node_Str"));
          if (result != null) {
            newObject.eSet(newObject.eClass().getEStructuralFeature("String_Node_Str"),result);
          }
          list.addUnique(newObject);
        }
 else {
          IdEObject referencedObject=null;
          buffer.order(ByteOrder.LITTLE_ENDIAN);
          short cid=buffer.getShort();
          buffer.order(ByteOrder.BIG_ENDIAN);
          if (cid == -1) {
          }
 else           if (cid < 0) {
            EClass referenceClass=database.getEClassForCid((short)(-cid));
            if (referenceClass == null) {
              throw new BimserverDatabaseException("String_Node_Str" + (-cid));
            }
            if (feature.isMany()) {
              referencedObject=readEmbeddedValue(feature,buffer,referenceClass,query);
            }
 else {
              referencedObject=readWrappedValue(feature,buffer,referenceClass,query);
            }
          }
 else           if (cid > 0) {
            EClass referenceClass=database.getEClassForCid(cid);
            if (referenceClass == null) {
              throw new BimserverDatabaseException("String_Node_Str" + cid);
            }
            buffer.position(buffer.position() - 2);
            referencedObject=readReference(originalQueryClass,buffer,model,idEObject,feature,referenceClass,query,todoList);
          }
          if (referencedObject != null) {
            if (!feature.getEType().isInstance(referencedObject)) {
              throw new BimserverDatabaseException(referencedObject.getClass().getSimpleName() + "String_Node_Str" + feature.getEType().getName()+ "String_Node_Str"+ feature.getName());
            }
            if (feature.isUnique()) {
              list.add(referencedObject);
            }
 else {
              list.addUnique(referencedObject);
            }
          }
        }
      }
    }
  }
 else   if (feature.getEType() instanceof EDataType) {
    int listSize=buffer.getInt();
    BasicEList<Object> list=new BasicEList<Object>(listSize);
    for (int i=0; i < listSize; i++) {
      Object reference=readPrimitiveValue(feature.getEType(),buffer,query);
      if (reference != null) {
        list.addUnique(reference);
      }
    }
    return list;
  }
  return null;
}