Community
Participate
Working Groups
Some of the API methods for manipulating repositories, profiles, etc. do not specify a return value nor do they throw an exception. IMetadataRepositoriesManager.getRepository(URL) IMetadataRepositoriesManager.removeRepository(repo) IArtifactRepoManager.addRepository(URL) IArtifactRepoManager.getRepository(URL, int) IArtifactRepoManager.removeRepository(repo) IProfileRegistry.addProfile(Profile) throws IllegalArgument if it is a duplicate, but has no exception for failure to add for other conditions IProfileRegistry.removeProfile(Profile) etc...etc... It would probably be best to spec that all of these can throw a ProvisionException?? That would be more in line with the way the resource API always throws a CoreException for any failures encountered, and allows the UI code to know what's going on. I'm less sure about where it is necessary/appropriate to define exceptions on the IU methods, since once you have a valid IU I don't know what errors may occur, but IFile should probably be used as a guide for making these decisions.
This bug is quite old. I reviewed the current API and most of the inconsistencies mentioned above were addressed during 3.4. The only suggestion remaining is: IRepositoryManager.addRepository(URI) - should indicate that this just affects the cache and that the validity of the URI or presence of the repo will not be checked until it is loaded (there is similar wording in setRepositoryProperty that could be used)
I have added works to that effect in the javadoc.