Is the IVersionableHandle return by IChange.item() constant?
Des IChange.item() means the same IVersionableHandle as the corresponding IShareable.getRemote()?
My understanding is IChange.item() is a constant IVersionalbleHandle that identifies the corresponding IShareable in the local workspace. But not for IChange.afterState() and IChange.beforeState(). So we can always find the local IShareable using IShareableManager.findShareable(IChange.item()). Correct? |
7 answers
jingweno wrote:
Des IShareable.getRemote() means the same IVersionableHandle as IChange.item() identifies the item for which the change describes. IChange.beforeState() and IChange.afterState() can both be null, so IChange.item() identifies the versionable item in all cases. JohnC SCM Server |
But can you always get a local copy (IShareable) by using IShareableManager.findShareable(IChange.item())? Or it depends on what version you have on your local workspace. Will the IVersionables returned by IChange.item() be the same if two changes are made to the same file? If not, how could I get the IShareable (still exists in current workspace) when I only have the IChange that is 3 months old (not the latest change) on hand?
jingweno wrote: Des IShareable.getRemote() means the same IVersionableHandle as IChange.item() identifies the item for which the change describes. IChange.beforeState() and IChange.afterState() can both be null, so IChange.item() identifies the versionable item in all cases. JohnC SCM Server |
You may get a sharable, but not necessarily the same state, as the
configuration may have moved on. What exactly are you trying to build? JohnC jingweno wrote: But can you always get a local copy (IShareable) by using |
I try to get all the changed methods (IMethod) in a specific IChangeSet (using diff). Getting the IShareable enables me to get the IType and use the IType.getMethod(String name, String[] parameterTypeSignatures). I am not sure whether this is the best way, but the only way I can come up with.
You may get a sharable, but not necessarily the same state, as the But can you always get a local copy (IShareable) by using |
I try to get all the changed methods (IMethod) in a specific IChangeSet This will give you methods that are in the file on disk (assuming the file even exists on disk) not the ones that are in the version that you are looking at in the changeset. To do this right you call ASTParser.newParser(), then ASParser.createAST (). - Dmitry |
yes, i did it this way for the diff. But the diff only gets back the You could create something like RemoteFileEditorInput and do the following: ICompilationUnitDocumentProvider provider = (ICompilationUnitDocumentProvider)JavaUI.getDocumentProvider(); provider.connect(input); ICompilationUnit cu = (ICompilationUnit)provider.getWorkingCopy(input); - Dmitry |
yes, i did it this way for the diff. But the diff only gets back the method name. I need a IMethod object (its ok that it doesn't exist in the workspace) to get the its ID, e.g. IJavaElement.getHandleIdentifier(). Any better solution?
I try to get all the changed methods (IMethod) in a specific IChangeSet This will give you methods that are in the file on disk (assuming the file even exists on disk) not the ones that are in the version that you are looking at in the changeset. To do this right you call ASTParser.newParser(), then ASParser.createAST (). - Dmitry |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.