Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-5653

keySet().iterator() does not propagate flags to remove()

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Calling remove() on iterator obtained through keySet() does not propagate flags from the original (decorated) cache. Test case (should go into BaseEntryRetrieverTest):

         @Test
         public void simpleTestWithFlags() {
            Map<Object, String> values = putValuesInCache();
      
            final Cache<Object, Object> cache = cache(0, CACHE_NAME);
            cache.getAdvancedCache().addInterceptor(new BaseCustomInterceptor() {
               @Override
               public Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command) throws Throwable {
                  assertTrue(command.hasFlag(Flag.SKIP_CACHE_STORE));
                  return super.visitRemoveCommand(ctx, command);
               }
            }, 0);
            for (Iterator it = cache(0, CACHE_NAME).getAdvancedCache().withFlags(Flag.SKIP_CACHE_STORE).keySet().iterator(); it.hasNext();) {
               assertTrue(values.containsKey(it.next()));
               it.remove();
            }
         }
      

              wburns@redhat.com Will Burns
              rvansa1@redhat.com Radim Vansa (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: