Skip to content

Commit

Permalink
Merge pull request #6899 from ORCID/8716-source-sorting-option
Browse files Browse the repository at this point in the history
fix: Update isSelfAsserted method in funding and fix NPE in peer review
  • Loading branch information
amontenegro authored Oct 3, 2023
2 parents ee4ca57 + 3345630 commit 180e275
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,4 @@ public Boolean hasPublicPeerReviews(String orcid) {
return peerReviewDao.hasPublicPeerReviews(orcid);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.orcid.jaxb.model.v3.release.record.summary.WorkSummary;
import org.orcid.jaxb.model.v3.release.record.summary.Works;
import org.orcid.pojo.ajaxForm.AffiliationForm;
import org.orcid.pojo.ajaxForm.FundingForm;
import org.orcid.pojo.ajaxForm.PojoUtil;

import java.util.List;
Expand Down Expand Up @@ -323,7 +324,7 @@ public static boolean isSelfAsserted(AffiliationForm af, String orcid) {
return (orcid.equals(af.getSource()) || orcid.equals(af.getAssertionOriginOrcid()));
}

public static boolean isSelfAsserted(String source, String orcid) {
return !orcid.equals(source);
public static boolean isSelfAsserted(FundingForm ff, String orcid) {
return (orcid.equals(ff.getSource()) || orcid.equals(ff.getAssertionOriginOrcid()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@ public Comparator<FundingGroup> getInstance(String key, boolean sortAsc, String
public Comparator<FundingGroup> SOURCE_COMPARATOR = (g1, g2) -> Boolean.compare(isSelfAsserted(g1), isSelfAsserted(g2));

private boolean isSelfAsserted(FundingGroup fundingGroup) {
return SourceUtils.isSelfAsserted(fundingGroup.getSource(), orcid);
return SourceUtils.isSelfAsserted(fundingGroup.getDefaultFunding(), orcid);
}
}

0 comments on commit 180e275

Please sign in to comment.