fixing compilation errors - STEMLab/geotools GitHub Wiki
The transition to Java 5 allows us to add generic types in GeoTools code base. This addition is usually transparent. However there is a few cases where it may cause compilation failures. This page list the errors and how to fix them.
In codes like below:
FactoryRegistry registry = new FactoryCreator(Arrays.asList(new Class[] {
MyFactorySpi.class
}));
The new Class[]
statement needs to be replaced by new Class<?>[]
.
Replace the call to new Hints(null)
by new Hints()
.
This exception was deprecated in GeoTools 2.4 and replaced by FactoryRegistryException
.
This method was deprecated in GeoTools 2.4 and replaced by
getServiceProviders(Class, Filter, Hints)
. Just adding two null
arguments will be enough. We
made those arguments mandatory (even if null
) in order to remind developpers to always pass user's
Hints
if they known them.