Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-05-24 03:22:17 -0400
committerEike Stepper2018-05-24 03:22:17 -0400
commit9d8a9199fbadbb125a1468d29b2480ca138696df (patch)
tree3146216d4ddb5390fcc817a43813f26aad5ca1c3
parentbc842e8edda8edaaf40c281760e7791af16075d4 (diff)
downloadcdo-9d8a9199fbadbb125a1468d29b2480ca138696df.tar.gz
cdo-9d8a9199fbadbb125a1468d29b2480ca138696df.tar.xz
cdo-9d8a9199fbadbb125a1468d29b2480ca138696df.zip
[502932] org.eclipse.emf.cdo.common.revision.CDORevisionUtil$Uninitialized cannot be cast to org.eclipse.emf.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=502932
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java42
2 files changed, 43 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
index 80097332ed..39574aea91 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
@@ -801,7 +801,7 @@ public class Repository extends Container<Object> implements InternalRepository,
if (unchunked)
{
- for (int i = chunkEnd + 1; i < size; i++)
+ for (int i = chunkEnd; i < size; i++)
{
if (list.get(i) == InternalCDOList.UNINITIALIZED)
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java
index a25cdc563b..f8fadd34bc 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Eike Stepper - initial API and implementation
+ * Bernd Fuhrmann - testEnsureChunk for bug 502932
*/
package org.eclipse.emf.cdo.tests;
@@ -410,4 +411,45 @@ public class ChunkingTest extends AbstractCDOTest
company.getCategories().add(category);
return category;
}
+
+ /**
+ * Bug 502932.
+ */
+ @Requires("DB")
+ public void testEnsureChunk() throws Exception
+ {
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("/test1"));
+ Company company1 = getModel1Factory().createCompany();
+ company1.setName("company1");
+ resource.getContents().add(company1);
+
+ Company company2 = getModel1Factory().createCompany();
+ company2.setName("company2");
+ resource.getContents().add(company2);
+ for (int i = 0; i < 3000; i++)
+ {
+ Customer customer = getModel1Factory().createCustomer();
+ customer.setName("customer" + i);
+ company2.getCustomers().add(customer);
+ }
+
+ transaction.commit();
+ session.close();
+ }
+
+ clearCache(getRepository().getRevisionManager());
+
+ CDOSession session = openSession();
+ session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(1, 10));
+ CDOView view = session.openView();
+ CDOResource resource = view.getResource(getResourcePath("/test1"));
+
+ Company company1 = (Company)resource.getContents().get(0);
+ Company company2 = (Company)resource.getContents().get(1);
+ company1.getCustomers();
+ company2.getCustomers().get(1);
+ }
}

Back to the top