//System.out.println("DEBUG: "+version.toString());
if (_versionNameIndex.containsKey(version.name())) {
throw new WikiTimeException(WikiTimeException.DuplicateVersion, "Version " + version.name() + " already exists");
}
if (version.number() != (_versionList.size() + 1)) {
throw new WikiFatalException("Invalid version number " + version.number() + ". Expected number is " + (_versionList.size() + 1));
}
_versionList.add(version);
_versionNameIndex.put(version.name(), version);
}