Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » ConcurrentModificationException
ConcurrentModificationException [message #158801] Thu, 08 November 2007 04:54 Go to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

I get a java.util.ConcurrentModificationException (when Loading a
Resource, and then setting a relation between a element in the current
editor - and one in the loaded resource.) Everything is seems to be
setup correct.

Does anyone know this error?

Thanks,

Tomas Zijdemans
Re: ConcurrentModificationException [message #158815 is a reply to message #158801] Thu, 08 November 2007 05:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: external.deyaa.adranale.de.bosch.com

This problem is related to the java.util package not GMF.

The most common occurance of this exception is when you are using a
java.util.iterator and at the same time try to modify the collection like
deleting an element. This happens because the iterator doesnot allow
modification on the collection while it is using it.


I hope this will be helpful
Re: ConcurrentModificationException [message #158847 is a reply to message #158815] Thu, 08 November 2007 06:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

Thanks for helping!

Hmm.. strange. I've searched my code and the only iterators are those
who get generated (and I'm not using any of them). Could it be something
else?

Maybe this is because I use diagram partitioning?


Thanks,

Tomas Zijdemans

Deyaa wrote:
> This problem is related to the java.util package not GMF.
>
> The most common occurance of this exception is when you are using a
> java.util.iterator and at the same time try to modify the collection
> like deleting an element. This happens because the iterator doesnot
> allow modification on the collection while it is using it.
>
>
> I hope this will be helpful
>
>
>
>
Re: ConcurrentModificationException [message #158910 is a reply to message #158847] Thu, 08 November 2007 07:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

I really don't understand. I get this error everywhere. Even with
completely non-customized code. This used to work :(

Any ideas at all is appreciated!


Thanks,

Tomas Zijdemans


Tomas Zijdemans wrote:
> Thanks for helping!
>
> Hmm.. strange. I've searched my code and the only iterators are those
> who get generated (and I'm not using any of them). Could it be something
> else?
>
> Maybe this is because I use diagram partitioning?
>
>
> Thanks,
>
> Tomas Zijdemans
>
> Deyaa wrote:
>> This problem is related to the java.util package not GMF.
>>
>> The most common occurance of this exception is when you are using a
>> java.util.iterator and at the same time try to modify the collection
>> like deleting an element. This happens because the iterator doesnot
>> allow modification on the collection while it is using it.
>>
>>
>> I hope this will be helpful
>>
>>
>>
>>
Re: ConcurrentModificationException [message #158954 is a reply to message #158910] Thu, 08 November 2007 08:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Tomas,

When you ask questions about an exception, it's generally a good idea to
show the full stack trace. With Java 5.0's new for-each loops, you
might be using and iterator without even knowing it. Many people assume
this concurrent modification exception is a threading issue when
generally it is not...


Tomas Zijdemans wrote:
> I really don't understand. I get this error everywhere. Even with
> completely non-customized code. This used to work :(
>
> Any ideas at all is appreciated!
>
>
> Thanks,
>
> Tomas Zijdemans
>
>
> Tomas Zijdemans wrote:
>> Thanks for helping!
>>
>> Hmm.. strange. I've searched my code and the only iterators are those
>> who get generated (and I'm not using any of them). Could it be
>> something else?
>>
>> Maybe this is because I use diagram partitioning?
>>
>>
>> Thanks,
>>
>> Tomas Zijdemans
>>
>> Deyaa wrote:
>>> This problem is related to the java.util package not GMF.
>>>
>>> The most common occurance of this exception is when you are using a
>>> java.util.iterator and at the same time try to modify the collection
>>> like deleting an element. This happens because the iterator doesnot
>>> allow modification on the collection while it is using it.
>>>
>>>
>>> I hope this will be helpful
>>>
>>>
>>>
>>>
Re: ConcurrentModificationException [message #159023 is a reply to message #158954] Thu, 08 November 2007 09:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

I have been unsuccessful so far in generating a stacktrace (when I run
it in the debugger, the resource is only set up "one-way" - so I can't
reproduce the error).

The two diagrams are loaded and the relation is set in one of them. When
I switch my view to the second editor - the error occurs. The first
editor crashes. When I try to open it I get this:

org.eclipse.core.runtime.CoreException: ERROR
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.createPartControl(DiagramDocumentEditor. java:1458)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
at
org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(Ed itorAreaHelper.java:263)
at
org.eclipse.ui.internal.EditorManager.setVisibleEditor(Edito rManager.java:1405)
at
org.eclipse.ui.internal.EditorManager$5.runWithException(Edi torManager.java:939)
at
org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)


I suspect it appears because of the diagram partitioning.

Any help is really appreciated :)

Best Regards,
Tomas Zijdemans


Ed Merks wrote:
> Tomas,
>
> When you ask questions about an exception, it's generally a good idea to
> show the full stack trace. With Java 5.0's new for-each loops, you
> might be using and iterator without even knowing it. Many people assume
> this concurrent modification exception is a threading issue when
> generally it is not...
>
>
> Tomas Zijdemans wrote:
>> I really don't understand. I get this error everywhere. Even with
>> completely non-customized code. This used to work :(
>>
>> Any ideas at all is appreciated!
>>
>>
>> Thanks,
>>
>> Tomas Zijdemans
>>
>>
>> Tomas Zijdemans wrote:
>>> Thanks for helping!
>>>
>>> Hmm.. strange. I've searched my code and the only iterators are those
>>> who get generated (and I'm not using any of them). Could it be
>>> something else?
>>>
>>> Maybe this is because I use diagram partitioning?
>>>
>>>
>>> Thanks,
>>>
>>> Tomas Zijdemans
>>>
>>> Deyaa wrote:
>>>> This problem is related to the java.util package not GMF.
>>>>
>>>> The most common occurance of this exception is when you are using a
>>>> java.util.iterator and at the same time try to modify the collection
>>>> like deleting an element. This happens because the iterator doesnot
>>>> allow modification on the collection while it is using it.
>>>>
>>>>
>>>> I hope this will be helpful
>>>>
>>>>
>>>>
>>>>
Re: ConcurrentModificationException [message #159046 is a reply to message #159023] Thu, 08 November 2007 11:38 Go to previous messageGo to next message
Eclipse UserFriend
Hello Tomas,

> org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocum
> entEditor.createPartControl(DiagramDocumentEditor.java:1458)
Looks like document provider was not able to load diagram. Can you please
check if the diagram file you are openning was not corrupted on prev. step?
(just open it with text or XML editor to see if the file looks like a valid
XML).

-----------------
Alex Shatalin
Re: ConcurrentModificationException [message #159090 is a reply to message #159046] Thu, 08 November 2007 15:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

Thanks for your time Alex.

Alex Shatalin wrote:
> Looks like document provider was not able to load diagram. Can you
> please check if the diagram file you are openning was not corrupted on
> prev. step?

I am quite sure it got corrupted. Attaching it below.

Two concerns arise:

1. "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
Does this mean I have GMF 1 installed ???

2. I am using diagram partitioning (the referenced diagram - from this -
is a subdiagram). I got a feeling there may be a bug when one loads a
resource into a subdiagram. The reason for this is that these diagrams
work flawlessly in an EMF generated editor.




<?xml version="1.0" encoding="UTF-8"?>
<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
xmlns:org.ueml.uemlbase="http:///org/ueml/uemlbase/uemlbase.ecore"
xmi:id="_Ct7doI4JEdyOuuMRtlsA_w" type="Uemlbase"
name="default12.editor_diagram" measurementUnit="Pixel">
<children xmi:type="notation:Node" xmi:id="_DJpJQI4JEdyOuuMRtlsA_w"
type="2003">
<children xmi:type="notation:Node" xmi:id="_DJpJQ44JEdyOuuMRtlsA_w"
type="5003"/>
<styles xmi:type="notation:ShapeStyle"
xmi:id="_DJpJQY4JEdyOuuMRtlsA_w"/>
<element xmi:type="org.ueml.uemlbase:ClassNode"
href="default15.editor#//@classes.0"/>
<layoutConstraint xmi:type="notation:Bounds"
xmi:id="_DJpJQo4JEdyOuuMRtlsA_w" x="559" y="59"/>
</children>
<styles xmi:type="notation:DiagramStyle"
xmi:id="_Ct7doY4JEdyOuuMRtlsA_w"/>
<element xmi:type="org.ueml.uemlbase:A_DiagramElement"
href="default15.editor#/"/>
</notation:Diagram>
Re: ConcurrentModificationException [message #159179 is a reply to message #159090] Fri, 09 November 2007 04:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

I've reversed to not using diagram partitioning, but the problem still
occurs..

Running out of ideas.

Tomas Zijdemans



Tomas Zijdemans wrote:
> Thanks for your time Alex.
>
> Alex Shatalin wrote:
>> Looks like document provider was not able to load diagram. Can you
>> please check if the diagram file you are openning was not corrupted on
>> prev. step?
>
> I am quite sure it got corrupted. Attaching it below.
>
> Two concerns arise:
>
> 1. "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
> Does this mean I have GMF 1 installed ???
>
> 2. I am using diagram partitioning (the referenced diagram - from this -
> is a subdiagram). I got a feeling there may be a bug when one loads a
> resource into a subdiagram. The reason for this is that these diagrams
> work flawlessly in an EMF generated editor.
>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
> xmlns:org.ueml.uemlbase="http:///org/ueml/uemlbase/uemlbase.ecore"
> xmi:id="_Ct7doI4JEdyOuuMRtlsA_w" type="Uemlbase"
> name="default12.editor_diagram" measurementUnit="Pixel">
> <children xmi:type="notation:Node" xmi:id="_DJpJQI4JEdyOuuMRtlsA_w"
> type="2003">
> <children xmi:type="notation:Node" xmi:id="_DJpJQ44JEdyOuuMRtlsA_w"
> type="5003"/>
> <styles xmi:type="notation:ShapeStyle"
> xmi:id="_DJpJQY4JEdyOuuMRtlsA_w"/>
> <element xmi:type="org.ueml.uemlbase:ClassNode"
> href="default15.editor#//@classes.0"/>
> <layoutConstraint xmi:type="notation:Bounds"
> xmi:id="_DJpJQo4JEdyOuuMRtlsA_w" x="559" y="59"/>
> </children>
> <styles xmi:type="notation:DiagramStyle"
> xmi:id="_Ct7doY4JEdyOuuMRtlsA_w"/>
> <element xmi:type="org.ueml.uemlbase:A_DiagramElement"
> href="default15.editor#/"/>
> </notation:Diagram>
Re: ConcurrentModificationException [message #159196 is a reply to message #159179] Fri, 09 November 2007 05:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

I've found some new triaging info.

The error only occurs on the first relation I set. All subsequent
relations are created without errors.

Could this mean that there is a collection which doesn't get initialized
properly?

(Both elements have an abstract superclass. It is their super classes
which have a relation to each other. Could this be the cause?)

Best Regards,

Tomas Zijdemans


Tomas Zijdemans wrote:
> I've reversed to not using diagram partitioning, but the problem still
> occurs..
>
> Running out of ideas.
>
> Tomas Zijdemans
>
>
>
> Tomas Zijdemans wrote:
>> Thanks for your time Alex.
>>
>> Alex Shatalin wrote:
>>> Looks like document provider was not able to load diagram. Can you
>>> please check if the diagram file you are openning was not corrupted
>>> on prev. step?
>>
>> I am quite sure it got corrupted. Attaching it below.
>>
>> Two concerns arise:
>>
>> 1. "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>> Does this mean I have GMF 1 installed ???
>>
>> 2. I am using diagram partitioning (the referenced diagram - from this
>> - is a subdiagram). I got a feeling there may be a bug when one loads
>> a resource into a subdiagram. The reason for this is that these
>> diagrams work flawlessly in an EMF generated editor.
>>
>>
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>> xmlns:org.ueml.uemlbase="http:///org/ueml/uemlbase/uemlbase.ecore"
>> xmi:id="_Ct7doI4JEdyOuuMRtlsA_w" type="Uemlbase"
>> name="default12.editor_diagram" measurementUnit="Pixel">
>> <children xmi:type="notation:Node" xmi:id="_DJpJQI4JEdyOuuMRtlsA_w"
>> type="2003">
>> <children xmi:type="notation:Node"
>> xmi:id="_DJpJQ44JEdyOuuMRtlsA_w" type="5003"/>
>> <styles xmi:type="notation:ShapeStyle"
>> xmi:id="_DJpJQY4JEdyOuuMRtlsA_w"/>
>> <element xmi:type="org.ueml.uemlbase:ClassNode"
>> href="default15.editor#//@classes.0"/>
>> <layoutConstraint xmi:type="notation:Bounds"
>> xmi:id="_DJpJQo4JEdyOuuMRtlsA_w" x="559" y="59"/>
>> </children>
>> <styles xmi:type="notation:DiagramStyle"
>> xmi:id="_Ct7doY4JEdyOuuMRtlsA_w"/>
>> <element xmi:type="org.ueml.uemlbase:A_DiagramElement"
>> href="default15.editor#/"/>
>> </notation:Diagram>
Re: ConcurrentModificationException [message #159260 is a reply to message #159090] Fri, 09 November 2007 08:16 Go to previous messageGo to next message
Eclipse UserFriend
Hello Tomas,


> 1. "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
> Does this mean I have GMF 1 installed ???
No. Notation model was not changed in GMF for quite a long time..

Can oyu debug DocumentProvider call to see why corresponding information
can not be loaded from the diagram file? (The files you attached looks normal..)

-----------------
Alex Shatalin
Re: ConcurrentModificationException [message #159276 is a reply to message #159260] Fri, 09 November 2007 08:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

Thanks for helping Alex! (I got a deadline coming up, so I'm in a bit of
a hurry on this one)

I started the editor again to view where in the DocumentProvider I
should start, but then everything worked again !! - This bug truly has
me baffled! Now i can't reproduce the DocumentProvider error without
making completely new diagrams.

I tried debugging the relation with breakpoints, but everything seemed
normal. So it's a mystery where the Concurrent Exception originates from..

Thanks,

Tomas Zijdemans


Alex Shatalin wrote:
> Hello Tomas,
>
>
>> 1. "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>> Does this mean I have GMF 1 installed ???
> No. Notation model was not changed in GMF for quite a long time..
>
> Can oyu debug DocumentProvider call to see why corresponding information
> can not be loaded from the diagram file? (The files you attached looks
> normal..)
>
> -----------------
> Alex Shatalin
>
>
Re: ConcurrentModificationException [message #159300 is a reply to message #159276] Fri, 09 November 2007 09:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Tomas,

You might not know about it, but in the breakpoints view you can set a
breakpoint that will stop when a particular exception is about to be
thrown. Look for the "J!" button...


Tomas Zijdemans wrote:
> Thanks for helping Alex! (I got a deadline coming up, so I'm in a bit
> of a hurry on this one)
>
> I started the editor again to view where in the DocumentProvider I
> should start, but then everything worked again !! - This bug truly has
> me baffled! Now i can't reproduce the DocumentProvider error without
> making completely new diagrams.
>
> I tried debugging the relation with breakpoints, but everything seemed
> normal. So it's a mystery where the Concurrent Exception originates
> from..
>
> Thanks,
>
> Tomas Zijdemans
>
>
> Alex Shatalin wrote:
>> Hello Tomas,
>>
>>
>>> 1. "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>>> Does this mean I have GMF 1 installed ???
>> No. Notation model was not changed in GMF for quite a long time..
>>
>> Can oyu debug DocumentProvider call to see why corresponding
>> information can not be loaded from the diagram file? (The files you
>> attached looks normal..)
>>
>> -----------------
>> Alex Shatalin
>>
>>
Re: ConcurrentModificationException [message #159507 is a reply to message #159300] Sun, 11 November 2007 12:22 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the tip, will check it out. After a week hammering at this
error, I've lost all faith in my ability to create multiple editors and
make them function together. I get this error, and Load Resources shows
nothing in "Browse workspace".

So thought I would ask you guys what needs to be done.

Here is what I do:
1. Single ecore and genmodel (with one root element for each editor)
2. Derive tooling, graph and map for each editor.
3. Derive a generator with these attributes set unique:
- File extensions
- Model ID
- Visual ID
- Plugin ID
- Editor ID

Any input is, as always, greatly appreciated :)


Best Regards,

Tomas Zijdemans


Ed Merks wrote:
> Tomas,
>
> You might not know about it, but in the breakpoints view you can set a
> breakpoint that will stop when a particular exception is about to be
> thrown. Look for the "J!" button...
>
>
> Tomas Zijdemans wrote:
>> Thanks for helping Alex! (I got a deadline coming up, so I'm in a bit
>> of a hurry on this one)
>>
>> I started the editor again to view where in the DocumentProvider I
>> should start, but then everything worked again !! - This bug truly has
>> me baffled! Now i can't reproduce the DocumentProvider error without
>> making completely new diagrams.
>>
>> I tried debugging the relation with breakpoints, but everything seemed
>> normal. So it's a mystery where the Concurrent Exception originates
>> from..
>>
>> Thanks,
>>
>> Tomas Zijdemans
>>
>>
>> Alex Shatalin wrote:
>>> Hello Tomas,
>>>
>>>
>>>> 1. "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>>>> Does this mean I have GMF 1 installed ???
>>> No. Notation model was not changed in GMF for quite a long time..
>>>
>>> Can oyu debug DocumentProvider call to see why corresponding
>>> information can not be loaded from the diagram file? (The files you
>>> attached looks normal..)
>>>
>>> -----------------
>>> Alex Shatalin
>>>
>>>
Re: ConcurrentModificationException [message #159515 is a reply to message #159507] Sun, 11 November 2007 13:01 Go to previous messageGo to next message
Eclipse UserFriend
Hmm. It seems I have got things working. And I have a definitive source
of the error. Either I have misunderstood something, or there is a bug
in GMF.

As previously stated, everything works in EMF. This just occurs in GMF.
Scenario:
- A is super of B. B is super of C and D. (A and B should be abstract,
but this does not seem to effect anything)
- If root can contain A's, and an editor for C and another for D is
created - the error occurs.
- If root can contain C's and D's, and an editor for C and another for D
is created - the error does not occur.

Regards,

Tomas Zijdemans


Tomas Zijdemans wrote:
> Thanks for the tip, will check it out. After a week hammering at this
> error, I've lost all faith in my ability to create multiple editors and
> make them function together. I get this error, and Load Resources shows
> nothing in "Browse workspace".
>
> So thought I would ask you guys what needs to be done.
>
> Here is what I do:
> 1. Single ecore and genmodel (with one root element for each editor)
> 2. Derive tooling, graph and map for each editor.
> 3. Derive a generator with these attributes set unique:
> - File extensions
> - Model ID
> - Visual ID
> - Plugin ID
> - Editor ID
>
> Any input is, as always, greatly appreciated :)
>
>
> Best Regards,
>
> Tomas Zijdemans
>
>
> Ed Merks wrote:
>> Tomas,
>>
>> You might not know about it, but in the breakpoints view you can set a
>> breakpoint that will stop when a particular exception is about to be
>> thrown. Look for the "J!" button...
>>
>>
>> Tomas Zijdemans wrote:
>>> Thanks for helping Alex! (I got a deadline coming up, so I'm in a bit
>>> of a hurry on this one)
>>>
>>> I started the editor again to view where in the DocumentProvider I
>>> should start, but then everything worked again !! - This bug truly
>>> has me baffled! Now i can't reproduce the DocumentProvider error
>>> without making completely new diagrams.
>>>
>>> I tried debugging the relation with breakpoints, but everything
>>> seemed normal. So it's a mystery where the Concurrent Exception
>>> originates from..
>>>
>>> Thanks,
>>>
>>> Tomas Zijdemans
>>>
>>>
>>> Alex Shatalin wrote:
>>>> Hello Tomas,
>>>>
>>>>
>>>>> 1. "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>>>>> Does this mean I have GMF 1 installed ???
>>>> No. Notation model was not changed in GMF for quite a long time..
>>>>
>>>> Can oyu debug DocumentProvider call to see why corresponding
>>>> information can not be loaded from the diagram file? (The files you
>>>> attached looks normal..)
>>>>
>>>> -----------------
>>>> Alex Shatalin
>>>>
>>>>
Re: ConcurrentModificationException [message #159604 is a reply to message #159515] Mon, 12 November 2007 06:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jan.herriger.gmx.de

If you have node mappings to supertypes (A and B), you should define
domain specialisations for them (new "constraint" inside the mapping).
The body should be:

oclIsTypeOf(A)

Tomas Zijdemans schrieb:
> Hmm. It seems I have got things working. And I have a definitive source
> of the error. Either I have misunderstood something, or there is a bug
> in GMF.
>
> As previously stated, everything works in EMF. This just occurs in GMF.
> Scenario:
> - A is super of B. B is super of C and D. (A and B should be abstract,
> but this does not seem to effect anything)
> - If root can contain A's, and an editor for C and another for D is
> created - the error occurs.
> - If root can contain C's and D's, and an editor for C and another for D
> is created - the error does not occur.
>
> Regards,
>
> Tomas Zijdemans
>
>
> Tomas Zijdemans wrote:
>> Thanks for the tip, will check it out. After a week hammering at this
>> error, I've lost all faith in my ability to create multiple editors
>> and make them function together. I get this error, and Load Resources
>> shows nothing in "Browse workspace".
>>
>> So thought I would ask you guys what needs to be done.
>>
>> Here is what I do:
>> 1. Single ecore and genmodel (with one root element for each editor)
>> 2. Derive tooling, graph and map for each editor.
>> 3. Derive a generator with these attributes set unique:
>> - File extensions
>> - Model ID
>> - Visual ID
>> - Plugin ID
>> - Editor ID
>>
>> Any input is, as always, greatly appreciated :)
>>
>>
>> Best Regards,
>>
>> Tomas Zijdemans
>>
>>
>> Ed Merks wrote:
>>> Tomas,
>>>
>>> You might not know about it, but in the breakpoints view you can set
>>> a breakpoint that will stop when a particular exception is about to
>>> be thrown. Look for the "J!" button...
>>>
>>>
>>> Tomas Zijdemans wrote:
>>>> Thanks for helping Alex! (I got a deadline coming up, so I'm in a
>>>> bit of a hurry on this one)
>>>>
>>>> I started the editor again to view where in the DocumentProvider I
>>>> should start, but then everything worked again !! - This bug truly
>>>> has me baffled! Now i can't reproduce the DocumentProvider error
>>>> without making completely new diagrams.
>>>>
>>>> I tried debugging the relation with breakpoints, but everything
>>>> seemed normal. So it's a mystery where the Concurrent Exception
>>>> originates from..
>>>>
>>>> Thanks,
>>>>
>>>> Tomas Zijdemans
>>>>
>>>>
>>>> Alex Shatalin wrote:
>>>>> Hello Tomas,
>>>>>
>>>>>
>>>>>> 1.
>>>>>> "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>>>>>> Does this mean I have GMF 1 installed ???
>>>>> No. Notation model was not changed in GMF for quite a long time..
>>>>>
>>>>> Can oyu debug DocumentProvider call to see why corresponding
>>>>> information can not be loaded from the diagram file? (The files you
>>>>> attached looks normal..)
>>>>>
>>>>> -----------------
>>>>> Alex Shatalin
>>>>>
>>>>>
Re: ConcurrentModificationException [message #159657 is a reply to message #159604] Mon, 12 November 2007 07:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

Thanks for answering. I do not have nodemappings to supertypes.

I've done a reinstall of eclipse and gmf 2.0.1.

Created a root with two elements that relate to each other. Derive a
diagram for both. Run it, and still get the same error!!

Jan Herriger wrote:
> If you have node mappings to supertypes (A and B), you should define
> domain specialisations for them (new "constraint" inside the mapping).
> The body should be:
>
> oclIsTypeOf(A)
>
> Tomas Zijdemans schrieb:
>> Hmm. It seems I have got things working. And I have a definitive
>> source of the error. Either I have misunderstood something, or there
>> is a bug in GMF.
>>
>> As previously stated, everything works in EMF. This just occurs in
>> GMF. Scenario:
>> - A is super of B. B is super of C and D. (A and B should be abstract,
>> but this does not seem to effect anything)
>> - If root can contain A's, and an editor for C and another for D is
>> created - the error occurs.
>> - If root can contain C's and D's, and an editor for C and another for
>> D is created - the error does not occur.
>>
>> Regards,
>>
>> Tomas Zijdemans
>>
>>
>> Tomas Zijdemans wrote:
>>> Thanks for the tip, will check it out. After a week hammering at this
>>> error, I've lost all faith in my ability to create multiple editors
>>> and make them function together. I get this error, and Load Resources
>>> shows nothing in "Browse workspace".
>>>
>>> So thought I would ask you guys what needs to be done.
>>>
>>> Here is what I do:
>>> 1. Single ecore and genmodel (with one root element for each editor)
>>> 2. Derive tooling, graph and map for each editor.
>>> 3. Derive a generator with these attributes set unique:
>>> - File extensions
>>> - Model ID
>>> - Visual ID
>>> - Plugin ID
>>> - Editor ID
>>>
>>> Any input is, as always, greatly appreciated :)
>>>
>>>
>>> Best Regards,
>>>
>>> Tomas Zijdemans
>>>
>>>
>>> Ed Merks wrote:
>>>> Tomas,
>>>>
>>>> You might not know about it, but in the breakpoints view you can set
>>>> a breakpoint that will stop when a particular exception is about to
>>>> be thrown. Look for the "J!" button...
>>>>
>>>>
>>>> Tomas Zijdemans wrote:
>>>>> Thanks for helping Alex! (I got a deadline coming up, so I'm in a
>>>>> bit of a hurry on this one)
>>>>>
>>>>> I started the editor again to view where in the DocumentProvider I
>>>>> should start, but then everything worked again !! - This bug truly
>>>>> has me baffled! Now i can't reproduce the DocumentProvider error
>>>>> without making completely new diagrams.
>>>>>
>>>>> I tried debugging the relation with breakpoints, but everything
>>>>> seemed normal. So it's a mystery where the Concurrent Exception
>>>>> originates from..
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Tomas Zijdemans
>>>>>
>>>>>
>>>>> Alex Shatalin wrote:
>>>>>> Hello Tomas,
>>>>>>
>>>>>>
>>>>>>> 1.
>>>>>>> "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>>>>>>> Does this mean I have GMF 1 installed ???
>>>>>> No. Notation model was not changed in GMF for quite a long time..
>>>>>>
>>>>>> Can oyu debug DocumentProvider call to see why corresponding
>>>>>> information can not be loaded from the diagram file? (The files
>>>>>> you attached looks normal..)
>>>>>>
>>>>>> -----------------
>>>>>> Alex Shatalin
>>>>>>
>>>>>>
Re: ConcurrentModificationException [message #159666 is a reply to message #159657] Mon, 12 November 2007 08:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Tomas,

I still haven't seen a full stack trace showing the error. You should
be able to get it from the Error log view. Have you been able to get
the debugger to stop at the point when the exception is thrown using an
exception breakpoint?


Tomas Zijdemans wrote:
> Thanks for answering. I do not have nodemappings to supertypes.
>
> I've done a reinstall of eclipse and gmf 2.0.1.
>
> Created a root with two elements that relate to each other. Derive a
> diagram for both. Run it, and still get the same error!!
>
> Jan Herriger wrote:
>> If you have node mappings to supertypes (A and B), you should define
>> domain specialisations for them (new "constraint" inside the
>> mapping). The body should be:
>>
>> oclIsTypeOf(A)
>>
>> Tomas Zijdemans schrieb:
>>> Hmm. It seems I have got things working. And I have a definitive
>>> source of the error. Either I have misunderstood something, or there
>>> is a bug in GMF.
>>>
>>> As previously stated, everything works in EMF. This just occurs in
>>> GMF. Scenario:
>>> - A is super of B. B is super of C and D. (A and B should be
>>> abstract, but this does not seem to effect anything)
>>> - If root can contain A's, and an editor for C and another for D is
>>> created - the error occurs.
>>> - If root can contain C's and D's, and an editor for C and another
>>> for D is created - the error does not occur.
>>>
>>> Regards,
>>>
>>> Tomas Zijdemans
>>>
>>>
>>> Tomas Zijdemans wrote:
>>>> Thanks for the tip, will check it out. After a week hammering at
>>>> this error, I've lost all faith in my ability to create multiple
>>>> editors and make them function together. I get this error, and Load
>>>> Resources shows nothing in "Browse workspace".
>>>>
>>>> So thought I would ask you guys what needs to be done.
>>>>
>>>> Here is what I do:
>>>> 1. Single ecore and genmodel (with one root element for each editor)
>>>> 2. Derive tooling, graph and map for each editor.
>>>> 3. Derive a generator with these attributes set unique:
>>>> - File extensions
>>>> - Model ID
>>>> - Visual ID
>>>> - Plugin ID
>>>> - Editor ID
>>>>
>>>> Any input is, as always, greatly appreciated :)
>>>>
>>>>
>>>> Best Regards,
>>>>
>>>> Tomas Zijdemans
>>>>
>>>>
>>>> Ed Merks wrote:
>>>>> Tomas,
>>>>>
>>>>> You might not know about it, but in the breakpoints view you can
>>>>> set a breakpoint that will stop when a particular exception is
>>>>> about to be thrown. Look for the "J!" button...
>>>>>
>>>>>
>>>>> Tomas Zijdemans wrote:
>>>>>> Thanks for helping Alex! (I got a deadline coming up, so I'm in a
>>>>>> bit of a hurry on this one)
>>>>>>
>>>>>> I started the editor again to view where in the DocumentProvider
>>>>>> I should start, but then everything worked again !! - This bug
>>>>>> truly has me baffled! Now i can't reproduce the DocumentProvider
>>>>>> error without making completely new diagrams.
>>>>>>
>>>>>> I tried debugging the relation with breakpoints, but everything
>>>>>> seemed normal. So it's a mystery where the Concurrent Exception
>>>>>> originates from..
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Tomas Zijdemans
>>>>>>
>>>>>>
>>>>>> Alex Shatalin wrote:
>>>>>>> Hello Tomas,
>>>>>>>
>>>>>>>
>>>>>>>> 1.
>>>>>>>> "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>>>>>>>>
>>>>>>>> Does this mean I have GMF 1 installed ???
>>>>>>> No. Notation model was not changed in GMF for quite a long time..
>>>>>>>
>>>>>>> Can oyu debug DocumentProvider call to see why corresponding
>>>>>>> information can not be loaded from the diagram file? (The files
>>>>>>> you attached looks normal..)
>>>>>>>
>>>>>>> -----------------
>>>>>>> Alex Shatalin
>>>>>>>
>>>>>>>
Re: ConcurrentModificationException [message #159680 is a reply to message #159666] Mon, 12 November 2007 08:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

Thanks for helping Ed. I found the breakpointtype you spoke of,
reproduced the error, and copied the Stack. So here it is:


Thread [main] (Suspended (exception ConcurrentModificationException))
BasicEList$EIterator<E1>.checkModCount() line: 1378
BasicEList$EIterator<E1>.doNext() line: 1326
BasicEList$EIterator<E1>.next() line: 1312
UemlbaseDocumentProvider.doSynchronize(Object, IProgressMonitor) line: 402
AbstractDocumentProvider$1SynchronizeOperation.execute(IProg ressMonitor)
line: 983
AbstractDocumentProvider$1SynchronizeOperation(AbstractDocum entProvider$DocumentProviderOperation).run(IProgressMonitor)
line: 66
UemlbaseDocumentProvider(AbstractDocumentProvider).executeOp eration(AbstractDocumentProvider$DocumentProviderOperation,
IProgressMonitor) line: 530
UemlbaseDocumentProvider(AbstractDocumentProvider).synchroni ze(Object)
line: 991
UemlbaseDiagramEditor(DiagramDocumentEditor).handleEditorInp utChanged()
line: 568
UemlbaseDiagramEditor(DiagramDocumentEditor).sanityCheckStat e(IEditorInput)
line: 692
UemlbaseDiagramEditor(DiagramDocumentEditor).safelySanityChe ckState(IEditorInput)
line: 674
DiagramDocumentEditor$ActivationListener.handleActivation() line: 1135
DiagramDocumentEditor$ActivationListener.partActivated(IWork benchPart)
line: 1094
PartListenerList$1.run() line: 72
SafeRunner.run(ISafeRunnable) line: 37
Platform.run(ISafeRunnable) line: 857
PartListenerList.fireEvent(SafeRunnable, IPartListener, IWorkbenchPart,
String) line: 57
PartListenerList.firePartActivated(IWorkbenchPart) line: 70
PartService.firePartActivated(IWorkbenchPartReference) line: 73
PartService.setActivePart(IWorkbenchPartReference) line: 171
WWinPartService.updateActivePart() line: 124
WWinPartService.access$0(WWinPartService) line: 115
WWinPartService$1.partDeactivated(IWorkbenchPartReference) line: 48
PartListenerList2$4.run() line: 113
SafeRunner.run(ISafeRunnable) line: 37
Platform.run(ISafeRunnable) line: 857
PartListenerList2.fireEvent(SafeRunnable, IPartListener2,
IWorkbenchPartReference, String) line: 53
PartListenerList2.firePartDeactivated(IWorkbenchPartReferenc e) line: 111
PartService.firePartDeactivated(IWorkbenchPartReference) line: 116
PartService.setActivePart(IWorkbenchPartReference) line: 165
WorkbenchPagePartList.fireActivePartChanged(IWorkbenchPartRe ference,
IWorkbenchPartReference) line: 56
WorkbenchPagePartList(PartList).setActivePart(IWorkbenchPart Reference)
line: 126
WorkbenchPage.setActivePart(IWorkbenchPart) line: 3402
WorkbenchPage.requestActivation(IWorkbenchPart) line: 2946
EditorPane(PartPane).requestActivation() line: 265
EditorPane.requestActivation() line: 98
EditorPane(PartPane).setFocus() line: 311
EditorPane.setFocus() line: 127
EditorStack(PartStack).presentationSelectionChanged(IPresent ablePart)
line: 846
PartStack.access$1(PartStack, IPresentablePart) line: 829
PartStack$1.selectPart(IPresentablePart) line: 139
TabbedStackPresentation$1.handleEvent(TabFolderEvent) line: 131
DefaultTabFolder(AbstractTabFolder).fireEvent(TabFolderEvent ) line: 267
DefaultTabFolder(AbstractTabFolder).fireEvent(int, AbstractTabItem)
line: 276
DefaultTabFolder.access$1(DefaultTabFolder, int, AbstractTabItem) line: 1
DefaultTabFolder$2.handleEvent(Event) line: 84
EventTable.sendEvent(Event) line: 66
CTabFolder(Widget).sendEvent(Event) line: 938
CTabFolder(Widget).sendEvent(int, Event, boolean) line: 962
CTabFolder(Widget).sendEvent(int, Event) line: 947
CTabFolder(Widget).notifyListeners(int, Event) line: 706
CTabFolder.setSelection(int, boolean) line: 3227
CTabFolder.onMouse(Event) line: 2005
CTabFolder$1.handleEvent(Event) line: 316
EventTable.sendEvent(Event) line: 66
CTabFolder(Widget).sendEvent(Event) line: 938
Display.runDeferredEvents() line: 3682
Display.readAndDispatch() line: 3293
Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2389
Workbench.runUI() line: 2353
Workbench.access$4(Workbench) line: 2219
Workbench$4.run() line: 466
Realm.runWithDefault(Realm, Runnable) line: 289
Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 461
PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149
IDEApplication.start(IApplicationContext) line: 106
EclipseAppHandle.run(Object) line: 169
EclipseAppLauncher.runApplication(Object) line: 106
EclipseAppLauncher.start(Object) line: 76
EclipseStarter.run(Object) line: 363
EclipseStarter.run(String[], Runnable) line: 176
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available
Method.invoke(Object, Object...) line: not available
Main.invokeFramework(String[], URL[]) line: 508
Main.basicRun(String[]) line: 447
Main.run(String[]) line: 1173
Main.main(String[]) line: 1148




Ed Merks wrote:
> Tomas,
>
> I still haven't seen a full stack trace showing the error. You should
> be able to get it from the Error log view. Have you been able to get
> the debugger to stop at the point when the exception is thrown using an
> exception breakpoint?
>
>
> Tomas Zijdemans wrote:
>> Thanks for answering. I do not have nodemappings to supertypes.
>>
>> I've done a reinstall of eclipse and gmf 2.0.1.
>>
>> Created a root with two elements that relate to each other. Derive a
>> diagram for both. Run it, and still get the same error!!
>>
>> Jan Herriger wrote:
>>> If you have node mappings to supertypes (A and B), you should define
>>> domain specialisations for them (new "constraint" inside the
>>> mapping). The body should be:
>>>
>>> oclIsTypeOf(A)
>>>
>>> Tomas Zijdemans schrieb:
>>>> Hmm. It seems I have got things working. And I have a definitive
>>>> source of the error. Either I have misunderstood something, or there
>>>> is a bug in GMF.
>>>>
>>>> As previously stated, everything works in EMF. This just occurs in
>>>> GMF. Scenario:
>>>> - A is super of B. B is super of C and D. (A and B should be
>>>> abstract, but this does not seem to effect anything)
>>>> - If root can contain A's, and an editor for C and another for D is
>>>> created - the error occurs.
>>>> - If root can contain C's and D's, and an editor for C and another
>>>> for D is created - the error does not occur.
>>>>
>>>> Regards,
>>>>
>>>> Tomas Zijdemans
>>>>
>>>>
>>>> Tomas Zijdemans wrote:
>>>>> Thanks for the tip, will check it out. After a week hammering at
>>>>> this error, I've lost all faith in my ability to create multiple
>>>>> editors and make them function together. I get this error, and Load
>>>>> Resources shows nothing in "Browse workspace".
>>>>>
>>>>> So thought I would ask you guys what needs to be done.
>>>>>
>>>>> Here is what I do:
>>>>> 1. Single ecore and genmodel (with one root element for each editor)
>>>>> 2. Derive tooling, graph and map for each editor.
>>>>> 3. Derive a generator with these attributes set unique:
>>>>> - File extensions
>>>>> - Model ID
>>>>> - Visual ID
>>>>> - Plugin ID
>>>>> - Editor ID
>>>>>
>>>>> Any input is, as always, greatly appreciated :)
>>>>>
>>>>>
>>>>> Best Regards,
>>>>>
>>>>> Tomas Zijdemans
>>>>>
>>>>>
>>>>> Ed Merks wrote:
>>>>>> Tomas,
>>>>>>
>>>>>> You might not know about it, but in the breakpoints view you can
>>>>>> set a breakpoint that will stop when a particular exception is
>>>>>> about to be thrown. Look for the "J!" button...
>>>>>>
>>>>>>
>>>>>> Tomas Zijdemans wrote:
>>>>>>> Thanks for helping Alex! (I got a deadline coming up, so I'm in a
>>>>>>> bit of a hurry on this one)
>>>>>>>
>>>>>>> I started the editor again to view where in the DocumentProvider
>>>>>>> I should start, but then everything worked again !! - This bug
>>>>>>> truly has me baffled! Now i can't reproduce the DocumentProvider
>>>>>>> error without making completely new diagrams.
>>>>>>>
>>>>>>> I tried debugging the relation with breakpoints, but everything
>>>>>>> seemed normal. So it's a mystery where the Concurrent Exception
>>>>>>> originates from..
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Tomas Zijdemans
>>>>>>>
>>>>>>>
>>>>>>> Alex Shatalin wrote:
>>>>>>>> Hello Tomas,
>>>>>>>>
>>>>>>>>
>>>>>>>>> 1.
>>>>>>>>> "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>>>>>>>>>
>>>>>>>>> Does this mean I have GMF 1 installed ???
>>>>>>>> No. Notation model was not changed in GMF for quite a long time..
>>>>>>>>
>>>>>>>> Can oyu debug DocumentProvider call to see why corresponding
>>>>>>>> information can not be loaded from the diagram file? (The files
>>>>>>>> you attached looks normal..)
>>>>>>>>
>>>>>>>> -----------------
>>>>>>>> Alex Shatalin
>>>>>>>>
>>>>>>>>
Re: ConcurrentModificationException [message #159739 is a reply to message #159680] Mon, 12 November 2007 11:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Tomas,

So what does the code at "UemlbaseDocumentProvider.doSynchronize(Object,
IProgressMonitor) line: 402" look like?


Tomas Zijdemans wrote:
> Thanks for helping Ed. I found the breakpointtype you spoke of,
> reproduced the error, and copied the Stack. So here it is:
>
>
> Thread [main] (Suspended (exception ConcurrentModificationException))
> BasicEList$EIterator<E1>.checkModCount() line: 1378
> BasicEList$EIterator<E1>.doNext() line: 1326
> BasicEList$EIterator<E1>.next() line: 1312
> UemlbaseDocumentProvider.doSynchronize(Object, IProgressMonitor)
> line: 402
> AbstractDocumentProvider$1SynchronizeOperation.execute(IProg ressMonitor)
> line: 983
> AbstractDocumentProvider$1SynchronizeOperation(AbstractDocum entProvider$DocumentProviderOperation).run(IProgressMonitor)
> line: 66
> UemlbaseDocumentProvider(AbstractDocumentProvider).executeOp eration(AbstractDocumentProvider$DocumentProviderOperation,
> IProgressMonitor) line: 530
> UemlbaseDocumentProvider(AbstractDocumentProvider).synchroni ze(Object)
> line: 991
> UemlbaseDiagramEditor(DiagramDocumentEditor).handleEditorInp utChanged()
> line: 568
> UemlbaseDiagramEditor(DiagramDocumentEditor).sanityCheckStat e(IEditorInput)
> line: 692
> UemlbaseDiagramEditor(DiagramDocumentEditor).safelySanityChe ckState(IEditorInput)
> line: 674
> DiagramDocumentEditor$ActivationListener.handleActivation() line:
> 1135
> DiagramDocumentEditor$ActivationListener.partActivated(IWork benchPart)
> line: 1094
> PartListenerList$1.run() line: 72
> SafeRunner.run(ISafeRunnable) line: 37
> Platform.run(ISafeRunnable) line: 857
> PartListenerList.fireEvent(SafeRunnable, IPartListener,
> IWorkbenchPart, String) line: 57
> PartListenerList.firePartActivated(IWorkbenchPart) line: 70
> PartService.firePartActivated(IWorkbenchPartReference) line: 73
> PartService.setActivePart(IWorkbenchPartReference) line: 171
> WWinPartService.updateActivePart() line: 124
> WWinPartService.access$0(WWinPartService) line: 115
> WWinPartService$1.partDeactivated(IWorkbenchPartReference) line:
> 48
> PartListenerList2$4.run() line: 113
> SafeRunner.run(ISafeRunnable) line: 37
> Platform.run(ISafeRunnable) line: 857
> PartListenerList2.fireEvent(SafeRunnable, IPartListener2,
> IWorkbenchPartReference, String) line: 53
> PartListenerList2.firePartDeactivated(IWorkbenchPartReferenc e)
> line: 111
> PartService.firePartDeactivated(IWorkbenchPartReference) line: 116
> PartService.setActivePart(IWorkbenchPartReference) line: 165
> WorkbenchPagePartList.fireActivePartChanged(IWorkbenchPartRe ference,
> IWorkbenchPartReference) line: 56
> WorkbenchPagePartList(PartList).setActivePart(IWorkbenchPart Reference)
> line: 126
> WorkbenchPage.setActivePart(IWorkbenchPart) line: 3402
> WorkbenchPage.requestActivation(IWorkbenchPart) line: 2946
> EditorPane(PartPane).requestActivation() line: 265
> EditorPane.requestActivation() line: 98
> EditorPane(PartPane).setFocus() line: 311
> EditorPane.setFocus() line: 127
> EditorStack(PartStack).presentationSelectionChanged(IPresent ablePart)
> line: 846
> PartStack.access$1(PartStack, IPresentablePart) line: 829
> PartStack$1.selectPart(IPresentablePart) line: 139
> TabbedStackPresentation$1.handleEvent(TabFolderEvent) line: 131
> DefaultTabFolder(AbstractTabFolder).fireEvent(TabFolderEvent )
> line: 267
> DefaultTabFolder(AbstractTabFolder).fireEvent(int,
> AbstractTabItem) line: 276
> DefaultTabFolder.access$1(DefaultTabFolder, int, AbstractTabItem)
> line: 1
> DefaultTabFolder$2.handleEvent(Event) line: 84
> EventTable.sendEvent(Event) line: 66
> CTabFolder(Widget).sendEvent(Event) line: 938
> CTabFolder(Widget).sendEvent(int, Event, boolean) line: 962
> CTabFolder(Widget).sendEvent(int, Event) line: 947
> CTabFolder(Widget).notifyListeners(int, Event) line: 706
> CTabFolder.setSelection(int, boolean) line: 3227
> CTabFolder.onMouse(Event) line: 2005
> CTabFolder$1.handleEvent(Event) line: 316
> EventTable.sendEvent(Event) line: 66
> CTabFolder(Widget).sendEvent(Event) line: 938
> Display.runDeferredEvents() line: 3682
> Display.readAndDispatch() line: 3293
> Workbench.runEventLoop(Window$IExceptionHandler, Display) line:
> 2389
> Workbench.runUI() line: 2353
> Workbench.access$4(Workbench) line: 2219
> Workbench$4.run() line: 466
> Realm.runWithDefault(Realm, Runnable) line: 289
> Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line:
> 461
> PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line:
> 149
> IDEApplication.start(IApplicationContext) line: 106
> EclipseAppHandle.run(Object) line: 169
> EclipseAppLauncher.runApplication(Object) line: 106
> EclipseAppLauncher.start(Object) line: 76
> EclipseStarter.run(Object) line: 363
> EclipseStarter.run(String[], Runnable) line: 176
> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line:
> not available [native method]
> NativeMethodAccessorImpl.invoke(Object, Object[]) line: not
> available
> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not
> available
> Method.invoke(Object, Object...) line: not available
> Main.invokeFramework(String[], URL[]) line: 508
> Main.basicRun(String[]) line: 447
> Main.run(String[]) line: 1173
> Main.main(String[]) line: 1148
>
>
>
>
> Ed Merks wrote:
>> Tomas,
>>
>> I still haven't seen a full stack trace showing the error. You
>> should be able to get it from the Error log view. Have you been able
>> to get the debugger to stop at the point when the exception is thrown
>> using an exception breakpoint?
>>
>>
>> Tomas Zijdemans wrote:
>>> Thanks for answering. I do not have nodemappings to supertypes.
>>>
>>> I've done a reinstall of eclipse and gmf 2.0.1.
>>>
>>> Created a root with two elements that relate to each other. Derive a
>>> diagram for both. Run it, and still get the same error!!
>>>
>>> Jan Herriger wrote:
>>>> If you have node mappings to supertypes (A and B), you should
>>>> define domain specialisations for them (new "constraint" inside the
>>>> mapping). The body should be:
>>>>
>>>> oclIsTypeOf(A)
>>>>
>>>> Tomas Zijdemans schrieb:
>>>>> Hmm. It seems I have got things working. And I have a definitive
>>>>> source of the error. Either I have misunderstood something, or
>>>>> there is a bug in GMF.
>>>>>
>>>>> As previously stated, everything works in EMF. This just occurs in
>>>>> GMF. Scenario:
>>>>> - A is super of B. B is super of C and D. (A and B should be
>>>>> abstract, but this does not seem to effect anything)
>>>>> - If root can contain A's, and an editor for C and another for D
>>>>> is created - the error occurs.
>>>>> - If root can contain C's and D's, and an editor for C and another
>>>>> for D is created - the error does not occur.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Tomas Zijdemans
>>>>>
>>>>>
>>>>> Tomas Zijdemans wrote:
>>>>>> Thanks for the tip, will check it out. After a week hammering at
>>>>>> this error, I've lost all faith in my ability to create multiple
>>>>>> editors and make them function together. I get this error, and
>>>>>> Load Resources shows nothing in "Browse workspace".
>>>>>>
>>>>>> So thought I would ask you guys what needs to be done.
>>>>>>
>>>>>> Here is what I do:
>>>>>> 1. Single ecore and genmodel (with one root element for each editor)
>>>>>> 2. Derive tooling, graph and map for each editor.
>>>>>> 3. Derive a generator with these attributes set unique:
>>>>>> - File extensions
>>>>>> - Model ID
>>>>>> - Visual ID
>>>>>> - Plugin ID
>>>>>> - Editor ID
>>>>>>
>>>>>> Any input is, as always, greatly appreciated :)
>>>>>>
>>>>>>
>>>>>> Best Regards,
>>>>>>
>>>>>> Tomas Zijdemans
>>>>>>
>>>>>>
>>>>>> Ed Merks wrote:
>>>>>>> Tomas,
>>>>>>>
>>>>>>> You might not know about it, but in the breakpoints view you can
>>>>>>> set a breakpoint that will stop when a particular exception is
>>>>>>> about to be thrown. Look for the "J!" button...
>>>>>>>
>>>>>>>
>>>>>>> Tomas Zijdemans wrote:
>>>>>>>> Thanks for helping Alex! (I got a deadline coming up, so I'm in
>>>>>>>> a bit of a hurry on this one)
>>>>>>>>
>>>>>>>> I started the editor again to view where in the
>>>>>>>> DocumentProvider I should start, but then everything worked
>>>>>>>> again !! - This bug truly has me baffled! Now i can't reproduce
>>>>>>>> the DocumentProvider error without making completely new diagrams.
>>>>>>>>
>>>>>>>> I tried debugging the relation with breakpoints, but everything
>>>>>>>> seemed normal. So it's a mystery where the Concurrent Exception
>>>>>>>> originates from..
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> Tomas Zijdemans
>>>>>>>>
>>>>>>>>
>>>>>>>> Alex Shatalin wrote:
>>>>>>>>> Hello Tomas,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> 1.
>>>>>>>>>> "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>>>>>>>>>>
>>>>>>>>>> Does this mean I have GMF 1 installed ???
>>>>>>>>> No. Notation model was not changed in GMF for quite a long time..
>>>>>>>>>
>>>>>>>>> Can oyu debug DocumentProvider call to see why corresponding
>>>>>>>>> information can not be loaded from the diagram file? (The
>>>>>>>>> files you attached looks normal..)
>>>>>>>>>
>>>>>>>>> -----------------
>>>>>>>>> Alex Shatalin
>>>>>>>>>
>>>>>>>>>
Re: ConcurrentModificationException [message #159753 is a reply to message #159739] Mon, 12 November 2007 16:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

Well, it is a generated method, so it would be kind of strange if the
error was there. But it suggest that the synchronization of the object
(called when I select the diagram) fails.

/**
* @generated
*/
protected void doSynchronize(Object element, IProgressMonitor monitor)
throws CoreException {
ResourceSetInfo info = getResourceSetInfo(element);
if (info != null) {
for (Iterator it =
info.getResourceSet().getResources().iterator();
it.hasNext();) {
402 Resource nextResource = (Resource) it.next();
handleElementChanged(info, nextResource, monitor);
}
return;
}
super.doSynchronize(element, monitor);
}


Ed Merks wrote:
> Tomas,
>
> So what does the code at "UemlbaseDocumentProvider.doSynchronize(Object,
> IProgressMonitor) line: 402" look like?
>
>
> Tomas Zijdemans wrote:
>> Thanks for helping Ed. I found the breakpointtype you spoke of,
>> reproduced the error, and copied the Stack. So here it is:
>>
>>
>> Thread [main] (Suspended (exception
>> ConcurrentModificationException))
>> BasicEList$EIterator<E1>.checkModCount() line: 1378
>> BasicEList$EIterator<E1>.doNext() line: 1326
>> BasicEList$EIterator<E1>.next() line: 1312
>> UemlbaseDocumentProvider.doSynchronize(Object, IProgressMonitor) line:
>> 402
>> AbstractDocumentProvider$1SynchronizeOperation.execute(IProg ressMonitor)
>> line: 983
>> AbstractDocumentProvider$1SynchronizeOperation(AbstractDocum entProvider$DocumentProviderOperation).run(IProgressMonitor)
>> line: 66
>> UemlbaseDocumentProvider(AbstractDocumentProvider).executeOp eration(AbstractDocumentProvider$DocumentProviderOperation,
>> IProgressMonitor) line: 530
>> UemlbaseDocumentProvider(AbstractDocumentProvider).synchroni ze(Object)
>> line: 991
>> UemlbaseDiagramEditor(DiagramDocumentEditor).handleEditorInp utChanged()
>> line: 568
>> UemlbaseDiagramEditor(DiagramDocumentEditor).sanityCheckStat e(IEditorInput)
>> line: 692
>> UemlbaseDiagramEditor(DiagramDocumentEditor).safelySanityChe ckState(IEditorInput)
>> line: 674
>> DiagramDocumentEditor$ActivationListener.handleActivation() line:
>> 1135
>> DiagramDocumentEditor$ActivationListener.partActivated(IWork benchPart)
>> line: 1094 PartListenerList$1.run() line: 72
>> SafeRunner.run(ISafeRunnable) line: 37
>> Platform.run(ISafeRunnable) line: 857
>> PartListenerList.fireEvent(SafeRunnable, IPartListener,
>> IWorkbenchPart, String) line: 57
>> PartListenerList.firePartActivated(IWorkbenchPart) line: 70
>> PartService.firePartActivated(IWorkbenchPartReference) line: 73
>> PartService.setActivePart(IWorkbenchPartReference) line: 171
>> WWinPartService.updateActivePart() line: 124
>> WWinPartService.access$0(WWinPartService) line: 115
>> WWinPartService$1.partDeactivated(IWorkbenchPartReference) line: 48
>> PartListenerList2$4.run() line: 113
>> SafeRunner.run(ISafeRunnable) line: 37
>> Platform.run(ISafeRunnable) line: 857
>> PartListenerList2.fireEvent(SafeRunnable, IPartListener2,
>> IWorkbenchPartReference, String) line: 53
>> PartListenerList2.firePartDeactivated(IWorkbenchPartReferenc e) line:
>> 111 PartService.firePartDeactivated(IWorkbenchPartReference)
>> line: 116 PartService.setActivePart(IWorkbenchPartReference)
>> line: 165
>> WorkbenchPagePartList.fireActivePartChanged(IWorkbenchPartRe ference,
>> IWorkbenchPartReference) line: 56
>> WorkbenchPagePartList(PartList).setActivePart(IWorkbenchPart Reference)
>> line: 126 WorkbenchPage.setActivePart(IWorkbenchPart) line:
>> 3402 WorkbenchPage.requestActivation(IWorkbenchPart) line:
>> 2946 EditorPane(PartPane).requestActivation() line: 265
>> EditorPane.requestActivation() line: 98
>> EditorPane(PartPane).setFocus() line: 311 EditorPane.setFocus()
>> line: 127
>> EditorStack(PartStack).presentationSelectionChanged(IPresent ablePart)
>> line: 846 PartStack.access$1(PartStack, IPresentablePart) line:
>> 829 PartStack$1.selectPart(IPresentablePart) line: 139
>> TabbedStackPresentation$1.handleEvent(TabFolderEvent) line: 131
>> DefaultTabFolder(AbstractTabFolder).fireEvent(TabFolderEvent ) line:
>> 267 DefaultTabFolder(AbstractTabFolder).fireEvent(int,
>> AbstractTabItem) line: 276
>> DefaultTabFolder.access$1(DefaultTabFolder, int, AbstractTabItem)
>> line: 1 DefaultTabFolder$2.handleEvent(Event) line: 84
>> EventTable.sendEvent(Event) line: 66
>> CTabFolder(Widget).sendEvent(Event) line: 938
>> CTabFolder(Widget).sendEvent(int, Event, boolean) line: 962
>> CTabFolder(Widget).sendEvent(int, Event) line: 947
>> CTabFolder(Widget).notifyListeners(int, Event) line: 706
>> CTabFolder.setSelection(int, boolean) line: 3227
>> CTabFolder.onMouse(Event) line: 2005
>> CTabFolder$1.handleEvent(Event) line: 316
>> EventTable.sendEvent(Event) line: 66
>> CTabFolder(Widget).sendEvent(Event) line: 938
>> Display.runDeferredEvents() line: 3682 Display.readAndDispatch()
>> line: 3293 Workbench.runEventLoop(Window$IExceptionHandler,
>> Display) line: 2389 Workbench.runUI() line: 2353
>> Workbench.access$4(Workbench) line: 2219 Workbench$4.run() line:
>> 466 Realm.runWithDefault(Realm, Runnable) line: 289
>> Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 461
>> PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line:
>> 149 IDEApplication.start(IApplicationContext) line: 106
>> EclipseAppHandle.run(Object) line: 169
>> EclipseAppLauncher.runApplication(Object) line: 106
>> EclipseAppLauncher.start(Object) line: 76
>> EclipseStarter.run(Object) line: 363
>> EclipseStarter.run(String[], Runnable) line: 176
>> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
>> available [native method]
>> NativeMethodAccessorImpl.invoke(Object, Object[]) line: not
>> available DelegatingMethodAccessorImpl.invoke(Object, Object[])
>> line: not available Method.invoke(Object, Object...) line: not
>> available Main.invokeFramework(String[], URL[]) line: 508
>> Main.basicRun(String[]) line: 447 Main.run(String[]) line:
>> 1173 Main.main(String[]) line: 1148
>>
>>
>>
>> Ed Merks wrote:
>>> Tomas,
>>>
>>> I still haven't seen a full stack trace showing the error. You
>>> should be able to get it from the Error log view. Have you been able
>>> to get the debugger to stop at the point when the exception is thrown
>>> using an exception breakpoint?
>>>
>>>
>>> Tomas Zijdemans wrote:
>>>> Thanks for answering. I do not have nodemappings to supertypes.
>>>>
>>>> I've done a reinstall of eclipse and gmf 2.0.1.
>>>>
>>>> Created a root with two elements that relate to each other. Derive a
>>>> diagram for both. Run it, and still get the same error!!
>>>>
>>>> Jan Herriger wrote:
>>>>> If you have node mappings to supertypes (A and B), you should
>>>>> define domain specialisations for them (new "constraint" inside the
>>>>> mapping). The body should be:
>>>>>
>>>>> oclIsTypeOf(A)
>>>>>
>>>>> Tomas Zijdemans schrieb:
>>>>>> Hmm. It seems I have got things working. And I have a definitive
>>>>>> source of the error. Either I have misunderstood something, or
>>>>>> there is a bug in GMF.
>>>>>>
>>>>>> As previously stated, everything works in EMF. This just occurs in
>>>>>> GMF. Scenario:
>>>>>> - A is super of B. B is super of C and D. (A and B should be
>>>>>> abstract, but this does not seem to effect anything)
>>>>>> - If root can contain A's, and an editor for C and another for D
>>>>>> is created - the error occurs.
>>>>>> - If root can contain C's and D's, and an editor for C and another
>>>>>> for D is created - the error does not occur.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Tomas Zijdemans
>>>>>>
>>>>>>
>>>>>> Tomas Zijdemans wrote:
>>>>>>> Thanks for the tip, will check it out. After a week hammering at
>>>>>>> this error, I've lost all faith in my ability to create multiple
>>>>>>> editors and make them function together. I get this error, and
>>>>>>> Load Resources shows nothing in "Browse workspace".
>>>>>>>
>>>>>>> So thought I would ask you guys what needs to be done.
>>>>>>>
>>>>>>> Here is what I do:
>>>>>>> 1. Single ecore and genmodel (with one root element for each editor)
>>>>>>> 2. Derive tooling, graph and map for each editor.
>>>>>>> 3. Derive a generator with these attributes set unique:
>>>>>>> - File extensions
>>>>>>> - Model ID
>>>>>>> - Visual ID
>>>>>>> - Plugin ID
>>>>>>> - Editor ID
>>>>>>>
>>>>>>> Any input is, as always, greatly appreciated :)
>>>>>>>
>>>>>>>
>>>>>>> Best Regards,
>>>>>>>
>>>>>>> Tomas Zijdemans
>>>>>>>
>>>>>>>
>>>>>>> Ed Merks wrote:
>>>>>>>> Tomas,
>>>>>>>>
>>>>>>>> You might not know about it, but in the breakpoints view you can
>>>>>>>> set a breakpoint that will stop when a particular exception is
>>>>>>>> about to be thrown. Look for the "J!" button...
>>>>>>>>
>>>>>>>>
>>>>>>>> Tomas Zijdemans wrote:
>>>>>>>>> Thanks for helping Alex! (I got a deadline coming up, so I'm in
>>>>>>>>> a bit of a hurry on this one)
>>>>>>>>>
>>>>>>>>> I started the editor again to view where in the
>>>>>>>>> DocumentProvider I should start, but then everything worked
>>>>>>>>> again !! - This bug truly has me baffled! Now i can't reproduce
>>>>>>>>> the DocumentProvider error without making completely new diagrams.
>>>>>>>>>
>>>>>>>>> I tried debugging the relation with breakpoints, but everything
>>>>>>>>> seemed normal. So it's a mystery where the Concurrent Exception
>>>>>>>>> originates from..
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> Tomas Zijdemans
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Alex Shatalin wrote:
>>>>>>>>>> Hello Tomas,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> 1.
>>>>>>>>>>> "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>>>>>>>>>>>
>>>>>>>>>>> Does this mean I have GMF 1 installed ???
>>>>>>>>>> No. Notation model was not changed in GMF for quite a long time..
>>>>>>>>>>
>>>>>>>>>> Can oyu debug DocumentProvider call to see why corresponding
>>>>>>>>>> information can not be loaded from the diagram file? (The
>>>>>>>>>> files you attached looks normal..)
>>>>>>>>>>
>>>>>>>>>> -----------------
>>>>>>>>>> Alex Shatalin
>>>>>>>>>>
>>>>>>>>>>
Re: ConcurrentModificationException [message #159756 is a reply to message #159753] Mon, 12 November 2007 16:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Tomas,

Since resources are often demand loaded into a resource set as proxies
are resolved, that's probably what's happening here. Maybe try changing
it to

for (Iterator it = new
ArrayList(info.getResourceSet().getResources()).iterator();


Tomas Zijdemans wrote:
> Well, it is a generated method, so it would be kind of strange if the
> error was there. But it suggest that the synchronization of the object
> (called when I select the diagram) fails.
>
> /**
> * @generated
> */
> protected void doSynchronize(Object element, IProgressMonitor monitor)
> throws CoreException {
> ResourceSetInfo info = getResourceSetInfo(element);
> if (info != null) {
> for (Iterator it =
> info.getResourceSet().getResources().iterator();
> it.hasNext();) {
> 402 Resource nextResource = (Resource) it.next();
> handleElementChanged(info, nextResource, monitor);
> }
> return;
> }
> super.doSynchronize(element, monitor);
> }
>
>
> Ed Merks wrote:
>> Tomas,
>>
>> So what does the code at
>> "UemlbaseDocumentProvider.doSynchronize(Object, IProgressMonitor)
>> line: 402" look like?
>>
>>
>> Tomas Zijdemans wrote:
>>> Thanks for helping Ed. I found the breakpointtype you spoke of,
>>> reproduced the error, and copied the Stack. So here it is:
>>>
>>>
>>> Thread [main] (Suspended (exception
>>> ConcurrentModificationException))
>>> BasicEList$EIterator<E1>.checkModCount() line: 1378
>>> BasicEList$EIterator<E1>.doNext() line: 1326
>>> BasicEList$EIterator<E1>.next() line: 1312
>>> UemlbaseDocumentProvider.doSynchronize(Object, IProgressMonitor)
>>> line: 402
>>> AbstractDocumentProvider$1SynchronizeOperation.execute(IProg ressMonitor)
>>> line: 983
>>> AbstractDocumentProvider$1SynchronizeOperation(AbstractDocum entProvider$DocumentProviderOperation).run(IProgressMonitor)
>>> line: 66
>>> UemlbaseDocumentProvider(AbstractDocumentProvider).executeOp eration(AbstractDocumentProvider$DocumentProviderOperation,
>>> IProgressMonitor) line: 530
>>> UemlbaseDocumentProvider(AbstractDocumentProvider).synchroni ze(Object)
>>> line: 991
>>> UemlbaseDiagramEditor(DiagramDocumentEditor).handleEditorInp utChanged()
>>> line: 568
>>> UemlbaseDiagramEditor(DiagramDocumentEditor).sanityCheckStat e(IEditorInput)
>>> line: 692
>>> UemlbaseDiagramEditor(DiagramDocumentEditor).safelySanityChe ckState(IEditorInput)
>>> line: 674
>>> DiagramDocumentEditor$ActivationListener.handleActivation() line:
>>> 1135
>>> DiagramDocumentEditor$ActivationListener.partActivated(IWork benchPart)
>>> line: 1094 PartListenerList$1.run() line: 72
>>> SafeRunner.run(ISafeRunnable) line: 37
>>> Platform.run(ISafeRunnable) line: 857
>>> PartListenerList.fireEvent(SafeRunnable, IPartListener,
>>> IWorkbenchPart, String) line: 57
>>> PartListenerList.firePartActivated(IWorkbenchPart) line: 70
>>> PartService.firePartActivated(IWorkbenchPartReference) line:
>>> 73 PartService.setActivePart(IWorkbenchPartReference) line:
>>> 171 WWinPartService.updateActivePart() line: 124
>>> WWinPartService.access$0(WWinPartService) line: 115
>>> WWinPartService$1.partDeactivated(IWorkbenchPartReference) line:
>>> 48 PartListenerList2$4.run() line: 113
>>> SafeRunner.run(ISafeRunnable) line: 37
>>> Platform.run(ISafeRunnable) line: 857
>>> PartListenerList2.fireEvent(SafeRunnable, IPartListener2,
>>> IWorkbenchPartReference, String) line: 53
>>> PartListenerList2.firePartDeactivated(IWorkbenchPartReferenc e) line:
>>> 111 PartService.firePartDeactivated(IWorkbenchPartReference)
>>> line: 116 PartService.setActivePart(IWorkbenchPartReference)
>>> line: 165
>>> WorkbenchPagePartList.fireActivePartChanged(IWorkbenchPartRe ference,
>>> IWorkbenchPartReference) line: 56
>>> WorkbenchPagePartList(PartList).setActivePart(IWorkbenchPart Reference)
>>> line: 126 WorkbenchPage.setActivePart(IWorkbenchPart) line:
>>> 3402 WorkbenchPage.requestActivation(IWorkbenchPart) line:
>>> 2946 EditorPane(PartPane).requestActivation() line: 265
>>> EditorPane.requestActivation() line: 98
>>> EditorPane(PartPane).setFocus() line: 311
>>> EditorPane.setFocus() line: 127
>>> EditorStack(PartStack).presentationSelectionChanged(IPresent ablePart)
>>> line: 846 PartStack.access$1(PartStack, IPresentablePart)
>>> line: 829 PartStack$1.selectPart(IPresentablePart) line:
>>> 139 TabbedStackPresentation$1.handleEvent(TabFolderEvent)
>>> line: 131
>>> DefaultTabFolder(AbstractTabFolder).fireEvent(TabFolderEvent ) line:
>>> 267 DefaultTabFolder(AbstractTabFolder).fireEvent(int,
>>> AbstractTabItem) line: 276
>>> DefaultTabFolder.access$1(DefaultTabFolder, int, AbstractTabItem)
>>> line: 1 DefaultTabFolder$2.handleEvent(Event) line: 84
>>> EventTable.sendEvent(Event) line: 66
>>> CTabFolder(Widget).sendEvent(Event) line: 938
>>> CTabFolder(Widget).sendEvent(int, Event, boolean) line: 962
>>> CTabFolder(Widget).sendEvent(int, Event) line: 947
>>> CTabFolder(Widget).notifyListeners(int, Event) line: 706
>>> CTabFolder.setSelection(int, boolean) line: 3227
>>> CTabFolder.onMouse(Event) line: 2005
>>> CTabFolder$1.handleEvent(Event) line: 316
>>> EventTable.sendEvent(Event) line: 66
>>> CTabFolder(Widget).sendEvent(Event) line: 938
>>> Display.runDeferredEvents() line: 3682
>>> Display.readAndDispatch() line: 3293
>>> Workbench.runEventLoop(Window$IExceptionHandler, Display) line:
>>> 2389 Workbench.runUI() line: 2353
>>> Workbench.access$4(Workbench) line: 2219 Workbench$4.run()
>>> line: 466 Realm.runWithDefault(Realm, Runnable) line:
>>> 289 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor)
>>> line: 461 PlatformUI.createAndRunWorkbench(Display,
>>> WorkbenchAdvisor) line: 149
>>> IDEApplication.start(IApplicationContext) line: 106
>>> EclipseAppHandle.run(Object) line: 169
>>> EclipseAppLauncher.runApplication(Object) line: 106
>>> EclipseAppLauncher.start(Object) line: 76
>>> EclipseStarter.run(Object) line: 363
>>> EclipseStarter.run(String[], Runnable) line: 176
>>> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
>>> available [native method]
>>> NativeMethodAccessorImpl.invoke(Object, Object[]) line: not
>>> available DelegatingMethodAccessorImpl.invoke(Object,
>>> Object[]) line: not available Method.invoke(Object, Object...)
>>> line: not available Main.invokeFramework(String[], URL[])
>>> line: 508 Main.basicRun(String[]) line: 447
>>> Main.run(String[]) line: 1173 Main.main(String[]) line: 1148
>>>
>>>
>>> Ed Merks wrote:
>>>> Tomas,
>>>>
>>>> I still haven't seen a full stack trace showing the error. You
>>>> should be able to get it from the Error log view. Have you been
>>>> able to get the debugger to stop at the point when the exception is
>>>> thrown using an exception breakpoint?
>>>>
>>>>
>>>> Tomas Zijdemans wrote:
>>>>> Thanks for answering. I do not have nodemappings to supertypes.
>>>>>
>>>>> I've done a reinstall of eclipse and gmf 2.0.1.
>>>>>
>>>>> Created a root with two elements that relate to each other. Derive
>>>>> a diagram for both. Run it, and still get the same error!!
>>>>>
>>>>> Jan Herriger wrote:
>>>>>> If you have node mappings to supertypes (A and B), you should
>>>>>> define domain specialisations for them (new "constraint" inside
>>>>>> the mapping). The body should be:
>>>>>>
>>>>>> oclIsTypeOf(A)
>>>>>>
>>>>>> Tomas Zijdemans schrieb:
>>>>>>> Hmm. It seems I have got things working. And I have a definitive
>>>>>>> source of the error. Either I have misunderstood something, or
>>>>>>> there is a bug in GMF.
>>>>>>>
>>>>>>> As previously stated, everything works in EMF. This just occurs
>>>>>>> in GMF. Scenario:
>>>>>>> - A is super of B. B is super of C and D. (A and B should be
>>>>>>> abstract, but this does not seem to effect anything)
>>>>>>> - If root can contain A's, and an editor for C and another for D
>>>>>>> is created - the error occurs.
>>>>>>> - If root can contain C's and D's, and an editor for C and
>>>>>>> another for D is created - the error does not occur.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Tomas Zijdemans
>>>>>>>
>>>>>>>
>>>>>>> Tomas Zijdemans wrote:
>>>>>>>> Thanks for the tip, will check it out. After a week hammering
>>>>>>>> at this error, I've lost all faith in my ability to create
>>>>>>>> multiple editors and make them function together. I get this
>>>>>>>> error, and Load Resources shows nothing in "Browse workspace".
>>>>>>>>
>>>>>>>> So thought I would ask you guys what needs to be done.
>>>>>>>>
>>>>>>>> Here is what I do:
>>>>>>>> 1. Single ecore and genmodel (with one root element for each
>>>>>>>> editor)
>>>>>>>> 2. Derive tooling, graph and map for each editor.
>>>>>>>> 3. Derive a generator with these attributes set unique:
>>>>>>>> - File extensions
>>>>>>>> - Model ID
>>>>>>>> - Visual ID
>>>>>>>> - Plugin ID
>>>>>>>> - Editor ID
>>>>>>>>
>>>>>>>> Any input is, as always, greatly appreciated :)
>>>>>>>>
>>>>>>>>
>>>>>>>> Best Regards,
>>>>>>>>
>>>>>>>> Tomas Zijdemans
>>>>>>>>
>>>>>>>>
>>>>>>>> Ed Merks wrote:
>>>>>>>>> Tomas,
>>>>>>>>>
>>>>>>>>> You might not know about it, but in the breakpoints view you
>>>>>>>>> can set a breakpoint that will stop when a particular
>>>>>>>>> exception is about to be thrown. Look for the "J!" button...
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Tomas Zijdemans wrote:
>>>>>>>>>> Thanks for helping Alex! (I got a deadline coming up, so I'm
>>>>>>>>>> in a bit of a hurry on this one)
>>>>>>>>>>
>>>>>>>>>> I started the editor again to view where in the
>>>>>>>>>> DocumentProvider I should start, but then everything worked
>>>>>>>>>> again !! - This bug truly has me baffled! Now i can't
>>>>>>>>>> reproduce the DocumentProvider error without making
>>>>>>>>>> completely new diagrams.
>>>>>>>>>>
>>>>>>>>>> I tried debugging the relation with breakpoints, but
>>>>>>>>>> everything seemed normal. So it's a mystery where the
>>>>>>>>>> Concurrent Exception originates from..
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>>
>>>>>>>>>> Tomas Zijdemans
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Alex Shatalin wrote:
>>>>>>>>>>> Hello Tomas,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> 1.
>>>>>>>>>>>> "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>>>>>>>>>>>>
>>>>>>>>>>>> Does this mean I have GMF 1 installed ???
>>>>>>>>>>> No. Notation model was not changed in GMF for quite a long
>>>>>>>>>>> time..
>>>>>>>>>>>
>>>>>>>>>>> Can oyu debug DocumentProvider call to see why corresponding
>>>>>>>>>>> information can not be loaded from the diagram file? (The
>>>>>>>>>>> files you attached looks normal..)
>>>>>>>>>>>
>>>>>>>>>>> -----------------
>>>>>>>>>>> Alex Shatalin
>>>>>>>>>>>
>>>>>>>>>>>
Re: ConcurrentModificationException [message #159840 is a reply to message #159756] Mon, 12 November 2007 17:39 Go to previous messageGo to next message
Eclipse UserFriend
Hello Ed,

> Since resources are often demand loaded into a resource set as proxies
> are resolved, that's probably what's happening here. Maybe try
> changing it to
>
> for (Iterator it = new
> ArrayList(info.getResourceSet().getResources()).iterator();

Should we adopt GMF generator to always use this pattern?

-----------------
Alex Shatalin
Re: ConcurrentModificationException [message #159845 is a reply to message #159840] Mon, 12 November 2007 18:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------080800020203040502070200
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Alex,

Making a copy of the list is a bit expensive. Depending on if you want
to visit the demand loaded resources or not, I'd suggest either

List<Resource> resources = resourceSet.getResources();
for (int i = 0; i < resources.size(); ++i)

or

List<Resource> resources = resourceSet.getResources();
for (int i = 0, size = resources.size(); i < size; ++i)

The former would visit even ones added during the traversal, while the
latter would visit only those known to be in the list at the start of
the traversal.

EcoreUtil's resolveAll is written this way because we want to resolve
proxies even in the demand loaded resources.

public static void resolveAll(ResourceSet resourceSet)
{
List<Resource> resources = resourceSet.getResources();
for (int i = 0; i < resources.size(); ++i)
{
resolveAll(resources.get(i));
}
}


Alex Shatalin wrote:
> Hello Ed,
>
>> Since resources are often demand loaded into a resource set as proxies
>> are resolved, that's probably what's happening here. Maybe try
>> changing it to
>>
>> for (Iterator it = new
>> ArrayList(info.getResourceSet().getResources()).iterator();
>
> Should we adopt GMF generator to always use this pattern?
>
> -----------------
> Alex Shatalin
>
>


--------------080800020203040502070200
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Alex,<br>
<br>
Making a copy of the list is a bit expensive.  Depending on if you want
to visit the demand loaded resources or not,  I'd suggest either<br>
<br>
   List&lt;Resource&gt; resources = resourceSet.getResources();<br>
    for (int i = 0; i &lt; resources.size(); ++i)<br>
<br>
or <br>
<br>
   List&lt;Resource&gt; resources = resourceSet.getResources();<br>
    for (int i = 0, size = resources.size(); i &lt; size; ++i)<br>
<br>
The former would visit even ones added during the traversal, while the
latter would visit only those known to be in the list at the start of
the traversal.  <br>
<br>
EcoreUtil's resolveAll is written this way because we want to resolve
proxies even in the demand loaded resources.<br>
<blockquote><small>  public static void resolveAll(ResourceSet
resourceSet)</small><br>
<small>  {</small><br>
<small>    List&lt;Resource&gt; resources =
resourceSet.getResources();</small><br>
<small>    for (int i = 0; i &lt; resources.size(); ++i)</small><br>
<small>    {</small><br>
<small>      resolveAll(resources.get(i));</small><br>
<small>    }</small><br>
<small>  }</small><br>
</blockquote>
<br>
Alex Shatalin wrote:
<blockquote cite="mid:3c3172e61a05c8c9f39c57a4b488@news.eclipse.org"
type="cite">Hello Ed,
<br>
<br>
<blockquote type="cite">Since resources are often demand loaded into
a resource set as proxies
<br>
are resolved, that's probably what's happening here.  Maybe try
<br>
changing it to
<br>
<br>
for (Iterator it = new
<br>
ArrayList(info.getResourceSet().getResources()).iterator();
<br>
</blockquote>
<br>
Should we adopt GMF generator to always use this pattern?
<br>
<br>
-----------------
<br>
Alex Shatalin
<br>
<br>
<br>
</blockquote>
<br>
</body>
</html>

--------------080800020203040502070200--
Re: ConcurrentModificationException [message #159874 is a reply to message #159756] Tue, 13 November 2007 03:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

My birthday is coming up, and I've had a hard time making a wish list
for family and friends.. This is probably the gift I'm going to
appreciate the most!

This removes the error from all my editors!

Thanks Ed!

Tomas Zijdemans


Ed Merks wrote:
> Tomas,
>
> Since resources are often demand loaded into a resource set as proxies
> are resolved, that's probably what's happening here. Maybe try changing
> it to
>
> for (Iterator it = new
> ArrayList(info.getResourceSet().getResources()).iterator();
>
>
> Tomas Zijdemans wrote:
>> Well, it is a generated method, so it would be kind of strange if the
>> error was there. But it suggest that the synchronization of the object
>> (called when I select the diagram) fails.
>>
>> /**
>> * @generated
>> */
>> protected void doSynchronize(Object element, IProgressMonitor monitor)
>> throws CoreException {
>> ResourceSetInfo info = getResourceSetInfo(element);
>> if (info != null) {
>> for (Iterator it =
>> info.getResourceSet().getResources().iterator();
>> it.hasNext();) {
>> 402 Resource nextResource = (Resource) it.next();
>> handleElementChanged(info, nextResource, monitor);
>> }
>> return;
>> }
>> super.doSynchronize(element, monitor);
>> }
>>
>>
>> Ed Merks wrote:
>>> Tomas,
>>>
>>> So what does the code at
>>> "UemlbaseDocumentProvider.doSynchronize(Object, IProgressMonitor)
>>> line: 402" look like?
>>>
>>>
>>> Tomas Zijdemans wrote:
>>>> Thanks for helping Ed. I found the breakpointtype you spoke of,
>>>> reproduced the error, and copied the Stack. So here it is:
>>>>
>>>>
>>>> Thread [main] (Suspended (exception
>>>> ConcurrentModificationException))
>>>> BasicEList$EIterator<E1>.checkModCount() line: 1378
>>>> BasicEList$EIterator<E1>.doNext() line: 1326
>>>> BasicEList$EIterator<E1>.next() line: 1312
>>>> UemlbaseDocumentProvider.doSynchronize(Object, IProgressMonitor)
>>>> line: 402
>>>> AbstractDocumentProvider$1SynchronizeOperation.execute(IProg ressMonitor)
>>>> line: 983
>>>> AbstractDocumentProvider$1SynchronizeOperation(AbstractDocum entProvider$DocumentProviderOperation).run(IProgressMonitor)
>>>> line: 66
>>>> UemlbaseDocumentProvider(AbstractDocumentProvider).executeOp eration(AbstractDocumentProvider$DocumentProviderOperation,
>>>> IProgressMonitor) line: 530
>>>> UemlbaseDocumentProvider(AbstractDocumentProvider).synchroni ze(Object)
>>>> line: 991
>>>> UemlbaseDiagramEditor(DiagramDocumentEditor).handleEditorInp utChanged()
>>>> line: 568
>>>> UemlbaseDiagramEditor(DiagramDocumentEditor).sanityCheckStat e(IEditorInput)
>>>> line: 692
>>>> UemlbaseDiagramEditor(DiagramDocumentEditor).safelySanityChe ckState(IEditorInput)
>>>> line: 674
>>>> DiagramDocumentEditor$ActivationListener.handleActivation() line:
>>>> 1135
>>>> DiagramDocumentEditor$ActivationListener.partActivated(IWork benchPart)
>>>> line: 1094 PartListenerList$1.run() line: 72
>>>> SafeRunner.run(ISafeRunnable) line: 37
>>>> Platform.run(ISafeRunnable) line: 857
>>>> PartListenerList.fireEvent(SafeRunnable, IPartListener,
>>>> IWorkbenchPart, String) line: 57
>>>> PartListenerList.firePartActivated(IWorkbenchPart) line: 70
>>>> PartService.firePartActivated(IWorkbenchPartReference) line:
>>>> 73 PartService.setActivePart(IWorkbenchPartReference) line:
>>>> 171 WWinPartService.updateActivePart() line: 124
>>>> WWinPartService.access$0(WWinPartService) line: 115
>>>> WWinPartService$1.partDeactivated(IWorkbenchPartReference) line:
>>>> 48 PartListenerList2$4.run() line: 113
>>>> SafeRunner.run(ISafeRunnable) line: 37
>>>> Platform.run(ISafeRunnable) line: 857
>>>> PartListenerList2.fireEvent(SafeRunnable, IPartListener2,
>>>> IWorkbenchPartReference, String) line: 53
>>>> PartListenerList2.firePartDeactivated(IWorkbenchPartReferenc e) line:
>>>> 111 PartService.firePartDeactivated(IWorkbenchPartReference)
>>>> line: 116 PartService.setActivePart(IWorkbenchPartReference)
>>>> line: 165
>>>> WorkbenchPagePartList.fireActivePartChanged(IWorkbenchPartRe ference,
>>>> IWorkbenchPartReference) line: 56
>>>> WorkbenchPagePartList(PartList).setActivePart(IWorkbenchPart Reference)
>>>> line: 126 WorkbenchPage.setActivePart(IWorkbenchPart) line:
>>>> 3402 WorkbenchPage.requestActivation(IWorkbenchPart) line:
>>>> 2946 EditorPane(PartPane).requestActivation() line: 265
>>>> EditorPane.requestActivation() line: 98
>>>> EditorPane(PartPane).setFocus() line: 311
>>>> EditorPane.setFocus() line: 127
>>>> EditorStack(PartStack).presentationSelectionChanged(IPresent ablePart)
>>>> line: 846 PartStack.access$1(PartStack, IPresentablePart)
>>>> line: 829 PartStack$1.selectPart(IPresentablePart) line:
>>>> 139 TabbedStackPresentation$1.handleEvent(TabFolderEvent)
>>>> line: 131
>>>> DefaultTabFolder(AbstractTabFolder).fireEvent(TabFolderEvent ) line:
>>>> 267 DefaultTabFolder(AbstractTabFolder).fireEvent(int,
>>>> AbstractTabItem) line: 276
>>>> DefaultTabFolder.access$1(DefaultTabFolder, int, AbstractTabItem)
>>>> line: 1 DefaultTabFolder$2.handleEvent(Event) line: 84
>>>> EventTable.sendEvent(Event) line: 66
>>>> CTabFolder(Widget).sendEvent(Event) line: 938
>>>> CTabFolder(Widget).sendEvent(int, Event, boolean) line: 962
>>>> CTabFolder(Widget).sendEvent(int, Event) line: 947
>>>> CTabFolder(Widget).notifyListeners(int, Event) line: 706
>>>> CTabFolder.setSelection(int, boolean) line: 3227
>>>> CTabFolder.onMouse(Event) line: 2005
>>>> CTabFolder$1.handleEvent(Event) line: 316
>>>> EventTable.sendEvent(Event) line: 66
>>>> CTabFolder(Widget).sendEvent(Event) line: 938
>>>> Display.runDeferredEvents() line: 3682
>>>> Display.readAndDispatch() line: 3293
>>>> Workbench.runEventLoop(Window$IExceptionHandler, Display) line:
>>>> 2389 Workbench.runUI() line: 2353
>>>> Workbench.access$4(Workbench) line: 2219 Workbench$4.run()
>>>> line: 466 Realm.runWithDefault(Realm, Runnable) line:
>>>> 289 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor)
>>>> line: 461 PlatformUI.createAndRunWorkbench(Display,
>>>> WorkbenchAdvisor) line: 149
>>>> IDEApplication.start(IApplicationContext) line: 106
>>>> EclipseAppHandle.run(Object) line: 169
>>>> EclipseAppLauncher.runApplication(Object) line: 106
>>>> EclipseAppLauncher.start(Object) line: 76
>>>> EclipseStarter.run(Object) line: 363
>>>> EclipseStarter.run(String[], Runnable) line: 176
>>>> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
>>>> available [native method]
>>>> NativeMethodAccessorImpl.invoke(Object, Object[]) line: not
>>>> available DelegatingMethodAccessorImpl.invoke(Object,
>>>> Object[]) line: not available Method.invoke(Object, Object...)
>>>> line: not available Main.invokeFramework(String[], URL[])
>>>> line: 508 Main.basicRun(String[]) line: 447
>>>> Main.run(String[]) line: 1173 Main.main(String[]) line: 1148
>>>>
>>>> Ed Merks wrote:
>>>>> Tomas,
>>>>>
>>>>> I still haven't seen a full stack trace showing the error. You
>>>>> should be able to get it from the Error log view. Have you been
>>>>> able to get the debugger to stop at the point when the exception is
>>>>> thrown using an exception breakpoint?
>>>>>
>>>>>
>>>>> Tomas Zijdemans wrote:
>>>>>> Thanks for answering. I do not have nodemappings to supertypes.
>>>>>>
>>>>>> I've done a reinstall of eclipse and gmf 2.0.1.
>>>>>>
>>>>>> Created a root with two elements that relate to each other. Derive
>>>>>> a diagram for both. Run it, and still get the same error!!
>>>>>>
>>>>>> Jan Herriger wrote:
>>>>>>> If you have node mappings to supertypes (A and B), you should
>>>>>>> define domain specialisations for them (new "constraint" inside
>>>>>>> the mapping). The body should be:
>>>>>>>
>>>>>>> oclIsTypeOf(A)
>>>>>>>
>>>>>>> Tomas Zijdemans schrieb:
>>>>>>>> Hmm. It seems I have got things working. And I have a definitive
>>>>>>>> source of the error. Either I have misunderstood something, or
>>>>>>>> there is a bug in GMF.
>>>>>>>>
>>>>>>>> As previously stated, everything works in EMF. This just occurs
>>>>>>>> in GMF. Scenario:
>>>>>>>> - A is super of B. B is super of C and D. (A and B should be
>>>>>>>> abstract, but this does not seem to effect anything)
>>>>>>>> - If root can contain A's, and an editor for C and another for D
>>>>>>>> is created - the error occurs.
>>>>>>>> - If root can contain C's and D's, and an editor for C and
>>>>>>>> another for D is created - the error does not occur.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Tomas Zijdemans
>>>>>>>>
>>>>>>>>
>>>>>>>> Tomas Zijdemans wrote:
>>>>>>>>> Thanks for the tip, will check it out. After a week hammering
>>>>>>>>> at this error, I've lost all faith in my ability to create
>>>>>>>>> multiple editors and make them function together. I get this
>>>>>>>>> error, and Load Resources shows nothing in "Browse workspace".
>>>>>>>>>
>>>>>>>>> So thought I would ask you guys what needs to be done.
>>>>>>>>>
>>>>>>>>> Here is what I do:
>>>>>>>>> 1. Single ecore and genmodel (with one root element for each
>>>>>>>>> editor)
>>>>>>>>> 2. Derive tooling, graph and map for each editor.
>>>>>>>>> 3. Derive a generator with these attributes set unique:
>>>>>>>>> - File extensions
>>>>>>>>> - Model ID
>>>>>>>>> - Visual ID
>>>>>>>>> - Plugin ID
>>>>>>>>> - Editor ID
>>>>>>>>>
>>>>>>>>> Any input is, as always, greatly appreciated :)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Best Regards,
>>>>>>>>>
>>>>>>>>> Tomas Zijdemans
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Ed Merks wrote:
>>>>>>>>>> Tomas,
>>>>>>>>>>
>>>>>>>>>> You might not know about it, but in the breakpoints view you
>>>>>>>>>> can set a breakpoint that will stop when a particular
>>>>>>>>>> exception is about to be thrown. Look for the "J!" button...
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Tomas Zijdemans wrote:
>>>>>>>>>>> Thanks for helping Alex! (I got a deadline coming up, so I'm
>>>>>>>>>>> in a bit of a hurry on this one)
>>>>>>>>>>>
>>>>>>>>>>> I started the editor again to view where in the
>>>>>>>>>>> DocumentProvider I should start, but then everything worked
>>>>>>>>>>> again !! - This bug truly has me baffled! Now i can't
>>>>>>>>>>> reproduce the DocumentProvider error without making
>>>>>>>>>>> completely new diagrams.
>>>>>>>>>>>
>>>>>>>>>>> I tried debugging the relation with breakpoints, but
>>>>>>>>>>> everything seemed normal. So it's a mystery where the
>>>>>>>>>>> Concurrent Exception originates from..
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>>
>>>>>>>>>>> Tomas Zijdemans
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Alex Shatalin wrote:
>>>>>>>>>>>> Hello Tomas,
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>> 1.
>>>>>>>>>>>>> "xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
>>>>>>>>>>>>>
>>>>>>>>>>>>> Does this mean I have GMF 1 installed ???
>>>>>>>>>>>> No. Notation model was not changed in GMF for quite a long
>>>>>>>>>>>> time..
>>>>>>>>>>>>
>>>>>>>>>>>> Can oyu debug DocumentProvider call to see why corresponding
>>>>>>>>>>>> information can not be loaded from the diagram file? (The
>>>>>>>>>>>> files you attached looks normal..)
>>>>>>>>>>>>
>>>>>>>>>>>> -----------------
>>>>>>>>>>>> Alex Shatalin
>>>>>>>>>>>>
>>>>>>>>>>>>
Re: ConcurrentModificationException [message #159898 is a reply to message #159874] Tue, 13 November 2007 04:21 Go to previous messageGo to next message
Eclipse UserFriend
Hello Tomas,

Can you please submitt corresponding request for me - I'll be able to correct
GMF generator to get rid of this error in future.

-----------------
Alex Shatalin
Re: ConcurrentModificationException [message #159931 is a reply to message #159756] Tue, 13 November 2007 07:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Ed et al.,

I seem to recall something about the resources list of the ResourceSet
implementing a custom iterator that was tolerant of additions (by proxy
resolution) during iteration. Was this not done in EMF 2.0 or some such
long ago release? Am I out to lunch? Sounds like a useful capability for
this particular list to have, in general.

Cheers,

Christian


Ed Merks wrote:

> Tomas,
>
> Since resources are often demand loaded into a resource set as proxies
> are resolved, that's probably what's happening here. Maybe try changing
> it to
>
> for (Iterator it = new
> ArrayList(info.getResourceSet().getResources()).iterator();
>
>
> Tomas Zijdemans wrote:
>> Well, it is a generated method, so it would be kind of strange if the
>> error was there. But it suggest that the synchronization of the object
>> (called when I select the diagram) fails.
>>
>> /**
>> * @generated
>> */
>> protected void doSynchronize(Object element, IProgressMonitor monitor)
>> throws CoreException {
>> ResourceSetInfo info = getResourceSetInfo(element);
>> if (info != null) {
>> for (Iterator it =
>> info.getResourceSet().getResources().iterator();
>> it.hasNext();) {
>> 402 Resource nextResource = (Resource) it.next();
>> handleElementChanged(info, nextResource, monitor);
>> }
>> return;
>> }
>> super.doSynchronize(element, monitor);
>> }
>>

-----8<-----
Re: ConcurrentModificationException [message #159947 is a reply to message #159931] Tue, 13 November 2007 08:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------010506050308060306090700
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Christian,

There's EcoreUtil.ContentTreeIterator.ResourcesIterator, but that's used
for the tree iterators. The iterator for ResourceSet.getResources
itself is just a plain old fail fast iterator. I'm not sure it's a good
idea to make it be not fail fast given that some clients might well
expect to see only resources that were there at the start of the
iteration, which is generally a safe assumption when using an iterator.


Christian W. Damus wrote:
> Hi, Ed et al.,
>
> I seem to recall something about the resources list of the ResourceSet
> implementing a custom iterator that was tolerant of additions (by proxy
> resolution) during iteration. Was this not done in EMF 2.0 or some such
> long ago release? Am I out to lunch? Sounds like a useful capability for
> this particular list to have, in general.
>
> Cheers,
>
> Christian
>
>
> Ed Merks wrote:
>
>
>> Tomas,
>>
>> Since resources are often demand loaded into a resource set as proxies
>> are resolved, that's probably what's happening here. Maybe try changing
>> it to
>>
>> for (Iterator it = new
>> ArrayList(info.getResourceSet().getResources()).iterator();
>>
>>
>> Tomas Zijdemans wrote:
>>
>>> Well, it is a generated method, so it would be kind of strange if the
>>> error was there. But it suggest that the synchronization of the object
>>> (called when I select the diagram) fails.
>>>
>>> /**
>>> * @generated
>>> */
>>> protected void doSynchronize(Object element, IProgressMonitor monitor)
>>> throws CoreException {
>>> ResourceSetInfo info = getResourceSetInfo(element);
>>> if (info != null) {
>>> for (Iterator it =
>>> info.getResourceSet().getResources().iterator();
>>> it.hasNext();) {
>>> 402 Resource nextResource = (Resource) it.next();
>>> handleElementChanged(info, nextResource, monitor);
>>> }
>>> return;
>>> }
>>> super.doSynchronize(element, monitor);
>>> }
>>>
>>>
>
> -----8<-----
>


--------------010506050308060306090700
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Christian,<br>
<br>
There's EcoreUtil.ContentTreeIterator.ResourcesIterator, but that's
used for the tree iterators.&nbsp;&nbsp; The iterator for
ResourceSet.getResources itself is just a plain old fail fast
iterator.&nbsp; I'm not sure it's a good idea to make it be not fail fast
given that some clients might well expect to see only resources that
were there at the start of the iteration, which is generally a safe
assumption when using an iterator.<br>
<br>
<br>
Christian W. Damus wrote:
<blockquote cite="mid:fhc665$v4c$1@build.eclipse.org" type="cite">
<pre wrap="">Hi, Ed et al.,

I seem to recall something about the resources list of the ResourceSet
implementing a custom iterator that was tolerant of additions (by proxy
resolution) during iteration. Was this not done in EMF 2.0 or some such
long ago release? Am I out to lunch? Sounds like a useful capability for
this particular list to have, in general.

Cheers,

Christian


Ed Merks wrote:

</pre>
<blockquote type="cite">
<pre wrap="">Tomas,

Since resources are often demand loaded into a resource set as proxies
are resolved, that's probably what's happening here. Maybe try changing
it to

for (Iterator it = new
ArrayList(info.getResourceSet().getResources()).iterator();


Tomas Zijdemans wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Well, it is a generated method, so it would be kind of strange if the
error was there. But it suggest that the synchronization of the object
(called when I select the diagram) fails.

/**
* @generated
*/
protected void doSynchronize(Object element, IProgressMonitor monitor)
throws CoreException {
ResourceSetInfo info = getResourceSetInfo(element);
if (info != null) {
for (Iterator it =
info.getResourceSet().getResources().iterator();
it.hasNext();) {
402 Resource nextResource = (Resource) it.next();
handleElementChanged(info, nextResource, monitor);
}
return;
}
super.doSynchronize(element, monitor);
}

</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
-----8&lt;-----
</pre>
</blockquote>
<br>
</body>
</html>

--------------010506050308060306090700--
Re: ConcurrentModificationException [message #159995 is a reply to message #159947] Tue, 13 November 2007 08:55 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Ed,

Thanks for clarifying! I'm glad I'm not out to lunch.

I see that the tree iterator naturally has different semantics from the
usual iterator. The very process of iterating contents may add to the
resources list (resolving containment proxies) so this is necessary in that
context. That isn't the case with simple iteration over
ResourceSet::getResources(), so I withdraw my remark.

cW

Ed Merks wrote:

> Christian,
>
> There's EcoreUtil.ContentTreeIterator.ResourcesIterator, but that's used
> for the tree iterators. The iterator for ResourceSet.getResources
> itself is just a plain old fail fast iterator. I'm not sure it's a good
> idea to make it be not fail fast given that some clients might well
> expect to see only resources that were there at the start of the
> iteration, which is generally a safe assumption when using an iterator.
>
>
> Christian W. Damus wrote:
>> Hi, Ed et al.,
>>
>> I seem to recall something about the resources list of the ResourceSet
>> implementing a custom iterator that was tolerant of additions (by proxy
>> resolution) during iteration. Was this not done in EMF 2.0 or some such
>> long ago release? Am I out to lunch? Sounds like a useful capability
>> for this particular list to have, in general.
>>
>> Cheers,
>>
>> Christian

-----8<-----
Previous Topic:Specifying Location of Element during Configuration
Next Topic:Diagram - Model element separation
Goto Forum:
  


Current Time: Sun Apr 27 10:13:12 EDT 2025

Powered by FUDForum. Page generated in 0.05989 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top