/** * Returns {@code true} if the specified factory is available. */ private boolean isAvailable(final Object provider) { if (!(provider instanceof OptionalFactory)) { return true; } final OptionalFactory factory = (OptionalFactory) provider; final Class type = factory.getClass(); if (!testingAvailability.add(type)) { throw new RecursiveSearchException(type); } try { return factory.isAvailable(); } finally { if (!testingAvailability.remove(type)) { throw new AssertionError(type); // Should never happen. } } }
/** * Returns {@code true} if the specified factory is available. */ private boolean isAvailable(final Object provider) { if (!(provider instanceof OptionalFactory)) { return true; } final OptionalFactory factory = (OptionalFactory) provider; final Class<? extends OptionalFactory> type = factory.getClass(); if (!testingAvailability.addAndCheck(type)) { throw new RecursiveSearchException(type); } try { return factory.isAvailable(); } finally { testingAvailability.removeAndCheck(type); } }
throw new RecursiveSearchException(category);
throw new RecursiveSearchException(category);
throw new RecursiveSearchException(category);
throw new RecursiveSearchException(category);
throw new RecursiveSearchException(category);
throw new RecursiveSearchException(category);