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 227324 Details for
Bug 399832
Wrong package nsURI is generated into the globalEiqModel.xmi when using packages from eiqgen
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]
Fixed URI calculation when EClass is identified by xmi:id
EMF-IncQuery_#399832.patch (text/plain), 2.50 KB, created by
Balazs Grill
on 2013-02-20 05:25:15 EST
(
hide
)
Description:
Fixed URI calculation when EClass is identified by xmi:id
Filename:
MIME Type:
Creator:
Balazs Grill
Created:
2013-02-20 05:25:15 EST
Size:
2.50 KB
patch
obsolete
>diff --git a/plugins/org.eclipse.incquery.tooling.core/src/org/eclipse/incquery/tooling/core/generator/util/EMFPatternURIHandler.java b/plugins/org.eclipse.incquery.tooling.core/src/org/eclipse/incquery/tooling/core/generator/util/EMFPatternURIHandler.java >index c9da48f..d587004 100644 >--- a/plugins/org.eclipse.incquery.tooling.core/src/org/eclipse/incquery/tooling/core/generator/util/EMFPatternURIHandler.java >+++ b/plugins/org.eclipse.incquery.tooling.core/src/org/eclipse/incquery/tooling/core/generator/util/EMFPatternURIHandler.java >@@ -53,7 +53,7 @@ > List<String> fragments = new ArrayList<String>(); > EPackage p = e; > while (nonEmptySuperPackage(p) != null) { >- fragments.add(p.getNsPrefix()); >+ fragments.add(p.getName()); > p = nonEmptySuperPackage(p); > uriString = p.getNsURI(); > >@@ -109,12 +109,29 @@ > */ > for (EPackage p : uriToEPackageMap.values()) { > EObject eObject = p.eResource().getEObject(fragment); >+ EPackage e = p; > if(eObject != null) { > if(eObject instanceof ENamedElement) { >+ remainingFragment = ""; >+ EObject parent = eObject.eContainer(); >+ /* >+ * Because this element was found by ID, p may not be the containing >+ * package. We must find the correct parent package along with all >+ * name elements inbetween. >+ */ >+ while (parent!= null && !(parent instanceof EPackage)){ >+ if (parent instanceof ENamedElement){ >+ remainingFragment += "/" + ((ENamedElement) parent).getName(); >+ } >+ parent = parent.eContainer(); >+ } >+ if (parent instanceof EPackage){ >+ e = (EPackage)parent; >+ } > String name = ((ENamedElement) eObject).getName(); >- remainingFragment = "/" + name; >+ remainingFragment += "/" + name; > } >- URI newUri = packageUriMap.get(p); >+ URI newUri = packageUriMap.get(e); > String newFragment = newUri.fragment() == null ? "/" + remainingFragment : newUri.fragment() > + remainingFragment; > newUri = newUri.appendFragment(newFragment);
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
Flags:
zoltan.ujhelyi
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 399832
:
226816
| 227324