Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Unexpected meta-model reloading improvement
Unexpected meta-model reloading improvement [message #981119] Mon, 12 November 2012 07:00 Go to next message
Ed Willink is currently offline Ed Willink
Messages: 4110
Registered: July 2009
Senior Member
Hi Ed

For Helios, in https://bugs.eclipse.org/bugs/show_bug.cgi?id=315034, I
reported that the Sample Reflective Editor did not reload changed
meta-models. You responded that eClass is deliberately not proxy
resolving and so WONTFIXed.

Now with Juno/post-Juno I'm noticing that meta-models do reload.

Great. What's the underlying change, and does it need to be propagated
to other tooling?

Regards

Ed Willink
Re: Unexpected meta-model reloading improvement [message #981136 is a reply to message #981119] Mon, 12 November 2012 07:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26152
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Ed,<br>
<br>
Comments below.<br>
<br>
<div class="moz-cite-prefix">On 12/11/2012 8:00 AM, Ed Willink
wrote:<br>
</div>
<blockquote cite="mid:k7q6qg$6oe$1@xxxxxxxxe.org" type="cite">Hi
Ed
<br>
<br>
For Helios, in
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=315034">https://bugs.eclipse.org/bugs/show_bug.cgi?id=315034</a>, I reported
that the Sample Reflective Editor did not reload changed
meta-models. You responded that eClass is deliberately not proxy
resolving and so WONTFIXed.
<br>
<br>
Now with Juno/post-Juno I'm noticing that meta-models do reload.
<br>
</blockquote>
Yes, they reload and always have.<br>
<blockquote cite="mid:k7q6qg$6oe$1@xxxxxxxxe.org" type="cite">
<br>
Great. What's the underlying change, and does it need to be
propagated to other tooling?
<br>
</blockquote>
I think what you're noticing&nbsp; is this specialization:<br>
<br>
&nbsp; protected static final List&lt;String&gt; NON_DYNAMIC_EXTENSIONS =
Arrays.asList(new String [] { "xcore", "emof", "ecore", "genmodel"
});<br>
<br>
<blockquote>&nbsp; protected void handleActivate()<br>
&nbsp; {<br>
&nbsp;&nbsp;&nbsp; if (removedResources.isEmpty() &amp;&amp;
!changedResources.isEmpty())<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (Resource resource :
editingDomain.getResourceSet().getResources())<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!changedResources.contains(resource))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; URI uri = resource.getURI();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!"java".equals(uri.scheme()) &amp;&amp;
!NON_DYNAMIC_EXTENSIONS.contains(uri.fileExtension()))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (Iterator&lt;EObject&gt; i =
resource.getAllContents(); i.hasNext(); )<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EObject eObject = i.next();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if
(changedResources.contains(eObject.eClass().eResource()))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; changedResources.add(resource);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; handleActivateGen();<br>
&nbsp; }<br>
</blockquote>
So basically we walk all objects of all resources that are not
sources of models themselves, and check if their model is a model
that's being reloaded and then add that resource to the set of
changed resources so that it too is unloaded and reloaded.&nbsp; If the
editor is dirty, you'll have to choose to throw your changes away.<br>
<br>
Note that there is still no resolving of EObject.eClass() so that
bugzilla continues to be a won't fix.<br>
<blockquote cite="mid:k7q6qg$6oe$1@xxxxxxxxe.org" type="cite">
<br>
&nbsp;&nbsp;&nbsp; Regards
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ed Willink
<br>
</blockquote>
<br>
</body>
</html>
Re: Unexpected meta-model reloading improvement [message #981153 is a reply to message #981136] Mon, 12 November 2012 07:38 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4110
Registered: July 2009
Senior Member
HI

Thanks. That helps me, but suddenly I wonder if this is one of the "e4"
problems, particularly the reported issues with slow tab-switching and
flickering for XML editors (e.g
https://bugs.eclipse.org/bugs/show_bug.cgi?id=385272#c195).

It seems that tab-switching will call handleActivate() which if the
ResourceSet is large could burn a lot of CPU probably on the UI thread.

Regards

Ed Willink


On 12/11/2012 07:20, Ed Merks wrote:
> Ed,
>
> Comments below.
>
> On 12/11/2012 8:00 AM, Ed Willink wrote:
>> Hi Ed
>>
>> For Helios, in https://bugs.eclipse.org/bugs/show_bug.cgi?id=315034,
>> I reported that the Sample Reflective Editor did not reload changed
>> meta-models. You responded that eClass is deliberately not proxy
>> resolving and so WONTFIXed.
>>
>> Now with Juno/post-Juno I'm noticing that meta-models do reload.
> Yes, they reload and always have.
>>
>> Great. What's the underlying change, and does it need to be
>> propagated to other tooling?
> I think what you're noticing is this specialization:
>
> protected static final List<String> NON_DYNAMIC_EXTENSIONS =
> Arrays.asList(new String [] { "xcore", "emof", "ecore", "genmodel" });
>
> protected void handleActivate()
> {
> if (removedResources.isEmpty() && !changedResources.isEmpty())
> {
> for (Resource resource :
> editingDomain.getResourceSet().getResources())
> {
> if (!changedResources.contains(resource))
> {
> URI uri = resource.getURI();
> if (!"java".equals(uri.scheme()) &&
> !NON_DYNAMIC_EXTENSIONS.contains(uri.fileExtension()))
> {
> for (Iterator<EObject> i = resource.getAllContents();
> i.hasNext(); )
> {
> EObject eObject = i.next();
> if
> (changedResources.contains(eObject.eClass().eResource()))
> {
> changedResources.add(resource);
> break;
> }
> }
> }
> }
> }
> }
> handleActivateGen();
> }
>
> So basically we walk all objects of all resources that are not sources
> of models themselves, and check if their model is a model that's being
> reloaded and then add that resource to the set of changed resources so
> that it too is unloaded and reloaded. If the editor is dirty, you'll
> have to choose to throw your changes away.
>
> Note that there is still no resolving of EObject.eClass() so that
> bugzilla continues to be a won't fix.
>>
>> Regards
>>
>> Ed Willink
>
Re: Unexpected meta-model reloading improvement [message #981186 is a reply to message #981153] Mon, 12 November 2012 08:13 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26152
Registered: July 2009
Senior Member
Ed,

Of course the logic only kicks in when there are changed resources,
i.e., resources in the resource set for which there have been deltas in
their underlying workspace IFile. It certainly won't cause XML editors
to flicker the toolbar (which is most likely caused by the extensive use
of property testers).


On 12/11/2012 8:38 AM, Ed Willink wrote:
> HI
>
> Thanks. That helps me, but suddenly I wonder if this is one of the
> "e4" problems, particularly the reported issues with slow
> tab-switching and flickering for XML editors (e.g
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=385272#c195).
>
> It seems that tab-switching will call handleActivate() which if the
> ResourceSet is large could burn a lot of CPU probably on the UI thread.
>
> Regards
>
> Ed Willink
>
>
> On 12/11/2012 07:20, Ed Merks wrote:
>> Ed,
>>
>> Comments below.
>>
>> On 12/11/2012 8:00 AM, Ed Willink wrote:
>>> Hi Ed
>>>
>>> For Helios, in https://bugs.eclipse.org/bugs/show_bug.cgi?id=315034,
>>> I reported that the Sample Reflective Editor did not reload changed
>>> meta-models. You responded that eClass is deliberately not proxy
>>> resolving and so WONTFIXed.
>>>
>>> Now with Juno/post-Juno I'm noticing that meta-models do reload.
>> Yes, they reload and always have.
>>>
>>> Great. What's the underlying change, and does it need to be
>>> propagated to other tooling?
>> I think what you're noticing is this specialization:
>>
>> protected static final List<String> NON_DYNAMIC_EXTENSIONS =
>> Arrays.asList(new String [] { "xcore", "emof", "ecore", "genmodel" });
>>
>> protected void handleActivate()
>> {
>> if (removedResources.isEmpty() && !changedResources.isEmpty())
>> {
>> for (Resource resource :
>> editingDomain.getResourceSet().getResources())
>> {
>> if (!changedResources.contains(resource))
>> {
>> URI uri = resource.getURI();
>> if (!"java".equals(uri.scheme()) &&
>> !NON_DYNAMIC_EXTENSIONS.contains(uri.fileExtension()))
>> {
>> for (Iterator<EObject> i = resource.getAllContents();
>> i.hasNext(); )
>> {
>> EObject eObject = i.next();
>> if
>> (changedResources.contains(eObject.eClass().eResource()))
>> {
>> changedResources.add(resource);
>> break;
>> }
>> }
>> }
>> }
>> }
>> }
>> handleActivateGen();
>> }
>>
>> So basically we walk all objects of all resources that are not
>> sources of models themselves, and check if their model is a model
>> that's being reloaded and then add that resource to the set of
>> changed resources so that it too is unloaded and reloaded. If the
>> editor is dirty, you'll have to choose to throw your changes away.
>>
>> Note that there is still no resolving of EObject.eClass() so that
>> bugzilla continues to be a won't fix.
>>>
>>> Regards
>>>
>>> Ed Willink
>>
>
Previous Topic:Global EPackage registry and Resource loading
Next Topic:[CDO] Exception on pre-built binary package
Goto Forum:
  


Current Time: Fri Oct 31 06:21:19 GMT 2014

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

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