JDK-8158004 : Node, Shape and Shape3D need meaningful runtime exception message when application directly extends these classes
  • Type: Bug
  • Component: javafx
  • Sub-Component: scenegraph
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-05-26
  • Updated: 2017-05-11
  • Resolved: 2016-06-24
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.

To download the current JDK release, click here.
Related Reports
Blocks :  
We need to provide meaningful runtime exception message on Node, Shape and Shape3D when  the impl_ encapsulation work is done ( JDK-8144585 ).


Changeset: 11ac266f4614 Author: ckyang Date: 2016-06-24 13:29 -0700 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/11ac266f4614

OK. Thanks for the grammatical correction. Here is the revised webrev.01: http://cr.openjdk.java.net/~ckyang/JDK-8158004/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.