Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317352

Summary: [ui] callin marker creator fires too many jobs
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTDTAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 0.7   
Target Milestone: 0.7   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
implementation
none
Additional fixes none

Description Stephan Herrmann CLA 2010-06-19 05:53:26 EDT
When editing a role class the progress view sometimes shows many
jobs relating to update of callin markers. When this happens
the UI becomes less responsive.

We should collate events as to reduce the number of update jobs.
Comment 1 Stephan Herrmann CLA 2010-06-19 09:17:47 EDT
Created attachment 172268 [details]
implementation

The patch fixes the immediate issue:
 - invalidate each role at most once
 - use 'baseMemberAdded' only if #members < 3 (per type)
   otherwise call invalidateBaseCU(..) regarding the enclosing compilation unit
 - when invoking invalidateBase(..) for the current editor input,
   trigger a full updateCallinMarkers(ResourceMarkable,..)

Also included:
 - don't synchronize CallinMarkerRemover,
   saw a deadlock where multiple threads were processing JavaElementDelats.
   Deadlock is worse than markers removed at a wrong point in time.
 - make MethodMapping.findMethod(..) smarter so it finds callout-methods, too.
   (needed for callin/callout-markers at base-level callouts).
 - 'CallinMarkerCreator2.getAllMethodsAndFields(..)': find callout-methods, too

Not working currently:
 - adding a method to a role-and-base does is not reflected in the deltas
 - arbitrary change in a role creates ADDED deltas for all method mappings
Comment 2 Stephan Herrmann CLA 2010-06-19 09:19:29 EDT
Patch has been committed as r519, r520.
Comment 3 Stephan Herrmann CLA 2010-06-19 09:25:14 EDT
(In reply to comment #1)

> Not working currently:
>  - adding a method to a role-and-base does is not reflected in the deltas
>  - arbitrary change in a role creates ADDED deltas for all method mappings

Following up on these in bug 317358.
Comment 4 Stephan Herrmann CLA 2010-06-19 15:02:07 EDT
With this patch markers in binary base class are not removed if a callin is
removed. CallinMarkerCreator2.invalidateBase(IJavaElement) must also look
for a CLASS_FILE parent.
Comment 5 Stephan Herrmann CLA 2010-06-19 16:21:51 EDT
Created attachment 172276 [details]
Additional fixes

(In reply to comment #4)

> With this patch markers in binary base class are not removed if a callin is
> removed. CallinMarkerCreator2.invalidateBase(IJavaElement) must also look
> for a CLASS_FILE parent.

Fixed by
 - symmetrically implementing invalidateBaseMarkable (was invalidateBaseCU)
   for Resources and JavaElements
 - implementing removal of JavaElement-based markers (as a FIXME actually)

This solution is backed by the following cleanup:
 - use more explicit type IClassFile for element of JavaElementMarkable
   (we only use IResource or IClassFile as toplevel elements!)
Comment 6 Stephan Herrmann CLA 2010-06-19 16:23:44 EDT
Patch from comment 5 has been committed as r521.
Comment 7 Stephan Herrmann CLA 2010-07-06 07:09:30 EDT
Verified using build 201007050931.