summaryrefslogtreecommitdiffstats
path: root/run-core-tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2009-10-16 17:25:34 -0700
committerElliott Hughes <enh@google.com>2009-10-19 11:45:17 -0700
commitfc354fea0c535ceef679e8856a73dd05be8351df (patch)
treeffb95a768a15afe82b74c9a9368a96e50192f3a1 /run-core-tests
parentbe13bf181738e1bd6d98d6f226c813a517c27f65 (diff)
downloadlibcore-fc354fea0c535ceef679e8856a73dd05be8351df.zip
libcore-fc354fea0c535ceef679e8856a73dd05be8351df.tar.gz
libcore-fc354fea0c535ceef679e8856a73dd05be8351df.tar.bz2
Improve error handling in InetAddress native code.
Fix a bug where we changed the return values of functions such as byteArrayToSocketAddress without changing the logic in the callers that's supposed to distinguish success and failure. For simplicity, I've switch all of these functions over to returning bool, and I've gone through all the callers to ensure we're using the right check now. (This is the majority of the diff.) Also switch to throwing IllegalArgumentException instead of SocketException when we find ourselves with a bad byte[] --- before we were throwing a checked exception we weren't allowed to (from native code, which can't actually be checked statically) and then trying to cover up in Java. I've also simply removed one case where we were trying to mask an OutOfMemoryError with a SocketException. I also removed dead code in socketAddressToString: this function's sole caller always passed false for withPort. This makes the temporary variable and the copying (which was unsafe) unnecessary. In instances where I was already changing the code, I've removed bogus "handle == 0" failures, but I'll come back and remove all the other instances in another patch. Since I was in connectSocketImpl, I've removed the dead second half of that method.
Diffstat (limited to 'run-core-tests')
0 files changed, 0 insertions, 0 deletions