Home » Modeling » Epsilon » [Eugenia] FixGenModel leaves empty model, how to track down problem?
|
Re: [Eugenia] FixGenModel leaves empty model, how to track down problem? [message #524151 is a reply to message #524126] |
Tue, 30 March 2010 23:28 |
Christoph Wienands Messages: 55 Registered: July 2009 |
Member |
|
|
I narrowed down the issue a bit but still I'm at a loss. The problem
(deleting all the genmodel elements, including package) only seems to happen
when I access elements from the ECore namespace. For example:
for (feature in GenModel!GenFeature.all)
{
feature.ecoreFeature.println();
}
will cause the issue, whereas
for (feature in GenModel!GenFeature.all)
{
feature.println();
}
does not cause it. First I thought, maybe the underlying ECore metamodel
does not get loaded, but the output from println() clearly shows that the
ECore model element were loaded and can be accessed by EOL. I also created a
minimal example with one class and one ID attribute to make sure it's not my
complex metamodel.
Here are two more examples that work:
for (attr in ECore!EAttribute.all) {
attr.println();
}
for (feature in GenModel!GenFeature.all)
{
feature.println();
}
However, the next examples all fail:
for (feature in GenModel!GenFeature.all)
{
feature.name.toString.println();
}
for (feature in GenModel!GenFeature.all)
{
feature.isId.toString.println();
}
for (feature in GenModel!GenFeature.all)
{
feature.ecoreFeature.name.toString.println();
}
So it seems to me, as soon as EOL traverses from the GenModel feature to the
ECore attribute, something goes awefully wrong. As I said, during processing
the ECore model elements are there because I can see them in the println()
output. The issue seems to be afterwards, when the GenModel is saved back to
disk.
Just for reference, here is the minimal ECore example:
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmi:id="_DfsvoTxQEd-dAr9hUABrmg"
name="My" nsURI="http://my.com/my" nsPrefix="my">
<eClassifiers xsi:type="ecore:EClass" xmi:id="_EecP0DxQEd-dAr9hUABrmg"
name="A">
<eStructuralFeatures xsi:type="ecore:EAttribute"
xmi:id="_Gw8d8DxQEd-dAr9hUABrmg"
name="ID" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EString"
iD="true"/>
</eClassifiers>
</ecore:EPackage>
Any ideas?
Thanks, Christoph
|
|
|
Re: [Eugenia] FixGenModel leaves empty model, how to track down problem? [message #524225 is a reply to message #524151] |
Wed, 31 March 2010 08:39 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi Christoph,
I've reproduced this and it's definitely a bug. Could you please file a
bug report and post the link here so that we can keep track of this?
Cheers,
Dimitris
Christoph Wienands wrote:
> I narrowed down the issue a bit but still I'm at a loss. The problem
> (deleting all the genmodel elements, including package) only seems to happen
> when I access elements from the ECore namespace. For example:
>
>
> for (feature in GenModel!GenFeature.all)
> {
> feature.ecoreFeature.println();
> }
>
>
> will cause the issue, whereas
>
>
> for (feature in GenModel!GenFeature.all)
> {
> feature.println();
> }
>
>
> does not cause it. First I thought, maybe the underlying ECore metamodel
> does not get loaded, but the output from println() clearly shows that the
> ECore model element were loaded and can be accessed by EOL. I also created a
> minimal example with one class and one ID attribute to make sure it's not my
> complex metamodel.
>
> Here are two more examples that work:
>
> for (attr in ECore!EAttribute.all) {
> attr.println();
> }
>
> for (feature in GenModel!GenFeature.all)
> {
> feature.println();
> }
>
> However, the next examples all fail:
>
> for (feature in GenModel!GenFeature.all)
> {
> feature.name.toString.println();
> }
>
> for (feature in GenModel!GenFeature.all)
> {
> feature.isId.toString.println();
> }
>
> for (feature in GenModel!GenFeature.all)
> {
> feature.ecoreFeature.name.toString.println();
> }
>
>
> So it seems to me, as soon as EOL traverses from the GenModel feature to the
> ECore attribute, something goes awefully wrong. As I said, during processing
> the ECore model elements are there because I can see them in the println()
> output. The issue seems to be afterwards, when the GenModel is saved back to
> disk.
>
> Just for reference, here is the minimal ECore example:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmi:id="_DfsvoTxQEd-dAr9hUABrmg"
> name="My" nsURI="http://my.com/my" nsPrefix="my">
> <eClassifiers xsi:type="ecore:EClass" xmi:id="_EecP0DxQEd-dAr9hUABrmg"
> name="A">
> <eStructuralFeatures xsi:type="ecore:EAttribute"
> xmi:id="_Gw8d8DxQEd-dAr9hUABrmg"
> name="ID" eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EString"
> iD="true"/>
> </eClassifiers>
> </ecore:EPackage>
>
>
> Any ideas?
>
> Thanks, Christoph
>
>
--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
|
|
|
Re: [Eugenia] FixGenModel leaves empty model, how to track down problem? [message #588057 is a reply to message #524151] |
Wed, 31 March 2010 08:39 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi Christoph,
I've reproduced this and it's definitely a bug. Could you please file a
bug report and post the link here so that we can keep track of this?
Cheers,
Dimitris
Christoph Wienands wrote:
> I narrowed down the issue a bit but still I'm at a loss. The problem
> (deleting all the genmodel elements, including package) only seems to happen
> when I access elements from the ECore namespace. For example:
>
>
> for (feature in GenModel!GenFeature.all)
> {
> feature.ecoreFeature.println();
> }
>
>
> will cause the issue, whereas
>
>
> for (feature in GenModel!GenFeature.all)
> {
> feature.println();
> }
>
>
> does not cause it. First I thought, maybe the underlying ECore metamodel
> does not get loaded, but the output from println() clearly shows that the
> ECore model element were loaded and can be accessed by EOL. I also created a
> minimal example with one class and one ID attribute to make sure it's not my
> complex metamodel.
>
> Here are two more examples that work:
>
> for (attr in ECore!EAttribute.all) {
> attr.println();
> }
>
> for (feature in GenModel!GenFeature.all)
> {
> feature.println();
> }
>
> However, the next examples all fail:
>
> for (feature in GenModel!GenFeature.all)
> {
> feature.name.toString.println();
> }
>
> for (feature in GenModel!GenFeature.all)
> {
> feature.isId.toString.println();
> }
>
> for (feature in GenModel!GenFeature.all)
> {
> feature.ecoreFeature.name.toString.println();
> }
>
>
> So it seems to me, as soon as EOL traverses from the GenModel feature to the
> ECore attribute, something goes awefully wrong. As I said, during processing
> the ECore model elements are there because I can see them in the println()
> output. The issue seems to be afterwards, when the GenModel is saved back to
> disk.
>
> Just for reference, here is the minimal ECore example:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmi:id="_DfsvoTxQEd-dAr9hUABrmg"
> name="My" nsURI="http://my.com/my" nsPrefix="my">
> <eClassifiers xsi:type="ecore:EClass" xmi:id="_EecP0DxQEd-dAr9hUABrmg"
> name="A">
> <eStructuralFeatures xsi:type="ecore:EAttribute"
> xmi:id="_Gw8d8DxQEd-dAr9hUABrmg"
> name="ID" eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EString"
> iD="true"/>
> </eClassifiers>
> </ecore:EPackage>
>
>
> Any ideas?
>
> Thanks, Christoph
>
>
--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
|
|
|
Goto Forum:
Current Time: Thu Sep 26 21:26:56 GMT 2024
Powered by FUDForum. Page generated in 0.03834 seconds
|