You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Paul Mietz Egli (JIRA)" <ji...@apache.org> on 2008/01/03 01:24:34 UTC

[jira] Created: (JCR-1285) ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object

ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object
-----------------------------------------------------------------------------------------------------------

                 Key: JCR-1285
                 URL: https://issues.apache.org/jira/browse/JCR-1285
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-ocm
    Affects Versions: 1.4
            Reporter: Paul Mietz Egli


When a query returns no objects, ObjectContentManagerImpl.getObject(Query) throws the following exception:

java.util.NoSuchElementException
        at java.util.AbstractList$Itr.next(AbstractList.java:427)
        at org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObject(ObjectContentManagerImpl.java:538)

Javadocs for ObjectContentManager interface suggest that a ObjectContentManagerException should be thrown in this case.

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


[jira] Assigned: (JCR-1285) ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object

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

Felix Meschberger reassigned JCR-1285:
--------------------------------------

    Assignee: Felix Meschberger

> ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1285
>                 URL: https://issues.apache.org/jira/browse/JCR-1285
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-ocm
>    Affects Versions: 1.4
>         Environment: jackrabbit-ocm-1.4-20071210.145858-1
> java version "1.5.0_13"
>            Reporter: Paul Mietz Egli
>            Assignee: Felix Meschberger
>         Attachments: ObjectContentManagerImpl.java.diff
>
>
> When a query returns no objects, ObjectContentManagerImpl.getObject(Query) throws the following exception:
> java.util.NoSuchElementException
>         at java.util.AbstractList$Itr.next(AbstractList.java:427)
>         at org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObject(ObjectContentManagerImpl.java:538)
> Javadocs for ObjectContentManager interface suggest that a ObjectContentManagerException should be thrown in this case.

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


[jira] Commented: (JCR-1285) ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555503#action_12555503 ] 

Felix Meschberger commented on JCR-1285:
----------------------------------------

Thanks for reporting and the patch. In fact the method is defined to return null if no object matches the query. Therefore I fix the issue as follows:

            return result.isEmpty() ? null : result.iterator().next();


> ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1285
>                 URL: https://issues.apache.org/jira/browse/JCR-1285
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-ocm
>    Affects Versions: 1.4
>         Environment: jackrabbit-ocm-1.4-20071210.145858-1
> java version "1.5.0_13"
>            Reporter: Paul Mietz Egli
>            Assignee: Felix Meschberger
>         Attachments: ObjectContentManagerImpl.java.diff
>
>
> When a query returns no objects, ObjectContentManagerImpl.getObject(Query) throws the following exception:
> java.util.NoSuchElementException
>         at java.util.AbstractList$Itr.next(AbstractList.java:427)
>         at org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObject(ObjectContentManagerImpl.java:538)
> Javadocs for ObjectContentManager interface suggest that a ObjectContentManagerException should be thrown in this case.

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


[jira] Resolved: (JCR-1285) ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object

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

Felix Meschberger resolved JCR-1285.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4

Fixed in Rev. 608382

Please close this issue if it solves your problem. Thanks.

> ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1285
>                 URL: https://issues.apache.org/jira/browse/JCR-1285
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-ocm
>    Affects Versions: 1.4
>         Environment: jackrabbit-ocm-1.4-20071210.145858-1
> java version "1.5.0_13"
>            Reporter: Paul Mietz Egli
>            Assignee: Felix Meschberger
>             Fix For: 1.4
>
>         Attachments: ObjectContentManagerImpl.java.diff
>
>
> When a query returns no objects, ObjectContentManagerImpl.getObject(Query) throws the following exception:
> java.util.NoSuchElementException
>         at java.util.AbstractList$Itr.next(AbstractList.java:427)
>         at org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObject(ObjectContentManagerImpl.java:538)
> Javadocs for ObjectContentManager interface suggest that a ObjectContentManagerException should be thrown in this case.

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


[jira] Updated: (JCR-1285) ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object

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

Paul Mietz Egli updated JCR-1285:
---------------------------------

    Environment: 
jackrabbit-ocm-1.4-20071210.145858-1
java version "1.5.0_13"



> ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1285
>                 URL: https://issues.apache.org/jira/browse/JCR-1285
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-ocm
>    Affects Versions: 1.4
>         Environment: jackrabbit-ocm-1.4-20071210.145858-1
> java version "1.5.0_13"
>            Reporter: Paul Mietz Egli
>         Attachments: ObjectContentManagerImpl.java.diff
>
>
> When a query returns no objects, ObjectContentManagerImpl.getObject(Query) throws the following exception:
> java.util.NoSuchElementException
>         at java.util.AbstractList$Itr.next(AbstractList.java:427)
>         at org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObject(ObjectContentManagerImpl.java:538)
> Javadocs for ObjectContentManager interface suggest that a ObjectContentManagerException should be thrown in this case.

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


[jira] Updated: (JCR-1285) ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object

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

Paul Mietz Egli updated JCR-1285:
---------------------------------

    Attachment: ObjectContentManagerImpl.java.diff

Suggested fix, though personally I'd be happy with a null return value as well.

> ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1285
>                 URL: https://issues.apache.org/jira/browse/JCR-1285
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-ocm
>    Affects Versions: 1.4
>            Reporter: Paul Mietz Egli
>         Attachments: ObjectContentManagerImpl.java.diff
>
>
> When a query returns no objects, ObjectContentManagerImpl.getObject(Query) throws the following exception:
> java.util.NoSuchElementException
>         at java.util.AbstractList$Itr.next(AbstractList.java:427)
>         at org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObject(ObjectContentManagerImpl.java:538)
> Javadocs for ObjectContentManager interface suggest that a ObjectContentManagerException should be thrown in this case.

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


[jira] Commented: (JCR-1285) ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object

Posted by "Paul Mietz Egli (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560472#action_12560472 ] 

Paul Mietz Egli commented on JCR-1285:
--------------------------------------

Changes in 1.4 work great, thanks!

> ObjectContentManagerImpl.getObject(Query) throws NoSuchElementException when query does not match an object
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-1285
>                 URL: https://issues.apache.org/jira/browse/JCR-1285
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-ocm
>    Affects Versions: 1.4
>         Environment: jackrabbit-ocm-1.4-20071210.145858-1
> java version "1.5.0_13"
>            Reporter: Paul Mietz Egli
>            Assignee: Felix Meschberger
>             Fix For: 1.4
>
>         Attachments: ObjectContentManagerImpl.java.diff
>
>
> When a query returns no objects, ObjectContentManagerImpl.getObject(Query) throws the following exception:
> java.util.NoSuchElementException
>         at java.util.AbstractList$Itr.next(AbstractList.java:427)
>         at org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObject(ObjectContentManagerImpl.java:538)
> Javadocs for ObjectContentManager interface suggest that a ObjectContentManagerException should be thrown in this case.

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