AbstractResultList.subList throws UnsupportedOperationException
---------------------------------------------------------------

                 Key: OPENJPA-1025
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1025
             Project: OpenJPA
          Issue Type: Bug
          Components: lib
    Affects Versions: 1.2.1, 1.3.0, 2.0.0
         Environment: 
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/rop/AbstractResultList.java?revision=757278&view=markup,
Seam 2.0, OpenJPA 1.2.1
            Reporter: Julien Kronegg


AbstractResultList implements the basics for readonly result lists. When 
calling the subList(int,int) method, the following exception is raised:

    java.lang.UnsupportedOperationException
    at 
org.apache.openjpa.lib.rop.AbstractResultList.subList(AbstractResultList.java:84)
    at 
org.apache.openjpa.kernel.DelegatingResultList.subList(DelegatingResultList.java:308)
    ...

Since the subList() method contract is to create a new List from the 
ResultList, this operation does not modify the original list.
Thus, the subList() method should not raise an exception but should return a 
new list such as:

    return new ArrayList(openjpaList).subList(from, to);

This problem is also found by other users: 
http://n2.nabble.com/DelegatingResultList.subList-not-implemented--td210389.html

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

Reply via email to