ComplexTypeImpl.getDescriptor(String) is too strict
---------------------------------------------------

                 Key: GEOT-3285
                 URL: http://jira.codehaus.org/browse/GEOT-3285
             Project: GeoTools
          Issue Type: Improvement
    Affects Versions: 2.7-M3
            Reporter: Andrea Aime
            Assignee: Ben Caradoc-Davies
             Fix For: 2.7-M4
         Attachments: GEOT-3285.patch

The method implementation just goes looking for a unqualified attribute name in 
the property map.
That is wrong, because the map contains qualified attributes.

The Javadoc for that method says:

{panel}
     * Describe a single property by unqualified name.
     * <p>
     * Note: Special care should be taken when using this method in the case
     * that two properties with the same local name but different namespace uri
     * exist. For this reason using {...@link #getDescriptor(Name)} is safer.
{panel}

While not direct, the note clearly implies the attribute should try to match 
the attribute name with the local name of the type attributes.
This approach is also seen in ComplexAttributeImpl.

The attached patch solves the issue by making two indexed accesses and then a 
linear scan: tries unqualified, qualified by the same namespace as the feature, 
and then linear scan through the attributes

-- 
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

        

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to