use consistent rethrow for impossible CloneNotSupportedException

This commit is contained in:
Anton Keks 2016-01-12 22:17:15 +02:00
parent eeaee75b26
commit ea4e0eea7b
2 changed files with 2 additions and 4 deletions

View File

@ -96,8 +96,7 @@ public final class PortIterator implements Iterator<Integer>, Cloneable {
return (PortIterator) super.clone();
}
catch (CloneNotSupportedException e) {
assert false : "this should never happen";
return null;
throw new RuntimeException(e);
}
}

View File

@ -50,8 +50,7 @@ public abstract class AbstractExporter implements Exporter {
return (Exporter) super.clone();
}
catch (CloneNotSupportedException e) {
// this cannot happen
return null;
throw new RuntimeException(e);
}
}
}