Modular Java and the accessibility of methods

Jeff Allen <[email protected]>
Newsgroups gmane.comp.lang.jython.devel
Message-ID <[email protected]>
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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.