5 ms·
Hi. You missed the opportunity to implement the reader as an AutoCloseable and do the get as a Reader method. That way, classe users will be warned by the IDE
by motoboi 3y ago
Hi. You missed the opportunity to implement the reader as an AutoCloseable and do the get as a Reader method.
That way, classe users will be warned by the IDE that they should use a try-with-resources when acquiring a Reader.
For the sake of completeness here, Java compiler will warn about it, but that warning is disabled by default.
- jerrinot 3y agoThat's actually exactly what I did! I removed this part from the article as I felt it was not relevant for the concurrent protocol design and it was adding mental load for readers not that fluent in Java.