You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by Ross Gardler <rg...@apache.org> on 2009/09/22 16:36:16 UTC

Re: [jira] Commented: (WOOKIE-38) Confusion of what is/is not optional in config.xml

2009/9/22 Scott Wilson (JIRA) <ji...@apache.org>:
>
>    [ 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