set the old identifier before switching to the new one

This commit is contained in:
Claudio Atzori 2021-05-14 12:53:40 +02:00
parent 1bd70fa2c6
commit f19feceaf0
1 changed files with 1 additions and 2 deletions

View File

@ -105,12 +105,11 @@ case object Crossref2Oaf {
//is replaced using IdentifierFactory, but the old identifier //is replaced using IdentifierFactory, but the old identifier
//is preserved among the originalId(s) //is preserved among the originalId(s)
val oldId = generateIdentifier(result, doi) val oldId = generateIdentifier(result, doi)
result.setId(oldId)
val newId = IdentifierFactory.createIdentifier(result) val newId = IdentifierFactory.createIdentifier(result)
if (!oldId.equalsIgnoreCase(newId)) { if (!oldId.equalsIgnoreCase(newId)) {
result.getOriginalId.add(oldId) result.getOriginalId.add(oldId)
} }
result.setId(newId) result.setId(newId)
// Add DataInfo // Add DataInfo