forked from D-Net/dnet-hadoop
bug fix in the result merge: it takes the correct bestaccessright basing on the license instead of the trust
This commit is contained in:
parent
babebbc9d3
commit
5a8bc329c5
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
package eu.dnetlib.dhp.schema.oaf;
|
package eu.dnetlib.dhp.schema.oaf;
|
||||||
|
|
||||||
|
import eu.dnetlib.dhp.schema.common.LicenseComparator;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
@ -245,7 +247,7 @@ public class Result extends OafEntity implements Serializable {
|
||||||
|
|
||||||
instance = mergeLists(instance, r.getInstance());
|
instance = mergeLists(instance, r.getInstance());
|
||||||
|
|
||||||
if (r.getBestaccessright() != null && compareTrust(this, r) < 0)
|
if (r.getBestaccessright() != null && new LicenseComparator().compare(r.getBestaccessright(), bestaccessright) < 0)
|
||||||
bestaccessright = r.getBestaccessright();
|
bestaccessright = r.getBestaccessright();
|
||||||
|
|
||||||
if (r.getResulttype() != null && compareTrust(this, r) < 0)
|
if (r.getResulttype() != null && compareTrust(this, r) < 0)
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class EntityMergerTest implements Serializable {
|
||||||
assertEquals(dedupId, pub_merged.getId());
|
assertEquals(dedupId, pub_merged.getId());
|
||||||
|
|
||||||
assertEquals(pub_merged.getJournal(), pub_top.getJournal());
|
assertEquals(pub_merged.getJournal(), pub_top.getJournal());
|
||||||
assertEquals(pub_merged.getBestaccessright(), pub_top.getBestaccessright());
|
assertEquals(pub_merged.getBestaccessright().getClassid(), "OPEN");
|
||||||
assertEquals(pub_merged.getResulttype(), pub_top.getResulttype());
|
assertEquals(pub_merged.getResulttype(), pub_top.getResulttype());
|
||||||
assertEquals(pub_merged.getLanguage(), pub_merged.getLanguage());
|
assertEquals(pub_merged.getLanguage(), pub_merged.getLanguage());
|
||||||
assertEquals(pub_merged.getPublisher(), pub_top.getPublisher());
|
assertEquals(pub_merged.getPublisher(), pub_top.getPublisher());
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue