public Transaction beginTransaction(int ensure) { try { return delegate.beginTransaction(ensure); } catch (UnsupportedOperationException ex) { // let's convert to InheritanceTree ArrayStorage arr = (ArrayStorage) delegate; InheritanceTree inh = new InheritanceTree(); changeDelegate(inh); // // Copy content // Enumeration<Pair<Object>> en = arr.lookup(Object.class); while (en.hasMoreElements()) { if (!inh.add(en.nextElement(), new ArrayList<Class>())) { throw new IllegalStateException("All objects have to be accepted"); // NOI18N } } // // Copy listeners // AbstractLookup.ReferenceToResult<?> ref = arr.cleanUpResult(null); if (ref != null) { ref.cloneList(inh); } // we have added the current content and now we can start transaction return delegate.beginTransaction(ensure); } }
public Transaction beginTransaction(int ensure) { try { return delegate.beginTransaction(ensure); } catch (UnsupportedOperationException ex) { // let's convert to InheritanceTree ArrayStorage arr = (ArrayStorage) delegate; InheritanceTree inh = new InheritanceTree(); changeDelegate(inh); // // Copy content // Enumeration<Pair<Object>> en = arr.lookup(Object.class); while (en.hasMoreElements()) { if (!inh.add(en.nextElement(), new ArrayList<Class>())) { throw new IllegalStateException("All objects have to be accepted"); // NOI18N } } // // Copy listeners // AbstractLookup.ReferenceToResult<?> ref = arr.cleanUpResult(null); if (ref != null) { ref.cloneList(inh); } // we have added the current content and now we can start transaction return delegate.beginTransaction(ensure); } }
public Transaction beginTransaction(int ensure) { try { return delegate.beginTransaction(ensure); } catch (UnsupportedOperationException ex) { // let's convert to InheritanceTree ArrayStorage arr = (ArrayStorage) delegate; InheritanceTree inh = new InheritanceTree(); changeDelegate(inh); // // Copy content // Enumeration<Pair<Object>> en = arr.lookup(Object.class); while (en.hasMoreElements()) { if (!inh.add(en.nextElement(), new ArrayList<Class>())) { throw new IllegalStateException("All objects have to be accepted"); // NOI18N } } // // Copy listeners // AbstractLookup.ReferenceToResult<?> ref = arr.cleanUpResult(null); if (ref != null) { ref.cloneList(inh); } // we have added the current content and now we can start transaction return delegate.beginTransaction(ensure); } }