TIL: printing a struct that inherits an `AbstractQ...
# contributing-to-airbyte
d
TIL: printing a struct that inherits an
AbstractQueue
(
struct.toString()
) without overriding
toString
actually empties the queue.. thanks @charles for the assist!
u
another in our line of java / infinite stream gotchas
u
Lol this wasn’t obvious?!?!?! /s
u
Not really. In .NET, printing the
ToString
of a queue does not empty the queue, and neither does running a
foreach
over it to get at all its elements. I can see a decent argument for the latter being suboptimal behavior, but it's not "obviously" correct or incorrect.
u
haha I was just being sarcastic. This behavior is wild