jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JCR-3163) NPE in RepositoryServiceImpl.getPropertyInfo()
Date Wed, 30 Nov 2011 21:37:40 GMT
NPE in RepositoryServiceImpl.getPropertyInfo()
----------------------------------------------

                 Key: JCR-3163
                 URL: https://issues.apache.org/jira/browse/JCR-3163
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-spi2dav
    Affects Versions: 2.3.4, 2.3.3
            Reporter: Tobias Bocanegra
             Fix For: 2.4


under unknown conditions, i get a NPE in get property info, such as the 'getValue()' of the
getstring dav property is null:

            } else if (props.contains(JCR_GET_STRING)) {
                // single valued non-binary property
                String str = props.get(JCR_GET_STRING).getValue().toString();
                QValue qValue = ValueFormat.getQValue(str, propertyType, getNamePathResolver(sessionInfo),
getQValueFactory(sessionInfo));
                return new PropertyInfoImpl(propertyId, p, propertyType, qValue);
            } else {

the other properties in the propset are:
 - getstring: null
 - type: String
 - length: 0

the property in question is the last property of a node and it's an empty string. the error
only occurs on certain usage patterns, but consistently. maybe depending on the fetch-depth
or internal cache.

extending the check to:
            } else if (props.contains(JCR_GET_STRING) && props.get(JCR_GET_STRING).getValue()
!= null) {

solves the problem.
 


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message