mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 23:03:34 +02: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:
parent
8b297fa099
commit
527668c1b0
1 changed files with 4 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue