Skip to content
This repository was archived by the owner on Feb 25, 2024. It is now read-only.

Commit f5120bb

Browse files
committed
desugar bug: must override PrimitiveIterator.OfDouble/Int/Long Iterator
methods because desugar doesn't treat this correctly
1 parent 5392244 commit f5120bb

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/main/java/java9/util/Spliterators.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,18 @@ public int nextInt() {
10401040
}
10411041
}
10421042

1043+
@Override
1044+
public Integer next() {
1045+
// desugar bug
1046+
return nextInt();
1047+
}
1048+
1049+
@Override
1050+
public void forEachRemaining(IntConsumer action) {
1051+
// desugar bug
1052+
PrimitiveIterator.OfInt.super.forEachRemaining(action);
1053+
}
1054+
10431055
@Override
10441056
public void remove() {
10451057
throw new UnsupportedOperationException("remove");
@@ -1090,6 +1102,18 @@ public long nextLong() {
10901102
}
10911103
}
10921104

1105+
@Override
1106+
public Long next() {
1107+
// desugar bug
1108+
return nextLong();
1109+
}
1110+
1111+
@Override
1112+
public void forEachRemaining(LongConsumer action) {
1113+
// desugar bug
1114+
PrimitiveIterator.OfLong.super.forEachRemaining(action);
1115+
}
1116+
10931117
@Override
10941118
public void remove() {
10951119
throw new UnsupportedOperationException("remove");
@@ -1140,6 +1164,18 @@ public double nextDouble() {
11401164
}
11411165
}
11421166

1167+
@Override
1168+
public Double next() {
1169+
// desugar bug
1170+
return nextDouble();
1171+
}
1172+
1173+
@Override
1174+
public void forEachRemaining(DoubleConsumer action) {
1175+
// desugar bug
1176+
PrimitiveIterator.OfDouble.super.forEachRemaining(action);
1177+
}
1178+
11431179
@Override
11441180
public void remove() {
11451181
throw new UnsupportedOperationException("remove");

0 commit comments

Comments
 (0)