private void replaceRegistration(ClassPath[] newPaths) {
GlobalPathRegistry registry = GlobalPathRegistry.getDefault();
ClassPath[] oldPaths = paths.getAndSet(newPaths);
if (oldPaths != null) {
registry.unregister(type, oldPaths);
}
if (newPaths != null) {
registry.register(type, newPaths);
}
}