Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update isSelfAsserted method in funding and fix NPE in peer review #6899

Merged
merged 2 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}