Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.0.0
Description
Should reuse functions defined in WrappedCloseableIterator instead of overriding them
ResponseValidator#wrapIterator
def wrapIterator[T <: GeneratedMessageV3, V <: CloseableIterator[T]]( inner: V): WrappedCloseableIterator[T] = { new WrappedCloseableIterator[T] { override def innerIterator: Iterator[T] = inner override def hasNext: Boolean = { innerIterator.hasNext } override def next(): T = { verifyResponse { innerIterator.next() } } override def close(): Unit = { innerIterator match { case it: CloseableIterator[T] => it.close() case _ => // nothing } } } }
WrappedCloseableIterator
private[sql] abstract class WrappedCloseableIterator[E] extends CloseableIterator[E] { def innerIterator: Iterator[E] override def next(): E = innerIterator.next() override def hasNext: Boolean = innerIterator.hasNext override def close(): Unit = innerIterator match { case it: CloseableIterator[E] => it.close() case _ => // nothing } }
Attachments
Issue Links
- links to