Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 121138 Details for
Bug 247794
Make ResourceImpl.ContentsEList<E> public static
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Introduce a static base class.
247794.patch (text/plain), 4.21 KB, created by
Ed Merks
on 2008-12-23 09:27:37 EST
(
hide
)
Description:
Introduce a static base class.
Filename:
MIME Type:
Creator:
Ed Merks
Created:
2008-12-23 09:27:37 EST
Size:
4.21 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.ecore >Index: src/org/eclipse/emf/ecore/resource/impl/ResourceImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/resource/impl/ResourceImpl.java,v >retrieving revision 1.31 >diff -u -r1.31 ResourceImpl.java >--- src/org/eclipse/emf/ecore/resource/impl/ResourceImpl.java 15 Dec 2008 15:48:20 -0000 1.31 >+++ src/org/eclipse/emf/ecore/resource/impl/ResourceImpl.java 23 Dec 2008 14:19:41 -0000 >@@ -366,16 +366,19 @@ > } > > /** >- * A notifying list implementation for supporting {@link Resource#getContents}. >+ * A basic reusable notifying list implementation for supporting {@link Resource#getContents}. > */ >- protected class ContentsEList<E extends Object & EObject> extends NotifyingInternalEListImpl<E> implements InternalEList<E> >+ public static abstract class ResourceContentsEList<E extends Object & EObject> extends NotifyingInternalEListImpl<E> implements InternalEList<E> > { > private static final long serialVersionUID = 1L; > >+ protected abstract Resource.Internal getResource(); >+ protected abstract Notification setLoaded(boolean loaded); >+ > @Override > public Object getNotifier() > { >- return ResourceImpl.this; >+ return getResource(); > } > > @Override >@@ -387,7 +390,7 @@ > @Override > protected boolean isNotificationRequired() > { >- return ResourceImpl.this.eNotificationRequired(); >+ return !getResource().eAdapters().isEmpty(); > } > > @Override >@@ -412,8 +415,8 @@ > public NotificationChain inverseAdd(E object, NotificationChain notifications) > { > InternalEObject eObject = (InternalEObject)object; >- notifications = eObject.eSetResource(ResourceImpl.this, notifications); >- ResourceImpl.this.attached(eObject); >+ notifications = eObject.eSetResource(getResource(), notifications); >+ getResource().attached(eObject); > return notifications; > } > >@@ -421,9 +424,9 @@ > public NotificationChain inverseRemove(E object, NotificationChain notifications) > { > InternalEObject eObject = (InternalEObject)object; >- if (ResourceImpl.this.isLoaded) >+ if (getResource().isLoaded()) > { >- ResourceImpl.this.detached(eObject); >+ getResource().detached(eObject); > } > return eObject.eSetResource(null, notifications); > } >@@ -474,28 +477,54 @@ > > protected void loaded() > { >- if (!ResourceImpl.this.isLoaded()) >+ if (!getResource().isLoaded()) > { >- Notification notification = ResourceImpl.this.setLoaded(true); >+ Notification notification = setLoaded(true); > if (notification != null) > { >- ResourceImpl.this.eNotify(notification); >+ getResource().eNotify(notification); > } > } > } > > protected void modified() > { >- if (isTrackingModification()) >+ if (getResource().isTrackingModification()) > { >- setModified(true); >+ getResource().setModified(true); > } > } > > @Override > public boolean contains(Object object) > { >- return size <= 4 ? super.contains(object) : object instanceof InternalEObject && ((InternalEObject)object).eDirectResource() == ResourceImpl.this; >+ return size <= 4 ? super.contains(object) : object instanceof InternalEObject && ((InternalEObject)object).eDirectResource() == getResource(); >+ } >+ } >+ >+ /** >+ * A notifying list implementation for supporting {@link Resource#getContents}. >+ */ >+ protected class ContentsEList<E extends Object & EObject> extends ResourceContentsEList<E> >+ { >+ private static final long serialVersionUID = 1L; >+ >+ @Override >+ protected ResourceImpl getResource() >+ { >+ return ResourceImpl.this; >+ } >+ >+ @Override >+ protected Notification setLoaded(boolean loaded) >+ { >+ return getResource().setLoaded(loaded); >+ } >+ >+ @Override >+ protected boolean isNotificationRequired() >+ { >+ return getResource().eNotificationRequired(); > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 247794
: 121138