It's all about the answers!

Ask a question

how to get the IMethod when using diff


Jingwen Ou (5610) | asked Sep 18 '08, 12:44 p.m.
1. when we use the diff tool to compare two Java files, there will be a "box" at the top summarizing the methods that are different from the current ones. Is it possible to get the IMethod objects of these changed methods? I mean how to convert the DiffNode to IMethod (using Differencer.findDifferences will return a DiffNode of two states).

2. IChange.beforeState() and IChange.afterState() both return a IVersionableHandler that identifies a change state. We normally asked the repository for the content of these two states before making a diff. For example,
IWorkspaceManager.versionableManager().fetchCompleteState(IChange.beforeState(), monitor);


But when I use the following to get the before state's IShareable (locally), it still returns a non-null result:

FileSystemCore.getSharingManager().findShareables(FileSystemCore.getSharingManager().getDefaultCFARoot(),IChange.beforeState(), component, monitor);


Does it mean Jazz also persist the before/after state object locally?

Thanks in advance,
Owen

One answer



permanent link
Dmitry Karasik (1.8k11) | answered Sep 18 '08, 12:44 p.m.
JAZZ DEVELOPER
But when I use the following to get the before state's IShareable
(locally), it still returns a non-null result:

FileSystemCore.getSharingManager().findShareables
(FileSystemCore.getSharingManager().getDefaultCFARoot

(),IChange.beforeState(),
component, monitor);


Does it mean Jazz also persist the before/after state object locally?


No. findShareables() looks up a shareable by itemId, it ignores the
stateId. So in fact you get back 2 shareables that are exactly the same.

- Dmitry

Your answer


Register or to post your answer.