Package org.jboss.aop.array

Examples of org.jboss.aop.array.ArrayRegistry$ArrayRegistryEntryFactory


      assertNull(references);
   }

   public void testNestedReferencesRemoveAtHigherLevel()
   {
      ArrayRegistry registry = ArrayRegistry.getInstance();
      int[] arr = new int[] {1, 2, 3};
      ClassForReference obj = new ClassForReference();
      Object[][][][] fieldA = new Object[][][][] {null, null, new Object[][][] {null, new Object[][] {null, null, new Object[] {null, null, null, arr}}}}; //2, 1, 2, 3
      obj.fieldA = fieldA;

      List<ArrayReference> references = registry.getArrayOwners(arr);
     
      assertEquals(1, references.size());
     
      ArrayReference reference = references.get(0);
      assertEquals(obj, reference.getRootObject());
      assertEquals("fieldA", reference.getRootField());
      assertEquals(4, reference.getNestedArrayIndices().size());
      assertEquals(new Integer(2), reference.getNestedArrayIndices().get(0));
      assertEquals(new Integer(1), reference.getNestedArrayIndices().get(1));
      assertEquals(new Integer(2), reference.getNestedArrayIndices().get(2));
      assertEquals(new Integer(3), reference.getNestedArrayIndices().get(3));

      fieldA[2][1] = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
View Full Code Here

TOP

Related Classes of org.jboss.aop.array.ArrayRegistry$ArrayRegistryEntryFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.