The Geotoolkit migrate module provides a tool to perform the straightforward changes to a Java code base to migrate that Java code from GeoTools to Geotoolkit.org. This helper tools renames classes and packages but does not handle changes in method signature. Once this tool is run, there will likely be remaining changes which will have to be ported by hand.
The tool makes the following changes. For every occurence of:
where gt is any GeoTools package and GT is any GeoTools class in that package, then if and only if that particular GT class has been ported to Geotoolkit, the following is applied:
where gto and GTO are usually identical to the above GeoTools names (gt and GT respectively), but not always. For example the package of WeakHashMap is org.geotools.util in GeoTools, but org.geotoolkit.util.collection in Geotk.
Note that those changes apply to GeoTools classes only; the GeoAPI interfaces are the same. Any code that use only the GeoAPI interfaces should be able to switch smoothly between GeoTools and Geotk.
The latest JAR is available from the Maven repository. It can be saved in any directory. Once downloaded, the migration tools is launched as below:
cd [ROOT DIRECTORY OF SOURCE CODE] java -jar [PATH TO THE JAR]/geotk-migrate.jar [OPTION]
where the [OPTION] can be:
The migrated files will overwrite the old ones - make sure to backup your files before to run geotk-migrate with the --migrate option. Or yet better, run this tool in a SVN or Mercurial local repository, so the changes can easily be inspected and reverted if needed.
See the summary of changes since GeoTools for an overview of conceptual changes.
See the common compiler errors for changes that can not be performed by the automatic tools. Those changes need to be applied manually.