jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-800) EffectiveType#getTypeNames may throw NPE
Date Wed, 01 May 2013 09:06:15 GMT

    [ https://issues.apache.org/jira/browse/OAK-800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13646472#comment-13646472

Jukka Zitting commented on OAK-800:

FTR, here's a code snippet that we could use in {{TypeEditorProvider}} to do in-memory type
compilation when needed:

if (!types.getChildNode(NT_BASE).hasProperty(OAK_SUPERTYPES)) {
    NodeBuilder typesBuilder = types.builder();
    RegistrationEditor editor = new RegistrationEditor(typesBuilder);
    EditorDiff.process(editor, MISSING_NODE, types);
    types = typesBuilder.getNodeState();

bq. Probably that's also part of a broader discussion on migration from JR to Oak.

Agreed. Let's follow up on oak-dev@ and/or other issues.
> EffectiveType#getTypeNames may throw NPE
> ----------------------------------------
>                 Key: OAK-800
>                 URL: https://issues.apache.org/jira/browse/OAK-800
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>            Reporter: Tommaso Teofili
>            Assignee: Tommaso Teofili
>            Priority: Minor
>             Fix For: 0.7
> _EffectiveType#getTypeNames_ may throw NPE if any of the types doesn't have _oak:supertypes_
property defined.
> At line 200: 
> {code}
>     Iterables.addAll(names, type.getProperty("oak:supertypes").getValue(NAMES));
> {code}
> where _type.getProperty("oak:supertypes")_ may be _null_ (as per _@CheckForNull_ annotation
on _NodeState#getProperty(String name)_).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message