Package org.geotools.util.factory
Class RecursiveSearchException
- Object
-
- Throwable
-
- Exception
-
- RuntimeException
-
- FactoryRegistryException
-
- RecursiveSearchException
-
- All Implemented Interfaces:
Serializable
public class RecursiveSearchException extends FactoryRegistryException
Thrown whenFactoryRegistryis invoked recursively for the same category. This exception is often the result of a programming error. It happen typically when an implementation of someFooFactoryinterface queries in their constructor, directly or indirectly,FactoryRegistry.getFactory(Class, Predicate, Hints, Hints.Key)} for the same category (namelyFooFactory.class). Factories implemented as wrappers around other factories of the same kind are the most likely to fall in this canvas. If thisRecursiveSearchExceptionwas not throw, the application would typically dies with aStackOverflowError.A workaround for this exception is to invoke
getServiceProvideroutside the constuctor, when a method first need it.- Since:
- 2.3
- Author:
- Martin Desruisseaux
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RecursiveSearchException(Class<?> category)Creates a new exception with a default message determined from the specified category.RecursiveSearchException(String message)Creates a new exception with the specified detail message.
-
Method Summary
-
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
RecursiveSearchException
public RecursiveSearchException(Class<?> category)
Creates a new exception with a default message determined from the specified category.
-
RecursiveSearchException
public RecursiveSearchException(String message)
Creates a new exception with the specified detail message.
-
-