Closed hiddenalpha closed 11 months ago
Pass-through OutOfMemoryError if GetByteArrayElements() fails to alloc memory.
Can you explain where the OutOfMemoryError
is thrown?
Throw NullPointerException (in place of crashing) if caller passes null buffer.
Hmm... Should we wrap exceptions which are historically non-checked?
Will have a look as soon I find some time. Thx for feedback so far.
Hmm... Should we wrap exceptions which are historically non-checked?
Will have a look as soon I find some time. Thx for feedback so far.
Whoops, we don't. We only catch IOException
, so we're still going to throw unchecked exceptions, which I think is what we want, per:
I think unchecked exceptions are fine for now (they're certainly better than a JVM crash). If users complain about this we, can modify the the catch statement at a future time.
@hiddenalpha do you believe we should add more unit tests for these? Furthemore, have you had time to evaluate the safety of the windows code too?
do you believe we should add more unit tests for these?
I think writing unit tests may be challenging for some of those cases. Especially edge-cases in the native code. I think best is to add a test when we see a good opportunity and if it can be written in a simple (as in understandable/maintainable) way.
have you had time to evaluate the safety of the windows code too?
Did not look at the windows code at all yet. Will keep it in mind when I've a free time slot.
This can be tested in its current form using mvn -DskipTests install && mvn
until rebased against master (specifically #51, #151).
It looks good to me, but I've left a question about the unit test, since matching an exception string can have unobvious test failures in the event this string value ever gets changed.
When you have time, this PR needs to be rebased and there's still one comment remaining. I've love to see it merged. :)