2009/9/22 Scott Wilson (JIRA) <[email protected]>:
>
>    [ 
> https://issues.apache.org/jira/browse/WOOKIE-38?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12758248#action_12758248
>  ]
>
> Scott Wilson commented on WOOKIE-38:
> ------------------------------------
>
> Author certainly is optional in the spec; and throwing Null Pointer isn't 
> correct.
>
> So the question would be what is a reasonable thing to store where none is 
> specified - Null? Empty string? "Unknown"?

I'd suggest "Unknown", but ensure it is configrable (via the i18n
stuff makes sense) so people can change it easily.

Ross

>
>
>> Confusion of what is/is not optional in config.xml
>> --------------------------------------------------
>>
>>                 Key: WOOKIE-38
>>                 URL: https://issues.apache.org/jira/browse/WOOKIE-38
>>             Project: Wookie
>>          Issue Type: Bug
>>          Components: Server
>>            Reporter: Ross Gardler
>>            Priority: Minor
>>   Original Estimate: 3h
>>  Remaining Estimate: 3h
>>
>> in WidgetManifestModel we have a method:
>> public void fromXML(Element element) throws BadManifestException
>> This method reads the manfest information from the config.xml file
>> In that method all properties are marked as optional with comments such as:
>> // AUTHOR IS OPTIONAL - can only be one
>> However, if a widget does not specify the author then a null pointer 
>> exception is thrown by when trying to access the author information.
>> It is easy to place a null pointer guard on these properties, but are they 
>> optional or not? If they are optional what should we do when no value is 
>> supplied (default value, empty string?)
>> If they are not optional the fromXML method needs to throw a 
>> BadManifestExcpetion
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>



-- 
Ross Gardler

OSS Watch - supporting open source in education and research
http://www.oss-watch.ac.uk

Reply via email to