From: Jeff A. <ja...@fa...> - 2018-04-05 20:29:08
|
Java 9 is throwing us an interesting problem. This will be an issue wherever the factory pattern is used, and the actual class of object handed out may be a private implementation class not exported to the unnamed module. It's a common pattern. In Java, the compile-time type of the object is the public type the factory method returns. The implementation type extends or implements that "API" type, and it is the public methods of the API type that the compiled code references. In Jython, we end up trying to reference the implementation mthods directly. Java 9 forbids this, or at least grumbles about it unattractively. I have an idea to resolve it, but it alters the Python type of a Java class. Could be good or bad. What do others think? More in the text of the issue. http://bugs.jython.org/issue2662 -- Jeff Allen |