GCC's static analyzer is correctly reporting that resize() requires an unsigned integer, but the argument provided in the JNI function could be negative since it's a signed byte. Throwing an exception if the argument is negative fixes the warning.