Fixes #889 - ConstantThrowable.name can be removed.

This commit is contained in:
Simone Bordet 2016-08-31 12:25:19 +02:00
parent f856107301
commit e0c83757aa
1 changed files with 10 additions and 11 deletions

View File

@ -22,22 +22,21 @@ package org.eclipse.jetty.util;
* A {@link Throwable} that may be used in static contexts. It uses Java 7
* constructor that prevents setting stackTrace inside exception object.
*/
public class ConstantThrowable extends Throwable {
private String name;
public ConstantThrowable() {
public class ConstantThrowable extends Throwable
{
public ConstantThrowable()
{
this(null);
}
public ConstantThrowable(String name) {
super(null, null, false, false);
this.name = name;
public ConstantThrowable(String name)
{
super(name, null, false, false);
}
@Override
public String toString() {
return name;
public String toString()
{
return String.valueOf(getMessage());
}
}