aboutsummaryrefslogtreecommitdiffstats
path: root/lib/jinterface/test
diff options
context:
space:
mode:
authorNico Kruber <[email protected]>2015-11-09 20:35:26 +0100
committerNico Kruber <[email protected]>2015-11-17 11:31:16 +0100
commiteefc4f1b40c8d1bd01abe3687c5f343cb838b0d5 (patch)
tree144d32566178da6a981c9375db6bca663c26fd96 /lib/jinterface/test
parentc16c45a587a199987dae799ea02fb9c32216854f (diff)
downloadotp-eefc4f1b40c8d1bd01abe3687c5f343cb838b0d5.tar.gz
otp-eefc4f1b40c8d1bd01abe3687c5f343cb838b0d5.tar.bz2
otp-eefc4f1b40c8d1bd01abe3687c5f343cb838b0d5.zip
jinterface: fix writing small compressed values
This is a regression of 4390e43558 in the OtpOutputStream class. We can not call java.util.zip.DeflaterOutputStream.close() in the finally block of the OtpOutputStream.write_compressed(OtpErlangObject, int) method. This leads to a NullPointerException when encoding "{}" which is caused by the DeflaterOutputStream trying to write bytes to the deflater which was "destroyed" by calling java.util.zip.Deflater.end(). Further possibilities to call close() in the finally block are not suitable either (see the comment in the source). This leaves no choice but to revert the change from 4390e43558 in this class (and add an appropriate test case).
Diffstat (limited to 'lib/jinterface/test')
-rw-r--r--lib/jinterface/test/nc_SUITE.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/jinterface/test/nc_SUITE.erl b/lib/jinterface/test/nc_SUITE.erl
index 9679b90a0d..c5f3198c21 100644
--- a/lib/jinterface/test/nc_SUITE.erl
+++ b/lib/jinterface/test/nc_SUITE.erl
@@ -215,6 +215,7 @@ decompress_roundtrip(Config) when is_list(Config) ->
0.0,
math:sqrt(2),
<<1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,31:5>>,
+ "{}",
RandomBin1k,
RandomBin1M,
RandomBin10M,
@@ -244,6 +245,7 @@ compress_roundtrip(Config) when is_list(Config) ->
0.0,
math:sqrt(2),
<<1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,31:5>>,
+ "{}",
RandomBin1k,
RandomBin1M,
RandomBin10M,