--- old/src/java.base/share/classes/com/sun/java/util/jar/pack/Package.java Thu Mar 17 13:47:50 2016 +++ new/src/java.base/share/classes/com/sun/java/util/jar/pack/Package.java Thu Mar 17 13:47:50 2016 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -476,7 +476,7 @@ } else if (localICs.isEmpty()) { // It was a non-empty diff, but the local ICs were absent. actualICs = null; - changed = 0; // [] => null, no tuple change + changed = -1; // [] => null, no tuple change, force recomputation } else { // Non-trivial diff was transmitted. actualICs = computeICdiff(); --- old/src/java.base/share/classes/com/sun/java/util/jar/pack/PackageReader.java Thu Mar 17 13:47:52 2016 +++ new/src/java.base/share/classes/com/sun/java/util/jar/pack/PackageReader.java Thu Mar 17 13:47:51 2016 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, 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 @@ -1203,6 +1203,16 @@ // flesh out the local constant pool ConstantPool.completeReferencesIn(cpRefs, true, bsms); + // remove the attr previously set, otherwise add the bsm and + // references as required + if (bsms.isEmpty()) { + cls.attributes.remove(Package.attrBootstrapMethodsEmpty.canonicalInstance()); + } else { + cpRefs.add(Package.getRefString("BootstrapMethods")); + Collections.sort(bsms); + cls.setBootstrapMethods(bsms); + } + // Now that we know all our local class references, // compute the InnerClasses attribute. int changed = cls.expandLocalICs(); @@ -1221,16 +1231,6 @@ ConstantPool.completeReferencesIn(cpRefs, true, bsms); } - // remove the attr previously set, otherwise add the bsm and - // references as required - if (bsms.isEmpty()) { - cls.attributes.remove(Package.attrBootstrapMethodsEmpty.canonicalInstance()); - } else { - cpRefs.add(Package.getRefString("BootstrapMethods")); - Collections.sort(bsms); - cls.setBootstrapMethods(bsms); - } - // construct a local constant pool int numDoubles = 0; for (Entry e : cpRefs) { @@ -1262,7 +1262,7 @@ Arrays.sort(cpMap, narrowLimit, fillp, entryOutputOrder); if (verbose > 3) { - Utils.log.fine("CP of "+this+" {"); + Utils.log.fine("CP of "+cls+" {"); for (int i = 0; i < fillp; i++) { Entry e = cpMap[i]; Utils.log.fine(" "+((e==null)?-1:getOutputIndex(e)) --- old/test/tools/pack200/Pack200Test.java Thu Mar 17 13:47:53 2016 +++ new/test/tools/pack200/Pack200Test.java Thu Mar 17 13:47:53 2016 @@ -30,7 +30,7 @@ /* * @test - * @bug 6521334 6712743 8007902 + * @bug 6521334 6712743 8007902 8151901 8062335 * @key intermittent * @summary check for memory leaks, test general packer/unpacker functionality\ * using native and java unpackers