//Verify the mapping itself
try {
mapping.verify();
mapping.verifyMappedVersions( mappedVersions );
} catch ( VersionMismatchException e ) {
RuntimeException newException = new VersionMismatchException( e.getExpected(), e.getActual(), "Invalid mapping for <" + entry.getKey().getName() + ">: " + e.getMessage(), false );
newException.setStackTrace( e.getStackTrace() );
throw newException;
} catch ( UnsupportedVersionException e ) {
RuntimeException newException = new UnsupportedVersionException( e.getActual(), e.getSupportedRange(), "Invalid mapping for <" + entry.getKey().getName() + ">: " + e.getMessage(), false );
newException.setStackTrace( e.getStackTrace() );
throw newException;
}
//Check the write version
PluggableSerializer<?, S, D, E> serializer = getSerializer( entry.getKey() );
if ( !serializer.getFormatVersion().equals( mapping.getDelegateWriteVersion() ) ) {
throw new VersionMismatchException( serializer.getFormatVersion(), mapping.getDelegateWriteVersion(), "Invalid serialization/output version for <" + entry.getKey().getName() + ">. " );
}
}
return true;
}