When an ICopyFileArea could be null?
Hi, I've a plain java extension which set some jazz user properties and then perform a check-in. Everything it is ok if I work with elements that belong to an eclipse project, but when I set properties on a project I've some problem. During the ICheckInOperation I get a NullPointerException because ICopyFileArea cfa = CopyFileAreaManager.instance.getCopyFileAreaForPath(sbox.getRoot()); seems to be null. I don't know how this object is used, but does anybody know what can cause this behaviour? Thanks, Michele.
|
2 answers
The manager doesn't know about a CFA at that path. Have you registered the sandbox before making that call? It likely works in Eclipse because RTC automatically registers sandboxes on startup.
The CFAManager is marked as internal, so you should avoid using it if possible. Can you use the ISharingManager instead? Since our APIs aren't well defined, the command line interface would be an even better choice (if possible).
Comments
Stefano Antoniazzi
commented May 10 '16, 9:57 a.m.
Does this mean that a clean close outside Eclipse should also invoke sharingManager.deregister(sandbox, progressMonitor); ? |
I found out that the problem is in version 4 SDK and is related to the implementation of IRepositoryResolver that seems buggy or not so right.
As I already have an ITeamRepository (obtained using the login functions) I ovverride the resolver method:
private IRepositoryResolver resolver = new IRepositoryResolver() {
So, if I use this resolver in the getCheckinOperation method it runs correctly.
Michele.
|
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.
Comments
I still have this problem. The thing is that I don't use directly CFA, but when I try to use ICheckInOperation it gives me a NPE because the CFA is null. I've find out that I could resolve this problem deleting and reloading the workspace using scmtools before to run another check-in. So it seems that after running an ICheckInOperation the workspace becomes instable. Is there any way to refresh some metadata in order to use it again without reload it?
Have you tried the approach mentioned in the first question? (ie use ISharingManager.getSandbox() to ensure the sandbox has been registered)