@@ -19,7 +19,7 @@ public class ArrayIter implements Iterator {
19
19
20
20
static public Iterator EMPTY_ITERATOR = new Iterator () {
21
21
public boolean hasNext () { return false ; }
22
- public Object next () { return null ; }
22
+ public Object next () { throw new java . util . NoSuchElementException () ; }
23
23
public void remove () { throw new UnsupportedOperationException ("remove() not supported" ); }
24
24
};
25
25
@@ -68,7 +68,7 @@ public boolean hasNext() {
68
68
public Object next () {
69
69
if (array != null && i < array .length )
70
70
return array [i ++];
71
- return null ;
71
+ throw new java . util . NoSuchElementException () ;
72
72
}
73
73
74
74
public void remove () {
@@ -93,7 +93,7 @@ public boolean hasNext() {
93
93
public Long next () {
94
94
if (array != null && i < array .length )
95
95
return Long .valueOf (array [i ++]);
96
- return null ;
96
+ throw new java . util . NoSuchElementException () ;
97
97
}
98
98
99
99
public void remove () {
@@ -117,7 +117,7 @@ public boolean hasNext() {
117
117
public Double next () {
118
118
if (array != null && i < array .length )
119
119
return Double .valueOf (array [i ++]);
120
- return null ;
120
+ throw new java . util . NoSuchElementException () ;
121
121
}
122
122
123
123
public void remove () {
@@ -141,7 +141,7 @@ public boolean hasNext() {
141
141
public Double next () {
142
142
if (array != null && i < array .length )
143
143
return array [i ++];
144
- return null ;
144
+ throw new java . util . NoSuchElementException () ;
145
145
}
146
146
147
147
public void remove () {
@@ -166,7 +166,7 @@ public boolean hasNext() {
166
166
public Long next () {
167
167
if (array != null && i < array .length )
168
168
return Long .valueOf (array [i ++]);
169
- return null ;
169
+ throw new java . util . NoSuchElementException () ;
170
170
}
171
171
172
172
public void remove () {
@@ -191,7 +191,7 @@ public boolean hasNext() {
191
191
public Byte next () {
192
192
if (array != null && i < array .length )
193
193
return array [i ++];
194
- return null ;
194
+ throw new java . util . NoSuchElementException () ;
195
195
}
196
196
197
197
public void remove () {
@@ -216,7 +216,7 @@ public boolean hasNext() {
216
216
public Character next () {
217
217
if (array != null && i < array .length )
218
218
return array [i ++];
219
- return null ;
219
+ throw new java . util . NoSuchElementException () ;
220
220
}
221
221
222
222
public void remove () {
@@ -241,7 +241,7 @@ public boolean hasNext() {
241
241
public Long next () {
242
242
if (array != null && i < array .length )
243
243
return Long .valueOf (array [i ++]);
244
- return null ;
244
+ throw new java . util . NoSuchElementException () ;
245
245
}
246
246
247
247
public void remove () {
@@ -266,7 +266,7 @@ public boolean hasNext() {
266
266
public Boolean next () {
267
267
if (array != null && i < array .length )
268
268
return Boolean .valueOf (array [i ++]);
269
- return null ;
269
+ throw new java . util . NoSuchElementException () ;
270
270
}
271
271
272
272
public void remove () {
0 commit comments