Program: 11765
Project: 11765
Buggy source:
public void saveEObject(InternalEObject internalEObject,Check check) throws IOException {
  if (internalEObject == null) {
    writeCompressedInt(-1);
  }
 else {
    Integer id=eObjectIDMap.get(internalEObject);
    if (id == null) {
      int idValue=eObjectIDMap.size();
      writeCompressedInt(idValue);
      eObjectIDMap.put(internalEObject,idValue);
      EClass eClass=internalEObject.eClass();
      EClassData eClassData=writeEClass(eClass);
      boolean checkIsTransientProxy=false;
switch (check) {
case DIRECT_RESOURCE:
{
          Internal resource=internalEObject.eDirectResource();
          if (resource != null) {
            writeCompressedInt(-1);
            writeURI(resource.getURI(),resource.getURIFragment(internalEObject));
            if (version == Version.VERSION_1_0) {
              return;
            }
            checkIsTransientProxy=true;
          }
 else           if (internalEObject.eIsProxy()) {
            writeCompressedInt(-1);
            writeURI(internalEObject.eProxyURI());
            if (version == Version.VERSION_1_0) {
              return;
            }
          }
          break;
        }
case RESOURCE:
{
        Resource resource=internalEObject.eResource();
        if (resource != this.resource && resource != null) {
          writeCompressedInt(-1);
          writeURI(resource.getURI(),resource.getURIFragment(internalEObject));
          if (version == Version.VERSION_1_0) {
            return;
          }
          checkIsTransientProxy=true;
        }
 else         if (internalEObject.eIsProxy()) {
          writeCompressedInt(-1);
          writeURI(internalEObject.eProxyURI());
          if (version == Version.VERSION_1_0) {
            return;
          }
        }
        break;
      }
case NOTHING:
case CONTAINER:
{
      break;
    }
}
EStructuralFeatureData[] eStructuralFeatureData=eClassData.eStructuralFeatureData;
for (int i=0, length=eStructuralFeatureData.length; i < length; ++i) {
  EStructuralFeatureData structuralFeatureData=eStructuralFeatureData[i];
  if (!structuralFeatureData.isTransient && (structuralFeatureData.kind != FeatureKind.EOBJECT_CONTAINER_PROXY_RESOLVING || check == Check.CONTAINER) && (!checkIsTransientProxy || !structuralFeatureData.isProxyTransient)) {
    saveFeatureValue(internalEObject,i,structuralFeatureData);
  }
}
writeCompressedInt(0);
}
 else {
writeCompressedInt(id);
}
}
}

Fixed version (ground truth):
public void saveEObject(InternalEObject internalEObject,Check check) throws IOException {
  if (internalEObject == null) {
    writeCompressedInt(-1);
  }
 else {
    Integer id=eObjectIDMap.get(internalEObject);
    if (id == null) {
      int idValue=eObjectIDMap.size();
      writeCompressedInt(idValue);
      eObjectIDMap.put(internalEObject,idValue);
      EClass eClass=internalEObject.eClass();
      EClassData eClassData=writeEClass(eClass);
      boolean checkIsTransientProxy=false;
switch (check) {
case DIRECT_RESOURCE:
{
          Internal resource=internalEObject.eDirectResource();
          if (resource != null) {
            writeCompressedInt(-1);
            writeURI(resource.getURI(),resource.getURIFragment(internalEObject));
            if ((style & STYLE_PROXY_ATTRIBUTES) == 0) {
              return;
            }
            checkIsTransientProxy=true;
          }
 else           if (internalEObject.eIsProxy()) {
            writeCompressedInt(-1);
            writeURI(internalEObject.eProxyURI());
            if ((style & STYLE_PROXY_ATTRIBUTES) == 0) {
              return;
            }
            checkIsTransientProxy=true;
          }
          break;
        }
case RESOURCE:
{
        Resource resource=internalEObject.eResource();
        if (resource != this.resource && resource != null) {
          writeCompressedInt(-1);
          writeURI(resource.getURI(),resource.getURIFragment(internalEObject));
          if ((style & STYLE_PROXY_ATTRIBUTES) == 0) {
            return;
          }
          checkIsTransientProxy=true;
        }
 else         if (internalEObject.eIsProxy()) {
          writeCompressedInt(-1);
          writeURI(internalEObject.eProxyURI());
          if ((style & STYLE_PROXY_ATTRIBUTES) == 0) {
            return;
          }
          checkIsTransientProxy=true;
        }
        break;
      }
case NOTHING:
case CONTAINER:
{
      break;
    }
}
EStructuralFeatureData[] eStructuralFeatureData=eClassData.eStructuralFeatureData;
for (int i=0, length=eStructuralFeatureData.length; i < length; ++i) {
  EStructuralFeatureData structuralFeatureData=eStructuralFeatureData[i];
  if (!structuralFeatureData.isTransient && (structuralFeatureData.kind != FeatureKind.EOBJECT_CONTAINER_PROXY_RESOLVING || check == Check.CONTAINER) && (!checkIsTransientProxy || !structuralFeatureData.isProxyTransient)) {
    saveFeatureValue(internalEObject,i,structuralFeatureData);
  }
}
writeCompressedInt(0);
}
 else {
writeCompressedInt(id);
}
}
}