private void setMaxCachedVanityPathEntries()

in src/main/java/org/apache/sling/launchpad/testservices/serversidetests/ResourceResolverWithVanityBloomFilterTest.java [146:158]


    private void setMaxCachedVanityPathEntries(long maxCachedVanityPathEntries) throws Exception{
        //FIXME: enabling bloom filter usage using reflection for now
        // we need to have a new mechanism to test different then default OSGi configurations
        Field commonFactory = resourceResolverFactory.getClass().getDeclaredField("commonFactory");
        commonFactory.setAccessible(true);
        Object commonResourceResolverFactoryImpl = commonFactory.get(resourceResolverFactory);        
        Field mapEntries = commonResourceResolverFactoryImpl.getClass().getDeclaredField("mapEntries");
        mapEntries.setAccessible(true);
        Object  mapEntriesObject = mapEntries.get(commonResourceResolverFactoryImpl);        
        Field maxCachedVanityPathEntriesField = mapEntriesObject.getClass().getDeclaredField("maxCachedVanityPathEntries");
        maxCachedVanityPathEntriesField.setAccessible(true); 
        maxCachedVanityPathEntriesField.setLong(mapEntriesObject, maxCachedVanityPathEntries);
    }