Map NoSuchElementException to InvalidOperationException

This commit is contained in:
Sam Harwell 2013-02-18 17:13:51 -06:00
parent 1a44b8e759
commit a6bd78893d
6 changed files with 6 additions and 5 deletions

View File

@ -681,7 +681,7 @@ namespace Antlr4.Runtime.Atn
{ {
if (!this.HasNext()) if (!this.HasNext())
{ {
throw new NoSuchElementException(); throw new InvalidOperationException();
} }
this.index++; this.index++;
this.removed = false; this.removed = false;

View File

@ -210,7 +210,7 @@ namespace Antlr4.Runtime.Dfa
{ {
if (this.current >= this._enclosing.Size()) if (this.current >= this._enclosing.Size())
{ {
throw new NoSuchElementException(); throw new InvalidOperationException();
} }
while (this._enclosing.arrayData[this.currentIndex] == null) while (this._enclosing.arrayData[this.currentIndex] == null)
{ {

View File

@ -182,7 +182,7 @@ namespace Antlr4.Runtime.Dfa
{ {
if (this.current >= this._enclosing.Size()) if (this.current >= this._enclosing.Size())
{ {
throw new NoSuchElementException(); throw new InvalidOperationException();
} }
this.current++; this.current++;
return new _KeyValuePair_166(this); return new _KeyValuePair_166(this);

View File

@ -237,7 +237,7 @@ namespace Antlr4.Runtime.Dfa
{ {
if (this.current >= this._enclosing.Size()) if (this.current >= this._enclosing.Size())
{ {
throw new NoSuchElementException(); throw new InvalidOperationException();
} }
this.current++; this.current++;
return new _KeyValuePair_226(this); return new _KeyValuePair_226(this);

View File

@ -670,7 +670,7 @@ namespace Antlr4.Runtime.Misc
{ {
if (!this.HasNext()) if (!this.HasNext())
{ {
throw new NoSuchElementException(); throw new InvalidOperationException();
} }
this.removed = false; this.removed = false;
return this.data[this.nextIndex++]; return this.data[this.nextIndex++];

View File

@ -188,6 +188,7 @@
-typeMapping java.util.concurrent.CancellationException System.OperationCanceledException -typeMapping java.util.concurrent.CancellationException System.OperationCanceledException
-typeMapping java.lang.IndexOutOfBoundsException ArgumentOutOfRangeException -typeMapping java.lang.IndexOutOfBoundsException ArgumentOutOfRangeException
-typeMapping java.util.EmptyStackException InvalidOperationException -typeMapping java.util.EmptyStackException InvalidOperationException
-typeMapping java.util.NoSuchElementException InvalidOperationException
-typeMapping java.io.InputStream System.IO.Stream -typeMapping java.io.InputStream System.IO.Stream
-typeMapping java.io.InputStreamReader System.IO.StreamReader -typeMapping java.io.InputStreamReader System.IO.StreamReader