InKeySetFilter not working correctly with the filter that is not IndexAwareFilter

I found that InKeySetFilter works correctly with filter that does not implement IndexAwareFilter.

for example:
cache contains the Integer objects

cache.keySet (new InKeySetFilter (new ClassFilter (Integer.class), cache.keySet ())) //returns all elements

cache.keySet (new InKeySetFilter (new ClassFilter (String.class), cache.keySet ())) //also returns all the items

InKeySetFilter works the same way, not only with ClassFilter, but with a filter that is not IndexAware. It looks like a bug.

PS using coherence 3.5.3
Advertisement

Hi Serge,

Yes, there seems to be a bug, if m_filter isn't an IndexAwareFilter, applyIndex returns null instead of return m_filter.

With the help of the following subclass should solve this problem:

import java.util.Map;
import java.util.Set;

import com.tangosol.util.Filter;
import com.tangosol.util.filter.InKeySetFilter;
import com.tangosol.util.filter.IndexAwareFilter;

public class FixedInKeySetFilter extends InKeySetFilter {

   public FixedInKeySetFilter() {
   }

   public FixedInKeySetFilter(Filter filter, Set setKeys) {
      super(filter, setKeys);
   }

   public Filter applyIndex(Map mapIndexes, Set setKeys) {
      Filter filter = getFilter();
      Filter res = super.applyIndex(mapIndexes, setKeys);
      return setKeys.isEmpty() ? null : filter instanceof IndexAwareFilter ? res : filter;
   }
}

Best regards

Robert

Tags: Fusion Middleware

Similar Questions

Maybe you are looking for

  • Lock the position of the mask in FCPX?

    I have an image I want to move from right to left (I'm trying to simulate someone hit to swipe an image on their phone). But I need to be masked so that when the image is moved, it is not just move from one place to the screen to the other (it must b

  • Keep due to lack of updates of Windows Vista Edition Home Premium

    I have Windows Vista Home Premium SP1, and it is configured to search for and install updates automatically. I recently had to change this setting if the manual I received an update on the last update failure message try. The computer attempts to dow

  • VIXIA HF S100 low load Vid

    I forgot to insert my SD card and I Vid on the internal memory is it possible to download directly from Int Mem on Pc? as I did not find information in the manual or the FAQ section, I know that I can T railway from in-house to an SD card (when I fin

  • When you try to restore the system using the system image, Windows 7 does not find the USB HDD.

    I have 3 computers backed up with their images of system on an external USB drive. However, when you try to restore a computer using system image, Windows 7 fails to find the USB HDD. I think it would be probably due to the fact that the WindowsImage

  • Attribute RADIUS 198

    Hello I try to get the attribute radius 198 of the access router with ios 12.3 (AS5300, C2610) remotely. With 'debug RADIUS' following output apears: * 01:06:02.679 Mar 1: RADIUS: Acct-Session-Id [44] 10 "00000009. * 01:06:02.679 Mar 1: RADIUS: Frame