Skip to content

Fix potential OutOfBoundsException in PositionProvider

Viktor Kuncak requested to merge github/fork/romac/fix-pos-provider into master

Created by: romac

In a standalone version of PosititionProvider, scalac complains at this line that comparing values of types Unit and Int using '!=' will always yield true, which indeed turns out to be problematic as it might yield a OutOfBoundsException (eg. when given a StringReader). In this fix, I have also wrapped the supplied reader with a BufferedReader just in case the given reader was not already buffered.

Merge request reports