JDK support for VM to read classes from modules in a module library

Paul Sandoz paul.sandoz at oracle.com
Thu May 10 02:51:39 PDT 2012


On May 10, 2012, at 11:36 AM, David Holmes wrote:

> On 10/05/2012 6:49 PM, Paul Sandoz wrote:
>> On May 9, 2012, at 6:52 PM, Mandy Chung wrote:
>>>> [*] i must admit to never quite understanding what this flag means.
>>>> Java doc states that for initialize parameter "whether the class must be initialized". Is that a constraint or an action? I presume the later.
>>> 
>>> Yes, the later - that indicates whether the class static initializer will be invoked or not.
>>> 
>> 
>> Could we update the JavaDoc :-)
>> 
>> @param initialize if true the class will be initialized (specifically the class static initializer will be invoked) [refer to errors on initialization], otherwise the class is not initialized [refer to when it will be initialized].
> 
> A better update in my opinion would be to simply say:
> 
> @param initialize if true the class will be initialized - see JLS 12.4
> 
> Seriously, anyone using API's for explicit class loading should have read about classloading and initialization -

In an ideal world yes, in the real world most developers don't. I agree pointing to the JLS is a good idea.


> we're doing them a favour by pointing them to the JLS if they don't understand what class initialization is.
> 

IMO "favor" is the wrong perspective to look at this.

It costs us very little to write some helpful sentence or two (plus a strong recommendation to read relevant JLS section) and it can go a long way to aid developers understanding and reduce errors without requiring them to wade into the JLS.

Paul.


More information about the jigsaw-dev mailing list