Skip to content
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
8 changes: 5 additions & 3 deletions src/main/java/org/tdl/vireo/model/Submission.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ public class Submission extends ValidatingBaseEntity {
@JsonView(Views.SubmissionList.class)
private Map<Long, String> columnValues;

@Transient
private String committeeContactEmail;

public Submission() {
setModelValidator(new SubmissionValidator());
setFieldValues(new HashSet<FieldValue>());
Expand Down Expand Up @@ -603,17 +606,16 @@ public String getCommitteeContactEmail() {
Optional<FieldValue> optFv = this.getFieldValuesByPredicateValue("dc.contributor.advisor")
.stream()
.findFirst();
String email = null;
if (optFv.isPresent()) {
Optional<String> optEmail = optFv.get()
.getContacts()
.stream()
.findFirst();
if (optEmail.isPresent()) {
email = optEmail.get();
committeeContactEmail = optEmail.get();
}
}
return email;
return committeeContactEmail;
Comment on lines 614 to +618
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getCommitteeContactEmail() now caches into the committeeContactEmail field but never clears it when no advisor/contact is found. If the submission’s fieldValues change (or if a later call finds no email), this method can return a stale value from an earlier call. Consider recomputing into a local variable and assigning committeeContactEmail each call (including explicitly setting it back to null when not found) before returning.

Copilot uses AI. Check for mistakes.
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public ExcelExportPackage packageExport(Submission submission, List<SubmissionLi
if(column.getValuePath().size() > 1){
valuePath = new String[] {valuePath[0]};
}
submission.getCommitteeContactEmail();
Object valueAsObject = EntityUtility.getValueFromPath(submission, valuePath);

String value = "";
Expand Down
Loading