private void shutdownExecutorService()

in src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java [112:122]


    private void shutdownExecutorService(Object instance, String fieldName) {
        try {
            Field executorField = instance.getClass().getDeclaredField(fieldName);
            executorField.setAccessible(true);
            ExecutorService executor = (ExecutorService)executorField.get(instance);
            executor.shutdownNow();
        }
        catch (Throwable ex) {
            log.error("Potential Memory leak: Unable to shutdown executor service from field '" + fieldName + "' in " + instance, ex);
        }
    }