How does one handle a java method which returns a non-public sub-type via reflection?
jeffrey kutcher
jeffrey_kutcher at yahoo.com
Thu Jan 25 21:54:31 UTC 2018
VBox class hierarchy shows getChildren() are implemented in Parentand Pane. vbox.getChildren() returns an instance of Parent which isprotected rather than public found in Pane. Accessing the Listreturned by Parent is an illegal reference because it is protectedwhile accessing the List returned by Pane should be legal, butthis isn't whats returned.
VBox Class Hierarchy:
java.lang.Objectjavafx.scene.Nodejavafx.scene.Parent -> protected ObservableList<Node> getChildren()javafx.scene.layout.Regionjavafx.scene.layout.Pane -> public ObservableList<Node> getChildren()javafx.scene.layout.VBox
Class instance of vbox.getChildren() is:
vbox.getChildren().getClass() -> class javafx.scene.Parent$3
Pane is widening the access restrictions of Parent. Is this intentional?Does it have any effect? Should Parent's access restrictions of getChildren()be public also or should Pane's be protected?
My thought is public for both.
More information about the jigsaw-dev
mailing list