Uploaded image for project: 'JBoss Cache'
  1. JBoss Cache
  2. JBCACHE-847

PojoCache didn't restore the Collection class reference correctly during removeObject()

    Details

    • Estimated Difficulty:
      Medium

      Description

      This is reported from a user post. Here is how to reproduce it:

      log_.info("testRemoveProxy() ....");
      Person test = new Person();
      test.setName("Ben");
      test.setAge(10);
      ArrayList list = new ArrayList();
      list.add("English");
      list.add("Taiwanese");
      test.setLanguages(list);
      cache_.putObject("/a", test);
      Person result = (Person)cache_.getObject("/a");
      assertEquals(" ", test, result);

      assertTrue("Instance of proxyclass ", result.getLanguages() instanceof ClassProxy);

      cache_.removeObject("/a");

      // This would fail
      assertFalse("Instance of proxyclass ", result.getLanguages() instanceof ClassProxy);

      This must be a bug introduced during the 1.4 optimization. We should restore the non-proxy reference to the languages list, for example.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ben.wang Ben Wang (Inactive)
                Reporter:
                ben.wang Ben Wang (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: