if (availableLanguages[i].equals(document.getLanguage())) {
newDocument = newLanguageVersion;
}
}
} catch (TransactionException e) {
throw new PublicationException(e);
} finally {
if (documentManager != null) {
this.manager.release(documentManager);
}
}