|
|
Re: Problem solved!! [message #191529 is a reply to message #191368] |
Wed, 10 August 2005 16:59 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Most likely you were doing something wrong. But a better place for this
question would be the EMF newsgroup.
"Lucia" <cheng_lucia@yahoo.com> wrote in message
news:1463023ae45f3770a6961eda4826e773$1@www.eclipse.org...
> I found the solution !
>
> The following code should be used
>
> (1)EList l = resource.getContents();
> Iterator i = l.iterator();
> while (i.hasNext()) {
> Object o = i.next();
> if (o instanceof Model)
> model = (Model) o;
> }
>
> instead of
>
> (2)model = (Model)resource.getContents().get(0);
>
> I still have no idea, why the second one is not correct. During the debug
> I can exactly see that the resource has only one element in his content,
> which is one instance of Model.
>
> Any reasonable explaination is still welcome!!!
>
|
|
|
Re: Problem solved!! [message #192083 is a reply to message #191529] |
Sun, 14 August 2005 11:46 |
Eclipse User |
|
|
|
Originally posted by: siegercn.cs.tu-berlin.de
hi,
have you tryed to change from
model = (Model)resource.getContents().get(0),
to
model = (Model)(resource.getContents().get(0));
Yang
Pratik Shah wrote:
> Most likely you were doing something wrong. But a better place for this
> question would be the EMF newsgroup.
>
> "Lucia" <cheng_lucia@yahoo.com> wrote in message
> news:1463023ae45f3770a6961eda4826e773$1@www.eclipse.org...
>
>>I found the solution !
>>
>>The following code should be used
>>
>> (1)EList l = resource.getContents();
>> Iterator i = l.iterator();
>> while (i.hasNext()) {
>> Object o = i.next();
>> if (o instanceof Model)
>> model = (Model) o;
>> }
>>
>>instead of
>>
>> (2)model = (Model)resource.getContents().get(0);
>>
>>I still have no idea, why the second one is not correct. During the debug
>>I can exactly see that the resource has only one element in his content,
>>which is one instance of Model.
>>
>>Any reasonable explaination is still welcome!!!
>>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03488 seconds