Bug 90490 - Provide way to "diff" static structure
Summary: Provide way to "diff" static structure
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 1.2.1   Edit
Assignee: Matt Chapman CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-06 12:55 EDT by Ramnivas Laddad CLA
Modified: 2005-08-18 11:45 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ramnivas Laddad CLA 2005-04-06 12:55:00 EDT
Understanding how aspect's application differs between releases
is an important feature, to avoid any runtime surprises due to 
incorrectly modified pointcuts, renamed/moved fields/methods violating
assumptions made by pointcut developers, etc. Providing a "diff" tool
that let's developer compare how aspects and classes interact will
be tremendously useful for AspectJ adoption.

Here is expected of such a tool:
1. Ability to save static structure at any time under user-specified name.
   This will allow users to save structures with name such as "beta"
   "release 1", "release 2" etc.

2. Ability to specify two static structures to "diff".
   This will allow user to compare "what's new" and "what's different"
   between any two releases/snapshots.
Comment 1 Matt Chapman CLA 2005-04-07 09:31:28 EDT
Thanks for raising this Ramnivas. I prototyped a subset of this a long time ago,
with a simple view which listed what had changed in the of set of advised
elements between the just finished build, and the build prior to that. There
didn't seem to be much demand for it at the time so it fell by the wayside. Also
Mik's pointcut navigator prototype shows the changes in the context of the full
tree of advised elements, using bold and gray text decorators. Another
possibility would be to show these changes in the visualiser, with a new
provider. As well as being able to save out the structure for later comparisons,
I think we also need the ability to filter out the changes originating from
selected aspects - e.g. when someone adds a new method, and a tracing aspect
starts advising it, is probably not that interesting. So basically we need more
design discussions, then we can develop a new prototype for further evaluation.
Comment 2 Matt Chapman CLA 2005-06-28 10:25:20 EDT
The first version of this is now in! Please visit the following page to see how
to use it:

http://www.eclipse.org/ajdt/90490/
Comment 3 Mik Kersten CLA 2005-06-28 12:21:14 EDT
This looks great!!  Very elegant solution.  

I was wondering if a TableTree would help group things naturally, but it seems 
like clicking on the "Source" column provides an easy way of seeing what 
happened to each member of interest.  
Comment 4 Eugene Kuleshov CLA 2005-06-30 01:52:01 EDT
Looks really cool! 

I just wonder if this content can reside in some existing view. For example in
synchronize view (similar to "Compare with..." actions).

By the way, how about capturing these maps incrementally? Then, perhaps it could
be somehow integrated with local history facility.
Comment 5 Eugene Kuleshov CLA 2005-06-30 01:54:19 EDT
One more cosmetic thing. It would be nicer if new "Compare with" actions would
be under common "Compare with..." menu.
Comment 6 Matt Chapman CLA 2005-06-30 09:31:42 EDT
Thanks for the feedback! In response to the above comments:
#3: TableTree doesn't seem to work with TableCursor to provide keyboard
navigation of individual cells rather than complete rows. Use of TreeColumn
might be good, but that's 3.1 only so we're avoiding it for now (until we branch)

#4 and #5: I did look into the existing Compare With routines, but they present
the results in a textual diff view as an editor, which didn't seem to quite fit
as these crosscutting diffs don't have a defined order. To fit under the same
menu, we would have to replace the existing "Each other" submenu with our own,
which I'm not sure is possible - I'll take a look.

Also, work on adding a relationships filter to the view is underway (under bug
95724).
Comment 7 Ramnivas Laddad CLA 2005-06-30 14:26:27 EDT
Wonderful! Thank you very much!

Some feedback:
- It seems that the Crosscutting Comparison view is updated only after full
builds. Correct?
- Can the "Save Crosscutting Map..." be added to pop up menu on project node in
left-hand side tree view?
  (On a related note, perhaps this menu along with other AspectJ menus 
   could be moved as submenus under, say, "AspectJ" menu).
Comment 8 Matt Chapman CLA 2005-06-30 15:58:06 EDT
Glad you like it :)
If comparing against the current build, it should update after any build - in
fact is doesn't know whether the build is full or incremental. Actually it
currently updates after builds of *other* projects, which is obviously
unnecessary. If the editor markers and/or cross references view show a change in
the crosscutting relationships, that change should show in this new view - if
not, there's a bug.

Good idea about the menu - it makes senses to put it on the package explorer
context menu, and then that probably means we have enough entries for an AspectJ
submenu.
Comment 9 Eugene Kuleshov CLA 2005-07-05 22:13:31 EDT
(In reply to comment #6)
> Thanks for the feedback! In response to the above comments:
> #4 and #5: I did look into the existing Compare With routines, but they present
> the results in a textual diff view as an editor, which didn't seem to quite fit
> as these crosscutting diffs don't have a defined order.

Actually I meant Synchronize view itself, which is just a tree widget and
differences are shown in a text label + decorations. Then complete details about
selected diff could be shown in properties view. This would allow to save some
screen estate and reuse existing view, but price would be those fancy icons.

> To fit under the same
> menu, we would have to replace the existing "Each other" submenu with our own,
> which I'm not sure is possible - I'll take a look.

It is possible. You can contribute your own actions for any given resource type
to Compare With menu. For example
http://andrei.gmxhome.de/images/bco_compare2.gif and here its plugin manifest
http://cvs.forge.objectweb.org/cgi-bin/viewcvs.cgi/asm/eclipse/plugin/plugin.xml?rev=HEAD&content-type=text/vnd.viewcvs-markup
Comment 10 Matt Chapman CLA 2005-07-14 05:24:35 EDT
Thanks for the above info. After some discussion we've put the compare actions
under a "AspectJ Tools" submenu for now, for consistency with the other actions
we've moved under "AspectJ Tools", such as "save crosscutting map" and the
"include/exclude from build config".
I've also fixed a bug in the comparison routine, and when comparing two ajmap
files it now always compares the older one against the newer one. I've also
improved the sizing of the table columns, to fit the available space in the view.
Comment 11 Mik Kersten CLA 2005-07-14 10:20:33 EDT
A seperate AspectJ menu seems like a nice clear way to go, since the AspectJ 
functionality will be new to a lot of people so it helps for it to stand out 
some...
Comment 12 Matt Chapman CLA 2005-08-18 11:45:44 EDT
Implemented for AJDT 1.2.1 and 1.3.0.
Please raise new bugs for any problems or further enhancements to this new
functionality.