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 113085 Details for
Bug 248069
EObjectObservableMap should allow to observe none existant attributes
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]
A first patch
patch.txt (text/plain), 2.27 KB, created by
Thomas Schindl
on 2008-09-21 16:12:49 EDT
(
hide
)
Description:
A first patch
Filename:
MIME Type:
Creator:
Thomas Schindl
Created:
2008-09-21 16:12:49 EDT
Size:
2.27 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.databinding >Index: src/org/eclipse/emf/databinding/EObjectObservableMap.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.databinding/src/org/eclipse/emf/databinding/EObjectObservableMap.java,v >retrieving revision 1.3 >diff -u -r1.3 EObjectObservableMap.java >--- src/org/eclipse/emf/databinding/EObjectObservableMap.java 26 Jan 2008 20:56:46 -0000 1.3 >+++ src/org/eclipse/emf/databinding/EObjectObservableMap.java 21 Sep 2008 20:05:41 -0000 >@@ -1,13 +1,13 @@ > /** >- * <copyright> >+ * <copyright> > * > * Copyright (c) 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >+ * >+ * Contributors: > * IBM - Initial API and implementation > * > * </copyright> >@@ -25,6 +25,7 @@ > import org.eclipse.emf.common.notify.impl.AdapterImpl; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EStructuralFeature; >+import org.eclipse.emf.ecore.util.ExtendedMetaData; > > /** > * PROVISIONAL >@@ -34,7 +35,7 @@ > { > protected EStructuralFeature eStructuralFeature; > >- private Adapter elementListener = >+ private Adapter elementListener = > new AdapterImpl() > { > @Override >@@ -80,15 +81,24 @@ > @Override > protected Object doGet(Object key) > { >- return ((EObject)key).eGet(eStructuralFeature); >+ EObject eObject = (EObject)key; >+ if( eObject.eClass().getEAllStructuralFeatures().contains(eStructuralFeature) ) { >+ return ((EObject)key).eGet(eStructuralFeature); >+ } else { >+ return null; >+ } > } > > @Override > protected Object doPut(Object key, Object value) > { > EObject eObject = (EObject)key; >- Object result = eObject.eGet(eStructuralFeature); >- eObject.eSet(eStructuralFeature, value); >- return result; >+ if( ((EObject)key).eClass().getEAllStructuralFeatures().contains(eStructuralFeature) ) { >+ Object result = eObject.eGet(eStructuralFeature); >+ eObject.eSet(eStructuralFeature, value); >+ return result; >+ } else { >+ return null; >+ } > } > }
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 248069
:
113085
|
113086
|
115671