Position's line and character fields should be long, not int
shuheiktgw opened this issue Β· comments
Currently, the Position's line and character fields are int, but according to the latest protocol definition, the fields should be uinteger, which can be 0 to 2^31 - 1. Therefore, I believe they should have been long π
Integer covers this range as well: https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html
Closing, as there is nothing to fix here.
@pisv Wait, why is it closing? IIUC, the Integer class mentioned above is different from int. Java's native int is a 32-bit signed integer, so the maximum value is not 2^31 - 1 but 2^30. I believe what @nixel2007 meant was that we could use the Integer class instead of long, but did I miss something? π€
Ah sorry, I must have misunderstood something. Let me think about it...
int also uses the same boundaries :)
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
Yes, my bad, sorry I miscalculated it π