Re: Question on returning instances of a (not exported) derived class

2016-08-26 Thread Peter Levart
Hi Martin, On 08/25/2016 02:03 PM, Martin Lehmann wrote: I am a bit confused here, as you mention toString() . But in case [3] getName() is not related to toString() – at least not that I can see. InternalData.getName() overwrites Data.getName() , both returning a hard-coded String as

Re: Question on returning instances of a (not exported) derived class

2016-08-26 Thread Sander Mak
Hi Martin, > On 25 Aug 2016, at 14:03, Martin Lehmann wrote: > > About case [2] you wrote > > * Are you sure you didn't have the toString() method overridden in > InternalData at time of compilation? > > Yes, I am sure. I agree, this should compile. At least this

RE: Question on returning instances of a (not exported) derived class

2016-08-25 Thread Martin Lehmann
ehm...@gmx.de>; jigsaw-dev@openjdk.java.net Subject: Re: Question on returning instances of a (not exported) derived class Hi Martin, Let me try to explain why... On 08/25/2016 08:56 AM, Martin Lehmann wrote: package pkgmain; import pkgx.*; public class Main { public static void main(

Re: Question on returning instances of a (not exported) derived class

2016-08-25 Thread Peter Levart
Hi Martin, Let me try to explain why... On 08/25/2016 08:56 AM, Martin Lehmann wrote: package pkgmain; import pkgx.*; public class Main { public static void main(String[] args) { DataFactory myDataFactory = new DataFactory(); // all OK System.out.println("Factory.createData(): "

Question on returning instances of a (not exported) derived class

2016-08-25 Thread Martin Lehmann
Hi all, I have a question on exporting packages and its handling with derived classes. Any help appreciated! In a module mod.x one package "pkgx" is exported containing 2 classes Data and DataFactory. Another package "pkgxinternal" is not exported and contains the class InternalData which is