Community
Participate
Working Groups
20080430-0100 In v_856, the spec of JavaModelException was changed: Old: * This class is not intended to be subclassed by clients. Instances of this * class are automatically created by the Java model when problems arise, so * there is generally no need for clients to create instances. New: * @noinstantiate This class is not intended to be instantiated by clients. * @noextend This class is not intended to be subclassed by clients. The old one did not forbid instantiating, only mentioning that there 'generally no need'. The new spec says 'noinstantiate'. We have several places in refactoring where JavaModelExceptions are instanciated using the jdt.core error constants. Note that such fine differences are hard to detect as the old comment got replaces by the new tags. I think it's better to keep the old comment so it's easy to see that the change is not a change of rules.
The contract was not extracted from the comment, but from the component.xml. I agree that this contract was not obvious to clients, but the intent has never been to allow clients to instanciate this class.
I can't really say if it was a good idea to instantiate JavaModelException. But what's important here is what the Javadoc on the type declaration said. The component.xml is overruled by that in case of a conflict.
(In reply to comment #0) > Note that such fine differences are hard to detect as the old comment got > replaces by the new tags. I think it's better to keep the old comment so it's > easy to see that the change is not a change of rules. Actually I'm still seeing the old comment in I20080430-0100: * Instances of this class are automatically created by the Java model * when problems arise, so there is generally no need for clients to create * instances.
The "@noinstantiate This class is not intended to be instantiated by clients" will trigger the API usage error. I can remove that line if Jérôme agrees. As Jérôme mentioned, it comes from the component.xml file. The old specification didn't explicitly forbid to create instances. * Instances of this class are automatically created by the Java model * when problems arise, so there is generally no need for clients to create * instances. So we should remove the @noinstantiate. Jérôme, Philippe ?
If we are saying that the Javadoc takes precedence over the component.xml, then I agree we should remove @noinstanciate.
Jérôme, +1 for 3.4RC1?
+1
Created attachment 98696 [details] Proposed fix
Jérôme, please review patch. Thanks.
Released for 3.4RC1.
Verified for 3.4RC1 using I20080510-2000