mirror of
https://github.com/google/nomulus
synced 2026-07-19 22:42:23 +00:00
Remove infinite recursion in HistoryEntrySubject
The HistoryEntrySubject.actualCustomStringRepresentation() was calling a superclass method which ultimately called HistoryEntrySubject.actualCustomStringRepresentation(). So any test which failed due to a HistoryEntry problem resulted in a stack overflow error instead of a more helpful error indicating the actual problem. The solution is not to call the superclass method. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=143702856
This commit is contained in:
@@ -40,7 +40,10 @@ public class HistoryEntrySubject extends Subject<HistoryEntrySubject, HistoryEnt
|
||||
|
||||
@Override
|
||||
public String actualCustomStringRepresentation() {
|
||||
return Optional.fromNullable(customDisplaySubject).or(super.actualAsString());
|
||||
// This will unfortunately not use the customName field in the superclass, but we can't call
|
||||
// super.actualAsString(), because as currently implemented, it would result in an infinite
|
||||
// recursion.
|
||||
return Optional.fromNullable(customDisplaySubject).or(String.valueOf(actual()));
|
||||
}
|
||||
|
||||
public HistoryEntrySubject withCustomDisplaySubject(String customDisplaySubject) {
|
||||
|
||||
Reference in New Issue
Block a user