In ParsingException, the int column variable is 1-indexed. However, it checks if column < context.length() rather than <=, which means pointing to the last character in the context is not possible:
|
message.append(System.lineSeparator()).append(this.context); |
|
if (this.column >= 0 && this.column < this.context.length()) { |
|
message.append(System.lineSeparator()); |
|
if (this.column > 0) { |
|
final char[] spaces = new char[this.column - 1]; |
|
Arrays.fill(spaces, ' '); |
|
message.append(spaces); |
|
} |
|
|
|
message.append(POSITION_MARKER); |
|
} |
It is also not clear to me why it allows column to equal 0 (and renders it as if column equals 1), but this isn't as big of a concern.
In
ParsingException, theint columnvariable is 1-indexed. However, it checks ifcolumn < context.length()rather than<=, which means pointing to the last character in the context is not possible:Configurate/core/src/main/java/org/spongepowered/configurate/loader/ParsingException.java
Lines 177 to 187 in 033bdf8
It is also not clear to me why it allows column to equal 0 (and renders it as if column equals 1), but this isn't as big of a concern.