Пример #1
0
 protected static void doBecomeProxy(InternalEObject p, Resource res) {
   String id = res.getURIFragment(p);
   p.eSetProxyURI(res.getURI().appendFragment(id));
   if (res instanceof XMLResource) {
     ((XMLResource) res).setID(p, null);
   }
   p.eAdapters().clear();
 }
Пример #2
0
  /*
   * IMPORTANT: Compile errors in this method might indicate an old version of EMF. Legacy support is only enabled for
   * EMF with fixed bug #247130. These compile errors do not affect native models!
   */
  public static InternalCDOObject adaptLegacy(InternalEObject object) {
    EList<Adapter> adapters = object.eAdapters();
    CDOLegacyAdapter adapter = getLegacyAdapter(adapters);
    if (adapter == null) {
      adapter = new CDOLegacyAdapter(object);
    }

    return adapter;

    // EList<InternalEObject.EReadListener> readListeners = object.eReadListeners();
    // CDOLegacyWrapper wrapper = getLegacyWrapper(readListeners);
    // if (wrapper == null)
    // {
    // wrapper = new CDOLegacyWrapper(object);
    // // TODO Only Load/Attach transitions should actually *add* the wrappers!
    // readListeners.add(0, wrapper);
    // object.eWriteListeners().add(0, wrapper);
    // }
    //
    // return wrapper;
  }