Replaced MathRuntimeException in util package.

JIRA: MATH-459

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1240280 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2012-02-03 18:19:21 +00:00
parent 6aeda4dcf2
commit 1388bd7015
1 changed files with 6 additions and 8 deletions

View File

@ -25,8 +25,6 @@ import java.util.NoSuchElementException;
import org.apache.commons.math.Field; import org.apache.commons.math.Field;
import org.apache.commons.math.FieldElement; import org.apache.commons.math.FieldElement;
import org.apache.commons.math.MathRuntimeException;
import org.apache.commons.math.exception.util.LocalizedFormats;
/** /**
* Open addressed map from int to FieldElement. * Open addressed map from int to FieldElement.
@ -539,10 +537,10 @@ public class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Seriali
public int key() public int key()
throws ConcurrentModificationException, NoSuchElementException { throws ConcurrentModificationException, NoSuchElementException {
if (referenceCount != count) { if (referenceCount != count) {
throw MathRuntimeException.createConcurrentModificationException(LocalizedFormats.MAP_MODIFIED_WHILE_ITERATING); throw new ConcurrentModificationException();
} }
if (current < 0) { if (current < 0) {
throw MathRuntimeException.createNoSuchElementException(LocalizedFormats.ITERATOR_EXHAUSTED); throw new NoSuchElementException();
} }
return keys[current]; return keys[current];
} }
@ -556,10 +554,10 @@ public class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Seriali
public T value() public T value()
throws ConcurrentModificationException, NoSuchElementException { throws ConcurrentModificationException, NoSuchElementException {
if (referenceCount != count) { if (referenceCount != count) {
throw MathRuntimeException.createConcurrentModificationException(LocalizedFormats.MAP_MODIFIED_WHILE_ITERATING); throw new ConcurrentModificationException();
} }
if (current < 0) { if (current < 0) {
throw MathRuntimeException.createNoSuchElementException(LocalizedFormats.ITERATOR_EXHAUSTED); throw new NoSuchElementException();
} }
return values[current]; return values[current];
} }
@ -573,7 +571,7 @@ public class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Seriali
throws ConcurrentModificationException, NoSuchElementException { throws ConcurrentModificationException, NoSuchElementException {
if (referenceCount != count) { if (referenceCount != count) {
throw MathRuntimeException.createConcurrentModificationException(LocalizedFormats.MAP_MODIFIED_WHILE_ITERATING); throw new ConcurrentModificationException();
} }
// advance on step // advance on step
@ -587,7 +585,7 @@ public class OpenIntToFieldHashMap<T extends FieldElement<T>> implements Seriali
} catch (ArrayIndexOutOfBoundsException e) { } catch (ArrayIndexOutOfBoundsException e) {
next = -2; next = -2;
if (current < 0) { if (current < 0) {
throw MathRuntimeException.createNoSuchElementException(LocalizedFormats.ITERATOR_EXHAUSTED); throw new NoSuchElementException();
} }
} }