You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Dave Brosius (JIRA)" <ji...@apache.org> on 2008/04/15 06:21:05 UTC

[jira] Created: (JCR-1538) [patch] add toString for NodeImpl and PropertyImpl

[patch] add toString for NodeImpl and PropertyImpl
--------------------------------------------------

                 Key: JCR-1538
                 URL: https://issues.apache.org/jira/browse/JCR-1538
             Project: Jackrabbit
          Issue Type: Improvement
          Components: jackrabbit-core
    Affects Versions: core 1.4.2
            Reporter: Dave Brosius
            Priority: Trivial
             Fix For: 1.5
         Attachments: node_and_property_toString.patch

add toString for NodeImpl and PropertyImpl with new format. see how it is liked, before adding more.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1538) [patch] add toString for NodeImpl and PropertyImpl

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-1538:
-------------------------------

    Remaining Estimate: 0h
     Original Estimate: 0h

I made some related but less complex improvements in revisions 691296 and 691305. All items now return their type ("node" or "property") and (safe) path as the toString() output.

> [patch] add toString for NodeImpl and PropertyImpl
> --------------------------------------------------
>
>                 Key: JCR-1538
>                 URL: https://issues.apache.org/jira/browse/JCR-1538
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.2
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 1.5
>
>         Attachments: node_and_property_toString.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> add toString for NodeImpl and PropertyImpl with new format. see how it is liked, before adding more.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1538) [patch] add toString for NodeImpl and PropertyImpl

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588937#action_12588937 ] 

Tobias Bocanegra commented on JCR-1538:
---------------------------------------

i agree with thomas that only methods should be used that do not throw an exception and do not alter the state (item.getName() does).



> [patch] add toString for NodeImpl and PropertyImpl
> --------------------------------------------------
>
>                 Key: JCR-1538
>                 URL: https://issues.apache.org/jira/browse/JCR-1538
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.2
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 1.5
>
>         Attachments: node_and_property_toString.patch
>
>
> add toString for NodeImpl and PropertyImpl with new format. see how it is liked, before adding more.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1538) [patch] add toString for NodeImpl and PropertyImpl

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588949#action_12588949 ] 

Marcel Reutegger commented on JCR-1538:
---------------------------------------

I would also stay away from resolving namespaces, but return the namespace URI and the local name of a Name. Well, that actually means calling toString() on a Name ;), which is probably a good pattern.

> [patch] add toString for NodeImpl and PropertyImpl
> --------------------------------------------------
>
>                 Key: JCR-1538
>                 URL: https://issues.apache.org/jira/browse/JCR-1538
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.2
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 1.5
>
>         Attachments: node_and_property_toString.patch
>
>
> add toString for NodeImpl and PropertyImpl with new format. see how it is liked, before adding more.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-1538) [patch] add toString for NodeImpl and PropertyImpl

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting resolved JCR-1538.
--------------------------------

    Resolution: Fixed
      Assignee: Jukka Zitting

Completed in revision 698402. All ItemImpl descendants now have toString() methods that return a string like "<type> <path>" using safeGetJCRPath for the path part.

Also, I replaced all calls to safeGetJCRPath() with the toString() method in diagnostics output. The result is more readable, for example:

    "failed to add property " + name + " to " + safeGetJCRPath()

vs.

    "failed to add property " + name + " to " + this



> [patch] add toString for NodeImpl and PropertyImpl
> --------------------------------------------------
>
>                 Key: JCR-1538
>                 URL: https://issues.apache.org/jira/browse/JCR-1538
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.2
>            Reporter: Dave Brosius
>            Assignee: Jukka Zitting
>            Priority: Trivial
>             Fix For: 1.5
>
>         Attachments: node_and_property_toString.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> add toString for NodeImpl and PropertyImpl with new format. see how it is liked, before adding more.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1538) [patch] add toString for NodeImpl and PropertyImpl

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634047#action_12634047 ] 

Jukka Zitting commented on JCR-1538:
------------------------------------

> "failed to add property " + name + " to " + this

Wouldn't it be nice if Java supported stuff like "failed to add property ${name} to ${this}". Perhaps we should switch to Groovy. ;-)

> [patch] add toString for NodeImpl and PropertyImpl
> --------------------------------------------------
>
>                 Key: JCR-1538
>                 URL: https://issues.apache.org/jira/browse/JCR-1538
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.2
>            Reporter: Dave Brosius
>            Assignee: Jukka Zitting
>            Priority: Trivial
>             Fix For: 1.5
>
>         Attachments: node_and_property_toString.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> add toString for NodeImpl and PropertyImpl with new format. see how it is liked, before adding more.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1538) [patch] add toString for NodeImpl and PropertyImpl

Posted by "Dave Brosius (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Brosius updated JCR-1538:
------------------------------

    Attachment: node_and_property_toString.patch

> [patch] add toString for NodeImpl and PropertyImpl
> --------------------------------------------------
>
>                 Key: JCR-1538
>                 URL: https://issues.apache.org/jira/browse/JCR-1538
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.2
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 1.5
>
>         Attachments: node_and_property_toString.patch
>
>
> add toString for NodeImpl and PropertyImpl with new format. see how it is liked, before adding more.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1538) [patch] add toString for NodeImpl and PropertyImpl

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588936#action_12588936 ] 

Thomas Mueller commented on JCR-1538:
-------------------------------------

Hi,

The patch looks good, but maybe it can still be improved. Your implementation calls quite heavyweight methods that can throw RepositoryException. Maybe they throw unchecked exceptions as well (I recently had a problem with NullPointerException  in a toString() method). Catching Exception instead of just RepositoryException would be safer I guess. What about appending super.toString() in all cases (even if no exception occurs)? That way, you could detect it's the same object before and after the session is closed.

Regards,
Thomas

> [patch] add toString for NodeImpl and PropertyImpl
> --------------------------------------------------
>
>                 Key: JCR-1538
>                 URL: https://issues.apache.org/jira/browse/JCR-1538
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.2
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 1.5
>
>         Attachments: node_and_property_toString.patch
>
>
> add toString for NodeImpl and PropertyImpl with new format. see how it is liked, before adding more.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.