I am submitting a change to JNA which has in previous releases defined a set of constants as int type, specifically:
int VER_EQUAL = 1;
int VER_GREATER = 2;
int VER_GREATER_EQUAL = 3;
... etc...
(Since they are defined in an interface they are automatically static and final.)
These constants are used as the Condition argument in the VerSetConditionMask function, which requires a BYTE argument, mapped in JNA to Java's byte.
To use the existing int constants in that function would require me (and other users) to explicitly typecast them, so I want to change these constant values in the library to be byte, e.g.,
byte VER_EQUAL = 1;
byte VER_GREATER = 2;
byte VER_GREATER_EQUAL = 3;
... etc...
I do not think this change breaks backwards compatibility, because any code using these constants must currently expect at least an int, and will happily widen the byte without complaint. I've written plenty of test code to convince myself of this. I'm aware that changing Object types (like Integer to Byte) would not work, but I believe this is fine for primitives. However, despite an hour searching the web for confirmation, I remain the tiniest bit unconvinced.
Is this change backwards compatible? Or am I wrong and is there a case where this could break existing code relying on the int primitive?