Community
Participate
Working Groups
Fup of bug 317352: Stepping through RoleBindingChangedListener.updateCallinMarkers(..) I noticed that the deltas mentioned all (unchanged) method mappings as added and failed to mention a regular method that was actually added. Example used: edit roles of CompletionAdaptor.
Created attachment 172986 [details] proposed implementation Analysis revealed that the delta builder requires that the JavaModelManager has infos for all elements to be analyzed, incl. method mappings. While implementing corresponding support in CompilationUnitStructureRequestor (method createCallinInfo) it proved unfortunate that OTJavaElements are not JavaElements. Consequently, I re-rooted OTJavaElement to make it a subclass of Member. This allowed me to remove *many* workarounds where JavaElement and OTJavaElement had to be treated differently. Remaining FIXMEs in: - JavaElementDeltaBuilder#findContentChange(..): compare SourceMethodMappingInfo to detect content changes - JavaElementDeltaBuilder#recordElementInfo(..): is instanceof still needed - OTType#createElementInfo : unimplemented Further fix: - don't let CallinMapping#equals rely on equal callin names if these are generated (enclosed in '<' '>') (needed to avoid unwanted deltas) Tests for the original issue are in org.eclipse.objectteams.otdt.tests.otmodel.JavaElementDeltaTests where testAddCallinToRole2 indeed succeeded in reproducing the issue.
Changes have been committed as r543 & r544. Tests and actual usage of build 201006290324 show now issues to this point. Leaving only the 3 FIXMEs from comment 1 to be resolved before the release.
Created attachment 173049 [details] patch resolving one FIXME (In reply to comment #1) > Remaining FIXMEs in: > - JavaElementDeltaBuilder#findContentChange(..): compare > SourceMethodMappingInfo to detect content changes This patch implements the distinction of two levels of comparing method mappings: * top-level comparison using the equals method of the JavaElement * fine-grained comparison in findContentChange based on SourceMethodMappingInfo Actually, CallinMapping.equals(..) had to be made smarter for this purpose. Also extend the solution to callouts, too. Includes 4 new tests.
(In reply to comment #1) > Remaining FIXMEs in: > - OTType#createElementInfo : unimplemented I assume that OTTypes are never created directly (i.e., in not-open state). Thus implementation of this method should not be needed. If it still happens we will be alerted by the thrown UnsupportedOperationException.
(In reply to comment #1) > Remaining FIXMEs in: > - JavaElementDeltaBuilder#recordElementInfo(..): is instanceof still needed This check has been removed together with a few more of its kind in r549 (after neither tests nor runtime workbench could trigger that branch). This closes this issue.
Verified using build 201007050931 by inspecting and running the tests, as well as interactively observing updates in the Outline view.