[ 
http://jira.codehaus.org/browse/GEOT-2717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matthias Lendholt reopened GEOT-2717:
-------------------------------------


Was not fixed so far. New patch will be attached.

> NPE during WPSFactory instantiation if ows:Abstract element is missing/null 
> in DescriptionType
> ----------------------------------------------------------------------------------------------
>
>                 Key: GEOT-2717
>                 URL: http://jira.codehaus.org/browse/GEOT-2717
>             Project: GeoTools
>          Issue Type: Bug
>          Components: new modules
>    Affects Versions: 2.6-M2
>            Reporter: Matthias Lendholt
>            Assignee: Jody Garnett
>            Priority: Minor
>             Fix For: 2.6-M3
>
>         Attachments: GEOT-2717.2nd.patch
>
>
> I got NullPointerExceptions creating a new WPSFactory. The first one 
> happens in org.geotools.data.wps.WPSFactory:
> private void buildValuesFromProcessDescriptionType():
> this.description = this.pdt.getAbstract().getValue();
> In net.opengis.wps10.impl.DescriptionTypeImpl getAbstract() returns 
> _abstract and I cannot see any checks that avoid returning null. Trying 
> .getValue() results in the NPE. Since the child element "ows:Abstract" 
> of "DescriptionType" is optional 
> (http://schemas.opengis.net/wps/1.0.0/common/DescriptionType.xsd) it 
> must be checked if null is returned or not. Like
> this.description = 
> this.pdt.getAbstract()==null?"":this.pdt.getAbstract().getValue();
> It's not up to me to decide whether an empty String "" or null for 
> this.description should be used. Using null will result in an 
> IllegalArgumentException in getDescription() during conversion into an 
> InternationalString object.
> The same problem in org.geotools.data.wps.WPSUtils twice:
> 1) createInputParamMap(..)
> Creating the new Parameter
> Parameter param = new Parameter(idt.getIdentifier().getValue(), type,
>                      Text.text(idt.getTitle().getValue()),
>                      Text.text(idt.getAbstract().getValue()), required,
>                      idt.getMinOccurs().intValue(), 
> idt.getMaxOccurs().intValue(),
>                      null, null);
> 2) createOutputParamMap(..)
>   Parameter param = new Parameter(odt.getIdentifier().getValue(), type,
>                      Text.text(odt.getTitle().getValue()),
>                      Text.text(odt.getAbstract().getValue()) );

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to