[errorprone] Exceptions should not override #toString
Instead of overriding #toString provide getter for additional information so that code handling the exception can access it. See https://errorprone.info/bugpattern/OverrideThrowableToString Change-Id: Ie577ae9327e0234d55481253f2604b1644ea3f01
This commit is contained in:
parent
1e92426c5a
commit
978cbb84c4
|
@ -51,9 +51,4 @@ public void setPermanent(boolean permanent) {
|
|||
public boolean isPermanent() {
|
||||
return permanent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + ", permanent: " + permanent; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,8 +44,13 @@ public RevisionSyntaxException(String message, String revstr) {
|
|||
this.revstr = revstr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + ":" + revstr; //$NON-NLS-1$
|
||||
/**
|
||||
* Get the problematic revision string
|
||||
*
|
||||
* @return the problematic revision string
|
||||
* @since 6.8
|
||||
*/
|
||||
public String getRevstr() {
|
||||
return revstr;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue