JDK-8158004 : Node, Shape and Shape3D need meaningful runtime exception message when application directly extends these classes
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
OK. Thanks for the grammatical correction. Here is the revised webrev.01:
throw new UnsupportedOperationException(nodeType
+ "is not designed for extensibility by application.");
Missing a space after the node type. Also, to match the docs in JDK-8158006 I recommend something more like:
"Applications should not extend the " + nodeType + " class directly"
Can you similarly fix the messages in CameraHelper and LightBaseHelper to match? They are grammatically incorrect.
Please review the proposed fix: http://cr.openjdk.java.net/~ckyang/JDK-8158004/webrev.00/
Attached a simple test program
After the encapsulation work is done, if an application extends Node, Shape, or Shape3D directly, Node.getHelper will return null, which means that the caller of the NodeHelper with get an NPE. The task here will be to check for null in getHelper() itself and throw UnsupportedOperationError with a meaningful error message.