# HG changeset patch # User coffeys # Date 1570616043 0 # Node ID 7605e97c9491b2512f1e44cf7f630bc02b6f1aa3 # Parent 5185bc8dcbb179a987675f792ad56a11eddc2644 8231770: Test java/util/zip/FlaterTest.java fails with -Xcheck:jni Reviewed-by: alanb, coffeys, chegar Contributed-by: kiran.sidhartha.ravikumar@oracle.com diff -r 5185bc8dcbb1 -r 7605e97c9491 src/java.base/share/native/libzip/Deflater.c --- a/src/java.base/share/native/libzip/Deflater.c Tue Oct 08 15:30:39 2019 +0200 +++ b/src/java.base/share/native/libzip/Deflater.c Wed Oct 09 10:14:03 2019 +0000 @@ -257,7 +257,7 @@ res = doDeflate(env, addr, input, inputLen, output + outputOff, outputLen, flush, params); - (*env)->ReleasePrimitiveArrayCritical(env, outputArray, input, 0); + (*env)->ReleasePrimitiveArrayCritical(env, outputArray, output, 0); retVal = checkDeflateStatus(env, addr, inputLen, outputLen, params, res); return retVal; diff -r 5185bc8dcbb1 -r 7605e97c9491 test/jdk/java/util/zip/FlaterTest.java --- a/test/jdk/java/util/zip/FlaterTest.java Tue Oct 08 15:30:39 2019 +0200 +++ b/test/jdk/java/util/zip/FlaterTest.java Wed Oct 09 10:14:03 2019 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,10 +23,11 @@ /** * @test - * @bug 6348045 6341887 + * @bug 6348045 6341887 8231770 * @summary GZipOutputStream/InputStream goes critical(calls JNI_Get*Critical) - * and causes slowness. This test uses Deflater and Inflater directly. + * and causes slowness. This test uses Deflater and Inflater directly. * @key randomness + * @run main/othervm -Xcheck:jni FlaterTest */ import java.nio.*;