From f537c82bab64d3fdf252d090954964eb4164d5e6 Mon Sep 17 00:00:00 2001 From: Vinnie Ryan Date: Tue, 13 Aug 2013 14:15:03 +0100 Subject: [PATCH 1/4] 8013170: Spec for PBEParameterSpec does not specify behavior when paramSpec is null Reviewed-by: mullan --- jdk/src/share/classes/javax/crypto/spec/PBEParameterSpec.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jdk/src/share/classes/javax/crypto/spec/PBEParameterSpec.java b/jdk/src/share/classes/javax/crypto/spec/PBEParameterSpec.java index 8ea186e6b1e..4a17c40d0e0 100644 --- a/jdk/src/share/classes/javax/crypto/spec/PBEParameterSpec.java +++ b/jdk/src/share/classes/javax/crypto/spec/PBEParameterSpec.java @@ -64,7 +64,8 @@ public class PBEParameterSpec implements AlgorithmParameterSpec { * @param salt the salt. The contents of salt are copied * to protect against subsequent modification. * @param iterationCount the iteration count. - * @param paramSpec the cipher algorithm parameter specification. + * @param paramSpec the cipher algorithm parameter specification, which + * may be null. * @exception NullPointerException if salt is null. * * @since 1.8 From e3b61c033b89a314b00142afb910e72f3063865a Mon Sep 17 00:00:00 2001 From: Timothy Buktu Date: Mon, 12 Aug 2013 16:21:10 -0700 Subject: [PATCH 2/4] 8022180: BigInteger Burnikel-Ziegler quotient and remainder calculation assumes quotient parameter is zero Clear the quotient in divideAndRemainderBurnikelZiegler() if the divisor is larger than the dividend. Reviewed-by: alanb, bpb --- .../classes/java/math/MutableBigInteger.java | 4 +++- .../java/math/BigInteger/BigIntegerTest.java | 18 +++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/jdk/src/share/classes/java/math/MutableBigInteger.java b/jdk/src/share/classes/java/math/MutableBigInteger.java index 804d8be8e7a..6f72f2d0c83 100644 --- a/jdk/src/share/classes/java/math/MutableBigInteger.java +++ b/jdk/src/share/classes/java/math/MutableBigInteger.java @@ -1242,6 +1242,9 @@ class MutableBigInteger { int r = intLen; int s = b.intLen; + // Clear the quotient + quotient.offset = quotient.intLen = 0; + if (r < s) { return this; } else { @@ -1276,7 +1279,6 @@ class MutableBigInteger { // do schoolbook division on blocks, dividing 2-block numbers by 1-block numbers MutableBigInteger qi = new MutableBigInteger(); MutableBigInteger ri; - quotient.offset = quotient.intLen = 0; for (int i=t-2; i > 0; i--) { // step 8a: compute (qi,ri) such that z=b*qi+ri ri = z.divide2n1n(bShifted, qi); diff --git a/jdk/test/java/math/BigInteger/BigIntegerTest.java b/jdk/test/java/math/BigInteger/BigIntegerTest.java index 47f6af56c2e..279f5546b58 100644 --- a/jdk/test/java/math/BigInteger/BigIntegerTest.java +++ b/jdk/test/java/math/BigInteger/BigIntegerTest.java @@ -74,10 +74,10 @@ public class BigIntegerTest { static final int ORDER_SMALL = 60; static final int ORDER_MEDIUM = 100; - // #bits for testing Karatsuba and Burnikel-Ziegler + // #bits for testing Karatsuba static final int ORDER_KARATSUBA = 1800; - // #bits for testing Toom-Cook - static final int ORDER_TOOM_COOK = 3000; + // #bits for testing Toom-Cook and Burnikel-Ziegler + static final int ORDER_TOOM_COOK = 4000; // #bits for testing Karatsuba squaring static final int ORDER_KARATSUBA_SQUARE = 3200; // #bits for testing Toom-Cook squaring @@ -964,12 +964,12 @@ public class BigIntegerTest { nextProbablePrime(); arithmetic(order1); // small numbers - arithmetic(order3); // Karatsuba / Burnikel-Ziegler range - arithmetic(order4); // Toom-Cook range + arithmetic(order3); // Karatsuba range + arithmetic(order4); // Toom-Cook / Burnikel-Ziegler range divideAndRemainder(order1); // small numbers - divideAndRemainder(order3); // Karatsuba / Burnikel-Ziegler range - divideAndRemainder(order4); // Toom-Cook range + divideAndRemainder(order3); // Karatsuba range + divideAndRemainder(order4); // Toom-Cook / Burnikel-Ziegler range pow(order1); pow(order3); @@ -989,8 +989,8 @@ public class BigIntegerTest { byteArrayConv(order1); modInv(order1); // small numbers - modInv(order3); // Karatsuba / Burnikel-Ziegler range - modInv(order4); // Toom-Cook range + modInv(order3); // Karatsuba range + modInv(order4); // Toom-Cook / Burnikel-Ziegler range modExp(order1, order2); modExp2(order1); From 10ba495eafad499b8877b3f6a2872ff6894e1a66 Mon Sep 17 00:00:00 2001 From: Amy Lu Date: Tue, 13 Aug 2013 14:57:12 +0100 Subject: [PATCH 3/4] 8022779: ProblemList.txt updates (8/2013) Update ProblemList and remove AggressiveOpts MOAT test run Reviewed-by: chegar, alanb --- jdk/test/ProblemList.txt | 7 ------- jdk/test/java/util/Collection/MOAT.java | 1 - 2 files changed, 8 deletions(-) diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index ed5f9b0e71c..4790ef15eca 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -131,10 +131,6 @@ java/lang/management/MemoryMXBean/CollectionUsageThreshold.java generic-all # 7196801 java/lang/management/MemoryMXBean/LowMemoryTest2.sh generic-all -# 8019845 due to memleak not related to the tested fix -java/lang/instrument/RedefineBigClass.sh linux-x64 -java/lang/instrument/RetransformBigClass.sh linux-x64 - # 8021230 java/lang/ThreadLocal/ThreadLocalSupplierTest.java generic-all @@ -312,9 +308,6 @@ sun/security/mscapi/ShortRSAKey1024.sh windows-all # jdk_time -# 8016623 -java/time/test/java/time/format/TestDateTimeTextProvider.java generic-all - ############################################################################ # jdk_tools diff --git a/jdk/test/java/util/Collection/MOAT.java b/jdk/test/java/util/Collection/MOAT.java index a5b2c42e47b..37720016c3c 100644 --- a/jdk/test/java/util/Collection/MOAT.java +++ b/jdk/test/java/util/Collection/MOAT.java @@ -30,7 +30,6 @@ * @summary Run many tests on many Collection and Map implementations * @author Martin Buchholz * @run main MOAT - * @run main/othervm -XX:+AggressiveOpts MOAT */ /* Mother Of All (Collection) Tests From 91e6f2879615f5f72c59b3aeb9eb8f342c9422e4 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Tue, 13 Aug 2013 16:00:44 +0200 Subject: [PATCH 4/4] 8019948: java/util/logging/bundlesearch/ResourceBundleSearchTest.java is failing intermittently Reviewed-by: mchung, dholmes --- .../ResourceBundleSearchTest.java | 45 ++++++++++++++++--- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/jdk/test/java/util/logging/bundlesearch/ResourceBundleSearchTest.java b/jdk/test/java/util/logging/bundlesearch/ResourceBundleSearchTest.java index ee3de2dfb93..9cc22f4f2f2 100644 --- a/jdk/test/java/util/logging/bundlesearch/ResourceBundleSearchTest.java +++ b/jdk/test/java/util/logging/bundlesearch/ResourceBundleSearchTest.java @@ -57,9 +57,32 @@ public class ResourceBundleSearchTest { private static int numFail = 0; private static List msgs = new ArrayList<>(); + // This test has been falling in timeout - so we're adding some + // time stamp here and there to help diagnose whether it's a + // simple system slowness or whether there's a deeper issue, + // like a deadlock. The timeout issue should be fixed now, + // but we leave the time stamps in case it reappears. + // + static final long stamp = System.currentTimeMillis(); + private static String getTimeStamp() { + long time = System.currentTimeMillis(); + long delta = time - stamp; + long min = delta/60000; + long sec = (delta - min * 60000) / 10000; + long msec = delta - min * 60000 - sec * 1000; + return (min == 0 ? "" : (min + " min. ")) + + (sec == 0 ? "" : (sec + " sec. ")) + + (msec == 0 ? "" : (msec + "ms.")); + } + public static void main(String[] args) throws Throwable { + System.out.println("ResourceBundleSearchTest starting: "+getTimeStamp()); ResourceBundleSearchTest test = new ResourceBundleSearchTest(); - test.runTests(); + try { + test.runTests(); + } finally { + System.out.println("ResourceBundleSearchTest terminated: "+getTimeStamp()); + } } private void runTests() throws Throwable { @@ -77,15 +100,19 @@ public class ResourceBundleSearchTest { urls[0] = Paths.get(testDir, "resources").toUri().toURL(); URLClassLoader rbClassLoader = new URLClassLoader(urls); + int testnb = 1; + System.out.println("ResourceBundleSearchTest starting test #"+(testnb++)+": "+getTimeStamp()); // Test 1 - can we find a Logger bundle from doing a stack search? // We shouldn't be able to assertFalse(testGetBundleFromStackSearch(), "1-testGetBundleFromStackSearch"); + System.out.println("ResourceBundleSearchTest starting test #"+(testnb++)+": "+getTimeStamp()); // Test 2 - can we find a Logger bundle off of the Thread context class // loader? We should be able to. assertTrue(testGetBundleFromTCCL(TCCL_TEST_BUNDLE, rbClassLoader), "2-testGetBundleFromTCCL"); + System.out.println("ResourceBundleSearchTest starting test #"+(testnb++)+": "+getTimeStamp()); // Test 3 - Can we find a Logger bundle from the classpath? We should be // able to. We'll first check to make sure the setup is correct and // it actually is on the classpath before checking whether logging @@ -99,21 +126,25 @@ public class ResourceBundleSearchTest { + " on the classpath"); } + System.out.println("ResourceBundleSearchTest starting test #"+(testnb++)+": "+getTimeStamp()); // Test 4 - we should be able to find a bundle from the caller's // classloader, but only one level up. assertTrue(testGetBundleFromCallersClassLoader(), "4-testGetBundleFromCallersClassLoader"); + System.out.println("ResourceBundleSearchTest starting test #"+(testnb++)+": "+getTimeStamp()); // Test 5 - this ensures that getAnonymousLogger(String rbName) // can find the bundle from the caller's classloader assertTrue(testGetAnonymousLogger(), "5-testGetAnonymousLogger"); + System.out.println("ResourceBundleSearchTest starting test #"+(testnb++)+": "+getTimeStamp()); // Test 6 - first call getLogger("myLogger"). // Then call getLogger("myLogger","bundleName") from a different ClassLoader // Make sure we find the bundle assertTrue(testGetBundleFromSecondCallersClassLoader(), "6-testGetBundleFromSecondCallersClassLoader"); + System.out.println("ResourceBundleSearchTest generating report: "+getTimeStamp()); report(); } @@ -132,6 +163,7 @@ public class ResourceBundleSearchTest { public void assertTrue(boolean testResult, String testName) { if (testResult) { numPass++; + System.out.println("PASSED: " + testName); } else { numFail++; System.out.println("FAILED: " + testName @@ -142,6 +174,7 @@ public class ResourceBundleSearchTest { public void assertFalse(boolean testResult, String testName) { if (!testResult) { numPass++; + System.out.println("PASSED: " + testName); } else { numFail++; System.out.println("FAILED: " + testName @@ -170,12 +203,10 @@ public class ResourceBundleSearchTest { debug("Looking for " + bundleName + " using TCCL"); LoggingThread lr = new LoggingThread(bundleName, setOnTCCL); lr.start(); - synchronized (lr) { - try { - lr.wait(); - } catch (InterruptedException ex) { - throw ex; - } + try { + lr.join(); + } catch (InterruptedException ex) { + throw ex; } msgs.add(lr.msg); return lr.foundBundle;