From lana.steuck at oracle.com Sat Dec 1 00:55:02 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Sat, 01 Dec 2012 00:55:02 +0000 Subject: hg: jdk8/tl/corba: 2 new changesets Message-ID: <20121201005505.E7F9547C5B@hg.openjdk.java.net> Changeset: 65771ad1ca55 Author: katleman Date: 2012-11-15 15:38 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/corba/rev/65771ad1ca55 Added tag jdk8-b65 for changeset 5132f7900a8f ! .hgtags Changeset: 394515ad2a55 Author: katleman Date: 2012-11-29 11:29 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/corba/rev/394515ad2a55 Added tag jdk8-b66 for changeset 65771ad1ca55 ! .hgtags From lana.steuck at oracle.com Sat Dec 1 00:55:02 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Sat, 01 Dec 2012 00:55:02 +0000 Subject: hg: jdk8/tl/jaxws: 2 new changesets Message-ID: <20121201005511.2DF7447C5C@hg.openjdk.java.net> Changeset: 3eb7f11cb4e0 Author: katleman Date: 2012-11-15 15:39 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxws/rev/3eb7f11cb4e0 Added tag jdk8-b65 for changeset fbe54291c9d3 ! .hgtags Changeset: eb06aa51dfc2 Author: katleman Date: 2012-11-29 11:30 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxws/rev/eb06aa51dfc2 Added tag jdk8-b66 for changeset 3eb7f11cb4e0 ! .hgtags From lana.steuck at oracle.com Sat Dec 1 00:55:06 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Sat, 01 Dec 2012 00:55:06 +0000 Subject: hg: jdk8/tl/jaxp: 2 new changesets Message-ID: <20121201005513.9F21C47C5D@hg.openjdk.java.net> Changeset: e6af1ad464e3 Author: katleman Date: 2012-11-15 15:39 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/e6af1ad464e3 Added tag jdk8-b65 for changeset 5cf3c69a93d6 ! .hgtags Changeset: 83df3493ca3c Author: katleman Date: 2012-11-29 11:30 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/83df3493ca3c Added tag jdk8-b66 for changeset e6af1ad464e3 ! .hgtags From lana.steuck at oracle.com Sat Dec 1 00:55:02 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Sat, 01 Dec 2012 00:55:02 +0000 Subject: hg: jdk8/tl: 14 new changesets Message-ID: <20121201005504.3A97A47C5A@hg.openjdk.java.net> Changeset: 0e1b5886b06c Author: katleman Date: 2012-11-15 15:38 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/0e1b5886b06c Added tag jdk8-b65 for changeset b772de306dc2 ! .hgtags Changeset: a2df4ee40ecb Author: tbell Date: 2012-11-14 10:05 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/a2df4ee40ecb 8002026: build-infra: deploy repository building Summary: Change the compare script to handle deploy build artifacts. Reviewed-by: ohair, tbell Contributed-by: erik.joelsson at oracle.com ! common/bin/compare.sh ! common/bin/compare_exceptions.sh.incl Changeset: c81c4a5d8b50 Author: tbell Date: 2012-11-14 10:13 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/c81c4a5d8b50 8001875: build-infra: We must be able to force static linking of stdc++ Summary: Ensure that we build with static linking when requested, or do not build at all Reviewed-by: ohair, tbell Contributed-by: erik.joelsson at oracle.com ! common/autoconf/generated-configure.sh ! common/autoconf/libraries.m4 Changeset: 582c696033f5 Author: tbell Date: 2012-11-14 10:16 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/582c696033f5 8001941: build-infra: --disable-precompiled-headers does not seem to work Summary: With this fix the flag will do what it advertises Reviewed-by: ohair, tbell Contributed-by: erik.joelsson at oracle.com ! common/autoconf/build-performance.m4 ! common/autoconf/generated-configure.sh ! common/autoconf/hotspot-spec.gmk.in Changeset: f59a07f85125 Author: tbell Date: 2012-11-14 10:18 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/f59a07f85125 8003317: build-infra: Configure fails when current dir is part of a symlink Summary: Call macro for removing symbolic links on a copy of the CURDIR variable before comparing Reviewed-by: ohair, tbell Contributed-by: erik.joelsson at oracle.com ! common/autoconf/basics.m4 ! common/autoconf/generated-configure.sh Changeset: e69396d6d3e8 Author: tbell Date: 2012-11-14 10:20 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/e69396d6d3e8 8003327: build-infra: "/bin/sh: : cannot execute" on solaris Summary: Fix quoting inside cut command used in the pipeline Reviewed-by: ohair, tbell Contributed-by: erik.joelsson at oracle.com ! common/makefiles/MakeHelpers.gmk Changeset: 06f146c05f49 Author: tbell Date: 2012-11-15 00:54 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/rev/06f146c05f49 Merge Changeset: ecf751a69f6a Author: tbell Date: 2012-11-19 14:06 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/ecf751a69f6a 8003300: build-infra: fails on solaris when objcopy is not found Summary: Only call BASIC_FIXUP_EXECUTABLE() if objcopy was found. Reviewed-by: tbell Contributed-by: erik.joelsson at oracle.com ! common/autoconf/generated-configure.sh ! common/autoconf/toolchain.m4 Changeset: f8b0bacd4de5 Author: erikj Date: 2012-11-28 13:15 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/rev/f8b0bacd4de5 8001460: build-infra: Linker warnings on macosx Summary: Only linking against jvm variant specific dirs if they are expected to exist. Reviewed-by: ohair ! common/autoconf/generated-configure.sh ! common/autoconf/toolchain.m4 Changeset: 6ff2e1280dc3 Author: erikj Date: 2012-11-28 13:40 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/rev/6ff2e1280dc3 8003844: build-infra: docs target isn't working properly Summary: Fixed docs and docs-clean target. Added compare support for docs. Reviewed-by: ohair, jjg, ohrstrom ! common/bin/compare.sh ! common/makefiles/Main.gmk ! common/makefiles/javadoc/Javadoc.gmk Changeset: 7d7dd520ebfd Author: erikj Date: 2012-11-28 13:48 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/rev/7d7dd520ebfd 8003528: build-infra: Diffs in libjava and hotspot libs on solaris. Summary: Linking against server jvm first if available. Adding filters and exceptions for hotspot lib compare on solaris. Reviewed-by: ohair, ohrstrom ! common/autoconf/generated-configure.sh ! common/autoconf/toolchain.m4 ! common/bin/compare_exceptions.sh.incl Changeset: 13bb8c326e7b Author: katleman Date: 2012-11-28 14:03 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/13bb8c326e7b Merge Changeset: 16292f54195c Author: katleman Date: 2012-11-29 11:29 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/16292f54195c Added tag jdk8-b66 for changeset 13bb8c326e7b ! .hgtags Changeset: ad54163c95f5 Author: lana Date: 2012-11-30 16:31 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/ad54163c95f5 Merge From lana.steuck at oracle.com Sat Dec 1 00:55:16 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Sat, 01 Dec 2012 00:55:16 +0000 Subject: hg: jdk8/tl/langtools: 6 new changesets Message-ID: <20121201005532.7E6E847C5E@hg.openjdk.java.net> Changeset: b5d326a809a1 Author: katleman Date: 2012-11-15 15:40 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/b5d326a809a1 Added tag jdk8-b65 for changeset 5f2faba89cac ! .hgtags Changeset: 09ba1bfab344 Author: lana Date: 2012-11-20 11:50 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/09ba1bfab344 Merge - src/share/classes/com/sun/tools/javac/parser/SimpleDocCommentTable.java - test/tools/javac/defaultMethods/fd/FDTest.java - test/tools/javac/defaultMethods/fd/shapegen/ClassCase.java - test/tools/javac/defaultMethods/fd/shapegen/Hierarchy.java - test/tools/javac/defaultMethods/fd/shapegen/HierarchyGenerator.java - test/tools/javac/defaultMethods/fd/shapegen/Rule.java - test/tools/javac/defaultMethods/fd/shapegen/RuleGroup.java - test/tools/javac/defaultMethods/fd/shapegen/TTNode.java - test/tools/javac/defaultMethods/fd/shapegen/TTParser.java - test/tools/javac/defaultMethods/fd/shapegen/TTShape.java - test/tools/javac/diags/examples/CantAccessArgTypeInFunctionalDesc.java - test/tools/javac/diags/examples/CantAccessReturnTypeInFunctionalDesc.java - test/tools/javac/diags/examples/CantAccessThrownTypesInFunctionalDesc.java - test/tools/javac/diags/examples/CantReturnValueForVoid.java Changeset: da48ab364ea4 Author: erikj Date: 2012-11-28 13:37 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/da48ab364ea4 8003844: build-infra: docs target isn't working properly Summary: Adding resources to bootstrap javadoc.jar. Adding missing .js resource suffix Reviewed-by: ohair, jjg, ohrstrom ! makefiles/BuildLangtools.gmk Changeset: 20230f8b0eef Author: katleman Date: 2012-11-28 14:07 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/20230f8b0eef Merge Changeset: 303b09787a69 Author: katleman Date: 2012-11-29 11:31 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/303b09787a69 Added tag jdk8-b66 for changeset 20230f8b0eef ! .hgtags Changeset: 98e14fc9ee11 Author: lana Date: 2012-11-30 16:34 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/98e14fc9ee11 Merge From lana.steuck at oracle.com Sat Dec 1 00:55:25 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Sat, 01 Dec 2012 00:55:25 +0000 Subject: hg: jdk8/tl/hotspot: 25 new changesets Message-ID: <20121201005616.3048C47C5F@hg.openjdk.java.net> Changeset: 4e3e685dbc9d Author: katleman Date: 2012-11-15 15:39 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/4e3e685dbc9d Added tag jdk8-b65 for changeset 0f7290a03b24 ! .hgtags Changeset: 3be318ecfae5 Author: amurillo Date: 2012-11-09 08:36 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/3be318ecfae5 8003231: new hotspot build - hs25-b10 Reviewed-by: jcoomes ! make/hotspot_version Changeset: 6cb0d32b828b Author: bpittore Date: 2012-11-07 17:53 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/6cb0d32b828b 8001185: parsing of sun.boot.library.path in os::dll_build_name somewhat broken Summary: dll_dir can contain multiple paths, need to parse them correctly when loading agents Reviewed-by: dholmes, dlong Contributed-by: bill.pittore at oracle.com ! src/os/bsd/vm/os_bsd.cpp ! src/os/linux/vm/os_linux.cpp ! src/os/solaris/vm/os_solaris.cpp ! src/os/windows/vm/os_windows.cpp ! src/share/vm/classfile/classLoader.cpp ! src/share/vm/prims/jvmtiExport.cpp ! src/share/vm/runtime/os.cpp ! src/share/vm/runtime/os.hpp ! src/share/vm/runtime/thread.cpp Changeset: d9a84e246cce Author: cjplummer Date: 2012-11-09 09:45 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/d9a84e246cce Merge ! src/share/vm/runtime/thread.cpp Changeset: 429994fc0754 Author: cjplummer Date: 2012-11-14 10:13 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/429994fc0754 Merge Changeset: 6bc207d87e5d Author: mgerdin Date: 2012-11-09 00:38 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/6bc207d87e5d 7200229: NPG: possible performance issue exposed by closed/runtime/6559877/Test6559877.java Summary: Reduce the amount of calls to ChunkManager verification code Reviewed-by: jmasa, coleenp ! src/share/vm/memory/metaspace.cpp ! src/share/vm/memory/metaspace.hpp ! src/share/vm/memory/universe.cpp Changeset: 0400886d2613 Author: coleenp Date: 2012-11-14 22:37 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/0400886d2613 8003259: NPG: Build with gcc 4.7.2 broken by 7045397 Summary: Qualify calls with this pointers to make gcc accept this code. Reviewed-by: coleenp, andrew Contributed-by: peter.levart at gmail.com ! src/share/vm/memory/binaryTreeDictionary.cpp Changeset: c5d4acbb943d Author: johnc Date: 2012-11-15 14:29 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/c5d4acbb943d Merge Changeset: bd7a7ce2e264 Author: minqi Date: 2012-11-12 14:03 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/bd7a7ce2e264 6830717: replay of compilations would help with debugging Summary: When java process crashed in compiler thread, repeat the compilation process will help finding root cause. This is done with using SA dump application class data and replay data from core dump, then use debug version of jvm to recompile the problematic java method. Reviewed-by: kvn, twisti, sspitsyn Contributed-by: yumin.qi at oracle.com + agent/doc/c2replay.html ! agent/doc/clhsdb.html ! agent/doc/index.html ! agent/make/Makefile ! agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java ! agent/src/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java ! agent/src/share/classes/sun/jvm/hotspot/ci/ciConstant.java ! agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java ! agent/src/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java ! agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java ! agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java ! agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java ! agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java ! agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java ! agent/src/share/classes/sun/jvm/hotspot/oops/Field.java ! agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java ! agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java ! agent/src/share/classes/sun/jvm/hotspot/oops/Method.java ! agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java ! src/share/vm/ci/ciClassList.hpp ! src/share/vm/ci/ciEnv.cpp ! src/share/vm/ci/ciEnv.hpp ! src/share/vm/ci/ciInstanceKlass.cpp ! src/share/vm/ci/ciInstanceKlass.hpp ! src/share/vm/ci/ciMetadata.hpp ! src/share/vm/ci/ciMethod.cpp ! src/share/vm/ci/ciMethod.hpp ! src/share/vm/ci/ciMethodData.cpp ! src/share/vm/ci/ciMethodData.hpp ! src/share/vm/ci/ciObject.hpp ! src/share/vm/ci/ciObjectFactory.hpp + src/share/vm/ci/ciReplay.cpp + src/share/vm/ci/ciReplay.hpp ! src/share/vm/ci/ciSymbol.cpp ! src/share/vm/ci/ciSymbol.hpp ! src/share/vm/ci/ciUtilities.hpp ! src/share/vm/classfile/javaClasses.cpp ! src/share/vm/classfile/javaClasses.hpp ! src/share/vm/code/dependencies.cpp ! src/share/vm/interpreter/invocationCounter.hpp ! src/share/vm/oops/instanceKlass.cpp ! src/share/vm/oops/instanceKlass.hpp ! src/share/vm/oops/symbol.cpp ! src/share/vm/oops/symbol.hpp ! src/share/vm/opto/bytecodeInfo.cpp ! src/share/vm/prims/jni.cpp ! src/share/vm/prims/jvmtiExport.hpp ! src/share/vm/runtime/compilationPolicy.cpp ! src/share/vm/runtime/globals.hpp ! src/share/vm/runtime/vmStructs.cpp ! src/share/vm/utilities/array.hpp ! src/share/vm/utilities/utf8.cpp ! src/share/vm/utilities/utf8.hpp ! src/share/vm/utilities/vmError.cpp Changeset: bb33c6fdcf0d Author: bharadwaj Date: 2012-11-15 10:42 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/bb33c6fdcf0d 8001077: remove ciMethod::will_link Summary: Removed will_link and changed all calls to is_loaded(). Reviewed-by: kvn ! src/share/vm/c1/c1_GraphBuilder.cpp ! src/share/vm/ci/bcEscapeAnalyzer.cpp ! src/share/vm/ci/ciMethod.cpp ! src/share/vm/ci/ciMethod.hpp ! src/share/vm/opto/doCall.cpp Changeset: 6b6ddf8c4329 Author: neliasso Date: 2012-11-16 09:59 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/6b6ddf8c4329 Merge Changeset: 64812523d72e Author: sspitsyn Date: 2012-10-31 16:20 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/64812523d72e 7194607: VerifyLocalVariableTableOnRetransformTest.sh fails after JSR-292 merge Summary: Use verifier_max_size instead of max_size to get code attribute max stack size. Reviewed-by: dcubed, minqi Contributed-by: serguei.spitsyn at oracle.com ! src/share/vm/prims/jvmtiClassFileReconstituter.cpp Changeset: 8aaef2cee3b2 Author: minqi Date: 2012-11-08 16:48 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/8aaef2cee3b2 Merge ! src/share/vm/prims/jvmtiClassFileReconstituter.cpp - test/runtime/7158800/BadUtf8.java - test/runtime/7158800/InternTest.java - test/runtime/7158800/Test7158800.sh - test/runtime/7158800/badstrings.txt Changeset: ed8b1e39ff4f Author: zgu Date: 2012-11-09 11:04 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/ed8b1e39ff4f 8002273: NMT to report JNI memory leaks when -Xcheck:jni is on Summary: Allows NMT to report that JNI thread failed to detach from JVM before exiting, which leaks the JavaThread object when check:jni option is on. Reviewed-by: acorn, dholmes, coleenp, ctornqvi ! src/share/vm/services/memSnapshot.cpp Changeset: 4efcd79826f2 Author: zgu Date: 2012-11-09 11:47 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/4efcd79826f2 Merge Changeset: fb3190e77d3c Author: zgu Date: 2012-11-09 19:24 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/fb3190e77d3c 8001592: NMT: assertion failed: assert(_amount >= amt) failed: Just check: memBaseline.hpp:180 Summary: Fixed NMT that miscounted arena memory when it is used as value or stack object. Reviewed-by: acorn, coleenp ! src/share/vm/services/memBaseline.cpp ! src/share/vm/services/memPtr.hpp ! src/share/vm/services/memSnapshot.cpp ! src/share/vm/services/memSnapshot.hpp ! src/share/vm/services/memTracker.hpp Changeset: e26ce0e8b666 Author: zgu Date: 2012-11-09 16:45 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/e26ce0e8b666 Merge Changeset: 8c413497f434 Author: zgu Date: 2012-11-09 22:22 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/8c413497f434 Merge ! src/share/vm/services/memSnapshot.cpp Changeset: e4f764ddb06a Author: hseigel Date: 2012-11-12 15:58 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/e4f764ddb06a 7122219: Passed StringTableSize value not verified Summary: Check that the values specified for -XX:StringTableSize are within a certain range. Reviewed-by: dholmes, coleenp ! src/share/vm/classfile/symbolTable.hpp ! src/share/vm/runtime/arguments.cpp ! src/share/vm/runtime/globals.hpp ! src/share/vm/runtime/os.cpp ! src/share/vm/utilities/globalDefinitions.hpp Changeset: 070d523b96a7 Author: hseigel Date: 2012-11-12 16:15 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/070d523b96a7 8001471: Klass::cast() does nothing Summary: Remove function Klass::cast() and calls to it. Reviewed-by: dholmes, coleenp ! src/share/vm/c1/c1_Runtime1.cpp ! src/share/vm/ci/ciEnv.cpp ! src/share/vm/ci/ciType.cpp ! src/share/vm/classfile/classFileParser.cpp ! src/share/vm/classfile/dictionary.cpp ! src/share/vm/classfile/javaClasses.cpp ! src/share/vm/classfile/javaClasses.hpp ! src/share/vm/classfile/loaderConstraints.cpp ! src/share/vm/classfile/placeholders.cpp ! src/share/vm/classfile/placeholders.hpp ! src/share/vm/classfile/systemDictionary.cpp ! src/share/vm/code/dependencies.cpp ! src/share/vm/code/nmethod.cpp ! src/share/vm/compiler/disassembler.cpp ! src/share/vm/interpreter/bytecodeInterpreter.cpp ! src/share/vm/interpreter/interpreterRuntime.cpp ! src/share/vm/interpreter/linkResolver.cpp ! src/share/vm/memory/metaspaceShared.cpp ! src/share/vm/memory/universe.cpp ! src/share/vm/oops/arrayKlass.cpp ! src/share/vm/oops/cpCache.cpp ! src/share/vm/oops/instanceKlass.cpp ! src/share/vm/oops/klass.cpp ! src/share/vm/oops/klass.hpp ! src/share/vm/oops/klassVtable.cpp ! src/share/vm/oops/method.cpp ! src/share/vm/oops/objArrayKlass.cpp ! src/share/vm/oops/objArrayKlass.hpp ! src/share/vm/opto/runtime.cpp ! src/share/vm/prims/jni.cpp ! src/share/vm/prims/jniCheck.cpp ! src/share/vm/prims/jvm.cpp ! src/share/vm/prims/jvmtiEnv.cpp ! src/share/vm/prims/jvmtiEnvBase.cpp ! src/share/vm/prims/jvmtiExport.cpp ! src/share/vm/prims/jvmtiGetLoadedClasses.cpp ! src/share/vm/prims/jvmtiImpl.cpp ! src/share/vm/prims/jvmtiRedefineClasses.cpp ! src/share/vm/prims/jvmtiTagMap.cpp ! src/share/vm/prims/jvmtiTrace.cpp ! src/share/vm/prims/methodHandles.cpp ! src/share/vm/prims/nativeLookup.cpp ! src/share/vm/prims/unsafe.cpp ! src/share/vm/runtime/biasedLocking.cpp ! src/share/vm/runtime/reflection.cpp ! src/share/vm/runtime/sharedRuntime.cpp ! src/share/vm/runtime/signature.cpp ! src/share/vm/runtime/synchronizer.cpp ! src/share/vm/runtime/thread.cpp ! src/share/vm/runtime/vframe.cpp ! src/share/vm/services/classLoadingService.hpp ! src/share/vm/services/heapDumper.cpp ! src/share/vm/services/management.cpp ! src/share/vm/services/serviceUtil.hpp Changeset: 24e193d2a007 Author: coleenp Date: 2012-11-13 15:14 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/24e193d2a007 Merge Changeset: 80e866b1d053 Author: coleenp Date: 2012-11-16 09:19 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/80e866b1d053 Merge ! src/share/vm/ci/ciEnv.cpp ! src/share/vm/classfile/javaClasses.cpp ! src/share/vm/classfile/javaClasses.hpp ! src/share/vm/code/dependencies.cpp ! src/share/vm/interpreter/interpreterRuntime.cpp ! src/share/vm/memory/universe.cpp ! src/share/vm/oops/cpCache.cpp ! src/share/vm/oops/instanceKlass.cpp ! src/share/vm/prims/jni.cpp ! src/share/vm/prims/jvmtiExport.cpp ! src/share/vm/runtime/globals.hpp ! src/share/vm/runtime/os.cpp ! src/share/vm/runtime/thread.cpp Changeset: cfc5309f03b7 Author: amurillo Date: 2012-11-16 09:36 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/cfc5309f03b7 Merge Changeset: 01684f7fee1b Author: amurillo Date: 2012-11-16 09:36 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/01684f7fee1b Added tag hs25-b10 for changeset cfc5309f03b7 ! .hgtags Changeset: 2f6dc76eb8e5 Author: katleman Date: 2012-11-29 11:30 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/2f6dc76eb8e5 Added tag jdk8-b66 for changeset 01684f7fee1b ! .hgtags From lana.steuck at oracle.com Sat Dec 1 00:55:28 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Sat, 01 Dec 2012 00:55:28 +0000 Subject: hg: jdk8/tl/jdk: 18 new changesets Message-ID: <20121201005853.E139F47C60@hg.openjdk.java.net> Changeset: c87df8b1f55e Author: katleman Date: 2012-11-15 15:40 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c87df8b1f55e Added tag jdk8-b65 for changeset 130d3a54d28b ! .hgtags Changeset: 03d22c98b30a Author: ceisserer Date: 2012-11-13 16:12 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/03d22c98b30a 7105461: Large JTables are not rendered correctly with Xrender pipeline Reviewed-by: flar, prr ! src/solaris/classes/sun/java2d/xr/XRRenderer.java ! src/solaris/classes/sun/java2d/xr/XRUtils.java Changeset: ed977ca9a969 Author: lana Date: 2012-11-20 11:46 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ed977ca9a969 Merge Changeset: 11ba8795bbe9 Author: kshefov Date: 2012-11-14 11:37 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/11ba8795bbe9 7147408: [macosx] Add autodelay to fix a regression test Reviewed-by: serb, alexsch + test/javax/swing/text/StyledEditorKit/4506788/bug4506788.html + test/javax/swing/text/StyledEditorKit/4506788/bug4506788.java Changeset: f32a0aee7bb9 Author: alitvinov Date: 2012-11-14 18:40 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f32a0aee7bb9 6789984: JPasswordField can not receive keyboard input Reviewed-by: naoto, anthony ! src/share/classes/sun/awt/im/InputContext.java ! src/share/classes/sun/awt/im/InputMethodAdapter.java ! src/solaris/classes/sun/awt/X11InputMethod.java Changeset: 0269459afe2a Author: malenkov Date: 2012-11-20 18:56 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0269459afe2a 8003333: Regression: java/beans/EventHandler/Test6277266.java fails with ACE Reviewed-by: art ! test/java/beans/EventHandler/Test6277266.java Changeset: ea368459cca5 Author: lana Date: 2012-11-20 11:47 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ea368459cca5 Merge Changeset: 107a7a52a3c0 Author: lana Date: 2012-11-20 11:49 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/107a7a52a3c0 Merge Changeset: ccff3b663797 Author: tbell Date: 2012-11-14 10:21 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ccff3b663797 8001906: build-infra: warning: [path] bad path element on Solaris Summary: Remove unnecesary -cp parameter from compile line Reviewed-by: ohair, tbell Contributed-by: erik.joelsson at oracle.com ! makefiles/CompileDemos.gmk Changeset: 716efc201640 Author: tbell Date: 2012-11-15 00:55 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/716efc201640 Merge Changeset: 44e845bb5f76 Author: erikj Date: 2012-11-28 09:47 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/44e845bb5f76 8003960: build-infra: Jarsigner launcher has wrong classname Summary: Fixed package name in launcher Reviewed-by: alanb, ohair, ohrstrom ! makefiles/CompileLaunchers.gmk Changeset: ad5741112252 Author: erikj Date: 2012-11-28 13:20 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ad5741112252 8001460: build-infra: Linker warnings on macosx Summary: Remove creation of empty i386 section from fdlibm Reviewed-by: ohair ! makefiles/CompileNativeLibraries.gmk Changeset: 7ecc80d2ff2e Author: erikj Date: 2012-11-28 13:29 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7ecc80d2ff2e 8003477: build-infra: Remove explicit source file listings for libs when possible Reviewed-by: ohair, ohrstrom ! makefiles/CompileNativeLibraries.gmk Changeset: 51d2fd6d9850 Author: erikj Date: 2012-11-28 13:49 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/51d2fd6d9850 8003528: build-infra: Diffs in libjava and hotspot libs on solaris. Summary: Reorder libraries on link command line to match old build. Reviewed-by: ohair, ohrstrom ! makefiles/CompileNativeLibraries.gmk Changeset: 54516ed0f99f Author: erikj Date: 2012-11-28 14:10 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/54516ed0f99f 8003482: build-infra: Use correct manifest in security jars Reviewed-by: ohair, ohrstrom ! makefiles/CreateJars.gmk Changeset: 4d337fae2250 Author: katleman Date: 2012-11-28 14:06 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4d337fae2250 Merge Changeset: df5619994dc3 Author: katleman Date: 2012-11-29 11:31 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/df5619994dc3 Added tag jdk8-b66 for changeset 4d337fae2250 ! .hgtags Changeset: e66ec5b8c15e Author: lana Date: 2012-11-30 16:33 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e66ec5b8c15e Merge From Alan.Bateman at oracle.com Sat Dec 1 15:44:51 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 01 Dec 2012 15:44:51 +0000 Subject: RFR: 8003596 CheckLockLocationTest-Windows-fix In-Reply-To: <50B93EF8.3050109@oracle.com> References: <50B93EF8.3050109@oracle.com> Message-ID: <50BA25F2.3010205@oracle.com> On 30/11/2012 23:19, Jim Gish wrote: > Please review > http://cr.openjdk.java.net/~jgish/Bug8003596-CheckLockLocationTest-Windows-fix/ > > > > Summary: fixes test when running on Windows so that test that requires > setWritable is not run, because Windows does not support setWritable. > > Thanks, > Jim > Looks okay to me although "if (!isWindows())" to "if (!ON_WINDOWS)" might be neater. An alternative way to do this would be just to handle check the return from setWritable rather than failing. It is possible to change the deny adding entries to directories with the new file system API but it's probably not worth using it here. -Alan. From Alan.Bateman at oracle.com Sat Dec 1 15:54:32 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 01 Dec 2012 15:54:32 +0000 Subject: Request for review (XXS): JDK-8004066: TEST_BUG: test/java/lang/Math/DivModTests.java assumes ArithmeticException message In-Reply-To: <50B8FF6B.8040406@oracle.com> References: <50B8FF6B.8040406@oracle.com> Message-ID: <50BA2838.5050304@oracle.com> On 30/11/2012 18:48, Krystal Mo wrote: > Hi all, > > Could I get a couple of review for this small change, please? > And could someone from the JDK side sponsor this change? > > Bug: https://jbs.oracle.com/bugs/browse/JDK-8004066 > Webrev: http://cr.openjdk.java.net/~kmo/8004066/webrev.00/ > > The DivModTest introduced in JDK-6282196 [1] checks the contents of > the exception message, but that message isn't specified in JavaDoc and > thus may vary between VM implementations (or even in the same VM). It looks okay to me, I assume testIntFloorDivMod() could also be changed to create the ArithmeticException with the no-arg constructor as the exception message will no longer be tested. Just a general point, the tests in the jdk repository are not conformance tests and so it is okay (and normal) for these tests to exercise highly implementation-specific behavior. They are expected to be updated and always in sync with the JDK code. Clearly checking exception messages will a bit fragile, more so in this this case as the exception messages are coming from the VM. -Alan. From Alan.Bateman at oracle.com Sat Dec 1 15:58:20 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 01 Dec 2012 15:58:20 +0000 Subject: Request for review for [JBS] (JDK-8004212) java.util.Base64 methods decodeArray and decodeBuffer should return the number of bytes written In-Reply-To: <50B91F38.40907@oracle.com> References: <50B91F38.40907@oracle.com> Message-ID: <50BA291C.8010907@oracle.com> On 30/11/2012 21:03, Xueming Shen wrote: > Alan, > > It appears the return value is not correct in decode(Bytebuffer...) > case if > the buffer is overflow. Here is the webrev for that. > > http://cr.openjdk.java.net/~sherman/8004212/webrev/ I assume you mean the initial position is not 0 rather than overall. In any case, it looks fine to me. -Alan. From xueming.shen at oracle.com Sat Dec 1 19:13:38 2012 From: xueming.shen at oracle.com (Xueming Shen) Date: Sat, 01 Dec 2012 11:13:38 -0800 Subject: Request for review for [JBS] (JDK-8004212) java.util.Base64 methods decodeArray and decodeBuffer should return the number of bytes written In-Reply-To: <50BA291C.8010907@oracle.com> References: <50B91F38.40907@oracle.com> <50BA291C.8010907@oracle.com> Message-ID: <50BA56E2.3010201@oracle.com> I meant the situation that the initial position is not 0 AND the buffer does not not have enough space to decode all input. If the buffer has enough space, it worked the fine. -Sherman On 12/1/12 7:58 AM, Alan Bateman wrote: > On 30/11/2012 21:03, Xueming Shen wrote: >> Alan, >> >> It appears the return value is not correct in decode(Bytebuffer...) >> case if >> the buffer is overflow. Here is the webrev for that. >> >> http://cr.openjdk.java.net/~sherman/8004212/webrev/ > I assume you mean the initial position is not 0 rather than overall. > In any case, it looks fine to me. > > -Alan. From xueming.shen at oracle.com Sat Dec 1 19:35:44 2012 From: xueming.shen at oracle.com (xueming.shen at oracle.com) Date: Sat, 01 Dec 2012 19:35:44 +0000 Subject: hg: jdk8/tl/jdk: 8004212: java.util.Base64 methods decodeArray and decodeBuffer should return the number of bytes written Message-ID: <20121201193555.3FF4E47C75@hg.openjdk.java.net> Changeset: fd8ba2d8baec Author: sherman Date: 2012-12-01 11:36 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/fd8ba2d8baec 8004212: java.util.Base64 methods decodeArray and decodeBuffer should return the number of bytes written Summary: to return the length instead of position Reviewed-by: alanb ! src/share/classes/java/util/Base64.java ! test/java/util/Base64/TestBase64.java From alan.bateman at oracle.com Sun Dec 2 16:37:41 2012 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Sun, 02 Dec 2012 16:37:41 +0000 Subject: hg: jdk8/tl/jdk: 8003846: Override mechanism for currency data should not require creating currency.properties in java.home Message-ID: <20121202163810.B846F47C8F@hg.openjdk.java.net> Changeset: f657adf4fe78 Author: alanb Date: 2012-12-02 16:37 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f657adf4fe78 8003846: Override mechanism for currency data should not require creating currency.properties in java.home Reviewed-by: naoto ! src/share/classes/java/util/Currency.java ! test/java/util/Currency/PropertiesTest.java ! test/java/util/Currency/PropertiesTest.sh From krystal.mo at oracle.com Sun Dec 2 19:36:45 2012 From: krystal.mo at oracle.com (Krystal Mo) Date: Mon, 03 Dec 2012 03:36:45 +0800 Subject: Request for review (XXS): JDK-8004066: TEST_BUG: test/java/lang/Math/DivModTests.java assumes ArithmeticException message In-Reply-To: <50BA2838.5050304@oracle.com> References: <50B8FF6B.8040406@oracle.com> <50BA2838.5050304@oracle.com> Message-ID: <50BBADCD.5030504@oracle.com> Hi Alan and core-libs-dev, Thanks for the review. I've taken your advise and updated the webrev: http://cr.openjdk.java.net/~kmo/8004066/webrev.00/ Could you please review the updated version? Also, could anybody from the JDK side sponsor this change, please? Thanks, Kris On 12/01/2012 11:54 PM, Alan Bateman wrote: > On 30/11/2012 18:48, Krystal Mo wrote: >> Hi all, >> >> Could I get a couple of review for this small change, please? >> And could someone from the JDK side sponsor this change? >> >> Bug: https://jbs.oracle.com/bugs/browse/JDK-8004066 >> Webrev: http://cr.openjdk.java.net/~kmo/8004066/webrev.00/ >> >> The DivModTest introduced in JDK-6282196 [1] checks the contents of >> the exception message, but that message isn't specified in JavaDoc >> and thus may vary between VM implementations (or even in the same VM). > It looks okay to me, I assume testIntFloorDivMod() could also be > changed to create the ArithmeticException with the no-arg constructor > as the exception message will no longer be tested. > > Just a general point, the tests in the jdk repository are not > conformance tests and so it is okay (and normal) for these tests to > exercise highly implementation-specific behavior. They are expected to > be updated and always in sync with the JDK code. Clearly checking > exception messages will a bit fragile, more so in this this case as > the exception messages are coming from the VM. > > -Alan. > > From david.holmes at oracle.com Mon Dec 3 00:18:20 2012 From: david.holmes at oracle.com (david.holmes at oracle.com) Date: Mon, 03 Dec 2012 00:18:20 +0000 Subject: hg: jdk8/tl/jdk: 7200297: agent code does not handle multiple boot library path elements correctly Message-ID: <20121203001847.3487F47CB8@hg.openjdk.java.net> Changeset: 60550cd2b527 Author: dholmes Date: 2012-12-02 19:16 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/60550cd2b527 7200297: agent code does not handle multiple boot library path elements correctly Summary: When bug 6819213 was fixed it enabled sun.boot.library.path property to contain multiple paths. Code in agents does not handle multiple paths when attempting to find dependent shared libs. Reviewed-by: dholmes, sspitsyn, dsamersoff Contributed-by: Bill Pittore ! src/share/back/debugInit.c ! src/share/back/error_messages.c ! src/share/back/transport.c ! src/share/demo/jvmti/hprof/hprof.h ! src/share/demo/jvmti/hprof/hprof_init.c ! src/solaris/back/linker_md.c ! src/solaris/demo/jvmti/hprof/hprof_md.c ! src/solaris/npt/npt_md.h ! src/windows/back/linker_md.c ! src/windows/demo/jvmti/hprof/hprof_md.c ! src/windows/npt/npt_md.h From david.holmes at oracle.com Mon Dec 3 00:27:45 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 03 Dec 2012 10:27:45 +1000 Subject: RFR- 7200297 jdwp and hprof code do not handle multiple sun.boot.library.path elements correctly In-Reply-To: <50B8D4EE.3080607@oracle.com> References: <50B8CDCC.90702@oracle.com> <50B8D2C9.30502@oracle.com> <50B8D4EE.3080607@oracle.com> Message-ID: <50BBF201.80309@oracle.com> On 1/12/2012 1:46 AM, BILL PITTORE wrote: > Ok, Thanks. > David Holmes asked that I send to this alias and he would re-review then > push it for me. Yes I wanted a chance for TL folks to see it (Alan has). So re-Reviewed and pushed. Bill: note that I had to re-do the commit as you don't have jdk8 Author status. You are the Contributor. Thanks, David > > bill > > | > > On 11/30/2012 10:37 AM, Alan Bateman wrote: | >> On 30/11/2012 15:16, BILL PITTORE wrote: >>> This bug was reviewed by serviceability and hotspot-runtime-dev lists >>> since it dealt with jvmti agent code. >>> Comments welcome. The intent is to push into tl/jdk tree and then >>> eventually back into jdk7u-dev hopefully. Webrev here: >>> >>> http://cr.openjdk.java.net/~bpittore/7200297/webrev.04/ >>> >>> And previous reviews here: >>> http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2012-November/004801.html >>> >>> >>> thanks, >>> bill >>> >> Bill - if you already have a reviewer then just go ahead and push the >> fix, you don't need to get an additional review here. >> >> -Alan > > From david.holmes at oracle.com Mon Dec 3 00:47:57 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 03 Dec 2012 10:47:57 +1000 Subject: Request for review (XXS): JDK-8004066: TEST_BUG: test/java/lang/Math/DivModTests.java assumes ArithmeticException message In-Reply-To: <50BBADCD.5030504@oracle.com> References: <50B8FF6B.8040406@oracle.com> <50BA2838.5050304@oracle.com> <50BBADCD.5030504@oracle.com> Message-ID: <50BBF6BD.60307@oracle.com> On 3/12/2012 5:36 AM, Krystal Mo wrote: > Hi Alan and core-libs-dev, > > Thanks for the review. I've taken your advise and updated the webrev: > http://cr.openjdk.java.net/~kmo/8004066/webrev.00/ > > Could you please review the updated version? If you no longer check the exception message then there's no need to modify the exception construction. I can't help but think we've lost something in making this change though - any ArithmeticException will cause the test to pass, when it should only be exceptions from divide-by-zero that are ok. :( I don't see any way around it though. David ----- > Also, could anybody from the JDK side sponsor this change, please? > > Thanks, > Kris > > On 12/01/2012 11:54 PM, Alan Bateman wrote: >> On 30/11/2012 18:48, Krystal Mo wrote: >>> Hi all, >>> >>> Could I get a couple of review for this small change, please? >>> And could someone from the JDK side sponsor this change? >>> >>> Bug: https://jbs.oracle.com/bugs/browse/JDK-8004066 >>> Webrev: http://cr.openjdk.java.net/~kmo/8004066/webrev.00/ >>> >>> The DivModTest introduced in JDK-6282196 [1] checks the contents of >>> the exception message, but that message isn't specified in JavaDoc >>> and thus may vary between VM implementations (or even in the same VM). >> It looks okay to me, I assume testIntFloorDivMod() could also be >> changed to create the ArithmeticException with the no-arg constructor >> as the exception message will no longer be tested. >> >> Just a general point, the tests in the jdk repository are not >> conformance tests and so it is okay (and normal) for these tests to >> exercise highly implementation-specific behavior. They are expected to >> be updated and always in sync with the JDK code. Clearly checking >> exception messages will a bit fragile, more so in this this case as >> the exception messages are coming from the VM. >> >> -Alan. >> >> > From david.holmes at oracle.com Mon Dec 3 01:15:27 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 03 Dec 2012 11:15:27 +1000 Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch In-Reply-To: <50B900F2.9060902@oracle.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> Message-ID: <50BBFD2F.1080108@oracle.com> On 1/12/2012 4:54 AM, Alan Bateman wrote: > On 30/11/2012 18:36, Peter Levart wrote: >> : >> >> So, what do you think? What kind of tests should I prepare in addidion >> to those 3 so that the patch might get a consideration? > I think this is good work and thanks for re-basing your patch. I know > David plans to do a detail review. I think it will require extensive > performance testing too, perhaps with some large applications. Indeed I do plan a detailed review and have initiated some initial performance tests. I am also swamped but will try to get to the review this week - and will also need to check the referenced annotations updates. David > -Alan > From david.holmes at oracle.com Mon Dec 3 01:50:46 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 03 Dec 2012 11:50:46 +1000 Subject: Review Request: 8004201: add reducers to primitive type wrappers In-Reply-To: <50B8FE8A.2030403@oracle.com> References: <50B8FE8A.2030403@oracle.com> Message-ID: <50BC0576.4070202@oracle.com> Hi Akhil, Is it really necessary/desirable to flag all of these as " Suitable for conversion as a method reference to functional interfaces such as ..." ? This style: + * @param a a boolean argument. + * @param b another boolean argument. is at odds with the style used elsewhere for new Functional APIs, and with the style of other methods in these classes. Can we just use "first operand" and "second operand" for all of these? Character.sum does not make sense to me. Who adds together characters? I'm not even sure min and max are worth supporting for Character. I disagree with other suggestions to use the Math functions for float/double. I think all these methods should use the underlying primitive operator regardless of type. Thanks, David ----- On 1/12/2012 4:44 AM, Akhil Arora wrote: > Hi > > Requesting review for some basic functionality related to lambdas - > > Add min, max, sum methods to the primitive wrapper classes - Byte, > Short, Integer, Long, Float, Double and Character so as to be able to > use them as reducers in lambda expressions. Add and, or, xor methods to > Boolean. > > http://cr.openjdk.java.net/~akhil/8004201.0/webrev/ > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004201 > > Thanks From david.holmes at oracle.com Mon Dec 3 01:55:04 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 03 Dec 2012 11:55:04 +1000 Subject: Profiles update to jdk8-b65 Message-ID: <50BC0678.1040300@oracle.com> Just FYI the Profiles forest has been updated to the jdk8-b65 level. I hope to catch up to b66 this week. There is no new functionality here. The builds are still officially limited to linux only and I will soon add a check for that to allow this to be merged with the mainline repos. David ----- From krystal.mo at oracle.com Mon Dec 3 06:37:23 2012 From: krystal.mo at oracle.com (Krystal Mo) Date: Mon, 03 Dec 2012 14:37:23 +0800 Subject: Request for review (XXS): JDK-8004066: TEST_BUG: test/java/lang/Math/DivModTests.java assumes ArithmeticException message In-Reply-To: <50BBF6BD.60307@oracle.com> References: <50B8FF6B.8040406@oracle.com> <50BA2838.5050304@oracle.com> <50BBADCD.5030504@oracle.com> <50BBF6BD.60307@oracle.com> Message-ID: <50BC48A3.6000805@oracle.com> Hi David, On 12/03/2012 08:47 AM, David Holmes wrote: > On 3/12/2012 5:36 AM, Krystal Mo wrote: >> Hi Alan and core-libs-dev, >> >> Thanks for the review. I've taken your advise and updated the webrev: >> http://cr.openjdk.java.net/~kmo/8004066/webrev.00/ >> >> Could you please review the updated version? > > If you no longer check the exception message then there's no need to > modify the exception construction. > The exception message passed to the constructor call may be mistaken as a part of the test if we leave it there as it is now. There are comments on those lines which should be sufficient to show the intent of checking division by zero. So I took Alan's advise and made the update. Don't have a strong opinion on this one, though; I'm okay either way. > I can't help but think we've lost something in making this change > though - any ArithmeticException will cause the test to pass, when it > should only be exceptions from divide-by-zero that are ok. :( I don't > see any way around it though. > Well, we've lost something that wasn't there in the first place. There's no good way of verifying whether an ArithmeticException was thrown from a division by zero or not. Having just line numbers in the exception stack trace doesn't help; if it actually kept the bytecode index of the exception throw site, there might have been a way to verify if that bci was pointing to a idiv/ldiv instruction. But we don't have that information in the exception object. Thanks, Kris > David > ----- > > >> Also, could anybody from the JDK side sponsor this change, please? >> >> Thanks, >> Kris >> >> On 12/01/2012 11:54 PM, Alan Bateman wrote: >>> On 30/11/2012 18:48, Krystal Mo wrote: >>>> Hi all, >>>> >>>> Could I get a couple of review for this small change, please? >>>> And could someone from the JDK side sponsor this change? >>>> >>>> Bug: https://jbs.oracle.com/bugs/browse/JDK-8004066 >>>> Webrev: http://cr.openjdk.java.net/~kmo/8004066/webrev.00/ >>>> >>>> The DivModTest introduced in JDK-6282196 [1] checks the contents of >>>> the exception message, but that message isn't specified in JavaDoc >>>> and thus may vary between VM implementations (or even in the same VM). >>> It looks okay to me, I assume testIntFloorDivMod() could also be >>> changed to create the ArithmeticException with the no-arg constructor >>> as the exception message will no longer be tested. >>> >>> Just a general point, the tests in the jdk repository are not >>> conformance tests and so it is okay (and normal) for these tests to >>> exercise highly implementation-specific behavior. They are expected to >>> be updated and always in sync with the JDK code. Clearly checking >>> exception messages will a bit fragile, more so in this this case as >>> the exception messages are coming from the VM. >>> >>> -Alan. >>> >>> >> From david.holmes at oracle.com Mon Dec 3 07:23:17 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 03 Dec 2012 17:23:17 +1000 Subject: Request for review (XXS): JDK-8004066: TEST_BUG: test/java/lang/Math/DivModTests.java assumes ArithmeticException message In-Reply-To: <50BC48A3.6000805@oracle.com> References: <50B8FF6B.8040406@oracle.com> <50BA2838.5050304@oracle.com> <50BBADCD.5030504@oracle.com> <50BBF6BD.60307@oracle.com> <50BC48A3.6000805@oracle.com> Message-ID: <50BC5365.9000309@oracle.com> Hi Kris, On 3/12/2012 4:37 PM, Krystal Mo wrote: > On 12/03/2012 08:47 AM, David Holmes wrote: >> On 3/12/2012 5:36 AM, Krystal Mo wrote: >>> Hi Alan and core-libs-dev, >>> >>> Thanks for the review. I've taken your advise and updated the webrev: >>> http://cr.openjdk.java.net/~kmo/8004066/webrev.00/ >>> >>> Could you please review the updated version? >> >> If you no longer check the exception message then there's no need to >> modify the exception construction. >> > > The exception message passed to the constructor call may be mistaken as > a part of the test if we leave it there as it is now. There are comments > on those lines which should be sufficient to show the intent of checking > division by zero. So I took Alan's advise and made the update. Don't > have a strong opinion on this one, though; I'm okay either way. > >> I can't help but think we've lost something in making this change >> though - any ArithmeticException will cause the test to pass, when it >> should only be exceptions from divide-by-zero that are ok. :( I don't >> see any way around it though. >> > > Well, we've lost something that wasn't there in the first place. There's > no good way of verifying whether an ArithmeticException was thrown from > a division by zero or not. Well the exception message indicates it for hotspot - and that is what the test was checking for. Now it is a VM neutral test but isn't testing what we would like. AS I said I don't see a way around it. David ----- Having just line numbers in the exception > stack trace doesn't help; if it actually kept the bytecode index of the > exception throw site, there might have been a way to verify if that bci > was pointing to a idiv/ldiv instruction. But we don't have that > information in the exception object. > > Thanks, > Kris > >> David >> ----- >> >> >>> Also, could anybody from the JDK side sponsor this change, please? >>> >>> Thanks, >>> Kris >>> >>> On 12/01/2012 11:54 PM, Alan Bateman wrote: >>>> On 30/11/2012 18:48, Krystal Mo wrote: >>>>> Hi all, >>>>> >>>>> Could I get a couple of review for this small change, please? >>>>> And could someone from the JDK side sponsor this change? >>>>> >>>>> Bug: https://jbs.oracle.com/bugs/browse/JDK-8004066 >>>>> Webrev: http://cr.openjdk.java.net/~kmo/8004066/webrev.00/ >>>>> >>>>> The DivModTest introduced in JDK-6282196 [1] checks the contents of >>>>> the exception message, but that message isn't specified in JavaDoc >>>>> and thus may vary between VM implementations (or even in the same VM). >>>> It looks okay to me, I assume testIntFloorDivMod() could also be >>>> changed to create the ArithmeticException with the no-arg constructor >>>> as the exception message will no longer be tested. >>>> >>>> Just a general point, the tests in the jdk repository are not >>>> conformance tests and so it is okay (and normal) for these tests to >>>> exercise highly implementation-specific behavior. They are expected to >>>> be updated and always in sync with the JDK code. Clearly checking >>>> exception messages will a bit fragile, more so in this this case as >>>> the exception messages are coming from the VM. >>>> >>>> -Alan. >>>> >>>> >>> > From peter.levart at gmail.com Mon Dec 3 07:41:20 2012 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 03 Dec 2012 08:41:20 +0100 Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch In-Reply-To: <50BBFD2F.1080108@oracle.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> Message-ID: <50BC57A0.8000108@gmail.com> Hi David, Alan, Alexander and others, In the meanwhile I have added another annotations space optimization to the patch. If a Class doesn't inherit any annotations from a superclass, which I think is a common case, it assigns the same Map instance to "annotations" as well as "declaredAnnotations" fields. Previously - and in the original code - this only happened for java.lang.Object and interfaces. Here's the updated webrev: http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html I have also rewritten the performance micro-benchmarks. With the addition of repeating annotations, one performance aspect surfaces: when asking for a particular annotation type on a Class and that annotation is not present, the new repeating annotations support method AnnotationSupport.getOneAnnotation asks for @ContainedBy meta-annotation on the annotation type. This can result in an even more apparent synchronization hot-spot with original code that uses synchronized initAnnotationsIfNecessary(). This aspect is tested with the 3rd test. Other 2 tests test the same thing as before but are more stable now, since now they measure retrieval of 5 different annotation types from each AnnotatedElement, previously they only measured retrieval of 1 which was very sensitive to HashMap irregularities (it could happen that a particular key mapped to a bucket that was overloaded in one test-run and not in another)... Here're the new tests: https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java And the corresponding results when run on an i7 CPU on Linux: https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt Regards, Peter On 12/03/2012 02:15 AM, David Holmes wrote: > On 1/12/2012 4:54 AM, Alan Bateman wrote: >> On 30/11/2012 18:36, Peter Levart wrote: >>> : >>> >>> So, what do you think? What kind of tests should I prepare in addidion >>> to those 3 so that the patch might get a consideration? >> I think this is good work and thanks for re-basing your patch. I know >> David plans to do a detail review. I think it will require extensive >> performance testing too, perhaps with some large applications. > > Indeed I do plan a detailed review and have initiated some initial > performance tests. > > I am also swamped but will try to get to the review this week - and > will also need to check the referenced annotations updates. > > David > >> -Alan >> From dingxmin at linux.vnet.ibm.com Mon Dec 3 08:17:46 2012 From: dingxmin at linux.vnet.ibm.com (Frank Ding) Date: Mon, 03 Dec 2012 16:17:46 +0800 Subject: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData In-Reply-To: References: <509C7218.4020807@linux.vnet.ibm.com> <50A1AFA6.8010905@linux.vnet.ibm.com> <50B8436A.3000107@linux.vnet.ibm.com> Message-ID: <50BC602A.1070709@linux.vnet.ibm.com> Hi Lance, Thanks for your clarification. I created the test case you requested and attached it in this email. Please review it. By the way, the new Oracle bug (internal id 2376620) submitted by me several days ago seems not having been reviewed. Could you also help me on this? Best regards, Frank On 11/30/2012 8:40 PM, Lance Andersen - Oracle wrote: > Hi Frank, > > Thank you for the email. No we do not want tests that require database access in jtreg. > > What I was trying to say, albeit not probably as clear as it could have been is that it would be helpful to provide a complete example and to use Java DB as the database if it is a generic data access issue as while it is not a required part of the Java SE specification, we do provide it with the Oracle JDK so it makes it easier to test against for developers vs finding an instance of DB2, Sybase or even Oracle to test against. > > Best > Lance > On Nov 30, 2012, at 12:26 AM, Frank Ding wrote: > >> Hi Lance, >> Sorry for late response and thanks for your comment. You mean I can write a jtreg test case that connects to Java DB? I can do that. >> >> Best regards, >> Frank >> >> On 11/13/2012 10:13 PM, Lance Andersen - Oracle wrote: >>> Hi Frank, >>> >>> >>> Thank you for the note >>> If you could in the future, please provide a complete test program to repro the issue as it would save time with the reviews. Ideally if the issue is not database specific it would be good to leverage Java DB as it is included within Oracle JDK >>> >>> I will look at this sometime this week >>> >>> Best >>> Lance >>> On Nov 12, 2012, at 9:25 PM, Frank Ding wrote: >>> >>>> Hi Lance >>>> Thanks for your quick response. Please find the bug info below. >>>> >>>> The problem: >>>> When CachedRowSetImpl.acceptChanges() is called, incorrect number of conflicts, if any, is reported. The number of conflicts is the actual number of existing rows in database, which is the size of variable 'status' defined in CachedRowSetWriter.writeData(). It's not the conflict number that is supposed to be. >>>> >>>> Test case: >>>> The bug can be easily manifested in all SQL server environment. Here take PostgreSQL for example. >>>> 1. The sql script to create a table >>>> CREATE TABLE ressystem.roomdescription >>>> ( >>>> roomdescription_id serial NOT NULL, >>>> roomdescription character varying NOT NULL, >>>> CONSTRAINT roomdescription_pkey PRIMARY KEY (roomdescription_id) >>>> ) >>>> >>>> 2. Manually insert 3 rows >>>> (1, "Test 1") >>>> (2, "Test 2") >>>> (3, "Test 3") >>>> >>>> 3. Create a Java class that connects the established database and then execute the following code snippet. >>>> String query = "select roomdescription_id, roomdescription from ressystem.roomdescription"; >>>> Object[] values = {2, "Test2"}; >>>> rs.setCommand(query); >>>> rs.execute(conn); >>>> rs.moveToInsertRow(); >>>> for(int i=0; i>>> rs.updateObject(i+1,values[i]); >>>> } >>>> rs.insertRow(); >>>> rs.moveToCurrentRow(); >>>> rs.acceptChanges(conn); >>>> >>>> 4. An exception occurs with following output. >>>> javax.sql.rowset.spi.SyncProviderException: 4conflicts while synchronizing >>>> at com.sun.rowset.internal.CachedRowSetWriter.writeData(CachedRowSetWriter.java:412) >>>> at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:880) >>>> >>>> 5. In fact, there is only one conflicting row but 4 were reported. >>>> >>>> Best regards, >>>> Frank >>>> >>>> On 11/9/2012 7:41 PM, Lance Andersen - Oracle wrote: >>>>> Frank, >>>>> >>>>> If you can please post the bug info here, I will take a look at your patch >>>>> >>>>> Best >>>>> Lance >>>>> On Nov 8, 2012, at 10:01 PM, Frank Ding wrote: >>>>> >>>>>> Hi guys, >>>>>> We discovered a bug in CachedRowSetWriter.writeData method where incorrect number of conflicts is reported. I searched in Oracle bug database and no similar record was found. So I submitted a new one whose internal review ID is 2376620. A test case with code is illustrated in the bug submission that leverages PostgreSQL server but the issue is platform independent and easy to reproduce. >>>>>> I provided a patch review, available @ >>>>>> http://cr.openjdk.java.net/~dingxmin/2376620/webrev.01/ >>>>>> Is there anybody who is interested in patch and can also review bug 2376620? Your reply is appreciated. >>>>>> >>>>>> Best regards, >>>>>> Frank >>>>>> >>>>>> >>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>>> Oracle Java Engineering >>>>> 1 Network Drive >>>>> Burlington, MA 01803 >>>>> Lance.Andersen at oracle.com >>>>> >>> >>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > -------------- next part -------------- /* * Copyright (c) 2012 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * Portions Copyright (c) 2012 IBM Corporation */ import com.sun.rowset.CachedRowSetImpl; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import javax.sql.rowset.CachedRowSet; public class DerbyTest { private static String DERBY_DB_FILE = "derbydb"; private static Connection getConnection() throws Exception { String driver = "org.apache.derby.jdbc.EmbeddedDriver"; String url = "jdbc:derby:" + DERBY_DB_FILE + ";create=true"; Connection conn; try { Class.forName(driver); conn = DriverManager.getConnection(url); } catch (Exception e) { throw e; } return conn; } private static void createTable(Connection conn) throws SQLException { Statement statement = conn.createStatement(); try { statement.execute("DROP TABLE mytable"); } catch (SQLException ex) { // ignore exception when mytable doesn't exist } String createTableSQL = "CREATE TABLE mytable" + "(id INT NOT NULL PRIMARY KEY," + "description VARCHAR(30) NOT NULL)"; statement.executeUpdate(createTableSQL); statement.close(); } private static void prepareData(Connection conn) throws SQLException { Statement statement = conn.createStatement(); String insertTableData = "INSERT INTO mytable(id,description)" + "VALUES(1, 'r1')"; statement.executeUpdate(insertTableData); insertTableData = "INSERT INTO mytable(id,description)" + "VALUES(2, 'r2')"; statement.executeUpdate(insertTableData); statement.close(); } private static void createConflict(Connection conn) throws SQLException { CachedRowSet rs = new CachedRowSetImpl(); rs.setReadOnly(false); String querySql = "SELECT id, description FROM mytable"; rs.setCommand(querySql); rs.execute(conn); rs.moveToInsertRow(); rs.updateObject(1, 2); rs.updateObject(2, "new str"); rs.insertRow(); rs.moveToCurrentRow(); rs.acceptChanges(conn); } public static void main(String[] args) throws Exception { Connection conn = getConnection(); createTable(conn); prepareData(conn); try { createConflict(conn); } catch (SQLException ex) { String errMsg = ex.getMessage(); if (!errMsg.startsWith("1")) { System.out.println("The conflict number should be 1 but now " + "it is " + errMsg); throw ex; } } conn.close(); } } From weijun.wang at oracle.com Mon Dec 3 09:14:21 2012 From: weijun.wang at oracle.com (weijun.wang at oracle.com) Date: Mon, 03 Dec 2012 09:14:21 +0000 Subject: hg: jdk8/tl/jdk: 7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten Message-ID: <20121203091444.97B8347CD1@hg.openjdk.java.net> Changeset: a42da685dfca Author: weijun Date: 2012-12-03 17:14 +0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a42da685dfca 7198507: [TEST_BUG] sun/security/tools/keytool/console.sh should be rewritten Reviewed-by: xuelei ! test/sun/security/tools/keytool/console.sh From Lance.Andersen at oracle.com Mon Dec 3 12:54:10 2012 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Mon, 3 Dec 2012 07:54:10 -0500 Subject: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData In-Reply-To: <50BC602A.1070709@linux.vnet.ibm.com> References: <509C7218.4020807@linux.vnet.ibm.com> <50A1AFA6.8010905@linux.vnet.ibm.com> <50B8436A.3000107@linux.vnet.ibm.com> <50BC602A.1070709@linux.vnet.ibm.com> Message-ID: <94FE64AC-FC6A-4A92-8803-ABA278397515@oracle.com> I will get to it sometime within the next week. Have some higher priority items to address first Best Lance On Dec 3, 2012, at 3:17 AM, Frank Ding wrote: > Hi Lance, > Thanks for your clarification. I created the test case you requested and attached it in this email. Please review it. By the way, the new Oracle bug (internal id 2376620) submitted by me several days ago seems not having been reviewed. Could you also help me on this? > > Best regards, > Frank > > > On 11/30/2012 8:40 PM, Lance Andersen - Oracle wrote: >> Hi Frank, >> >> Thank you for the email. No we do not want tests that require database access in jtreg. >> >> What I was trying to say, albeit not probably as clear as it could have been is that it would be helpful to provide a complete example and to use Java DB as the database if it is a generic data access issue as while it is not a required part of the Java SE specification, we do provide it with the Oracle JDK so it makes it easier to test against for developers vs finding an instance of DB2, Sybase or even Oracle to test against. >> >> Best >> Lance >> On Nov 30, 2012, at 12:26 AM, Frank Ding wrote: >> >>> Hi Lance, >>> Sorry for late response and thanks for your comment. You mean I can write a jtreg test case that connects to Java DB? I can do that. >>> >>> Best regards, >>> Frank >>> >>> On 11/13/2012 10:13 PM, Lance Andersen - Oracle wrote: >>>> Hi Frank, >>>> >>>> >>>> Thank you for the note >>>> If you could in the future, please provide a complete test program to repro the issue as it would save time with the reviews. Ideally if the issue is not database specific it would be good to leverage Java DB as it is included within Oracle JDK >>>> >>>> I will look at this sometime this week >>>> >>>> Best >>>> Lance >>>> On Nov 12, 2012, at 9:25 PM, Frank Ding wrote: >>>> >>>>> Hi Lance >>>>> Thanks for your quick response. Please find the bug info below. >>>>> >>>>> The problem: >>>>> When CachedRowSetImpl.acceptChanges() is called, incorrect number of conflicts, if any, is reported. The number of conflicts is the actual number of existing rows in database, which is the size of variable 'status' defined in CachedRowSetWriter.writeData(). It's not the conflict number that is supposed to be. >>>>> >>>>> Test case: >>>>> The bug can be easily manifested in all SQL server environment. Here take PostgreSQL for example. >>>>> 1. The sql script to create a table >>>>> CREATE TABLE ressystem.roomdescription >>>>> ( >>>>> roomdescription_id serial NOT NULL, >>>>> roomdescription character varying NOT NULL, >>>>> CONSTRAINT roomdescription_pkey PRIMARY KEY (roomdescription_id) >>>>> ) >>>>> >>>>> 2. Manually insert 3 rows >>>>> (1, "Test 1") >>>>> (2, "Test 2") >>>>> (3, "Test 3") >>>>> >>>>> 3. Create a Java class that connects the established database and then execute the following code snippet. >>>>> String query = "select roomdescription_id, roomdescription from ressystem.roomdescription"; >>>>> Object[] values = {2, "Test2"}; >>>>> rs.setCommand(query); >>>>> rs.execute(conn); >>>>> rs.moveToInsertRow(); >>>>> for(int i=0; i>>>> rs.updateObject(i+1,values[i]); >>>>> } >>>>> rs.insertRow(); >>>>> rs.moveToCurrentRow(); >>>>> rs.acceptChanges(conn); >>>>> >>>>> 4. An exception occurs with following output. >>>>> javax.sql.rowset.spi.SyncProviderException: 4conflicts while synchronizing >>>>> at com.sun.rowset.internal.CachedRowSetWriter.writeData(CachedRowSetWriter.java:412) >>>>> at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:880) >>>>> >>>>> 5. In fact, there is only one conflicting row but 4 were reported. >>>>> >>>>> Best regards, >>>>> Frank >>>>> >>>>> On 11/9/2012 7:41 PM, Lance Andersen - Oracle wrote: >>>>>> Frank, >>>>>> >>>>>> If you can please post the bug info here, I will take a look at your patch >>>>>> >>>>>> Best >>>>>> Lance >>>>>> On Nov 8, 2012, at 10:01 PM, Frank Ding wrote: >>>>>> >>>>>>> Hi guys, >>>>>>> We discovered a bug in CachedRowSetWriter.writeData method where incorrect number of conflicts is reported. I searched in Oracle bug database and no similar record was found. So I submitted a new one whose internal review ID is 2376620. A test case with code is illustrated in the bug submission that leverages PostgreSQL server but the issue is platform independent and easy to reproduce. >>>>>>> I provided a patch review, available @ >>>>>>> http://cr.openjdk.java.net/~dingxmin/2376620/webrev.01/ >>>>>>> Is there anybody who is interested in patch and can also review bug 2376620? Your reply is appreciated. >>>>>>> >>>>>>> Best regards, >>>>>>> Frank >>>>>>> >>>>>>> >>>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>>>> Oracle Java Engineering >>>>>> 1 Network Drive >>>>>> Burlington, MA 01803 >>>>>> Lance.Andersen at oracle.com >>>>>> >>>> >>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>> Oracle Java Engineering >>>> 1 Network Drive >>>> Burlington, MA 01803 >>>> Lance.Andersen at oracle.com >>>> >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: DerbyTest.java URL: -------------- next part -------------- > -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From xuelei.fan at oracle.com Mon Dec 3 14:01:35 2012 From: xuelei.fan at oracle.com (xuelei.fan at oracle.com) Date: Mon, 03 Dec 2012 14:01:35 +0000 Subject: hg: jdk8/tl/jdk: 8004184: security tests leave JSSEServer running Message-ID: <20121203140215.00D5D47CDD@hg.openjdk.java.net> Changeset: ead651efb271 Author: xuelei Date: 2012-12-03 06:00 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ead651efb271 8004184: security tests leave JSSEServer running Summary: Use othervm mode to release resources, and correct the system properties issues in JSSE Reviewed-by: chegar ! test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java From jim.gish at oracle.com Mon Dec 3 15:01:43 2012 From: jim.gish at oracle.com (Jim Gish) Date: Mon, 03 Dec 2012 10:01:43 -0500 Subject: RFR: 8003596 CheckLockLocationTest-Windows-fix In-Reply-To: <50BA25F2.3010205@oracle.com> References: <50B93EF8.3050109@oracle.com> <50BA25F2.3010205@oracle.com> Message-ID: <50BCBED7.6060105@oracle.com> Thanks. Could you please push the change. Jim On 12/01/2012 10:44 AM, Alan Bateman wrote: > On 30/11/2012 23:19, Jim Gish wrote: >> Please review >> http://cr.openjdk.java.net/~jgish/Bug8003596-CheckLockLocationTest-Windows-fix/ >> >> >> >> Summary: fixes test when running on Windows so that test that >> requires setWritable is not run, because Windows does not support >> setWritable. >> >> Thanks, >> Jim >> > Looks okay to me although "if (!isWindows())" to "if (!ON_WINDOWS)" > might be neater. An alternative way to do this would be just to handle > check the return from setWritable rather than failing. It is possible > to change the deny adding entries to directories with the new file > system API but it's probably not worth using it here. > > -Alan. -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From sean.mullan at oracle.com Mon Dec 3 16:17:10 2012 From: sean.mullan at oracle.com (sean.mullan at oracle.com) Date: Mon, 03 Dec 2012 16:17:10 +0000 Subject: hg: jdk8/tl/jdk: 7199143: RFE: OCSP revocation checker should provide possibility to specify connection timeout Message-ID: <20121203161732.2584F47CEC@hg.openjdk.java.net> Changeset: ee9846f351d7 Author: mullan Date: 2012-12-03 11:07 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ee9846f351d7 7199143: RFE: OCSP revocation checker should provide possibility to specify connection timeout Summary: Added com.sun.security.ocsp.timeout system property to control timeout Reviewed-by: mullan, vinnie Contributed-by: jason.uh at oracle.com ! src/share/classes/sun/security/provider/certpath/OCSP.java From daniel.fuchs at oracle.com Mon Dec 3 19:04:45 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Mon, 03 Dec 2012 20:04:45 +0100 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) Message-ID: <50BCF7CD.1020308@oracle.com> Hi, This is a first webrev in a series that addresses a change intended for JDK 8: 7169894: JAXP Plugability Layer: using service loader I've been building up on Joe's work and Paul & Alan comments from an earlier discussion thread [1] This here addresses changes in the javax.xml.parsers package for the SAXParserFactory and DocumentBuilderFactory - and more specifically their no-argument newInstance() method. This change replaces the custom code that was reading the META-INF/services/ resources by a simple call to ServiceLoader. In addition - since it is foreseen that the default implementation for the parsers might come as a separate Module in the future, we cannot make the assumption that the first service provider encountered by the ServiceLoader will be the third-party/custom provider to use. As a consequence, since we must allow for a third-party/custom provider to override the default implementation - we will skip over any provider whose class name has the default implementation class name, and return it only if no other provider is found. This is a small spec change intended for JDK8 which is reflected in the API Documentation of the two factory classes. The impact is that in the very rare configuration where you have on the classpath two providers: A.jar:B.jar, where A.jar has a services/* config that points at the default factory implementation, and B.jar points at a custom implementation, then the new XxxxFactory will return the custom implementation pointed at by B.jar, whereas it used to return the default implementation pointed at by A.jar. best regards, -- daniel references: [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-June/010595.html From peter.levart at gmail.com Mon Dec 3 21:52:36 2012 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 03 Dec 2012 22:52:36 +0100 Subject: AnnotationType & AnnotationSupport + repeating annotations In-Reply-To: <50BC57A0.8000108@gmail.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> Message-ID: <50BD1F24.40306@gmail.com> Hi David and Alan, The following is in part connected with the new code for repeating annotations, and in part with the proposed patch for resolving synchronization issues with annotations as well as improvements regarding space and multi-threaded contention. Although connected, the patch proposed here can be taken entirely by itself. Let me try to explain what this patch does. This patch removes the "synchronized" keyword from the static method AnnotationType.getInstance(Class). By itself this synchronization does not present any big performance issue since the method is always called on slow-path (when parsing the annotations, when lazily constructing a Map of inherited annotations, when de-serializing annotations). The reason this method is synchronized on a single monitor is because it: - lazily constructs an instance of AnnotationType and exposes it to other threads via a Class.annotationType field - in the middle of the AnnotationType constructor it exposes a half-constructed instance via a Class.annotationType field to current thread so that recursive calls don't result in infinite recursion. As current parsing/resolving logic is coded, other threads must not see the half-constructed AnnotationType instance and current thread must see it. This is achieved by single re-entrant lock because only single lock guarantees the absence of dead-locks (as can be seen from bugs this lock in combination with initAnnotationsIfNecessary() is a cause for dead-locks, but that's another story). Now because there is a single lock, the method must not be called on heavily executed code paths or this will present a synchronization bottleneck. One such heavily executed code path is in the new sun.reflect.annotation.AnnotationSupport class that contains the logic for repeating annotations. In this class the AnnotationType for a particular annotation class is not obtained via this synchronized method, but incorrectly via direct unsynchronized read of Class.annotationType field. The code in AnnotationSupport can therefore dereference a half-constructed AnnotationType instance before it's constructor, executing in another thread, is finished and before final fields in object are frozen. Class.[get,set]AnnotationType should only be called from within the synchronized AnnotationType.getInstance method, but that apparently is to contended to be practical. I solved the problem by: - making AnnotationType an immutable object (all fields final) - exposing the instance to other threads via an unsynchronized write to Class.annotationType field only after constructor is finished and final fields are frozen - exposing the instance to current thread for recursive calls in the middle of the constructor via a special: private static final ClassValue> IN_CONSTRUCTION = ... field. It's true, this does present an overhead in storage, since every Class instance for annotation type will have a ClassValue.ClassValueMap installed, but it is hoped that the number of different annotation classes is not big compared to the number of all classes. A ThreadLocal referenced by ClassValue is only set for the in-flight recursive call and cleared afterwards. Because with such non-blocking access to AnnotationType, AnnotationType.getInstance() can be used in AnnotationSupport properly to quickly access the AnnotationType instances. The access to AnnotationType with this patch is so quick that I added 2 fields to it (container, containee) where the container and/or containee for a particular annotation type are cached and used in AnnotationSupport to resolve repeating annotations. This is much faster than invoking Class.getDirectDeclaredAnnotation() which is a HashMap.get, followed by reflective invocation of the "value" method on that annotation. The patch is here: http://dl.dropbox.com/u/101777488/jdk8-tl/AnnotationTypeSupport/webrev.01/index.html The benchmarks that show improvement are the same benchmarks used in my related proposed patch (Class.getAnnotations() bottleneck): https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java The results are combined results using plain JDK8 code with repeating annotation and then one patch applied at a time and finally both patches combined: https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt Regards, Peter P.S. Maybe this is not the best approach. Another approach would be to construct a special non-recursive variant of annotation parsing logic that would be used only for select meta-annotations - just enough to construct an AnnotationType with all it's data. The proposed patch is trying to keep the semantics of original logic, which is not entirely correct. The patch is not trying to solve the logic in-correctness. Here's a contrived example that exposes the in-correctness: Let's have the following two annotations: @Retention(RetentionPolicy.RUNTIME) @RuntimeAnnotationB public @interface RuntimeAnnotationA {} @Retention(RetentionPolicy.RUNTIME) @RuntimeAnnotationA public @interface RuntimeAnnotationB {} and the following test: @RuntimeAnnotationA public class AnnotationRetentionTest { public static void main(String[] args) { RuntimeAnnotationA ann1 = AnnotationRetentionTest.class.getDeclaredAnnotation(RuntimeAnnotationA.class); System.out.println(ann1 != null); RuntimeAnnotationA ann2 = RuntimeAnnotationB.class.getDeclaredAnnotation(RuntimeAnnotationA.class); System.out.println(ann2 != null); } } The test, when run, prints: true true Now change the RuntimeAnnotationA's retention policy to: @Retention(RetentionPolicy.CLASS) @RuntimeAnnotationB public @interface RuntimeAnnotationA {} ...and only recompile the RuntimeAnnotationA. When the test is run again with the recompiled RuntimeAnnotationA it prints: false true Although the annotation data for RuntimeAnnotationA is present in both AnnotationRetentionTest and RuntimeAnnotationB class files, the order of initialization and recursion causes the RuntimeAnnotationA to be loaded as RUNTIME annotation into the RuntimeAnnotationB.class (WRONG) but not into the AnnotationRetentionTest.class (CORRECT). From peter.levart at gmail.com Tue Dec 4 09:23:10 2012 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 04 Dec 2012 10:23:10 +0100 Subject: AnnotationType & AnnotationSupport + repeating annotations In-Reply-To: <50BD1F24.40306@gmail.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> <50BD1F24.40306@gmail.com> Message-ID: <50BDC0FE.9040004@gmail.com> Hi again, Zhong Yu suggested to use plain TheadLocal> instead of ClassValue in the proposed patch. Here's the updated webrev that contains this change: http://dl.dropbox.com/u/101777488/jdk8-tl/AnnotationTypeSupport/webrev.02/index.html The improvement is twofold: - There is no ClassValue.ClassValueMap installed on the annotation Class instances - The mechanism for exposing an instance of AnnotationType for recursive calls in the same thread only uses the ThreadLocal entry for the in-flight recursive call and cleans-up and removes the entry when the call stack unwinds, so no unused retained objects are left behind. The results of the benchmarks are not affected. Regards, Peter On 12/03/2012 10:52 PM, Peter Levart wrote: > Hi David and Alan, > > The following is in part connected with the new code for repeating > annotations, and in part with the proposed patch for resolving > synchronization issues with annotations as well as improvements > regarding space and multi-threaded contention. > > Although connected, the patch proposed here can be taken entirely by > itself. Let me try to explain what this patch does. This patch removes > the "synchronized" keyword from the static method > AnnotationType.getInstance(Class). By itself this synchronization does > not present any big performance issue since the method is always > called on slow-path (when parsing the annotations, when lazily > constructing a Map of inherited annotations, when de-serializing > annotations). The reason this method is synchronized on a single > monitor is because it: > - lazily constructs an instance of AnnotationType and exposes it to > other threads via a Class.annotationType field > - in the middle of the AnnotationType constructor it exposes a > half-constructed instance via a Class.annotationType field to current > thread so that recursive calls don't result in infinite recursion. > > As current parsing/resolving logic is coded, other threads must not > see the half-constructed AnnotationType instance and current thread > must see it. This is achieved by single re-entrant lock because only > single lock guarantees the absence of dead-locks (as can be seen from > bugs this lock in combination with initAnnotationsIfNecessary() is a > cause for dead-locks, but that's another story). > > Now because there is a single lock, the method must not be called on > heavily executed code paths or this will present a synchronization > bottleneck. One such heavily executed code path is in the new > sun.reflect.annotation.AnnotationSupport class that contains the logic > for repeating annotations. In this class the AnnotationType for a > particular annotation class is not obtained via this synchronized > method, but incorrectly via direct unsynchronized read of > Class.annotationType field. The code in AnnotationSupport can > therefore dereference a half-constructed AnnotationType instance > before it's constructor, executing in another thread, is finished and > before final fields in object are frozen. > > Class.[get,set]AnnotationType should only be called from within the > synchronized AnnotationType.getInstance method, but that apparently is > to contended to be practical. > > I solved the problem by: > - making AnnotationType an immutable object (all fields final) > - exposing the instance to other threads via an unsynchronized write > to Class.annotationType field only after constructor is finished and > final fields are frozen > - exposing the instance to current thread for recursive calls in the > middle of the constructor via a special: > > private static final ClassValue> > IN_CONSTRUCTION = ... > > field. > > It's true, this does present an overhead in storage, since every Class > instance for annotation type will have a ClassValue.ClassValueMap > installed, but it is hoped that the number of different annotation > classes is not big compared to the number of all classes. A > ThreadLocal referenced by ClassValue is only set for the in-flight > recursive call and cleared afterwards. > > Because with such non-blocking access to AnnotationType, > AnnotationType.getInstance() can be used in AnnotationSupport properly > to quickly access the AnnotationType instances. The access to > AnnotationType with this patch is so quick that I added 2 fields to it > (container, containee) where the container and/or containee for a > particular annotation type are cached and used in AnnotationSupport to > resolve repeating annotations. This is much faster than invoking > Class.getDirectDeclaredAnnotation() which is a HashMap.get, followed > by reflective invocation of the "value" method on that annotation. > > The patch is here: > > http://dl.dropbox.com/u/101777488/jdk8-tl/AnnotationTypeSupport/webrev.01/index.html > > > The benchmarks that show improvement are the same benchmarks used in > my related proposed patch (Class.getAnnotations() bottleneck): > > https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java > > > The results are combined results using plain JDK8 code with repeating > annotation and then one patch applied at a time and finally both > patches combined: > > https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt > > > > Regards, Peter > > P.S. > > Maybe this is not the best approach. Another approach would be to > construct a special non-recursive variant of annotation parsing logic > that would be used only for select meta-annotations - just enough to > construct an AnnotationType with all it's data. > > The proposed patch is trying to keep the semantics of original logic, > which is not entirely correct. The patch is not trying to solve the > logic in-correctness. Here's a contrived example that exposes the > in-correctness: > > Let's have the following two annotations: > > @Retention(RetentionPolicy.RUNTIME) > @RuntimeAnnotationB > public @interface RuntimeAnnotationA {} > > @Retention(RetentionPolicy.RUNTIME) > @RuntimeAnnotationA > public @interface RuntimeAnnotationB {} > > and the following test: > > @RuntimeAnnotationA > public class AnnotationRetentionTest { > public static void main(String[] args) { > RuntimeAnnotationA ann1 = > AnnotationRetentionTest.class.getDeclaredAnnotation(RuntimeAnnotationA.class); > System.out.println(ann1 != null); > RuntimeAnnotationA ann2 = > RuntimeAnnotationB.class.getDeclaredAnnotation(RuntimeAnnotationA.class); > System.out.println(ann2 != null); > } > } > > > The test, when run, prints: > > true > true > > Now change the RuntimeAnnotationA's retention policy to: > > @Retention(RetentionPolicy.CLASS) > @RuntimeAnnotationB > public @interface RuntimeAnnotationA {} > > ...and only recompile the RuntimeAnnotationA. > When the test is run again with the recompiled RuntimeAnnotationA it > prints: > > false > true > > > Although the annotation data for RuntimeAnnotationA is present in both > AnnotationRetentionTest and RuntimeAnnotationB class files, the order > of initialization and recursion causes the RuntimeAnnotationA to be > loaded as RUNTIME annotation into the RuntimeAnnotationB.class (WRONG) > but not into the AnnotationRetentionTest.class (CORRECT). > From Alan.Bateman at oracle.com Tue Dec 4 11:28:08 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 04 Dec 2012 11:28:08 +0000 Subject: RFR: 8003596 CheckLockLocationTest-Windows-fix In-Reply-To: <50BCBED7.6060105@oracle.com> References: <50B93EF8.3050109@oracle.com> <50BA25F2.3010205@oracle.com> <50BCBED7.6060105@oracle.com> Message-ID: <50BDDE48.3070106@oracle.com> On 03/12/2012 15:01, Jim Gish wrote: > Thanks. Could you please push the change. > > Jim I assume you also need to remove it from the exclude list (otherwise it will not run)? Also did you consider using !isWindows() rather than !ON_WINDOWS, I think it would be neater. Better again would be just handle setWritable returning false, then you wouldn't to do anything Windows specific. -Alan. From Alan.Bateman at oracle.com Tue Dec 4 13:54:02 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 04 Dec 2012 13:54:02 +0000 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50BCF7CD.1020308@oracle.com> References: <50BCF7CD.1020308@oracle.com> Message-ID: <50BE007A.4090102@oracle.com> On 03/12/2012 19:04, Daniel Fuchs wrote: > Hi, > > This is a first webrev in a series that addresses a change intended > for JDK 8: > > 7169894: JAXP Plugability Layer: using service loader > > I've been building up on Joe's work and Paul & Alan comments > from an earlier discussion thread [1] > > This here addresses changes in the javax.xml.parsers > package for the SAXParserFactory and DocumentBuilderFactory - and > more specifically their no-argument newInstance() method. > > This change replaces the custom code that was reading the > META-INF/services/ resources by a simple call to ServiceLoader. > > > Thank you very much for taking this one on. I think your approach to take javax.xml.parsers on its own is good as the previous review rounds got really stuck in the mire due to the number of factories, code duplication, and subtle specification and implementation differences. In the class descriptions it suggests that the default implementation may be "installed as a module" but we aren't there yet so I'm not sure about using the term "module". I think it should be okay to say "installed as an extension" as ServiceLoader uses this term. The class description also suggests that a SCE will be wrapped as a FactoryConfigurationException but in FactoryFinder I see that it actual wraps a RuntimeException. I think you can just use the no-arg constructor then then use initCause to set the cause to the SCE. Also the statement "If a misconfigured provider is encountered and SCE is thrown" can probably be changed to "If SCE is thrown" as it can be thrown for other reasons too. Minor nit is that the updates to DocumentBuilderFactory's class description requires a really wide screen compared to the rest of the javadoc. Minor implementation suggestion for findServiceProvider is that you can use for-each to iterate through the providers. Otherwise I think you've captured all the points of feedback from the original review. Finally one suggestion is to make keep notes on the "before & after" behavior, this is something that will be important for release and compatibility notes. -Alan. From alan.bateman at oracle.com Tue Dec 4 14:13:58 2012 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Tue, 04 Dec 2012 14:13:58 +0000 Subject: hg: jdk8/tl/jdk: 7142921: (fs) Files.probeContentType reports a MIME type of "text/plain" on Ubuntu 11.04; ... Message-ID: <20121204141424.2273947D7C@hg.openjdk.java.net> Changeset: 38ec2838dd86 Author: dxu Date: 2012-12-04 14:07 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/38ec2838dd86 7142921: (fs) Files.probeContentType reports a MIME type of "text/plain" on Ubuntu 11.04 7144997: (fs) Files.probeContentType returns null on Solaris 64-bit Reviewed-by: alanb, mduigou ! make/java/nio/Makefile ! make/java/nio/mapfile-linux ! makefiles/CompileJavaClasses.gmk ! makefiles/CompileNativeLibraries.gmk ! makefiles/mapfiles/libnio/mapfile-linux ! src/solaris/classes/sun/nio/fs/BsdFileSystemProvider.java ! src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java ! src/solaris/classes/sun/nio/fs/MacOSXFileSystemProvider.java + src/solaris/classes/sun/nio/fs/MagicFileTypeDetector.java + src/solaris/classes/sun/nio/fs/MimeTypesFileTypeDetector.java ! src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java ! src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java + src/solaris/native/sun/nio/fs/MagicFileTypeDetector.c From daniel.fuchs at oracle.com Tue Dec 4 14:42:27 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 04 Dec 2012 15:42:27 +0100 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50BE007A.4090102@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> Message-ID: <50BE0BD3.9060709@oracle.com> Hi Alan, Thanks a lot for your comments - some clarifications inline. On 12/4/12 2:54 PM, Alan Bateman wrote: > On 03/12/2012 19:04, Daniel Fuchs wrote: >> Hi, >> >> This is a first webrev in a series that addresses a change intended >> for JDK 8: >> >> 7169894: JAXP Plugability Layer: using service loader >> >> I've been building up on Joe's work and Paul & Alan comments >> from an earlier discussion thread [1] >> >> This here addresses changes in the javax.xml.parsers >> package for the SAXParserFactory and DocumentBuilderFactory - and >> more specifically their no-argument newInstance() method. >> >> This change replaces the custom code that was reading the >> META-INF/services/ resources by a simple call to ServiceLoader. >> >> >> > Thank you very much for taking this one on. I think your approach to > take javax.xml.parsers on its own is good as the previous review rounds > got really stuck in the mire due to the number of factories, code > duplication, and subtle specification and implementation differences. > > In the class descriptions it suggests that the default implementation > may be "installed as a module" but we aren't there yet so I'm not sure > about using the term "module". I think it should be okay to say > "installed as an extension" as ServiceLoader uses this term. OK - will do. > The class description also suggests that a SCE will be wrapped as a > FactoryConfigurationException but in FactoryFinder I see that it actual > wraps a RuntimeException. I think you can just use the no-arg > constructor then then use initCause to set the cause to the SCE. I have refrained to do that because I think there might be code that brutally does things like (Exception) error.getCause(); (I've seen this kind of pattern in the JAXP code - although I don't remember exactly where...) The reason is that FactoryConfigurationError is for some reason obviously supposed to wrap only exceptions - as its constructor will take only exceptions - and not throwables, and then overrides getCause() to return a locally cached variable of type Exception - see Using initCause() would therefore have no effect, unless the implementation of javax.xml.parsers.FactoryConfigurationError is changed to accept Throwable as cause - which could - I think have undesirable side effects on existing code. My guess is that this is an oddity inherited from the time when Cause was not defined at Throwable level - but managed locally on specific exceptions classes instead. I am fearing that changing the implementation of getCause() to allow setting the SCE directly as the cause might break compatibility, causing some ClassCastException to be thrown here and there. > Also the statement "If a misconfigured provider is encountered and SCE > is thrown" can probably be changed to "If SCE is thrown" as it can be > thrown for other reasons too. Will do. > Minor nit is that the updates to DocumentBuilderFactory's class > description requires a really wide screen compared to the rest of the > javadoc. Will fix. > Minor implementation suggestion for findServiceProvider is that you can > use for-each to iterate through the providers. I don't mind. Do you think it's better? I'll make the changes and send an updated webrev... > Otherwise I think you've captured all the points of feedback from the > original review. > > Finally one suggestion is to make keep notes on the "before & after" > behavior, this is something that will be important for release and > compatibility notes. OK - but in what form? In the webrev header? Or do you think I should add // comments in the code to make explicit the behavioral changes? Or do you mean I should collect & gather them in some separate text doc that will help writing the RN? > > -Alan. From alan.bateman at oracle.com Tue Dec 4 15:11:01 2012 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Tue, 04 Dec 2012 15:11:01 +0000 Subject: hg: jdk8/tl/jdk: 8004066: TEST_BUG: test/java/lang/Math/DivModTests.java assumes ArithmeticException message Message-ID: <20121204151120.8597847D7F@hg.openjdk.java.net> Changeset: 2e8863c4f7d0 Author: kmo Date: 2012-12-04 15:10 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/2e8863c4f7d0 8004066: TEST_BUG: test/java/lang/Math/DivModTests.java assumes ArithmeticException message Reviewed-by: twisti, alanb, dholmes ! test/java/lang/Math/DivModTests.java From Alan.Bateman at oracle.com Tue Dec 4 15:15:43 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 04 Dec 2012 15:15:43 +0000 Subject: AnnotationType & AnnotationSupport + repeating annotations In-Reply-To: <50BDC0FE.9040004@gmail.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> <50BD1F24.40306@gmail.com> <50BDC0FE.9040004@gmail.com> Message-ID: <50BE139F.70700@oracle.com> cc'ing Joel Borggr?n-Franck as it he added the support for repeating annotations very recently. On 04/12/2012 09:23, Peter Levart wrote: > Hi again, > > Zhong Yu suggested to use plain TheadLocal> instead of > ClassValue in the proposed patch. Here's the updated > webrev that contains this change: > > http://dl.dropbox.com/u/101777488/jdk8-tl/AnnotationTypeSupport/webrev.02/index.html > > > The improvement is twofold: > - There is no ClassValue.ClassValueMap installed on the annotation > Class instances > - The mechanism for exposing an instance of AnnotationType for > recursive calls in the same thread only uses the ThreadLocal entry for > the in-flight recursive call and cleans-up and removes the entry when > the call stack unwinds, so no unused retained objects are left behind. > > The results of the benchmarks are not affected. > > Regards, Peter > > On 12/03/2012 10:52 PM, Peter Levart wrote: >> Hi David and Alan, >> >> The following is in part connected with the new code for repeating >> annotations, and in part with the proposed patch for resolving >> synchronization issues with annotations as well as improvements >> regarding space and multi-threaded contention. >> >> Although connected, the patch proposed here can be taken entirely by >> itself. Let me try to explain what this patch does. This patch >> removes the "synchronized" keyword from the static method >> AnnotationType.getInstance(Class). By itself this synchronization >> does not present any big performance issue since the method is always >> called on slow-path (when parsing the annotations, when lazily >> constructing a Map of inherited annotations, when de-serializing >> annotations). The reason this method is synchronized on a single >> monitor is because it: >> - lazily constructs an instance of AnnotationType and exposes it to >> other threads via a Class.annotationType field >> - in the middle of the AnnotationType constructor it exposes a >> half-constructed instance via a Class.annotationType field to current >> thread so that recursive calls don't result in infinite recursion. >> >> As current parsing/resolving logic is coded, other threads must not >> see the half-constructed AnnotationType instance and current thread >> must see it. This is achieved by single re-entrant lock because only >> single lock guarantees the absence of dead-locks (as can be seen from >> bugs this lock in combination with initAnnotationsIfNecessary() is a >> cause for dead-locks, but that's another story). >> >> Now because there is a single lock, the method must not be called on >> heavily executed code paths or this will present a synchronization >> bottleneck. One such heavily executed code path is in the new >> sun.reflect.annotation.AnnotationSupport class that contains the >> logic for repeating annotations. In this class the AnnotationType for >> a particular annotation class is not obtained via this synchronized >> method, but incorrectly via direct unsynchronized read of >> Class.annotationType field. The code in AnnotationSupport can >> therefore dereference a half-constructed AnnotationType instance >> before it's constructor, executing in another thread, is finished and >> before final fields in object are frozen. >> >> Class.[get,set]AnnotationType should only be called from within the >> synchronized AnnotationType.getInstance method, but that apparently >> is to contended to be practical. >> >> I solved the problem by: >> - making AnnotationType an immutable object (all fields final) >> - exposing the instance to other threads via an unsynchronized write >> to Class.annotationType field only after constructor is finished and >> final fields are frozen >> - exposing the instance to current thread for recursive calls in the >> middle of the constructor via a special: >> >> private static final ClassValue> >> IN_CONSTRUCTION = ... >> >> field. >> >> It's true, this does present an overhead in storage, since every >> Class instance for annotation type will have a >> ClassValue.ClassValueMap installed, but it is hoped that the number >> of different annotation classes is not big compared to the number of >> all classes. A ThreadLocal referenced by ClassValue is only set for >> the in-flight recursive call and cleared afterwards. >> >> Because with such non-blocking access to AnnotationType, >> AnnotationType.getInstance() can be used in AnnotationSupport >> properly to quickly access the AnnotationType instances. The access >> to AnnotationType with this patch is so quick that I added 2 fields >> to it (container, containee) where the container and/or containee for >> a particular annotation type are cached and used in AnnotationSupport >> to resolve repeating annotations. This is much faster than invoking >> Class.getDirectDeclaredAnnotation() which is a HashMap.get, followed >> by reflective invocation of the "value" method on that annotation. >> >> The patch is here: >> >> http://dl.dropbox.com/u/101777488/jdk8-tl/AnnotationTypeSupport/webrev.01/index.html >> >> >> The benchmarks that show improvement are the same benchmarks used in >> my related proposed patch (Class.getAnnotations() bottleneck): >> >> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java >> >> >> The results are combined results using plain JDK8 code with repeating >> annotation and then one patch applied at a time and finally both >> patches combined: >> >> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt >> >> >> >> Regards, Peter >> >> P.S. >> >> Maybe this is not the best approach. Another approach would be to >> construct a special non-recursive variant of annotation parsing logic >> that would be used only for select meta-annotations - just enough to >> construct an AnnotationType with all it's data. >> >> The proposed patch is trying to keep the semantics of original logic, >> which is not entirely correct. The patch is not trying to solve the >> logic in-correctness. Here's a contrived example that exposes the >> in-correctness: >> >> Let's have the following two annotations: >> >> @Retention(RetentionPolicy.RUNTIME) >> @RuntimeAnnotationB >> public @interface RuntimeAnnotationA {} >> >> @Retention(RetentionPolicy.RUNTIME) >> @RuntimeAnnotationA >> public @interface RuntimeAnnotationB {} >> >> and the following test: >> >> @RuntimeAnnotationA >> public class AnnotationRetentionTest { >> public static void main(String[] args) { >> RuntimeAnnotationA ann1 = >> AnnotationRetentionTest.class.getDeclaredAnnotation(RuntimeAnnotationA.class); >> System.out.println(ann1 != null); >> RuntimeAnnotationA ann2 = >> RuntimeAnnotationB.class.getDeclaredAnnotation(RuntimeAnnotationA.class); >> System.out.println(ann2 != null); >> } >> } >> >> >> The test, when run, prints: >> >> true >> true >> >> Now change the RuntimeAnnotationA's retention policy to: >> >> @Retention(RetentionPolicy.CLASS) >> @RuntimeAnnotationB >> public @interface RuntimeAnnotationA {} >> >> ...and only recompile the RuntimeAnnotationA. >> When the test is run again with the recompiled RuntimeAnnotationA it >> prints: >> >> false >> true >> >> >> Although the annotation data for RuntimeAnnotationA is present in >> both AnnotationRetentionTest and RuntimeAnnotationB class files, the >> order of initialization and recursion causes the RuntimeAnnotationA >> to be loaded as RUNTIME annotation into the RuntimeAnnotationB.class >> (WRONG) but not into the AnnotationRetentionTest.class (CORRECT). >> > From daniel.fuchs at oracle.com Tue Dec 4 15:55:03 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 04 Dec 2012 16:55:03 +0100 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50BE0BD3.9060709@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BE0BD3.9060709@oracle.com> Message-ID: <50BE1CD7.3040104@oracle.com> On 12/4/12 3:42 PM, Daniel Fuchs wrote: >> In the class descriptions it suggests that the default implementation >> may be "installed as a module" but we aren't there yet so I'm not sure >> about using the term "module". I think it should be okay to say >> "installed as an extension" as ServiceLoader uses this term. So that would be the wording: * Uses the service-provider loading facilities, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate * and load an implementation of the service. If there are * providers other than the implementation specific default * located, then the first provider that is * not the default is instantiated and returned; Otherwise * the default implementation is returned if it is on the * classpath or installed as an extension. This however suggests that in JDK 8 the default implementation *needs* to be put on the classpath or installed as an extension. But is that right? Wouldn't that be required only when running with a profile in which the default implementation is not present by default? Maybe we need to find yet a better wording. -- daniel From jim.gish at oracle.com Tue Dec 4 16:49:27 2012 From: jim.gish at oracle.com (Jim Gish) Date: Tue, 04 Dec 2012 11:49:27 -0500 Subject: RFR: 8003596 CheckLockLocationTest-Windows-fix In-Reply-To: <50BDDE48.3070106@oracle.com> References: <50B93EF8.3050109@oracle.com> <50BA25F2.3010205@oracle.com> <50BCBED7.6060105@oracle.com> <50BDDE48.3070106@oracle.com> Message-ID: <50BE2997.7040102@oracle.com> http://cr.openjdk.java.net/~jgish/Bug8003596-CheckLockLocationTest-Windows-fix/ Better? :-) Thanks, Jim On 12/04/2012 06:28 AM, Alan Bateman wrote: > On 03/12/2012 15:01, Jim Gish wrote: >> Thanks. Could you please push the change. >> >> Jim > I assume you also need to remove it from the exclude list (otherwise > it will not run)? > > Also did you consider using !isWindows() rather than !ON_WINDOWS, I > think it would be neater. Better again would be just handle > setWritable returning false, then you wouldn't to do anything Windows > specific. > > -Alan. -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From Alan.Bateman at oracle.com Tue Dec 4 16:51:51 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 04 Dec 2012 16:51:51 +0000 Subject: RFR: 8003596 CheckLockLocationTest-Windows-fix In-Reply-To: <50BE2997.7040102@oracle.com> References: <50B93EF8.3050109@oracle.com> <50BA25F2.3010205@oracle.com> <50BCBED7.6060105@oracle.com> <50BDDE48.3070106@oracle.com> <50BE2997.7040102@oracle.com> Message-ID: <50BE2A27.1030901@oracle.com> On 04/12/2012 16:49, Jim Gish wrote: > http://cr.openjdk.java.net/~jgish/Bug8003596-CheckLockLocationTest-Windows-fix/ > > > Better? :-) Much nicer - thank you! I'll push this today for you. -Alan From maurizio.cimadamore at oracle.com Tue Dec 4 17:59:37 2012 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Tue, 04 Dec 2012 17:59:37 +0000 Subject: hg: jdk8/tl/langtools: 8004360: regression test DefaultMethodRegressionTests fails in langtools Message-ID: <20121204175941.ADEE447D98@hg.openjdk.java.net> Changeset: 0e70eb71fec0 Author: mcimadamore Date: 2012-12-04 17:19 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/0e70eb71fec0 8004360: regression test DefaultMethodRegressionTests fails in langtools Summary: ignore broken failing test Reviewed-by: jjg - test/tools/javac/defaultMethodExecution/DefaultMethodRegressionTests.java + test/tools/javac/defaultMethods/defaultMethodExecution/DefaultMethodRegressionTests.java From jim.gish at oracle.com Tue Dec 4 20:03:06 2012 From: jim.gish at oracle.com (Jim Gish) Date: Tue, 04 Dec 2012 15:03:06 -0500 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported Message-ID: <50BE56FA.8070508@oracle.com> Please review http://cr.openjdk.java.net/~jgish/Bug8004317-TestLibrary-getUnusedRandomPort-Failure/ We're getting intermittent failures on a number of RMI tests attempting to get an unused ephemeral port. This is a temporary change to print a stack trace until we can figure what's going on. For some reason the test framework isn't surfacing the nested exception. (There probably should be a separate bug for that, but my first priority here is to fix the intermittent test failures.) Thanks, Jim -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From mandy.chung at oracle.com Tue Dec 4 20:15:29 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 04 Dec 2012 12:15:29 -0800 Subject: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50B54A2C.1040907@oracle.com> References: <50B54A2C.1040907@oracle.com> Message-ID: <50BE59E1.6010008@oracle.com> Alan - thanks for the feedback. I have made several changes to the jdeps tool. Here is the new webrev at: http://cr.openjdk.java.net/~mchung/jdk8/webrevs/8003562/langtools-webrev.01/ I'll send out a formal code review request once I add the new unit tests. $ jdeps -h Usage: jdeps where possible options include: -version Version information -classpath Specify where to find class files -v --verbose Print class-level dependencies -v:class Print class-level dependencies -v:package Print package-level dependencies -v:summary Print dependency summary -p Restrict analysis to classes in this package (may be given multiple times) -e Restrict analysis to packages matching pattern (-p and -e are exclusive) -P --profile Show profile or the file containing a package -r --recursive Traverse all dependencies recursively -d Specify the depth of the transitive dependency analysis -r option is equivalent to setting depth to 0. -all Process all classes specified in -classpath Changes include: 1. Added -v:class, -v:package and -v:summary options to select the dependency output The default is package-level dependency. -v:summary only shows the dependencies across the boundaries in the given classpath or files. $ jdeps -classpath jfxrt.jar -v:summaryEnsemble.jar Ensemble.jar -> jfxrt.jar Ensemble.jar -> rt.jar 2. If only -classpath is given (taken from the -classpath in launching the application) but no input file, -all can be used to process all class files from the given classpath. 3. The output is now grouped by each input file/dir/jar file. By default, it will show the source of the dependency if it's coming from the given classpath or input files. Use -P to show the Profile and platform information. 4. -r option is repurposed for finding transitive dependencies recursively. I concur with Alan that --reverse is not needed since it only changes the output but not the dependency analysis. To find the usage of a specific class/package, -p and -e options can be used to diagnose dependency issue. Mandy On 11/27/12 3:18 PM, Mandy Chung wrote: > As part of prepare for modules [1], this RFE is to provide a > command-line tool in JDK8 so that developers can understand the static > dependencies of their applications and libraries.As part of Project > Jigsaw, a useful class analyzer [2] was developed that makes it very > easy to identify the dependencies based on the classfile library > thathas also been enhanced to support dependency analysis [3]. > > Inspired by the sample tool that Jon Gibbons developed, we propose > this new command-line name as "jdeps". > > $ ./bin/jdeps -h > Usage: jdeps > where possible options include: > -version Version information > -classpath Specify where to find class files > -v --verbose Print class-level dependencies > -r --reverse Invert the dependencies in the output > -p Restrict analysis to classes in this package > (may be given multiple times) > -e --regex Restrict analysis to packages matching pattern > (-p and -e are exclusive) > -P --profile Show profile or the file containing a package > -d --depth Specify the depth of the transitive > dependency analysis > Default depth is 1. Set depth to 0 to > traverse all dependencies. > -all Show all classes and members with no breakdown > > The jdeps tool shows package-level dependencies of the input files > that can be .class files, a directory, or a JAR file. Specify the > depth for the transitive dependency analysis; otherwise, it only > analyzes the input files. jdeps -P option will show where the > class/package comes from. For Java SE API, it will show the Profile > name (I implement a workaround for now until the profile work is in > jdk8). For JDK internal APIs, they will not be exported in modular > world. jdeps will indicate any usage of the JDK internal APIs in the > output to help developers prepare for transitioning to modules. > > See below for a few sample output. > > Webrev at: > http://cr.openjdk.java.net/~mchung/jdk8/webrevs/8003562/ > > The implementation classes for jdeps are in the langtools repo along > with the com.sun.tools.classfile library. I'm working on adding more > unit tests. I'd like to get this webrev out to begin the discussion > and get review feedback. > > Thanks > Mandy > [1] http://openjdk.java.net/jeps/162 > [2] > http://hg.openjdk.java.net/jigsaw/jigsaw/jdk/raw-file/543b0d24a920/make/tools/classanalyzer/classanalyzer.html > [3] http://bugs.sun.com/view_bug.do?bug_id=6907575 From alan.bateman at oracle.com Tue Dec 4 20:21:47 2012 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Tue, 04 Dec 2012 20:21:47 +0000 Subject: hg: jdk8/tl/jdk: 8003596: TEST_BUG: java/util/logging/CheckLockLocationTest.java failing [win] Message-ID: <20121204202227.EC74B47DA4@hg.openjdk.java.net> Changeset: 7004848974a2 Author: jgish Date: 2012-12-04 20:21 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7004848974a2 8003596: TEST_BUG: java/util/logging/CheckLockLocationTest.java failing [win] Reviewed-by: alanb ! test/ProblemList.txt ! test/java/util/logging/CheckLockLocationTest.java From Lance.Andersen at oracle.com Tue Dec 4 20:38:05 2012 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Tue, 4 Dec 2012 15:38:05 -0500 Subject: Review needed: 8004374 : Fwd: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData Message-ID: All, Attached is the patch for: 8004374 based off the issue that Frank reported. for http://cr.openjdk.java.net/~lancea/8004374/webrev.00/ The TCK, SQE and the JDBC Unit Tests run clean. I added a new Unit Test to validate the issue. Frank, I did not use your fix as I was able to clean the code up a bit more and get rid of more crud while addressing it. It is similar though. Best Lance Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From Alan.Bateman at oracle.com Tue Dec 4 20:42:15 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 04 Dec 2012 20:42:15 +0000 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BE56FA.8070508@oracle.com> References: <50BE56FA.8070508@oracle.com> Message-ID: <50BE6027.4070200@oracle.com> On 04/12/2012 20:03, Jim Gish wrote: > Please review > http://cr.openjdk.java.net/~jgish/Bug8004317-TestLibrary-getUnusedRandomPort-Failure/ > > > > We're getting intermittent failures on a number of RMI tests > attempting to get an unused ephemeral port. This is a temporary > change to print a stack trace until we can figure what's going on. For > some reason the test framework isn't surfacing the nested exception. > (There probably should be a separate bug for that, but my first > priority here is to fix the intermittent test failures.) > > Thanks, > Jim If this is what I think it is, they it may be useful to capture the output of "netstat -a" output at the time of the exception. -Alan From darryl.mocek at oracle.com Tue Dec 4 21:07:03 2012 From: darryl.mocek at oracle.com (Darryl Mocek) Date: Tue, 04 Dec 2012 13:07:03 -0800 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BE56FA.8070508@oracle.com> References: <50BE56FA.8070508@oracle.com> Message-ID: <50BE65F7.6030306@oracle.com> Hi Jim, changes look OK to me, although I'm curious why you chose to use an Integer instead of an int. Darryl On 12/04/2012 12:03 PM, Jim Gish wrote: > Please review > http://cr.openjdk.java.net/~jgish/Bug8004317-TestLibrary-getUnusedRandomPort-Failure/ > > > > We're getting intermittent failures on a number of RMI tests > attempting to get an unused ephemeral port. This is a temporary > change to print a stack trace until we can figure what's going on. For > some reason the test framework isn't surfacing the nested exception. > (There probably should be a separate bug for that, but my first > priority here is to fix the intermittent test failures.) > > Thanks, > Jim > From jim.gish at oracle.com Tue Dec 4 21:10:30 2012 From: jim.gish at oracle.com (Jim Gish) Date: Tue, 04 Dec 2012 16:10:30 -0500 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BE65F7.6030306@oracle.com> References: <50BE56FA.8070508@oracle.com> <50BE65F7.6030306@oracle.com> Message-ID: <50BE66C6.90409@oracle.com> The initial code was a bit strange in that it started out with an int set to the min "reserved" port number. I chose an Integer so I could start out with null rather than a magic number. Jim P.S. working on adding nestat -a output per Alan's suggestion. On 12/04/2012 04:07 PM, Darryl Mocek wrote: > Hi Jim, > > changes look OK to me, although I'm curious why you chose to use an > Integer instead of an int. > > Darryl > > On 12/04/2012 12:03 PM, Jim Gish wrote: >> Please review >> http://cr.openjdk.java.net/~jgish/Bug8004317-TestLibrary-getUnusedRandomPort-Failure/ >> >> >> >> We're getting intermittent failures on a number of RMI tests >> attempting to get an unused ephemeral port. This is a temporary >> change to print a stack trace until we can figure what's going on. >> For some reason the test framework isn't surfacing the nested >> exception. (There probably should be a separate bug for that, but my >> first priority here is to fix the intermittent test failures.) >> >> Thanks, >> Jim >> > -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From Alan.Bateman at oracle.com Tue Dec 4 21:12:57 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 04 Dec 2012 21:12:57 +0000 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50BE0BD3.9060709@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BE0BD3.9060709@oracle.com> Message-ID: <50BE6759.2000608@oracle.com> On 04/12/2012 14:42, Daniel Fuchs wrote: > : > >> The class description also suggests that a SCE will be wrapped as a >> FactoryConfigurationException but in FactoryFinder I see that it actual >> wraps a RuntimeException. I think you can just use the no-arg >> constructor then then use initCause to set the cause to the SCE. > > I have refrained to do that because I think there might be code that > brutally does things like (Exception) error.getCause(); > (I've seen this kind of pattern in the JAXP code - although > I don't remember exactly where...) > The reason is that FactoryConfigurationError is for some reason > obviously supposed to wrap only exceptions - as its constructor will > take only exceptions - and not throwables, and then overrides > getCause() to return a locally cached variable of type Exception - see > > > > Using initCause() would therefore have no effect, unless the > implementation of javax.xml.parsers.FactoryConfigurationError is > changed to accept Throwable as cause - which could - I think have > undesirable side effects on existing code. > > My guess is that this is an oddity inherited from the time when > Cause was not defined at Throwable level - but managed locally > on specific exceptions classes instead. > I am fearing that changing the implementation of getCause() > to allow setting the SCE directly as the cause might break > compatibility, causing some ClassCastException to be thrown here > and there. I see your point and happy to see that you are very careful with these changes. I think this just means that the wording, specifically "the error will be wrapped" needs to be changed so that it doesn't give the impression the SCE will be the cause. > : > >> Minor implementation suggestion for findServiceProvider is that you can >> use for-each to iterate through the providers. > > I don't mind. Do you think it's better? I'll make the changes and send > an updated webrev... I think it would be neater but it's a minor comment and nothing to do with the main dish. > : >> >> Finally one suggestion is to make keep notes on the "before & after" >> behavior, this is something that will be important for release and >> compatibility notes. > > OK - but in what form? In the webrev header? Or do you think I should > add // comments in the code to make explicit the behavioral changes? > Or do you mean I should collect & gather them in some separate text > doc that will help writing the RN? Good question, I'd suggest adding a note to JDK-7169894 for now so that it is as least recorded somewhere. -Alan From jim.gish at oracle.com Tue Dec 4 21:13:59 2012 From: jim.gish at oracle.com (Jim Gish) Date: Tue, 04 Dec 2012 16:13:59 -0500 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BE66C6.90409@oracle.com> References: <50BE56FA.8070508@oracle.com> <50BE65F7.6030306@oracle.com> <50BE66C6.90409@oracle.com> Message-ID: <50BE6797.2000302@oracle.com> Yeah -- I suppose that was silly. I could've started with -1. I'll clean it up on the next round. On 12/04/2012 04:10 PM, Jim Gish wrote: > The initial code was a bit strange in that it started out with an int > set to the min "reserved" port number. I chose an Integer so I could > start out with null rather than a magic number. > > Jim > > P.S. working on adding nestat -a output per Alan's suggestion. > > On 12/04/2012 04:07 PM, Darryl Mocek wrote: >> Hi Jim, >> >> changes look OK to me, although I'm curious why you chose to use >> an Integer instead of an int. >> >> Darryl >> >> On 12/04/2012 12:03 PM, Jim Gish wrote: >>> Please review >>> http://cr.openjdk.java.net/~jgish/Bug8004317-TestLibrary-getUnusedRandomPort-Failure/ >>> >>> >>> >>> We're getting intermittent failures on a number of RMI tests >>> attempting to get an unused ephemeral port. This is a temporary >>> change to print a stack trace until we can figure what's going on. >>> For some reason the test framework isn't surfacing the nested >>> exception. (There probably should be a separate bug for that, but >>> my first priority here is to fix the intermittent test failures.) >>> >>> Thanks, >>> Jim >>> >> > -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From Alan.Bateman at oracle.com Tue Dec 4 21:22:03 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 04 Dec 2012 21:22:03 +0000 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BE66C6.90409@oracle.com> References: <50BE56FA.8070508@oracle.com> <50BE65F7.6030306@oracle.com> <50BE66C6.90409@oracle.com> Message-ID: <50BE697B.7040903@oracle.com> On 04/12/2012 21:10, Jim Gish wrote: > : > > P.S. working on adding nestat -a output per Alan's suggestion. BTW: I didn't mean you have to run with my comment, it's just that I assume the issue that the Windows is out of dynamic ports. There is a registry setting to change the range, and I think there is a netsh command to adjust it too. If we can somehow capture the netstat output then it may confirm this. -Alan. From jim.gish at oracle.com Tue Dec 4 21:42:46 2012 From: jim.gish at oracle.com (Jim Gish) Date: Tue, 04 Dec 2012 16:42:46 -0500 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BE697B.7040903@oracle.com> References: <50BE56FA.8070508@oracle.com> <50BE65F7.6030306@oracle.com> <50BE66C6.90409@oracle.com> <50BE697B.7040903@oracle.com> Message-ID: <50BE6E56.5060905@oracle.com> OK -- how about a push then for now and with luck we might get some useful output in a day or two. Jim On 12/04/2012 04:22 PM, Alan Bateman wrote: > On 04/12/2012 21:10, Jim Gish wrote: >> : >> >> P.S. working on adding nestat -a output per Alan's suggestion. > BTW: I didn't mean you have to run with my comment, it's just that I > assume the issue that the Windows is out of dynamic ports. There is a > registry setting to change the range, and I think there is a netsh > command to adjust it too. If we can somehow capture the netstat output > then it may confirm this. > > -Alan. -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From sean.mullan at oracle.com Tue Dec 4 22:42:45 2012 From: sean.mullan at oracle.com (sean.mullan at oracle.com) Date: Tue, 04 Dec 2012 22:42:45 +0000 Subject: hg: jdk8/tl/jdk: 8004188: Rename src/share/lib/security/java.security to java.security-linux Message-ID: <20121204224256.AAADD47DD0@hg.openjdk.java.net> Changeset: 44ae777564eb Author: mullan Date: 2012-12-04 17:40 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/44ae777564eb 8004188: Rename src/share/lib/security/java.security to java.security-linux Reviewed-by: mullan, mchung Contributed-by: jason.uh at oracle.com ! make/java/security/Makefile - src/share/lib/security/java.security + src/share/lib/security/java.security-linux From stuart.marks at oracle.com Wed Dec 5 00:06:44 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Tue, 04 Dec 2012 16:06:44 -0800 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BE6E56.5060905@oracle.com> References: <50BE56FA.8070508@oracle.com> <50BE65F7.6030306@oracle.com> <50BE66C6.90409@oracle.com> <50BE697B.7040903@oracle.com> <50BE6E56.5060905@oracle.com> Message-ID: <50BE9014.9000508@oracle.com> Hi Jim, (Looks like you're cleaning up warnings along the way. I guess that's OK.) Before printing the stack trace, there should be a message to stderr indicating where this stack trace is coming from. For example, "getUnusedRandomPort: caught exception". The stack trace should be printed to stderr as well, using something like ex.printStackTrace(System.err). I think narrowing the catch to IOException is good, since that's the only exception case we really want to retry. I don't think it makes sense to mention IllegalArgumentException or SecurityException specifically in the comments though. Any exception other than IOException should fail-fast. A message should also be printed if we decide to retry because the port is one of the "reserved" ports. This might provide an important clue to solving the puzzle. (My hypothesis is that this routine fails relatively silently when, on its last retry, it successfully opens a reserved port. In this case ex will be null and we get the RuntimeException with no further explanation.) It would also be helpful to print numTries each time around the loop so that we can see if it really is retrying that many times. Regarding netstat, I think it's a good idea, but I'd suggest we work on it separately from this change. Instead, suppose we add a shell script test that's named so that it runs at the end of the jdk_rmi test target. This could just run netstat -a (or whatever) unconditionally. In fact, I could do that without even pushing any changes to the source code.... s'marks On 12/4/12 1:42 PM, Jim Gish wrote: > OK -- how about a push then for now and with luck we might get some useful > output in a day or two. > > Jim > > On 12/04/2012 04:22 PM, Alan Bateman wrote: >> On 04/12/2012 21:10, Jim Gish wrote: >>> : >>> >>> P.S. working on adding nestat -a output per Alan's suggestion. >> BTW: I didn't mean you have to run with my comment, it's just that I assume >> the issue that the Windows is out of dynamic ports. There is a registry >> setting to change the range, and I think there is a netsh command to adjust >> it too. If we can somehow capture the netstat output then it may confirm this. >> >> -Alan. > From david.holmes at oracle.com Wed Dec 5 05:25:50 2012 From: david.holmes at oracle.com (David Holmes) Date: Wed, 05 Dec 2012 15:25:50 +1000 Subject: Profiles update to jdk8-b66 In-Reply-To: <50BC0678.1040300@oracle.com> References: <50BC0678.1040300@oracle.com> Message-ID: <50BEDADE.40301@oracle.com> Just FYI the Profiles forest has been updated to the jdk8-b66 level. Aside from that, recent changes include: - javac support for -profile flag - keytool is now part of profile compact1 - Fix for FDS to ensure configure settings make their way through to hotspot David From mike.duigou at oracle.com Wed Dec 5 05:47:20 2012 From: mike.duigou at oracle.com (Mike Duigou) Date: Tue, 4 Dec 2012 21:47:20 -0800 Subject: Request for Review : CR#8004015 : [2nd pass] Add interface extends and defaults for basic functional interfaces In-Reply-To: References: Message-ID: <0CABE1EF-B971-43A0-ABB8-3EE3D82DC029@oracle.com> Hello all; I have updated the proposed patch. The changes primarily add class and method documentation regarding handling of null for the primitive specializations. http://cr.openjdk.java.net/~mduigou/8004015/1/webrev/ http://cr.openjdk.java.net/~mduigou/8004015/1/specdiff/java/util/function/package-summary.html I've also reformatted the source for the default methods. Mike On Nov 26 2012, at 18:12 , Mike Duigou wrote: > Hello all; > > In the original patch which added the basic lambda functional interfaces, CR#8001634 [1], none of the interfaces extended other interfaces. The reason was primarily that the javac compiler did not, at the time that 8001634 was proposed, support extension methods. The compiler now supports adding of method defaults so this patch improves the functional interfaces by filing in the inheritance hierarchy. > > Adding the parent interfaces and default methods allows each functional interface to be used in more places. It is especially important for the functional interfaces which support primitive types, IntSupplier, IntFunction, IntUnaryOperator, IntBinaryOperator, etc. We expect that eventually standard implementations of these interfaces will be provided for functions like max, min, sum, etc. By extending the reference oriented functional interfaces such as Function, the primitive implementations can be used with the boxed primitive types along with the primitive types for which they are defined. > > The patch to add parent interfaces and default methods can be found here: > > http://cr.openjdk.java.net/~mduigou/8004015/0/webrev/ > http://cr.openjdk.java.net/~mduigou/8004015/0/specdiff/java/util/function/package-summary.html > > Mike > > [1] http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c2e80176a697 From david.holmes at oracle.com Wed Dec 5 06:10:30 2012 From: david.holmes at oracle.com (David Holmes) Date: Wed, 05 Dec 2012 16:10:30 +1000 Subject: Request for Review : CR#8004015 : [2nd pass] Add interface extends and defaults for basic functional interfaces In-Reply-To: <0CABE1EF-B971-43A0-ABB8-3EE3D82DC029@oracle.com> References: <0CABE1EF-B971-43A0-ABB8-3EE3D82DC029@oracle.com> Message-ID: <50BEE556.6090602@oracle.com> Hi Mike, In multiple places: + *

xxx ... Should that be

tag? Is it actually needed? (my javadoc is a bit rusty). Aside: I don't realise you could {@inheritDoc) as a simple text insertion mechanism. Just to be clear, the null-handling statements are intended to be normative and apply to anyone who might provide an implementation of theses classes - right? Thanks, David On 5/12/2012 3:47 PM, Mike Duigou wrote: > Hello all; > > I have updated the proposed patch. The changes primarily add class and method documentation regarding handling of null for the primitive specializations. > > http://cr.openjdk.java.net/~mduigou/8004015/1/webrev/ > http://cr.openjdk.java.net/~mduigou/8004015/1/specdiff/java/util/function/package-summary.html > > I've also reformatted the source for the default methods. > > Mike > > > On Nov 26 2012, at 18:12 , Mike Duigou wrote: > >> Hello all; >> >> In the original patch which added the basic lambda functional interfaces, CR#8001634 [1], none of the interfaces extended other interfaces. The reason was primarily that the javac compiler did not, at the time that 8001634 was proposed, support extension methods. The compiler now supports adding of method defaults so this patch improves the functional interfaces by filing in the inheritance hierarchy. >> >> Adding the parent interfaces and default methods allows each functional interface to be used in more places. It is especially important for the functional interfaces which support primitive types, IntSupplier, IntFunction, IntUnaryOperator, IntBinaryOperator, etc. We expect that eventually standard implementations of these interfaces will be provided for functions like max, min, sum, etc. By extending the reference oriented functional interfaces such as Function, the primitive implementations can be used with the boxed primitive types along with the primitive types for which they are defined. >> >> The patch to add parent interfaces and default methods can be found here: >> >> http://cr.openjdk.java.net/~mduigou/8004015/0/webrev/ >> http://cr.openjdk.java.net/~mduigou/8004015/0/specdiff/java/util/function/package-summary.html >> >> Mike >> >> [1] http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c2e80176a697 > From Lance.Andersen at oracle.com Wed Dec 5 11:49:42 2012 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Wed, 5 Dec 2012 06:49:42 -0500 Subject: Request for Review : CR#8004015 : [2nd pass] Add interface extends and defaults for basic functional interfaces In-Reply-To: <0CABE1EF-B971-43A0-ABB8-3EE3D82DC029@oracle.com> References: <0CABE1EF-B971-43A0-ABB8-3EE3D82DC029@oracle.com> Message-ID: <965DB95B-8F79-4025-B4D9-94C5CCF12403@oracle.com> I am still wondering if we need some sort of javadoc tag for default implementations so that it will stand out better and allow us to be consistent with how we specify this across Java SE and other APIs that leverage default methods. Has any thought been given to this? Best Lance On Dec 5, 2012, at 12:47 AM, Mike Duigou wrote: > Hello all; > > I have updated the proposed patch. The changes primarily add class and method documentation regarding handling of null for the primitive specializations. > > http://cr.openjdk.java.net/~mduigou/8004015/1/webrev/ > http://cr.openjdk.java.net/~mduigou/8004015/1/specdiff/java/util/function/package-summary.html > > I've also reformatted the source for the default methods. > > Mike > > > On Nov 26 2012, at 18:12 , Mike Duigou wrote: > >> Hello all; >> >> In the original patch which added the basic lambda functional interfaces, CR#8001634 [1], none of the interfaces extended other interfaces. The reason was primarily that the javac compiler did not, at the time that 8001634 was proposed, support extension methods. The compiler now supports adding of method defaults so this patch improves the functional interfaces by filing in the inheritance hierarchy. >> >> Adding the parent interfaces and default methods allows each functional interface to be used in more places. It is especially important for the functional interfaces which support primitive types, IntSupplier, IntFunction, IntUnaryOperator, IntBinaryOperator, etc. We expect that eventually standard implementations of these interfaces will be provided for functions like max, min, sum, etc. By extending the reference oriented functional interfaces such as Function, the primitive implementations can be used with the boxed primitive types along with the primitive types for which they are defined. >> >> The patch to add parent interfaces and default methods can be found here: >> >> http://cr.openjdk.java.net/~mduigou/8004015/0/webrev/ >> http://cr.openjdk.java.net/~mduigou/8004015/0/specdiff/java/util/function/package-summary.html >> >> Mike >> >> [1] http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c2e80176a697 > -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From david.holmes at oracle.com Wed Dec 5 11:59:22 2012 From: david.holmes at oracle.com (David Holmes) Date: Wed, 05 Dec 2012 21:59:22 +1000 Subject: Proposal: Fully Concurrent ClassLoading Message-ID: <50BF371A.1060604@oracle.com> Java 7 introduced support for parallel classloading by adding to each class loader a ConcurrentHashMap, referenced through a new field, parallelLockMap. This contains a mapping from class names to Objects to use as a classloading lock for that class name. This scheme has a number of inefficiencies. To address this we propose for Java 8 the notion of a fully concurrent classloader ... This is a fairly simple proposal that I've written up as a blog entry: https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent Please discuss this proposal here. Thanks, David Holmes From alan.bateman at oracle.com Wed Dec 5 12:55:51 2012 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Wed, 05 Dec 2012 12:55:51 +0000 Subject: hg: jdk8/tl/jdk: 8004491: Build breakage on Linux due to 8004188 Message-ID: <20121205125631.21EC047E25@hg.openjdk.java.net> Changeset: b54a5b7d2e65 Author: alanb Date: 2012-12-05 12:20 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b54a5b7d2e65 8004491: Build breakage on Linux due to 8004188 Reviewed-by: chegar, erikj ! makefiles/CopyFiles.gmk From Alan.Bateman at oracle.com Wed Dec 5 14:45:16 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 05 Dec 2012 14:45:16 +0000 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50BE1CD7.3040104@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BE0BD3.9060709@oracle.com> <50BE1CD7.3040104@oracle.com> Message-ID: <50BF5DFC.4060009@oracle.com> On 04/12/2012 15:55, Daniel Fuchs wrote: > > So that would be the wording: > > * Uses the service-provider loading facilities, defined by the > * {@link java.util.ServiceLoader} class, to attempt to locate > * and load an implementation of the service. If there are > * providers other than the implementation specific default > * located, then the first provider that is > * not the default is instantiated and returned; Otherwise > * the default implementation is returned if it is on the > * classpath or installed as an extension. > > This however suggests that in JDK 8 the default implementation > *needs* to be put on the classpath or installed as an extension. > But is that right? > Wouldn't that be required only when running with a profile in > which the default implementation is not present by default? > > Maybe we need to find yet a better wording. > > -- daniel It might be better to just leave it as "Otherwise the default implementation is returned". -Alan From daniel.fuchs at oracle.com Wed Dec 5 14:56:00 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Wed, 05 Dec 2012 15:56:00 +0100 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50BF5DFC.4060009@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BE0BD3.9060709@oracle.com> <50BE1CD7.3040104@oracle.com> <50BF5DFC.4060009@oracle.com> Message-ID: <50BF6080.7020500@oracle.com> On 12/5/12 3:45 PM, Alan Bateman wrote: > On 04/12/2012 15:55, Daniel Fuchs wrote: >> >> So that would be the wording: >> >> * Uses the service-provider loading facilities, defined by the >> * {@link java.util.ServiceLoader} class, to attempt to locate >> * and load an implementation of the service. If there are >> * providers other than the implementation specific default >> * located, then the first provider that is >> * not the default is instantiated and returned; Otherwise >> * the default implementation is returned if it is on the >> * classpath or installed as an extension. >> >> This however suggests that in JDK 8 the default implementation >> *needs* to be put on the classpath or installed as an extension. >> But is that right? >> Wouldn't that be required only when running with a profile in >> which the default implementation is not present by default? >> >> Maybe we need to find yet a better wording. >> >> -- daniel > It might be better to just leave it as "Otherwise the default > implementation is returned". Or maybe: "Otherwise, the default implementation, if present, is returned" ? I think the original intent was to make provision for the case where the implementation module would not be installed.... -- daniel > > -Alan From Alan.Bateman at oracle.com Wed Dec 5 15:44:08 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 05 Dec 2012 15:44:08 +0000 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50BF6080.7020500@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BE0BD3.9060709@oracle.com> <50BE1CD7.3040104@oracle.com> <50BF5DFC.4060009@oracle.com> <50BF6080.7020500@oracle.com> Message-ID: <50BF6BC8.5000205@oracle.com> On 05/12/2012 14:56, Daniel Fuchs wrote: > > Or maybe: > > "Otherwise, the default implementation, if present, is returned" ? > > I think the original intent was to make provision for the case where > the implementation module would not be installed.... That is longer term intent, meaning when we go do modules. So your proposal seems good to me. -Alan From Alan.Bateman at oracle.com Wed Dec 5 15:57:15 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 05 Dec 2012 15:57:15 +0000 Subject: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50BE59E1.6010008@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BE59E1.6010008@oracle.com> Message-ID: <50BF6EDB.6090603@oracle.com> On 04/12/2012 20:15, Mandy Chung wrote: > Alan - thanks for the feedback. I have made several changes to the > jdeps tool. Here is the new webrev at: > > http://cr.openjdk.java.net/~mchung/jdk8/webrevs/8003562/langtools-webrev.01/ > > I'll send out a formal code review request once I add the new unit tests. I like the name of the tool, and I think the new proposed options looks much better. The only option that I suspect might confuse people is -d, I'm not sure that this is really needed. A minor observation but I wonder if -v/--verbose should be something else. The sub-options are good, it's just that -v is really is selecting the level that the dependencies are printed (and -v:summary is less verbose than the default). Otherwise I think this will be really useful to have. -Alan, From daniel.fuchs at oracle.com Wed Dec 5 16:17:54 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Wed, 05 Dec 2012 17:17:54 +0100 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50BE007A.4090102@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> Message-ID: <50BF73B2.5000102@oracle.com> Hi, Please find below a revised version of the changes for the javax.xml.parsers package. It hopefully incorporates all comments I have received so far. * better wording/formating for Javadoc changes * using for( : ) syntax in findServiceProvider * improved // comments explaining why the additional layer of RuntimeException is needed when wrapping ServiceConfigurationError. best regards, -- daniel On 12/4/12 2:54 PM, Alan Bateman wrote: > On 03/12/2012 19:04, Daniel Fuchs wrote: >> Hi, >> >> This is a first webrev in a series that addresses a change intended >> for JDK 8: >> >> 7169894: JAXP Plugability Layer: using service loader >> >> I've been building up on Joe's work and Paul & Alan comments >> from an earlier discussion thread [1] >> >> This here addresses changes in the javax.xml.parsers >> package for the SAXParserFactory and DocumentBuilderFactory - and >> more specifically their no-argument newInstance() method. >> >> This change replaces the custom code that was reading the >> META-INF/services/ resources by a simple call to ServiceLoader. >> >> >> > Thank you very much for taking this one on. I think your approach to > take javax.xml.parsers on its own is good as the previous review rounds > got really stuck in the mire due to the number of factories, code > duplication, and subtle specification and implementation differences. > > In the class descriptions it suggests that the default implementation > may be "installed as a module" but we aren't there yet so I'm not sure > about using the term "module". I think it should be okay to say > "installed as an extension" as ServiceLoader uses this term. > > The class description also suggests that a SCE will be wrapped as a > FactoryConfigurationException but in FactoryFinder I see that it actual > wraps a RuntimeException. I think you can just use the no-arg > constructor then then use initCause to set the cause to the SCE. > > Also the statement "If a misconfigured provider is encountered and SCE > is thrown" can probably be changed to "If SCE is thrown" as it can be > thrown for other reasons too. > > Minor nit is that the updates to DocumentBuilderFactory's class > description requires a really wide screen compared to the rest of the > javadoc. > > Minor implementation suggestion for findServiceProvider is that you can > use for-each to iterate through the providers. > > Otherwise I think you've captured all the points of feedback from the > original review. > > Finally one suggestion is to make keep notes on the "before & after" > behavior, this is something that will be important for release and > compatibility notes. > > -Alan. > > > > > From jim.gish at oracle.com Wed Dec 5 16:41:17 2012 From: jim.gish at oracle.com (Jim Gish) Date: Wed, 05 Dec 2012 11:41:17 -0500 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BE9014.9000508@oracle.com> References: <50BE56FA.8070508@oracle.com> <50BE65F7.6030306@oracle.com> <50BE66C6.90409@oracle.com> <50BE697B.7040903@oracle.com> <50BE6E56.5060905@oracle.com> <50BE9014.9000508@oracle.com> Message-ID: <50BF792D.9010605@oracle.com> Thanks for the suggestions, Stuart. BTW printStackTrace() prints to standard error by default -- that's why I don't explicitly have it in there. Cheers, Jim On 12/04/2012 07:06 PM, Stuart Marks wrote: > Hi Jim, > > (Looks like you're cleaning up warnings along the way. I guess that's > OK.) > > Before printing the stack trace, there should be a message to stderr > indicating where this stack trace is coming from. For example, > "getUnusedRandomPort: caught exception". The stack trace should be > printed to stderr as well, using something like > ex.printStackTrace(System.err). > > I think narrowing the catch to IOException is good, since that's the > only exception case we really want to retry. I don't think it makes > sense to mention IllegalArgumentException or SecurityException > specifically in the comments though. Any exception other than > IOException should fail-fast. > > A message should also be printed if we decide to retry because the > port is one of the "reserved" ports. This might provide an important > clue to solving the puzzle. > > (My hypothesis is that this routine fails relatively silently when, on > its last retry, it successfully opens a reserved port. In this case ex > will be null and we get the RuntimeException with no further > explanation.) > > It would also be helpful to print numTries each time around the loop > so that we can see if it really is retrying that many times. > > Regarding netstat, I think it's a good idea, but I'd suggest we work > on it separately from this change. Instead, suppose we add a shell > script test that's named so that it runs at the end of the jdk_rmi > test target. This could just run netstat -a (or whatever) > unconditionally. In fact, I could do that without even pushing any > changes to the source code.... > > s'marks > > On 12/4/12 1:42 PM, Jim Gish wrote: >> OK -- how about a push then for now and with luck we might get some >> useful >> output in a day or two. >> >> Jim >> >> On 12/04/2012 04:22 PM, Alan Bateman wrote: >>> On 04/12/2012 21:10, Jim Gish wrote: >>>> : >>>> >>>> P.S. working on adding nestat -a output per Alan's suggestion. >>> BTW: I didn't mean you have to run with my comment, it's just that I >>> assume >>> the issue that the Windows is out of dynamic ports. There is a registry >>> setting to change the range, and I think there is a netsh command to >>> adjust >>> it too. If we can somehow capture the netstat output then it may >>> confirm this. >>> >>> -Alan. >> -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From mike.duigou at oracle.com Wed Dec 5 18:07:54 2012 From: mike.duigou at oracle.com (Mike Duigou) Date: Wed, 5 Dec 2012 10:07:54 -0800 Subject: Request for Review : CR#8004015 : [2nd pass] Add interface extends and defaults for basic functional interfaces In-Reply-To: <50BEE556.6090602@oracle.com> References: <0CABE1EF-B971-43A0-ABB8-3EE3D82DC029@oracle.com> <50BEE556.6090602@oracle.com> Message-ID: <56B46C81-9364-4329-B373-80D1D80B295A@oracle.com> On Dec 4 2012, at 22:10 , David Holmes wrote: > Hi Mike, > > In multiple places: > > + *

xxx ... > > Should that be

tag? Is it actually needed? (my javadoc is a bit rusty). Many of these were added/changed by NetBeans styler. I then added additional instances. I have converted all of the

->

. I have also filed a bug against NetBans styler: http://netbeans.org/bugzilla/show_bug.cgi?id=223342 > Aside: I don't realise you could {@inheritDoc) as a simple text insertion mechanism. I only learned of this in the last six months myself. :-) > Just to be clear, the null-handling statements are intended to be normative and apply to anyone who might provide an implementation of theses classes - right? Correct. I would prefer that they were not but it seems unavoidable. Mike > > Thanks, > David > > On 5/12/2012 3:47 PM, Mike Duigou wrote: >> Hello all; >> >> I have updated the proposed patch. The changes primarily add class and method documentation regarding handling of null for the primitive specializations. >> >> http://cr.openjdk.java.net/~mduigou/8004015/1/webrev/ >> http://cr.openjdk.java.net/~mduigou/8004015/1/specdiff/java/util/function/package-summary.html >> >> I've also reformatted the source for the default methods. >> >> Mike >> >> >> On Nov 26 2012, at 18:12 , Mike Duigou wrote: >> >>> Hello all; >>> >>> In the original patch which added the basic lambda functional interfaces, CR#8001634 [1], none of the interfaces extended other interfaces. The reason was primarily that the javac compiler did not, at the time that 8001634 was proposed, support extension methods. The compiler now supports adding of method defaults so this patch improves the functional interfaces by filing in the inheritance hierarchy. >>> >>> Adding the parent interfaces and default methods allows each functional interface to be used in more places. It is especially important for the functional interfaces which support primitive types, IntSupplier, IntFunction, IntUnaryOperator, IntBinaryOperator, etc. We expect that eventually standard implementations of these interfaces will be provided for functions like max, min, sum, etc. By extending the reference oriented functional interfaces such as Function, the primitive implementations can be used with the boxed primitive types along with the primitive types for which they are defined. >>> >>> The patch to add parent interfaces and default methods can be found here: >>> >>> http://cr.openjdk.java.net/~mduigou/8004015/0/webrev/ >>> http://cr.openjdk.java.net/~mduigou/8004015/0/specdiff/java/util/function/package-summary.html >>> >>> Mike >>> >>> [1] http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c2e80176a697 >> From mike.duigou at oracle.com Wed Dec 5 18:20:26 2012 From: mike.duigou at oracle.com (Mike Duigou) Date: Wed, 5 Dec 2012 10:20:26 -0800 Subject: Request for Review : CR#8004015 : [final (?) pass] Add interface extends and defaults for basic functional interfaces In-Reply-To: <0CABE1EF-B971-43A0-ABB8-3EE3D82DC029@oracle.com> References: <0CABE1EF-B971-43A0-ABB8-3EE3D82DC029@oracle.com> Message-ID: I have updated webrev again to fix some reported javadoc technical issues and added null handling specification to the {Int|Double|Long}Supplier. http://cr.openjdk.java.net/~mduigou/8004015/2/webrev/ http://cr.openjdk.java.net/~mduigou/8004015/2/specdiff/java/util/function/package-summary.html I believe that this iteration is complete (or very nearly so). Mike On Dec 4 2012, at 21:47 , Mike Duigou wrote: > Hello all; > > I have updated the proposed patch. The changes primarily add class and method documentation regarding handling of null for the primitive specializations. > > http://cr.openjdk.java.net/~mduigou/8004015/1/webrev/ > http://cr.openjdk.java.net/~mduigou/8004015/1/specdiff/java/util/function/package-summary.html > > I've also reformatted the source for the default methods. > > Mike > > > On Nov 26 2012, at 18:12 , Mike Duigou wrote: > >> Hello all; >> >> In the original patch which added the basic lambda functional interfaces, CR#8001634 [1], none of the interfaces extended other interfaces. The reason was primarily that the javac compiler did not, at the time that 8001634 was proposed, support extension methods. The compiler now supports adding of method defaults so this patch improves the functional interfaces by filing in the inheritance hierarchy. >> >> Adding the parent interfaces and default methods allows each functional interface to be used in more places. It is especially important for the functional interfaces which support primitive types, IntSupplier, IntFunction, IntUnaryOperator, IntBinaryOperator, etc. We expect that eventually standard implementations of these interfaces will be provided for functions like max, min, sum, etc. By extending the reference oriented functional interfaces such as Function, the primitive implementations can be used with the boxed primitive types along with the primitive types for which they are defined. >> >> The patch to add parent interfaces and default methods can be found here: >> >> http://cr.openjdk.java.net/~mduigou/8004015/0/webrev/ >> http://cr.openjdk.java.net/~mduigou/8004015/0/specdiff/java/util/function/package-summary.html >> >> Mike >> >> [1] http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c2e80176a697 > From huizhe.wang at oracle.com Wed Dec 5 18:53:16 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Wed, 05 Dec 2012 10:53:16 -0800 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50BF73B2.5000102@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> Message-ID: <50BF981C.1010702@oracle.com> Hi Daniel, Looks good to me! -Joe On 12/5/2012 8:17 AM, Daniel Fuchs wrote: > Hi, > > Please find below a revised version of the changes for > the javax.xml.parsers package. > > It hopefully incorporates all comments I have received so far. > > > > > * better wording/formating for Javadoc changes > * using for( : ) syntax in findServiceProvider > * improved // comments explaining why the additional layer of > RuntimeException is needed when wrapping ServiceConfigurationError. > > best regards, > > -- daniel > > On 12/4/12 2:54 PM, Alan Bateman wrote: >> On 03/12/2012 19:04, Daniel Fuchs wrote: >>> Hi, >>> >>> This is a first webrev in a series that addresses a change intended >>> for JDK 8: >>> >>> 7169894: JAXP Plugability Layer: using service loader >>> >>> I've been building up on Joe's work and Paul & Alan comments >>> from an earlier discussion thread [1] >>> >>> This here addresses changes in the javax.xml.parsers >>> package for the SAXParserFactory and DocumentBuilderFactory - and >>> more specifically their no-argument newInstance() method. >>> >>> This change replaces the custom code that was reading the >>> META-INF/services/ resources by a simple call to ServiceLoader. >>> >>> >>> >>> >> Thank you very much for taking this one on. I think your approach to >> take javax.xml.parsers on its own is good as the previous review rounds >> got really stuck in the mire due to the number of factories, code >> duplication, and subtle specification and implementation differences. >> >> In the class descriptions it suggests that the default implementation >> may be "installed as a module" but we aren't there yet so I'm not sure >> about using the term "module". I think it should be okay to say >> "installed as an extension" as ServiceLoader uses this term. >> >> The class description also suggests that a SCE will be wrapped as a >> FactoryConfigurationException but in FactoryFinder I see that it actual >> wraps a RuntimeException. I think you can just use the no-arg >> constructor then then use initCause to set the cause to the SCE. >> >> Also the statement "If a misconfigured provider is encountered and SCE >> is thrown" can probably be changed to "If SCE is thrown" as it can be >> thrown for other reasons too. >> >> Minor nit is that the updates to DocumentBuilderFactory's class >> description requires a really wide screen compared to the rest of the >> javadoc. >> >> Minor implementation suggestion for findServiceProvider is that you can >> use for-each to iterate through the providers. >> >> Otherwise I think you've captured all the points of feedback from the >> original review. >> >> Finally one suggestion is to make keep notes on the "before & after" >> behavior, this is something that will be important for release and >> compatibility notes. >> >> -Alan. >> >> >> >> >> > From Alan.Bateman at oracle.com Wed Dec 5 18:58:19 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 05 Dec 2012 18:58:19 +0000 Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present Message-ID: <50BF994B.5020308@oracle.com> A while back [1], I brought up the issue of the Properties storeToXML/loadFromXML methods being problematic for our efforts to modularize the JDK and also the Compact Profiles effort. At the time I mentioned that we were thinking of including a small footprint XML parser that we could use in the base module (when JAXP is not present) and also use in the compact1 profile. The preparatory work to create a JDK-internal provider mechanism and the spec work to only require an implementation support UTF-8 and UTF-16 is already in jdk8, now it's time for the next step. Joe Wang has taken the JSR-280 RI, which includes some code from SAX, and stripped it down so that it's reasonably small (less than 50k in a compressed rt.jar). We've hooked it up to Properties so that it works as a fallback when there isn't an XmlPropertiesProvider present. There's still a good bit of clean-up required and there's probably more that can be pulled out but it's at the point where we can start early review. To that end, the webrev with everything is here: http://cr.openjdk.java.net/~alanb/8004371/webrev/ For tests then I've changed the LoadAndStoreXML test that I added recently to exercise the implementation. Otherwise, the implementation will only be used when testing the smallest profile (compact1, brewing in the jdk8/profiles forest) or when it gets pulled into the downstream jigsaw forest. Joe has some additional tests and we need to compare these with existing tests to see if it's worth converting them. One issue that I'm still mulling over, as least for the profiles effort, is whether to only include the fallback provider in the smallest profile as it won't be used otherwise. If the eventual size isn't too significant then it might not be worth it of course. -Alan. [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-October/011648.html From akhil.arora at oracle.com Wed Dec 5 19:39:40 2012 From: akhil.arora at oracle.com (Akhil Arora) Date: Wed, 05 Dec 2012 11:39:40 -0800 Subject: RFR: 8003246: Add Supplier to ThreadLocal Message-ID: <50BFA2FC.4010201@oracle.com> This patch adds a constructor to ThreadLocal to supply initial values using the new Supplier functional interface. Please review. This work was done by Jim Gish. http://cr.openjdk.java.net/~akhil/8003246.0/webrev/ http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8003246 Thanks From stuart.marks at oracle.com Wed Dec 5 19:45:20 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Wed, 05 Dec 2012 11:45:20 -0800 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BF792D.9010605@oracle.com> References: <50BE56FA.8070508@oracle.com> <50BE65F7.6030306@oracle.com> <50BE66C6.90409@oracle.com> <50BE697B.7040903@oracle.com> <50BE6E56.5060905@oracle.com> <50BE9014.9000508@oracle.com> <50BF792D.9010605@oracle.com> Message-ID: <50BFA450.3030001@oracle.com> On 12/5/12 8:41 AM, Jim Gish wrote: > BTW printStackTrace() prints to standard error by default -- that's why I don't > explicitly have it in there. Oh yes, so it does. Sorry, I was confused. s'marks From mike.duigou at oracle.com Wed Dec 5 19:50:19 2012 From: mike.duigou at oracle.com (Mike Duigou) Date: Wed, 5 Dec 2012 11:50:19 -0800 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50BFA2FC.4010201@oracle.com> References: <50BFA2FC.4010201@oracle.com> Message-ID: Looks good to me. Mike On Dec 5 2012, at 11:39 , Akhil Arora wrote: > This patch adds a constructor to ThreadLocal to supply initial values using the new Supplier functional interface. Please review. This work was done by Jim Gish. > > http://cr.openjdk.java.net/~akhil/8003246.0/webrev/ > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8003246 > > Thanks From dl at cs.oswego.edu Wed Dec 5 19:51:13 2012 From: dl at cs.oswego.edu (Doug Lea) Date: Wed, 05 Dec 2012 14:51:13 -0500 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50BFA2FC.4010201@oracle.com> References: <50BFA2FC.4010201@oracle.com> Message-ID: <50BFA5B1.3010301@cs.oswego.edu> On 12/05/12 14:39, Akhil Arora wrote: > This patch adds a constructor to ThreadLocal to supply initial values using the > new Supplier functional interface. Please review. This work was done by Jim Gish. > > http://cr.openjdk.java.net/~akhil/8003246.0/webrev/ > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8003246 > > Thanks > I see that EVERY ThreadLocal now has an extra field in case it is used with a Supplier. I expect that those web frameworks that create thousands of ThreadLocals (not just instances of Threadlocals) will see a measurable space increase. has anyone measure the impact? Did anyone consider instead defining a SuppliedThreadLocal subclass (or some better name) to isolate the impact? -Doug From forax at univ-mlv.fr Wed Dec 5 19:56:04 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Wed, 05 Dec 2012 20:56:04 +0100 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50BFA5B1.3010301@cs.oswego.edu> References: <50BFA2FC.4010201@oracle.com> <50BFA5B1.3010301@cs.oswego.edu> Message-ID: <50BFA6D4.7030108@univ-mlv.fr> On 12/05/2012 08:51 PM, Doug Lea wrote: > On 12/05/12 14:39, Akhil Arora wrote: >> This patch adds a constructor to ThreadLocal to supply initial values >> using the >> new Supplier functional interface. Please review. This work was done >> by Jim Gish. >> >> http://cr.openjdk.java.net/~akhil/8003246.0/webrev/ >> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8003246 >> >> Thanks >> > > I see that EVERY ThreadLocal now has an extra field in case it is > used with a Supplier. I expect that those web frameworks that create > thousands of ThreadLocals (not just instances of Threadlocals) > will see a measurable space increase. has anyone measure the impact? > > Did anyone consider instead defining a SuppliedThreadLocal > subclass (or some better name) to isolate the impact? The class doesn't even to have a name, one can add a static factory method in ThreadLocal and use an anonymous class to implement it. The other problem is that Supplier should be replaced by Supplier everywhere in the code. > > > -Doug > R?mi From jim.gish at oracle.com Wed Dec 5 20:51:48 2012 From: jim.gish at oracle.com (Jim Gish) Date: Wed, 05 Dec 2012 15:51:48 -0500 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BFA450.3030001@oracle.com> References: <50BE56FA.8070508@oracle.com> <50BE65F7.6030306@oracle.com> <50BE66C6.90409@oracle.com> <50BE697B.7040903@oracle.com> <50BE6E56.5060905@oracle.com> <50BE9014.9000508@oracle.com> <50BF792D.9010605@oracle.com> <50BFA450.3030001@oracle.com> Message-ID: <50BFB3E4.80807@oracle.com> Here's a new version for your consideration :-) http://cr.openjdk.java.net/~jgish/Bug8004317-TestLibrary-getUnusedRandomPort-Failure/ Thanks, Jim On 12/05/2012 02:45 PM, Stuart Marks wrote: > On 12/5/12 8:41 AM, Jim Gish wrote: >> BTW printStackTrace() prints to standard error by default -- that's >> why I don't >> explicitly have it in there. > > Oh yes, so it does. Sorry, I was confused. > > s'marks -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From akhil.arora at oracle.com Wed Dec 5 21:27:37 2012 From: akhil.arora at oracle.com (Akhil Arora) Date: Wed, 05 Dec 2012 13:27:37 -0800 Subject: Review Request: 8004201: add reducers to primitive type wrappers In-Reply-To: <50BC0576.4070202@oracle.com> References: <50B8FE8A.2030403@oracle.com> <50BC0576.4070202@oracle.com> Message-ID: <50BFBC49.9020200@oracle.com> Updated - http://cr.openjdk.java.net/~akhil/8004201.1/webrev/ - delegate to Math.min/max for int/long/float/double - rename Boolean.and/or/xor to logicalAnd/logicalOr/logicalXor - removed Character variants of min/max/sum On 12/02/2012 05:50 PM, David Holmes wrote: > Hi Akhil, > > Is it really necessary/desirable to flag all of these as " Suitable for > conversion as a method reference to functional interfaces such as ..." ? Not necessary, but it does provide a hint as to their intended use to a casual browser of these docs. > This style: > > + * @param a a boolean argument. > + * @param b another boolean argument. > > is at odds with the style used elsewhere for new Functional APIs, and > with the style of other methods in these classes. Can we just use "first > operand" and "second operand" for all of these? It is consistent with Math.min/max, which use the a/b style. Since these methods are not in one of the functional package, is'nt it better to stick to the local style? > Character.sum does not make sense to me. Who adds together characters? > I'm not even sure min and max are worth supporting for Character. Good point - removed these methods for Character. > I disagree with other suggestions to use the Math functions for > float/double. I think all these methods should use the underlying > primitive operator regardless of type. Are you disagreeing only for float/double or for int/long also? Can you provide more information as to why you disagree? Thanks > Thanks, > David > ----- > > On 1/12/2012 4:44 AM, Akhil Arora wrote: >> Hi >> >> Requesting review for some basic functionality related to lambdas - >> >> Add min, max, sum methods to the primitive wrapper classes - Byte, >> Short, Integer, Long, Float, Double and Character so as to be able to >> use them as reducers in lambda expressions. Add and, or, xor methods to >> Boolean. >> >> http://cr.openjdk.java.net/~akhil/8004201.0/webrev/ >> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004201 >> >> Thanks From vitalyd at gmail.com Wed Dec 5 21:42:01 2012 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Wed, 5 Dec 2012 16:42:01 -0500 Subject: Review Request: 8004201: add reducers to primitive type wrappers In-Reply-To: <50BFBC49.9020200@oracle.com> References: <50B8FE8A.2030403@oracle.com> <50BC0576.4070202@oracle.com> <50BFBC49.9020200@oracle.com> Message-ID: Regarding Character methods; it's unorthodox but some people use them as "fake" unsigned shorts. Whether that's enough to justify adding sum/max/min, I don't know. Sent from my phone On Dec 5, 2012 4:28 PM, "Akhil Arora" wrote: > Updated - http://cr.openjdk.java.net/~**akhil/8004201.1/webrev/ > > - delegate to Math.min/max for int/long/float/double > - rename Boolean.and/or/xor to logicalAnd/logicalOr/**logicalXor > - removed Character variants of min/max/sum > > On 12/02/2012 05:50 PM, David Holmes wrote: > >> Hi Akhil, >> >> Is it really necessary/desirable to flag all of these as " Suitable for >> conversion as a method reference to functional interfaces such as ..." ? >> > > Not necessary, but it does provide a hint as to their intended use to a > casual browser of these docs. > > This style: >> >> + * @param a a boolean argument. >> + * @param b another boolean argument. >> >> is at odds with the style used elsewhere for new Functional APIs, and >> with the style of other methods in these classes. Can we just use "first >> operand" and "second operand" for all of these? >> > > It is consistent with Math.min/max, which use the a/b style. Since these > methods are not in one of the functional package, is'nt it better to stick > to the local style? > > Character.sum does not make sense to me. Who adds together characters? >> I'm not even sure min and max are worth supporting for Character. >> > > Good point - removed these methods for Character. > > I disagree with other suggestions to use the Math functions for >> float/double. I think all these methods should use the underlying >> primitive operator regardless of type. >> > > Are you disagreeing only for float/double or for int/long also? Can you > provide more information as to why you disagree? > > Thanks > > Thanks, >> David >> ----- >> >> On 1/12/2012 4:44 AM, Akhil Arora wrote: >> >>> Hi >>> >>> Requesting review for some basic functionality related to lambdas - >>> >>> Add min, max, sum methods to the primitive wrapper classes - Byte, >>> Short, Integer, Long, Float, Double and Character so as to be able to >>> use them as reducers in lambda expressions. Add and, or, xor methods to >>> Boolean. >>> >>> http://cr.openjdk.java.net/~**akhil/8004201.0/webrev/ >>> http://bugs.sun.com/**bugdatabase/view_bug.do?bug_**id=8004201 >>> >>> Thanks >>> >> > From mandy.chung at oracle.com Wed Dec 5 21:55:40 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 05 Dec 2012 13:55:40 -0800 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50BF73B2.5000102@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> Message-ID: <50BFC2DC.1090608@oracle.com> Hi Daniel, Looks good to me. One question - the last bullet in the search order covers the default implementation case: "Platform default DocumentBuilderFactory instance." Would it make sense to merge the statement "Otherwise, the default implementation, if present, is returned" with the above statement? e.g. "Default implementation of DocumentBuilderFactory if present". Mandy On 12/5/2012 8:17 AM, Daniel Fuchs wrote: > Hi, > > Please find below a revised version of the changes for > the javax.xml.parsers package. > > It hopefully incorporates all comments I have received so far. > > > > > * better wording/formating for Javadoc changes > * using for( : ) syntax in findServiceProvider > * improved // comments explaining why the additional layer of > RuntimeException is needed when wrapping ServiceConfigurationError. > > best regards, > > -- daniel > > On 12/4/12 2:54 PM, Alan Bateman wrote: >> On 03/12/2012 19:04, Daniel Fuchs wrote: >>> Hi, >>> >>> This is a first webrev in a series that addresses a change intended >>> for JDK 8: >>> >>> 7169894: JAXP Plugability Layer: using service loader >>> >>> I've been building up on Joe's work and Paul & Alan comments >>> from an earlier discussion thread [1] >>> >>> This here addresses changes in the javax.xml.parsers >>> package for the SAXParserFactory and DocumentBuilderFactory - and >>> more specifically their no-argument newInstance() method. >>> >>> This change replaces the custom code that was reading the >>> META-INF/services/ resources by a simple call to ServiceLoader. >>> >>> >>> >>> >> Thank you very much for taking this one on. I think your approach to >> take javax.xml.parsers on its own is good as the previous review rounds >> got really stuck in the mire due to the number of factories, code >> duplication, and subtle specification and implementation differences. >> >> In the class descriptions it suggests that the default implementation >> may be "installed as a module" but we aren't there yet so I'm not sure >> about using the term "module". I think it should be okay to say >> "installed as an extension" as ServiceLoader uses this term. >> >> The class description also suggests that a SCE will be wrapped as a >> FactoryConfigurationException but in FactoryFinder I see that it actual >> wraps a RuntimeException. I think you can just use the no-arg >> constructor then then use initCause to set the cause to the SCE. >> >> Also the statement "If a misconfigured provider is encountered and SCE >> is thrown" can probably be changed to "If SCE is thrown" as it can be >> thrown for other reasons too. >> >> Minor nit is that the updates to DocumentBuilderFactory's class >> description requires a really wide screen compared to the rest of the >> javadoc. >> >> Minor implementation suggestion for findServiceProvider is that you can >> use for-each to iterate through the providers. >> >> Otherwise I think you've captured all the points of feedback from the >> original review. >> >> Finally one suggestion is to make keep notes on the "before & after" >> behavior, this is something that will be important for release and >> compatibility notes. >> >> -Alan. >> >> >> >> >> > From Ulf.Zibis at CoSoCo.de Wed Dec 5 21:58:37 2012 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Wed, 05 Dec 2012 22:58:37 +0100 Subject: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50B54A2C.1040907@oracle.com> References: <50B54A2C.1040907@oracle.com> Message-ID: <50BFC38D.8020406@CoSoCo.de> Yeah, this is a great tool. Does it also help to find the need to recompile a class if the source of a inlined referred static final constant has changed? -Ulf Am 28.11.2012 00:18, schrieb Mandy Chung: > As part of prepare for modules [1], this RFE is to provide a command-line tool in JDK8 so that > developers can understand the static dependencies of their applications and libraries.As part of > Project Jigsaw, a useful class analyzer [2] was developed that makes it very easy to identify the > dependencies based on the classfile library thathas also been enhanced to support dependency > analysis [3]. > > Inspired by the sample tool that Jon Gibbons developed, we propose this new command-line name as > "jdeps". > > $ ./bin/jdeps -h > Usage: jdeps > where possible options include: > -version Version information > -classpath Specify where to find class files > -v --verbose Print class-level dependencies > -r --reverse Invert the dependencies in the output > -p Restrict analysis to classes in this package > (may be given multiple times) > -e --regex Restrict analysis to packages matching pattern > (-p and -e are exclusive) > -P --profile Show profile or the file containing a package > -d --depth Specify the depth of the transitive dependency analysis > Default depth is 1. Set depth to 0 to traverse all dependencies. > -all Show all classes and members with no breakdown > > The jdeps tool shows package-level dependencies of the input files that can be .class files, a > directory, or a JAR file. Specify the depth for the transitive dependency analysis; otherwise, it > only analyzes the input files. jdeps -P option will show where the class/package comes from. For > Java SE API, it will show the Profile name (I implement a workaround for now until the profile > work is in jdk8). For JDK internal APIs, they will not be exported in modular world. jdeps will > indicate any usage of the JDK internal APIs in the output to help developers prepare for > transitioning to modules. > > See below for a few sample output. > > Webrev at: > http://cr.openjdk.java.net/~mchung/jdk8/webrevs/8003562/ > > The implementation classes for jdeps are in the langtools repo along with the > com.sun.tools.classfile library. I'm working on adding more unit tests. I'd like to get this > webrev out to begin the discussion and get review feedback. > > Thanks > Mandy > [1] http://openjdk.java.net/jeps/162 > [2] > http://hg.openjdk.java.net/jigsaw/jigsaw/jdk/raw-file/543b0d24a920/make/tools/classanalyzer/classanalyzer.html > [3] http://bugs.sun.com/view_bug.do?bug_id=6907575 > > Sample Output > > $./bin/jdeps demo/jfc/Notepad/Notepad.jar > (demo/jfc/Notepad/Notepad.jar) > -> java.awt > -> java.awt.event > -> java.beans > -> java.io > -> java.lang > -> java.net > -> java.util > -> java.util.logging > -> javax.swing > -> javax.swing.border > -> javax.swing.event > -> javax.swing.text > -> javax.swing.tree > -> javax.swing.undo > > $ ./bin/jdeps -P demo/jfc/Notepad/Notepad.jar > (demo/jfc/Notepad/Notepad.jar) > -> java.awt compact4 > -> java.awt.event compact4 > -> java.beans compact4 > -> java.io compact1 > -> java.lang compact1 > -> java.net compact1 > -> java.util compact1 > -> java.util.logging compact1 > -> javax.swing compact4 > -> javax.swing.border compact4 > -> javax.swing.event compact4 > -> javax.swing.text compact4 > -> javax.swing.tree compact4 > -> javax.swing.undo compact4 > > $ ./bin/jdeps -d 10 demo/jfc/Notepad/Notepad.jar > (demo/jfc/Notepad/Notepad.jar) > -> java.awt > -> java.awt.event > -> java.beans > -> java.io > -> java.lang > -> java.net > -> java.util > -> java.util.logging > -> javax.swing > -> javax.swing.border > -> javax.swing.event > -> javax.swing.text > -> javax.swing.tree > -> javax.swing.undo > java.security (/export/mchung/ws/jdeps-repo/build/macosx-x86_64/j2sdk-image/jre/lib/rt.jar) > -> javax.crypto > javax.crypto (/export/mchung/ws/jdeps-repo/build/macosx-x86_64/j2sdk-image/jre/lib/jce.jar) > -> java.io > -> java.lang > -> java.lang.reflect > -> java.net > -> java.nio > -> java.security > -> java.security.cert > -> java.security.spec > -> java.util > -> java.util.concurrent > -> java.util.jar > -> java.util.regex > -> java.util.zip > -> sun.security.jca JDK internal API > -> sun.security.util JDK internal API > javax.crypto.spec (/export/mchung/ws/jdeps-repo/build/macosx-x86_64/j2sdk-image/jre/lib/jce.jar) > -> java.lang > -> java.security.spec > -> java.util > From david.dehaven at oracle.com Wed Dec 5 22:44:12 2012 From: david.dehaven at oracle.com (David DeHaven) Date: Wed, 5 Dec 2012 14:44:12 -0800 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. Message-ID: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> A fix for intermittent test failures causing grief on Windows, particularly Windows 7 and 2008 systems: http://cr.openjdk.java.net/~ddehaven/8004042/webrev.1/ The underlying cause is as of yet unknown, but I was able to create an environment that caused similar failures by running "watch -n 0.2 cat JTwork/scratch/atest.bat" in another shell then running jtreg. Without the patch it would fail very regularly (especially when isolated and looped 1,000 times), with the patch it always passes. -DrD- From joe.darcy at oracle.com Wed Dec 5 23:44:53 2012 From: joe.darcy at oracle.com (Joseph Darcy) Date: Wed, 05 Dec 2012 15:44:53 -0800 Subject: Review Request: 8004201: add reducers to primitive type wrappers In-Reply-To: <50BFBC49.9020200@oracle.com> References: <50B8FE8A.2030403@oracle.com> <50BC0576.4070202@oracle.com> <50BFBC49.9020200@oracle.com> Message-ID: <50BFDC75.6000306@oracle.com> Akhil, In javadoc like this 298 * as {@code BinaryOperator<Boolean>}. you don't have to use "<" and the like inside {@code}; please change to 298 * as {@code BinaryOperator}. As a general comment, if the operations for primitive type Foo are put into java.lang.Foo, then the type of the operation needs to be explicitly represented in the expression calling the method (unless static imports are used, etc.). Therefore, I suggest putting these sort of static methods all into one class to allow overloading to do its thing (java.lang.Operators?). Also, for methods like sum, I think it is worth considering returning a larger type than the operands to avoid problems from integer or floating-point overflow. For example, sum on byte and short would return int, sun on int would return long, etc. As an aside, to get a numerically robust result, the summation logic over a set of doubles needs to be more than just a set of raw double additions, but that can be tackled later. Cheers, -Joe On 12/5/2012 1:27 PM, Akhil Arora wrote: > Updated - http://cr.openjdk.java.net/~akhil/8004201.1/webrev/ > > - delegate to Math.min/max for int/long/float/double > - rename Boolean.and/or/xor to logicalAnd/logicalOr/logicalXor > - removed Character variants of min/max/sum > > On 12/02/2012 05:50 PM, David Holmes wrote: >> Hi Akhil, >> >> Is it really necessary/desirable to flag all of these as " Suitable for >> conversion as a method reference to functional interfaces such as ..." ? > Not necessary, but it does provide a hint as to their intended use to a > casual browser of these docs. > >> This style: >> >> + * @param a a boolean argument. >> + * @param b another boolean argument. >> >> is at odds with the style used elsewhere for new Functional APIs, and >> with the style of other methods in these classes. Can we just use "first >> operand" and "second operand" for all of these? > It is consistent with Math.min/max, which use the a/b style. Since these > methods are not in one of the functional package, is'nt it better to > stick to the local style? > >> Character.sum does not make sense to me. Who adds together characters? >> I'm not even sure min and max are worth supporting for Character. > Good point - removed these methods for Character. > >> I disagree with other suggestions to use the Math functions for >> float/double. I think all these methods should use the underlying >> primitive operator regardless of type. > Are you disagreeing only for float/double or for int/long also? Can you > provide more information as to why you disagree? > > Thanks > >> Thanks, >> David >> ----- >> >> On 1/12/2012 4:44 AM, Akhil Arora wrote: >>> Hi >>> >>> Requesting review for some basic functionality related to lambdas - >>> >>> Add min, max, sum methods to the primitive wrapper classes - Byte, >>> Short, Integer, Long, Float, Double and Character so as to be able to >>> use them as reducers in lambda expressions. Add and, or, xor methods to >>> Boolean. >>> >>> http://cr.openjdk.java.net/~akhil/8004201.0/webrev/ >>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004201 >>> >>> Thanks > From stuart.marks at oracle.com Wed Dec 5 23:54:30 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Wed, 05 Dec 2012 15:54:30 -0800 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BFB3E4.80807@oracle.com> References: <50BE56FA.8070508@oracle.com> <50BE65F7.6030306@oracle.com> <50BE66C6.90409@oracle.com> <50BE697B.7040903@oracle.com> <50BE6E56.5060905@oracle.com> <50BE9014.9000508@oracle.com> <50BF792D.9010605@oracle.com> <50BFA450.3030001@oracle.com> <50BFB3E4.80807@oracle.com> Message-ID: <50BFDEB6.3070401@oracle.com> OK, looks better, more explicit so that we can find out why this is failing. There's still a subtle issue in the reporting though. Consider if on attempt N the ServerSocket call gets a valid port but it's one of the reserved ports. Then, unusedRandomPort will be >= 0 and isReservedPort() will be true, so we'll get the "INFO" message. Now on attempt N+1 suppose ServerSocket throws an exception. We'll get the exception stack trace, but then unusedRandomPort will still have its previous value, and we'll get the INFO message again, but spuriously this time. I hate to ask you to update this again, but as it stands I think the output will be quite confusing. I think setting unusedRandomPort back to -1 at the top of the loop should fix it. You need me to push this for you? I can drop in this change before I push, if you're OK with me doing this. s'marks On 12/5/12 12:51 PM, Jim Gish wrote: > Here's a new version for your consideration :-) > > http://cr.openjdk.java.net/~jgish/Bug8004317-TestLibrary-getUnusedRandomPort-Failure/ > > > Thanks, > Jim > > On 12/05/2012 02:45 PM, Stuart Marks wrote: >> On 12/5/12 8:41 AM, Jim Gish wrote: >>> BTW printStackTrace() prints to standard error by default -- that's why I don't >>> explicitly have it in there. >> >> Oh yes, so it does. Sorry, I was confused. >> >> s'marks > > -- > Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 > Oracle Java Platform Group | Core Libraries Team > 35 Network Drive > Burlington, MA 01803 > jim.gish at oracle.com > From jim.gish at oracle.com Thu Dec 6 00:02:56 2012 From: jim.gish at oracle.com (Jim Gish) Date: Wed, 05 Dec 2012 19:02:56 -0500 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BFDEB6.3070401@oracle.com> References: <50BE56FA.8070508@oracle.com> <50BE65F7.6030306@oracle.com> <50BE66C6.90409@oracle.com> <50BE697B.7040903@oracle.com> <50BE6E56.5060905@oracle.com> <50BE9014.9000508@oracle.com> <50BF792D.9010605@oracle.com> <50BFA450.3030001@oracle.com> <50BFB3E4.80807@oracle.com> <50BFDEB6.3070401@oracle.com> Message-ID: <50BFE0B0.9030102@oracle.com> Thanks Stuart. Sure - go ahead and make the change and do the push. Maybe we'll get lucky with the nightlies! Thanks again, Jim On 12/05/2012 06:54 PM, Stuart Marks wrote: > OK, looks better, more explicit so that we can find out why this is > failing. > > There's still a subtle issue in the reporting though. Consider if on > attempt N the ServerSocket call gets a valid port but it's one of the > reserved ports. Then, unusedRandomPort will be >= 0 and > isReservedPort() will be true, so we'll get the "INFO" message. > > Now on attempt N+1 suppose ServerSocket throws an exception. We'll get > the exception stack trace, but then unusedRandomPort will still have > its previous value, and we'll get the INFO message again, but > spuriously this time. I hate to ask you to update this again, but as > it stands I think the output will be quite confusing. > > I think setting unusedRandomPort back to -1 at the top of the loop > should fix it. > > You need me to push this for you? I can drop in this change before I > push, if you're OK with me doing this. > > s'marks > > On 12/5/12 12:51 PM, Jim Gish wrote: >> Here's a new version for your consideration :-) >> >> http://cr.openjdk.java.net/~jgish/Bug8004317-TestLibrary-getUnusedRandomPort-Failure/ >> >> >> >> >> Thanks, >> Jim >> >> On 12/05/2012 02:45 PM, Stuart Marks wrote: >>> On 12/5/12 8:41 AM, Jim Gish wrote: >>>> BTW printStackTrace() prints to standard error by default -- that's >>>> why I don't >>>> explicitly have it in there. >>> >>> Oh yes, so it does. Sorry, I was confused. >>> >>> s'marks >> >> -- >> Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 >> Oracle Java Platform Group | Core Libraries Team >> 35 Network Drive >> Burlington, MA 01803 >> jim.gish at oracle.com >> -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From mandy.chung at oracle.com Thu Dec 6 01:36:30 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 05 Dec 2012 17:36:30 -0800 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50B54A2C.1040907@oracle.com> References: <50B54A2C.1040907@oracle.com> Message-ID: <50BFF69E.1040805@oracle.com> This review request (add a new jdeps tool in the JDK) include changes in langtools and the jdk build. I would need reviewers from the langtools and the build-infra team. Webrev for review: http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/langtools-webrev.02/ http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/jdk-webrev.02/ The jdeps source is in the langtools repo. The change in the jdk repo is to add the new jdeps executable. I made change in the old and new build for the addition of this new jdeps tool. I discussed with Jon whether I should modify langtools/make/build.xml to add a new jdeps target. Since the old build will be replaced by the new build soon, I simply add com/sun/tools/jdeps as part of javap.includes. Alan, The -d option is kept as a hidden option and use as implementation. We can remove it when it's determined not useful in the future. I also rename -v:summary to -summary. Thanks Mandy ---------------------------- $ jdep -h Usage: jdeps where possible options include: -version Version information -classpath Specify where to find class files -summary Print dependency summary only -v:class Print class-level dependencies -v:package Print package-level dependencies -p Restrict analysis to classes in this package (may be given multiple times) -e Restrict analysis to packages matching pattern (-p and -e are exclusive) -P --profile Show profile or the file containing a package -R --recursive Traverse all dependencies recursively -all Process all classes specified in -classpath $ jdep Notepad.jar Ensemble.jar Notepad.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar (Notepad.jar) -> java.awt -> java.awt.event -> java.beans -> java.io -> java.lang -> java.net -> java.util -> java.util.logging -> javax.swing -> javax.swing.border -> javax.swing.event -> javax.swing.text -> javax.swing.tree -> javax.swing.undo Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\jfxrt.jar Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar com.javafx.main (Ensemble.jar) -> java.applet -> java.awt -> java.awt.event -> java.io -> java.lang -> java.lang.reflect -> java.net -> java.security -> java.util -> java.util.jar -> javax.swing -> sun.misc JDK internal API (rt.jar) From david.holmes at oracle.com Thu Dec 6 05:10:55 2012 From: david.holmes at oracle.com (David Holmes) Date: Thu, 06 Dec 2012 15:10:55 +1000 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50BFA2FC.4010201@oracle.com> References: <50BFA2FC.4010201@oracle.com> Message-ID: <50C028DF.2030303@oracle.com> On 6/12/2012 5:39 AM, Akhil Arora wrote: > This patch adds a constructor to ThreadLocal to supply initial values > using the new Supplier functional interface. Please review. This work > was done by Jim Gish. > > http://cr.openjdk.java.net/~akhil/8003246.0/webrev/ > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8003246 Has anyone actually established that this is a useful addition to make? What is the acceptance criteria for adding these new mechanisms to existing classes? Was there a CCC request for this? We need to be very wary of unnecessary bloat. David > Thanks From stuart.marks at oracle.com Thu Dec 6 05:12:03 2012 From: stuart.marks at oracle.com (stuart.marks at oracle.com) Date: Thu, 06 Dec 2012 05:12:03 +0000 Subject: hg: jdk8/tl/jdk: 8004317: TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported Message-ID: <20121206051214.7A1D447EF1@hg.openjdk.java.net> Changeset: a971516029ab Author: jgish Date: 2012-12-05 21:08 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a971516029ab 8004317: TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported Reviewed-by: alanb, dmocek, smarks ! test/java/rmi/testlibrary/TestLibrary.java From stuart.marks at oracle.com Thu Dec 6 05:24:47 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Wed, 05 Dec 2012 21:24:47 -0800 Subject: RFR: 8004317 TestLibrary.getUnusedRandomPort() fails intermittently, but exception not reported In-Reply-To: <50BFE0B0.9030102@oracle.com> References: <50BE56FA.8070508@oracle.com> <50BE65F7.6030306@oracle.com> <50BE66C6.90409@oracle.com> <50BE697B.7040903@oracle.com> <50BE6E56.5060905@oracle.com> <50BE9014.9000508@oracle.com> <50BF792D.9010605@oracle.com> <50BFA450.3030001@oracle.com> <50BFB3E4.80807@oracle.com> <50BFDEB6.3070401@oracle.com> <50BFE0B0.9030102@oracle.com> Message-ID: <50C02C1F.8090006@oracle.com> Pushed: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a971516029ab I couldn't resist doing a couple more fixups. (Man, there is a lot more cleaning up that could be done in here.) I don't know if I got this in time for tonight's nightly. Well, get it in there and see if it falls over sooner or later. s'marks On 12/5/12 4:02 PM, Jim Gish wrote: > Thanks Stuart. Sure - go ahead and make the change and do the push. Maybe > we'll get lucky with the nightlies! > > Thanks again, > Jim > On 12/05/2012 06:54 PM, Stuart Marks wrote: >> OK, looks better, more explicit so that we can find out why this is failing. >> >> There's still a subtle issue in the reporting though. Consider if on attempt >> N the ServerSocket call gets a valid port but it's one of the reserved ports. >> Then, unusedRandomPort will be >= 0 and isReservedPort() will be true, so >> we'll get the "INFO" message. >> >> Now on attempt N+1 suppose ServerSocket throws an exception. We'll get the >> exception stack trace, but then unusedRandomPort will still have its previous >> value, and we'll get the INFO message again, but spuriously this time. I hate >> to ask you to update this again, but as it stands I think the output will be >> quite confusing. >> >> I think setting unusedRandomPort back to -1 at the top of the loop should fix >> it. >> >> You need me to push this for you? I can drop in this change before I push, if >> you're OK with me doing this. >> >> s'marks >> >> On 12/5/12 12:51 PM, Jim Gish wrote: >>> Here's a new version for your consideration :-) >>> >>> http://cr.openjdk.java.net/~jgish/Bug8004317-TestLibrary-getUnusedRandomPort-Failure/ >>> >>> >>> >>> >>> Thanks, >>> Jim >>> >>> On 12/05/2012 02:45 PM, Stuart Marks wrote: >>>> On 12/5/12 8:41 AM, Jim Gish wrote: >>>>> BTW printStackTrace() prints to standard error by default -- that's why I >>>>> don't >>>>> explicitly have it in there. >>>> >>>> Oh yes, so it does. Sorry, I was confused. >>>> >>>> s'marks >>> >>> -- >>> Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 >>> Oracle Java Platform Group | Core Libraries Team >>> 35 Network Drive >>> Burlington, MA 01803 >>> jim.gish at oracle.com >>> > From stuart.marks at oracle.com Thu Dec 6 05:43:31 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Wed, 05 Dec 2012 21:43:31 -0800 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. In-Reply-To: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> References: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> Message-ID: <50C03083.4030102@oracle.com> On 12/5/12 2:44 PM, David DeHaven wrote: > > A fix for intermittent test failures causing grief on Windows, particularly Windows 7 and 2008 systems: > http://cr.openjdk.java.net/~ddehaven/8004042/webrev.1/ > > The underlying cause is as of yet unknown, but I was able to create an environment that caused similar failures by running "watch -n 0.2 cat JTwork/scratch/atest.bat" in another shell then running jtreg. Without the patch it would fail very regularly (especially when isolated and looped 1,000 times), with the patch it always passes. We had been discussing/speculating that the problem is the virus scanner checking the old incarnation of the file at the same time we want to create a new one. If so, and if it were to hold the file open with exclusive access, that would explain the AccessDeniedException instead of FileAlreadyExistsException (in the CREATE_NEW case). (I still don't have an explanation for why the file deletion doesn't throw an exception. That's what seems to cause jtreg some grief in its cleanup phase, and for that reason we've added retry logic to jtreg.) In any case I think backing off and retrying is probably what's getting us the benefit, not the adjustment of the file creation flags. In any case I'd increase the number of retry attempts. The test environment is surprisingly hostile. In the RMI tests we try to open an unused network port and retry 10 times if that fails, and sometimes that's not enough. (See Jim Gish's recent changeset.) InterruptedException shouldn't be ignored. Jtreg will interrupt the test if it times out, so this interruption should be handled gracefully. Perhaps, wrap the InterruptedException in an IOException and rethrow it? (Since the caller is clearly prepared to handle IOException.) Terminating the loop and returning normally doesn't seem right, since the file wasn't created successfully. This is only style, but perhaps it would be good to get rid of the 'done' boolean and replace the 'done = true' statement with a 'return'. This simplifies things a bit, I think. s'marks From david.holmes at oracle.com Thu Dec 6 06:06:45 2012 From: david.holmes at oracle.com (David Holmes) Date: Thu, 06 Dec 2012 16:06:45 +1000 Subject: Request for Review : CR#8004015 : [final (?) pass] Add interface extends and defaults for basic functional interfaces In-Reply-To: References: <0CABE1EF-B971-43A0-ABB8-3EE3D82DC029@oracle.com> Message-ID: <50C035F5.4050007@oracle.com> On 6/12/2012 4:20 AM, Mike Duigou wrote: > I have updated webrev again to fix some reported javadoc technical issues and added null handling specification to the {Int|Double|Long}Supplier. > > http://cr.openjdk.java.net/~mduigou/8004015/2/webrev/ > http://cr.openjdk.java.net/~mduigou/8004015/2/specdiff/java/util/function/package-summary.html > > I believe that this iteration is complete (or very nearly so). Sorry to be a pain but this: left - the left operand, must be non-null doesn't tell you what happens if it is null. Is it not better to simply have: @param left the left operand @param right the right operand @throws NullPointerException if either left or right are null ? David ----- > Mike > > On Dec 4 2012, at 21:47 , Mike Duigou wrote: > >> Hello all; >> >> I have updated the proposed patch. The changes primarily add class and method documentation regarding handling of null for the primitive specializations. >> >> http://cr.openjdk.java.net/~mduigou/8004015/1/webrev/ >> http://cr.openjdk.java.net/~mduigou/8004015/1/specdiff/java/util/function/package-summary.html >> >> I've also reformatted the source for the default methods. >> >> Mike >> >> >> On Nov 26 2012, at 18:12 , Mike Duigou wrote: >> >>> Hello all; >>> >>> In the original patch which added the basic lambda functional interfaces, CR#8001634 [1], none of the interfaces extended other interfaces. The reason was primarily that the javac compiler did not, at the time that 8001634 was proposed, support extension methods. The compiler now supports adding of method defaults so this patch improves the functional interfaces by filing in the inheritance hierarchy. >>> >>> Adding the parent interfaces and default methods allows each functional interface to be used in more places. It is especially important for the functional interfaces which support primitive types, IntSupplier, IntFunction, IntUnaryOperator, IntBinaryOperator, etc. We expect that eventually standard implementations of these interfaces will be provided for functions like max, min, sum, etc. By extending the reference oriented functional interfaces such as Function, the primitive implementations can be used with the boxed primitive types along with the primitive types for which they are defined. >>> >>> The patch to add parent interfaces and default methods can be found here: >>> >>> http://cr.openjdk.java.net/~mduigou/8004015/0/webrev/ >>> http://cr.openjdk.java.net/~mduigou/8004015/0/specdiff/java/util/function/package-summary.html >>> >>> Mike >>> >>> [1] http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c2e80176a697 >> > > From henry.jen at oracle.com Thu Dec 6 06:57:23 2012 From: henry.jen at oracle.com (Henry Jen) Date: Wed, 05 Dec 2012 22:57:23 -0800 Subject: Request for Review: CR#8001667, second attempt Message-ID: <50C041D3.9060703@oracle.com> Hi, This update reflect changes based on feedbacks for last version, the changes are - rename reverse() to reverseOrder() - rename Comparator.compose to Comparator.thenComparing - add 4 Comparator.thenComparing methods take [Int|Long|Double]Function to enable fluent syntax like this example, people.sort(Comparators.comparing(People::getFirstName).thenComparing(People.getLastName)) vs previously, people.sort(Comparators.comparing(Person::getName)) Comparator byLastFirst = Comparators.comparing(Person::getLastName) .compose(Comparators.comparing(Person::getFirstName)) Please review and comment on the webrev[1] and specdiff[2]. [1] http://cr.openjdk.java.net/~henryjen/ccc/8001667.1/webrev [2] http://cr.openjdk.java.net/~henryjen/ccc/8001667.1/specdiff/overview-summary.html Cheers, Henry From forax at univ-mlv.fr Thu Dec 6 08:23:09 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Thu, 06 Dec 2012 09:23:09 +0100 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C028DF.2030303@oracle.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> Message-ID: <50C055ED.1040602@univ-mlv.fr> On 12/06/2012 06:10 AM, David Holmes wrote: > On 6/12/2012 5:39 AM, Akhil Arora wrote: >> This patch adds a constructor to ThreadLocal to supply initial values >> using the new Supplier functional interface. Please review. This work >> was done by Jim Gish. >> >> http://cr.openjdk.java.net/~akhil/8003246.0/webrev/ >> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8003246 > > Has anyone actually established that this is a useful addition to > make? What is the acceptance criteria for adding these new mechanisms > to existing classes? Was there a CCC request for this? > > We need to be very wary of unnecessary bloat. It's a necessary bloat :) There are two good reasons to provide a new ThreadLocal<>(() -> initialValue), if all goes as planned, every Supplier will share the same class so instead of having one class by thread local that want to specify an initialValue, we will have only 2 classes (or 3 if the ThreadLocal that takes a Supplier is a subclass) in memory. Also, letting people to subclass ThreadLocal is not a good idea because if in one location someone decide to override get() to by example add a logging code (I've seen a similar problem) then suddenly all the codes that use ThreadLocal.get() will not be able to inline it. Given that too many things are done using ThreadLocal in JEE container, having a way to provide an initial value without subclassing ThreadLocal is a good idea. > > David R?mi From Alan.Bateman at oracle.com Thu Dec 6 10:04:28 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 06 Dec 2012 10:04:28 +0000 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50BF73B2.5000102@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> Message-ID: <50C06DAC.5050500@oracle.com> On 05/12/2012 16:17, Daniel Fuchs wrote: > Hi, > > Please find below a revised version of the changes for > the javax.xml.parsers package. > > It hopefully incorporates all comments I have received so far. > > > > > * better wording/formating for Javadoc changes > * using for( : ) syntax in findServiceProvider > * improved // comments explaining why the additional layer of > RuntimeException is needed when wrapping ServiceConfigurationError. > > best regards, > > -- daniel You've addressed all my comments and I think this looks very good. One other comment. Now that the wording is "Otherwise the default implementation, if present, is returned" it raises the question as to how what happens if the default implementation is not present. A suggestion is to just handle it in the next statement, something like "In the case of a SCE or the default provider is not present, then FCE will be thrown". I see Mandy's comment about the bullet item "Platform default DocumentBuilderFactory instance". I hadn't noticed this but I assume this should just be removed now. -Alan. From daniel.fuchs at oracle.com Thu Dec 6 11:22:23 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Thu, 06 Dec 2012 12:22:23 +0100 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50BFC2DC.1090608@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50BFC2DC.1090608@oracle.com> Message-ID: <50C07FEF.7050102@oracle.com> Hi Mandy, On 12/5/12 10:55 PM, Mandy Chung wrote: > Hi Daniel, > > Looks good to me. One question - the last bullet in the search order > covers the default implementation case: > "Platform default DocumentBuilderFactory instance." > > Would it make sense to merge the statement "Otherwise, the default > implementation, if present, is returned" with the above statement? e.g. > "Default implementation of DocumentBuilderFactory if > present". Good point - the description matches the internal implementation, but maybe too literally: ServiceLoader.load() may return the default implementation - or may return null - hence the text 'the default implementation, if present, is returned.' If ServiceLoader.load() returns null, then the algorithm will again try to instantiate the default implementation - usually using Class.forName with the TCCL - hence the last bullet: 'Platform default DocumentBuilderFactory instance.' This last step is necessary because the default implementation may be present without being accessible through a service provider (that's the default configuration: in JDK 8 - with no user configuration, ServiceLoader.load() will never instantiate the default implementation) However - from a user point of view - I don't think it makes sense to differentiate these two cases: As a user of the JAXP parser factories I won't really care how the default implementation is instantiated, will I? So indeed - I think we should merge the two! Thanks, -- daniel > > Mandy > > On 12/5/2012 8:17 AM, Daniel Fuchs wrote: >> Hi, >> >> Please find below a revised version of the changes for >> the javax.xml.parsers package. >> >> It hopefully incorporates all comments I have received so far. >> >> >> >> >> * better wording/formating for Javadoc changes >> * using for( : ) syntax in findServiceProvider >> * improved // comments explaining why the additional layer of >> RuntimeException is needed when wrapping ServiceConfigurationError. >> >> best regards, >> >> -- daniel >> >> On 12/4/12 2:54 PM, Alan Bateman wrote: >>> On 03/12/2012 19:04, Daniel Fuchs wrote: >>>> Hi, >>>> >>>> This is a first webrev in a series that addresses a change intended >>>> for JDK 8: >>>> >>>> 7169894: JAXP Plugability Layer: using service loader >>>> >>>> I've been building up on Joe's work and Paul & Alan comments >>>> from an earlier discussion thread [1] >>>> >>>> This here addresses changes in the javax.xml.parsers >>>> package for the SAXParserFactory and DocumentBuilderFactory - and >>>> more specifically their no-argument newInstance() method. >>>> >>>> This change replaces the custom code that was reading the >>>> META-INF/services/ resources by a simple call to ServiceLoader. >>>> >>>> >>>> >>>> >>> Thank you very much for taking this one on. I think your approach to >>> take javax.xml.parsers on its own is good as the previous review rounds >>> got really stuck in the mire due to the number of factories, code >>> duplication, and subtle specification and implementation differences. >>> >>> In the class descriptions it suggests that the default implementation >>> may be "installed as a module" but we aren't there yet so I'm not sure >>> about using the term "module". I think it should be okay to say >>> "installed as an extension" as ServiceLoader uses this term. >>> >>> The class description also suggests that a SCE will be wrapped as a >>> FactoryConfigurationException but in FactoryFinder I see that it actual >>> wraps a RuntimeException. I think you can just use the no-arg >>> constructor then then use initCause to set the cause to the SCE. >>> >>> Also the statement "If a misconfigured provider is encountered and SCE >>> is thrown" can probably be changed to "If SCE is thrown" as it can be >>> thrown for other reasons too. >>> >>> Minor nit is that the updates to DocumentBuilderFactory's class >>> description requires a really wide screen compared to the rest of the >>> javadoc. >>> >>> Minor implementation suggestion for findServiceProvider is that you can >>> use for-each to iterate through the providers. >>> >>> Otherwise I think you've captured all the points of feedback from the >>> original review. >>> >>> Finally one suggestion is to make keep notes on the "before & after" >>> behavior, this is something that will be important for release and >>> compatibility notes. >>> >>> -Alan. >>> >>> >>> >>> >>> >> From dl at cs.oswego.edu Thu Dec 6 11:32:35 2012 From: dl at cs.oswego.edu (Doug Lea) Date: Thu, 06 Dec 2012 06:32:35 -0500 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C055ED.1040602@univ-mlv.fr> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> Message-ID: <50C08253.9030904@cs.oswego.edu> On 12/06/12 03:23, Remi Forax wrote: > On 12/06/2012 06:10 AM, David Holmes wrote: >> On 6/12/2012 5:39 AM, Akhil Arora wrote: >>> This patch adds a constructor to ThreadLocal to supply initial values >>> using the new Supplier functional interface. Please review. This work was >>> done by Jim Gish. >>> >>> http://cr.openjdk.java.net/~akhil/8003246.0/webrev/ >>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8003246 >> ... > > There are two good reasons to provide a new ThreadLocal<>(() -> > initialValue), if all goes as planned, every Supplier will share the same > class so instead of having one class by thread local that want to specify an > initialValue, we will have only 2 classes (or 3 if the ThreadLocal that takes > a Supplier is a subclass) in memory. These seem like really good reasons to implement as you suggested in last post, with a static factory that uses a non-public *final* subclass that wires initialValue to supplier call, and not otherwise modifying the ThreadLocal class. It has the added benefit of, by not touching ThreadLocal, guaranteeing that it is time/space-neutral for other existing uses. Which also means that any future time/space improvements in ThreadLocal will not need to be constrained by this change. Jim/Akhil, could you please redo it this way? > Also, letting people to subclass ThreadLocal is not a good idea because if in > one location someone decide to override get() to by example add a logging > code (I've seen a similar problem) then suddenly all the codes that use > ThreadLocal.get() will not be able to inline it. (Yes. We see this when our (very heavy) uses of ThreadLocal inside j.u.c. go from fast to slow mode due to overrides in other unrelated ThreadLocal classes in application code. I've many times considered introducing a "JDK-internal" variant of ThreadLocal to protect against such things. Possibly even one with only a finite fixed capacity, that would allow further speed ups. Or maybe just introducing say a dozen extra dedicated fields in class Thread, making it optimally fast at the expense of non-extensibility.) -Doug From peter.levart at gmail.com Thu Dec 6 11:32:52 2012 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 06 Dec 2012 12:32:52 +0100 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50BF371A.1060604@oracle.com> References: <50BF371A.1060604@oracle.com> Message-ID: <50C08264.80804@gmail.com> Hi David, What about a middle-ground mode where findLoadedClass() and delegation to parent would be called without locks and only findClass() would be guarded by a per-class-name-per-classloader lock? In this mode concurrent attempts to define the same class would still be possible, but the possibility would be much lower. Usually findClass() involves non-ignorable level of resource-intensive work (ZIP, IO, NET) before it calls defineClass()... Also, in this mode, the Map of locks could be implemented so that lock objects would be Weak(ly)Reference(d), since requests for already loaded classes would be satisfied by findLoadedClass() already. We'd just need a ConcurrentWeakValuesHashMap. There must be something I'm missing here, isn't it? Regards, Peter On 12/05/2012 12:59 PM, David Holmes wrote: > Java 7 introduced support for parallel classloading by adding to each > class loader a ConcurrentHashMap, referenced through a new field, > parallelLockMap. This contains a mapping from class names to Objects > to use as a classloading lock for that class name. This scheme has a > number of inefficiencies. To address this we propose for Java 8 the > notion of a fully concurrent classloader ... > > This is a fairly simple proposal that I've written up as a blog entry: > > https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent > > > Please discuss this proposal here. > > Thanks, > David Holmes > From Alan.Bateman at oracle.com Thu Dec 6 11:35:33 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 06 Dec 2012 11:35:33 +0000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50BF371A.1060604@oracle.com> References: <50BF371A.1060604@oracle.com> Message-ID: <50C08305.90907@oracle.com> On 05/12/2012 11:59, David Holmes wrote: > Java 7 introduced support for parallel classloading by adding to each > class loader a ConcurrentHashMap, referenced through a new field, > parallelLockMap. This contains a mapping from class names to Objects > to use as a classloading lock for that class name. This scheme has a > number of inefficiencies. To address this we propose for Java 8 the > notion of a fully concurrent classloader ... > > This is a fairly simple proposal that I've written up as a blog entry: > > https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent > The jdk7 implementation is very unfortunate, it's a pity this wasn't caught before 7 shipped. I think the proposal is good, it preserves compatibility, and if there are loaders calling registerAsParallelCapable now (probably very few) then it they may be able to change to using registerAsFullyConcurrent without too much work. I am tempted to suggest that registerAsParallelCapable should be deprecated too. -Alan. From vitalyd at gmail.com Thu Dec 6 11:56:02 2012 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Thu, 6 Dec 2012 06:56:02 -0500 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C08253.9030904@cs.oswego.edu> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> Message-ID: Doug, When you see the fast to slow ThreadLocal transition due to class loading invalidating inlined get(), do you not then see it get restored back to fast mode since the receiver type in your call sites is still the monomorphic ThreadLocal (and not the unrelated subclasses)? Just trying to understand what R?mi and you are saying. Thanks Sent from my phone On Dec 6, 2012 6:33 AM, "Doug Lea"

wrote: > On 12/06/12 03:23, Remi Forax wrote: > >> On 12/06/2012 06:10 AM, David Holmes wrote: >> >>> On 6/12/2012 5:39 AM, Akhil Arora wrote: >>> >>>> This patch adds a constructor to ThreadLocal to supply initial values >>>> using the new Supplier functional interface. Please review. This work >>>> was >>>> done by Jim Gish. >>>> >>>> http://cr.openjdk.java.net/~**akhil/8003246.0/webrev/ >>>> http://bugs.sun.com/**bugdatabase/view_bug.do?bug_**id=8003246 >>>> >>> ... >>> >> >> There are two good reasons to provide a new ThreadLocal<>(() -> >> initialValue), if all goes as planned, every Supplier will share the same >> class so instead of having one class by thread local that want to specify >> an >> initialValue, we will have only 2 classes (or 3 if the ThreadLocal that >> takes >> a Supplier is a subclass) in memory. >> > > > These seem like really good reasons to implement as you > suggested in last post, with a static factory that uses a non-public > *final* subclass that wires initialValue to supplier call, > and not otherwise modifying the ThreadLocal class. > It has the added benefit of, by not touching ThreadLocal, > guaranteeing that it is time/space-neutral for other existing > uses. Which also means that any future time/space improvements > in ThreadLocal will not need to be constrained by this change. > > Jim/Akhil, could you please redo it this way? > > > Also, letting people to subclass ThreadLocal is not a good idea because >> if in >> one location someone decide to override get() to by example add a logging >> code (I've seen a similar problem) then suddenly all the codes that use >> ThreadLocal.get() will not be able to inline it. >> > > (Yes. We see this when our (very heavy) uses of ThreadLocal > inside j.u.c. go from fast to slow mode due to overrides in other > unrelated ThreadLocal classes in application code. I've many > times considered introducing a "JDK-internal" variant of > ThreadLocal to protect against such things. Possibly even > one with only a finite fixed capacity, that would allow > further speed ups. Or maybe just introducing say a dozen > extra dedicated fields in class Thread, making it optimally fast > at the expense of non-extensibility.) > > -Doug > > > From chris.hegarty at oracle.com Thu Dec 6 11:59:58 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 06 Dec 2012 11:59:58 +0000 Subject: Request for Review : CR#8004015 : [final (?) pass] Add interface extends and defaults for basic functional interfaces In-Reply-To: <50C035F5.4050007@oracle.com> References: <0CABE1EF-B971-43A0-ABB8-3EE3D82DC029@oracle.com> <50C035F5.4050007@oracle.com> Message-ID: <50C088BE.1040403@oracle.com> Mike, Some small comments. 1) IntUnaryOperator.java Typo in: + 30 *

This is the primitive type specialization of {@link IntUnaryOperator} for + 31 * {@code int} and also may be used as a {@code IntUnaryOperator}. When + 32 * used as a {@code IntUnaryOperator} the default {@code operate} implementation + 33 * provided by this interface neither accepts null parameters nor does it return + 34 * null results. IntUnaryOperator -> UnaryOperator 2) Double/Int/Long Function "When used as a Function the default apply implementation provided by this interface neither accepts null parameters nor does it return null results." "When used as a Function", is this really necessary, or should the behavior of the default apply method just be described? Why the restriction on null parameters, it seems overly restrictive since applyAsXXXX accepts nulls, right? 3) package description "null values are accepted and returned by these functional interfaces according to the constraints of the specification in which the functional interfaces are used. The functional interfaces themselves do not constrain or mandate use of null values. Most usages of the functional interfaces will define the role, if any, of null for that context." Given these changes, doesn't this need to be reworked ( to indicate that some methods specify null value behavior)? 4) Trivially, IntSupplier is missing a '

', before "This is the primitive type..." 5) I agree with David, NPE should be defined where applicable. -Chris. On 12/06/2012 06:06 AM, David Holmes wrote: > On 6/12/2012 4:20 AM, Mike Duigou wrote: >> I have updated webrev again to fix some reported javadoc technical >> issues and added null handling specification to the >> {Int|Double|Long}Supplier. >> >> http://cr.openjdk.java.net/~mduigou/8004015/2/webrev/ >> http://cr.openjdk.java.net/~mduigou/8004015/2/specdiff/java/util/function/package-summary.html >> >> >> I believe that this iteration is complete (or very nearly so). > > Sorry to be a pain but this: > > left - the left operand, must be non-null > > doesn't tell you what happens if it is null. Is it not better to simply > have: > > @param left the left operand > @param right the right operand > @throws NullPointerException if either left or right are null > > ? > > David > ----- > > >> Mike >> >> On Dec 4 2012, at 21:47 , Mike Duigou wrote: >> >>> Hello all; >>> >>> I have updated the proposed patch. The changes primarily add class >>> and method documentation regarding handling of null for the primitive >>> specializations. >>> >>> http://cr.openjdk.java.net/~mduigou/8004015/1/webrev/ >>> http://cr.openjdk.java.net/~mduigou/8004015/1/specdiff/java/util/function/package-summary.html >>> >>> >>> I've also reformatted the source for the default methods. >>> >>> Mike >>> >>> >>> On Nov 26 2012, at 18:12 , Mike Duigou wrote: >>> >>>> Hello all; >>>> >>>> In the original patch which added the basic lambda functional >>>> interfaces, CR#8001634 [1], none of the interfaces extended other >>>> interfaces. The reason was primarily that the javac compiler did >>>> not, at the time that 8001634 was proposed, support extension >>>> methods. The compiler now supports adding of method defaults so this >>>> patch improves the functional interfaces by filing in the >>>> inheritance hierarchy. >>>> >>>> Adding the parent interfaces and default methods allows each >>>> functional interface to be used in more places. It is especially >>>> important for the functional interfaces which support primitive >>>> types, IntSupplier, IntFunction, IntUnaryOperator, >>>> IntBinaryOperator, etc. We expect that eventually standard >>>> implementations of these interfaces will be provided for functions >>>> like max, min, sum, etc. By extending the reference oriented >>>> functional interfaces such as Function, the primitive >>>> implementations can be used with the boxed primitive types along >>>> with the primitive types for which they are defined. >>>> >>>> The patch to add parent interfaces and default methods can be found >>>> here: >>>> >>>> http://cr.openjdk.java.net/~mduigou/8004015/0/webrev/ >>>> http://cr.openjdk.java.net/~mduigou/8004015/0/specdiff/java/util/function/package-summary.html >>>> >>>> >>>> Mike >>>> >>>> [1] http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c2e80176a697 >>> >> >> From dl at cs.oswego.edu Thu Dec 6 12:03:45 2012 From: dl at cs.oswego.edu (Doug Lea) Date: Thu, 06 Dec 2012 07:03:45 -0500 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> Message-ID: <50C089A1.3090500@cs.oswego.edu> On 12/06/12 06:56, Vitaly Davidovich wrote: > Doug, > > When you see the fast to slow ThreadLocal transition due to class loading > invalidating inlined get(), do you not then see it get restored back to fast > mode since the receiver type in your call sites is still the monomorphic > ThreadLocal (and not the unrelated subclasses)? Just trying to understand what > R?mi and you are saying. > The possible outcomes are fairly non-deterministic, depending on hotspot's mood about recompiles, tiered-compile interactions, method size, Amddahl's law interactions, phase of moon, etc. (In j.u.c, we have learned that our users appreciate things being predictably fast enough rather than being unpredictably sometimes even faster but often slower. So when we see such cases, as with ThreadLocal, they get added to todo list.) -Doug From vitalyd at gmail.com Thu Dec 6 12:12:11 2012 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Thu, 6 Dec 2012 07:12:11 -0500 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C089A1.3090500@cs.oswego.edu> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C089A1.3090500@cs.oswego.edu> Message-ID: Understood - I'm just trying to make sure I don't have the wrong mental model of this in my mind. Taking pathology aside (e.g. code cache is full when time to recompile, poor tiering interaction, etc), I'd expect the fast inlined path to be restored assuming call site type profile (of the ones we care about) doesn't change after other subclasses are loaded. Would be good if someone can correct that if it's inaccurate. Apologies if this is slightly hijacking the thread, but it's Remi's fault :). Sent from my phone On Dec 6, 2012 7:03 AM, "Doug Lea"

wrote: > On 12/06/12 06:56, Vitaly Davidovich wrote: > >> Doug, >> >> When you see the fast to slow ThreadLocal transition due to class loading >> invalidating inlined get(), do you not then see it get restored back to >> fast >> mode since the receiver type in your call sites is still the monomorphic >> ThreadLocal (and not the unrelated subclasses)? Just trying to understand >> what >> R?mi and you are saying. >> >> > The possible outcomes are fairly non-deterministic, depending > on hotspot's mood about recompiles, tiered-compile interactions, > method size, Amddahl's law interactions, phase of moon, etc. > > (In j.u.c, we have learned that our users appreciate things > being predictably fast enough rather than being > unpredictably sometimes even faster but often slower. > So when we see such cases, as with ThreadLocal, they get added > to todo list.) > > -Doug > > > > > From david.holmes at oracle.com Thu Dec 6 12:42:59 2012 From: david.holmes at oracle.com (David Holmes) Date: Thu, 06 Dec 2012 22:42:59 +1000 Subject: Review Request: 8004201: add reducers to primitive type wrappers In-Reply-To: <50BFBC49.9020200@oracle.com> References: <50B8FE8A.2030403@oracle.com> <50BC0576.4070202@oracle.com> <50BFBC49.9020200@oracle.com> Message-ID: <50C092D3.4020201@oracle.com> On 6/12/2012 7:27 AM, Akhil Arora wrote: > Updated - http://cr.openjdk.java.net/~akhil/8004201.1/webrev/ > > - delegate to Math.min/max for int/long/float/double > - rename Boolean.and/or/xor to logicalAnd/logicalOr/logicalXor > - removed Character variants of min/max/sum > > On 12/02/2012 05:50 PM, David Holmes wrote: >> Is it really necessary/desirable to flag all of these as " Suitable for >> conversion as a method reference to functional interfaces such as ..." ? > > Not necessary, but it does provide a hint as to their intended use to a > casual browser of these docs. I don't find it desirable either. >> This style: >> >> + * @param a a boolean argument. >> + * @param b another boolean argument. >> >> is at odds with the style used elsewhere for new Functional APIs, and >> with the style of other methods in these classes. Can we just use "first >> operand" and "second operand" for all of these? > > It is consistent with Math.min/max, which use the a/b style. Since these > methods are not in one of the functional package, is'nt it better to > stick to the local style? Why do you consider Math to be representative of "local style"? Math isn't even internally consistent with its style - see Math.max versus Math.addExact etc. And Math doesn't include the arguments type in its description. (Consistency is not a strong point in the Java APIs :( ) Given these are being added to support the new functional type I suggest using the same style as for the functional types. >> Character.sum does not make sense to me. Who adds together characters? >> I'm not even sure min and max are worth supporting for Character. > > Good point - removed these methods for Character. > >> I disagree with other suggestions to use the Math functions for >> float/double. I think all these methods should use the underlying >> primitive operator regardless of type. > > Are you disagreeing only for float/double or for int/long also? Can you > provide more information as to why you disagree? I withdraw my objection. David ----- > Thanks > >> Thanks, >> David >> ----- >> >> On 1/12/2012 4:44 AM, Akhil Arora wrote: >>> Hi >>> >>> Requesting review for some basic functionality related to lambdas - >>> >>> Add min, max, sum methods to the primitive wrapper classes - Byte, >>> Short, Integer, Long, Float, Double and Character so as to be able to >>> use them as reducers in lambda expressions. Add and, or, xor methods to >>> Boolean. >>> >>> http://cr.openjdk.java.net/~akhil/8004201.0/webrev/ >>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004201 >>> >>> Thanks > From david.lloyd at redhat.com Thu Dec 6 15:06:56 2012 From: david.lloyd at redhat.com (David M. Lloyd) Date: Thu, 06 Dec 2012 09:06:56 -0600 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C08305.90907@oracle.com> References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com> Message-ID: <50C0B490.7050005@redhat.com> On 12/06/2012 05:35 AM, Alan Bateman wrote: > On 05/12/2012 11:59, David Holmes wrote: >> Java 7 introduced support for parallel classloading by adding to each >> class loader a ConcurrentHashMap, referenced through a new field, >> parallelLockMap. This contains a mapping from class names to Objects >> to use as a classloading lock for that class name. This scheme has a >> number of inefficiencies. To address this we propose for Java 8 the >> notion of a fully concurrent classloader ... >> >> This is a fairly simple proposal that I've written up as a blog entry: >> >> https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent >> > The jdk7 implementation is very unfortunate, it's a pity this wasn't > caught before 7 shipped. > > I think the proposal is good, it preserves compatibility, and if there > are loaders calling registerAsParallelCapable now (probably very few) > then it they may be able to change to using registerAsFullyConcurrent > without too much work. > > I am tempted to suggest that registerAsParallelCapable should be > deprecated too. I'm sorry I missed the original post, and I just want to add my wholehearted support for this idea. Our application server's class loader implementation can be configured (on certain JVMs) to run in a lock-free mode and we have seen good performance and memory footprint as a result on these particular JVMs. As far as the defineClass concurrent redefine issue goes - our current implementation simply does a try/catch for redefinition exceptions. If such an exception occurs, we load the concurrently defined class and return that. In practice, even with many threads, we would see relatively few such collisions. But, a tryDefineClass or defineClassIfNotPresent would be a welcome addition for certain. I'm very glad to see that Mr. Holmes has taken this initiative and found solutions to the various stumbling blocks. -- - DML From mandy.chung at oracle.com Thu Dec 6 15:35:33 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 06 Dec 2012 07:35:33 -0800 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50C0AD96.30407@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C0AD96.30407@oracle.com> Message-ID: <50C0BB45.9030501@oracle.com> Thanks Erik for the help. I missed the files for images build. I'll incorporate your patch. Mandy On 12/6/2012 6:37 AM, Erik Joelsson wrote: > Hello, > > I've looked at the build changes and noted that the old and new build > did not produce the same results. Here is a webrev with adjustments (I > chose to do a full forest webrev because I needed to change a file in > the root too): > > http://cr.openjdk.java.net/~erikj/8003562/webrev.03/ > > The changes are: > > * Add the jdeps package to tools.jar in new build > * Exclude jdeps from jre in new build > * Add "-DEXPAND_CLASSPATH_WILDCARDS > -DNEVER_ACT_AS_SERVER_CLASS_MACHINE" to compile in old build. I wasn't > sure if these were intended for this launcher, but I'm guessing that > it makes sense to match the settings of javap and javah. The other > alternative is to remove these from both old and new build. > * Add ./bin/jdeps to some exception lists in compare script. (jdeps, > like most executables, contains the version string.) > > With these changes, I don't see any new regressions in the compare > script on my machine. > > /Erik > > On 2012-12-06 02:36, Mandy Chung wrote: >> This review request (add a new jdeps tool in the JDK) include changes in >> langtools and the jdk build. I would need reviewers from the langtools >> and the build-infra team. >> >> Webrev for review: >> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/langtools-webrev.02/ >> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/jdk-webrev.02/ >> >> The jdeps source is in the langtools repo. The change in the jdk >> repo is >> to add the new jdeps executable. I made change in the old and new build >> for the addition of this new jdeps tool. I discussed with Jon whether I >> should modify langtools/make/build.xml to add a new jdeps target. Since >> the old build will be replaced by the new build soon, I simply add >> com/sun/tools/jdeps as part of javap.includes. >> >> Alan, >> >> The -d option is kept as a hidden option and use as implementation. We >> can remove it when it's determined not useful in the future. I also >> rename -v:summary to -summary. >> >> Thanks >> Mandy >> >> ---------------------------- >> >> $ jdep -h >> Usage: jdeps >> where possible options include: >> -version Version information >> -classpath Specify where to find class files >> -summary Print dependency summary only >> -v:class Print class-level dependencies >> -v:package Print package-level dependencies >> -p Restrict analysis to classes in this package >> (may be given multiple times) >> -e Restrict analysis to packages matching >> pattern >> (-p and -e are exclusive) >> -P --profile Show profile or the file containing a package >> -R --recursive Traverse all dependencies recursively >> -all Process all classes specified in -classpath >> >> $ jdep Notepad.jar Ensemble.jar >> Notepad.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar >> (Notepad.jar) >> -> java.awt >> -> java.awt.event >> -> java.beans >> -> java.io >> -> java.lang >> -> java.net >> -> java.util >> -> java.util.logging >> -> javax.swing >> -> javax.swing.border >> -> javax.swing.event >> -> javax.swing.text >> -> javax.swing.tree >> -> javax.swing.undo >> >> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\jfxrt.jar >> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar >> com.javafx.main (Ensemble.jar) >> -> java.applet >> -> java.awt >> -> java.awt.event >> -> java.io >> -> java.lang >> -> java.lang.reflect >> -> java.net >> -> java.security >> -> java.util >> -> java.util.jar >> -> javax.swing >> -> sun.misc JDK internal API >> (rt.jar) From david.dehaven at oracle.com Thu Dec 6 16:45:23 2012 From: david.dehaven at oracle.com (David DeHaven) Date: Thu, 6 Dec 2012 08:45:23 -0800 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. In-Reply-To: <50C03083.4030102@oracle.com> References: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> <50C03083.4030102@oracle.com> Message-ID: >> A fix for intermittent test failures causing grief on Windows, particularly Windows 7 and 2008 systems: >> http://cr.openjdk.java.net/~ddehaven/8004042/webrev.1/ >> >> The underlying cause is as of yet unknown, but I was able to create an environment that caused similar failures by running "watch -n 0.2 cat JTwork/scratch/atest.bat" in another shell then running jtreg. Without the patch it would fail very regularly (especially when isolated and looped 1,000 times), with the patch it always passes. > > We had been discussing/speculating that the problem is the virus scanner checking the old incarnation of the file at the same time we want to create a new one. If so, and if it were to hold the file open with exclusive access, that would explain the AccessDeniedException instead of FileAlreadyExistsException (in the CREATE_NEW case). > > (I still don't have an explanation for why the file deletion doesn't throw an exception. That's what seems to cause jtreg some grief in its cleanup phase, and for that reason we've added retry logic to jtreg.) I see a lot of quirky filesystem behavior just using Windows 7, especially compared to Unixish systems ? but maybe that's just me and my environment :) > In any case I think backing off and retrying is probably what's getting us the benefit, not the adjustment of the file creation flags. I agree? I also think this is deeper than just the virus scanner, but I've not the expertise to validate that claim. > In any case I'd increase the number of retry attempts. The test environment is surprisingly hostile. In the RMI tests we try to open an unused network port and retry 10 times if that fails, and sometimes that's not enough. (See Jim Gish's recent changeset.) For 8004317 (I think you pushed it yesterday)? I'll take a look at it. That was my initial value. I backed it off thinking it was overly aggressive, but if the environment is that hostile perhaps it's not. > InterruptedException shouldn't be ignored. Jtreg will interrupt the test if it times out, so this interruption should be handled gracefully. Perhaps, wrap the InterruptedException in an IOException and rethrow it? (Since the caller is clearly prepared to handle IOException.) Terminating the loop and returning normally doesn't seem right, since the file wasn't created successfully. Good point! I'll add that. I think I should through RuntimeException in both cases, to be consistent. > This is only style, but perhaps it would be good to get rid of the 'done' boolean and replace the 'done = true' statement with a 'return'. This simplifies things a bit, I think. I rewrote it to use a for loop instead and it's much cleaner. I'll post a new webrev later today. -DrD- From Lance.Andersen at oracle.com Thu Dec 6 17:01:09 2012 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Thu, 6 Dec 2012 12:01:09 -0500 Subject: signatures that are recorded for default methods Message-ID: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com> Folks, Will the signatures for interfaces that are recorded by the TCKs for interfaces record the fact that a method includes a default method? or will it just record the method definition? I am assuming it will, but I know there has been discussion that a implementor could choose a different default implementation on one of the recent threads that was up for review. I am still trying to understand what our guidelines are, if any for documenting the behavior of the supplied default methods given the javadocs are part of the specification for many APIs (and in some case the only spec). Best Lance Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From akhil.arora at oracle.com Thu Dec 6 17:01:55 2012 From: akhil.arora at oracle.com (Akhil Arora) Date: Thu, 06 Dec 2012 09:01:55 -0800 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C08253.9030904@cs.oswego.edu> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> Message-ID: <50C0CF83.1080208@oracle.com> On 12/06/2012 03:32 AM, Doug Lea wrote: > > These seem like really good reasons to implement as you > suggested in last post, with a static factory that uses a non-public > *final* subclass that wires initialValue to supplier call, > and not otherwise modifying the ThreadLocal class. > It has the added benefit of, by not touching ThreadLocal, > guaranteeing that it is time/space-neutral for other existing > uses. Which also means that any future time/space improvements > in ThreadLocal will not need to be constrained by this change. > > Jim/Akhil, could you please redo it this way? redone - http://cr.openjdk.java.net/~akhil/8003246.1/webrev/ Thanks From cs at schulte.it Thu Dec 6 17:26:10 2012 From: cs at schulte.it (Christian Schulte) Date: Thu, 06 Dec 2012 18:26:10 +0100 Subject: Misleading documentation for class java.nio.charset.spi.CharsetProvider Message-ID: <50C0D532.90001@schulte.it> Hello, I am not sure if this is the correct mailing list to send this mail to. Please apologize any inconvenience caused. The JDK 7 documentation of class java.nio.charset.spi.CharsetProvider states the following: [...] Charset providers are looked up via the current thread's context class loader. [...] Looking at method 'private static Iterator providers()' of class 'java.nio.charset.Charset', the above documentation seems incorrect since that method uses the system class loader. ClassLoader cl = ClassLoader.getSystemClassLoader(); ServiceLoader sl = ServiceLoader.load(CharsetProvider.class, cl); Is this intended ? Regards, -- Christian Schulte From brian.goetz at oracle.com Thu Dec 6 17:35:27 2012 From: brian.goetz at oracle.com (Brian Goetz) Date: Thu, 06 Dec 2012 12:35:27 -0500 Subject: Review Request: 8004201: add reducers to primitive type wrappers In-Reply-To: <50BFDC75.6000306@oracle.com> References: <50B8FE8A.2030403@oracle.com> <50BC0576.4070202@oracle.com> <50BFBC49.9020200@oracle.com> <50BFDC75.6000306@oracle.com> Message-ID: <50C0D75F.3030705@oracle.com> This suggestion makes me nervous, because we're already asking a great deal of type inference. If you say reduce(Operators::plus) and there are eight versions of Operators to choose from (and add boxing into the mix), I think we'll see a lot more inference errors. If the user says Integer::plus, the user has already told us what we want, and we're done. On 12/5/2012 6:44 PM, Joseph Darcy wrote: > Akhil, > > In javadoc like this > > 298 * as {@code BinaryOperator<Boolean>}. > > you don't have to use "<" and the like inside {@code}; please change to > > 298 * as {@code BinaryOperator}. > > As a general comment, if the operations for primitive type Foo are put > into java.lang.Foo, then the type of the operation needs to be > explicitly represented in the expression calling the method (unless > static imports are used, etc.). Therefore, I suggest putting these sort > of static methods all into one class to allow overloading to do its > thing (java.lang.Operators?). Also, for methods like sum, I think it is > worth considering returning a larger type than the operands to avoid > problems from integer or floating-point overflow. For example, sum on > byte and short would return int, sun on int would return long, etc. > > As an aside, to get a numerically robust result, the summation logic > over a set of doubles needs to be more than just a set of raw double > additions, but that can be tackled later. > > Cheers, > > -Joe > > > On 12/5/2012 1:27 PM, Akhil Arora wrote: >> Updated - http://cr.openjdk.java.net/~akhil/8004201.1/webrev/ >> >> - delegate to Math.min/max for int/long/float/double >> - rename Boolean.and/or/xor to logicalAnd/logicalOr/logicalXor >> - removed Character variants of min/max/sum >> >> On 12/02/2012 05:50 PM, David Holmes wrote: >>> Hi Akhil, >>> >>> Is it really necessary/desirable to flag all of these as " Suitable for >>> conversion as a method reference to functional interfaces such as ..." ? >> Not necessary, but it does provide a hint as to their intended use to a >> casual browser of these docs. >> >>> This style: >>> >>> + * @param a a boolean argument. >>> + * @param b another boolean argument. >>> >>> is at odds with the style used elsewhere for new Functional APIs, and >>> with the style of other methods in these classes. Can we just use "first >>> operand" and "second operand" for all of these? >> It is consistent with Math.min/max, which use the a/b style. Since these >> methods are not in one of the functional package, is'nt it better to >> stick to the local style? >> >>> Character.sum does not make sense to me. Who adds together characters? >>> I'm not even sure min and max are worth supporting for Character. >> Good point - removed these methods for Character. >> >>> I disagree with other suggestions to use the Math functions for >>> float/double. I think all these methods should use the underlying >>> primitive operator regardless of type. >> Are you disagreeing only for float/double or for int/long also? Can you >> provide more information as to why you disagree? >> >> Thanks >> >>> Thanks, >>> David >>> ----- >>> >>> On 1/12/2012 4:44 AM, Akhil Arora wrote: >>>> Hi >>>> >>>> Requesting review for some basic functionality related to lambdas - >>>> >>>> Add min, max, sum methods to the primitive wrapper classes - Byte, >>>> Short, Integer, Long, Float, Double and Character so as to be able to >>>> use them as reducers in lambda expressions. Add and, or, xor methods to >>>> Boolean. >>>> >>>> http://cr.openjdk.java.net/~akhil/8004201.0/webrev/ >>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004201 >>>> >>>> Thanks >> > From chris.hegarty at oracle.com Thu Dec 6 17:36:26 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 06 Dec 2012 17:36:26 +0000 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C0CF83.1080208@oracle.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> Message-ID: <50C0D79A.9020006@oracle.com> Thank you Akhil, this looks much better. I'm not completely comfortable with, "The initial value of the variable is provided by calling the {@code intialValue} method." Similarly, " The initial value of the variable is determined by invoking the {@code get} method on the {@code Supplier." Should these statements defer to the text in initialValue? Or maybe just leave out the additional text in the no-args constructor, and have withInitial() just describe its implementation? My concern is with the omission of the behavior of set(), and the term 'initial value' could be misinterpreted. Anyway, I'm relatively happy with this, let's see what others think. -Chris. On 12/06/2012 05:01 PM, Akhil Arora wrote: > On 12/06/2012 03:32 AM, Doug Lea wrote: >> >> These seem like really good reasons to implement as you >> suggested in last post, with a static factory that uses a non-public >> *final* subclass that wires initialValue to supplier call, >> and not otherwise modifying the ThreadLocal class. >> It has the added benefit of, by not touching ThreadLocal, >> guaranteeing that it is time/space-neutral for other existing >> uses. Which also means that any future time/space improvements >> in ThreadLocal will not need to be constrained by this change. >> >> Jim/Akhil, could you please redo it this way? > > redone - http://cr.openjdk.java.net/~akhil/8003246.1/webrev/ > > Thanks From daniel.fuchs at oracle.com Thu Dec 6 17:38:13 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Thu, 06 Dec 2012 18:38:13 +0100 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C06DAC.5050500@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50C06DAC.5050500@oracle.com> Message-ID: <50C0D805.5030509@oracle.com> Updated the javadoc for newInstance(): -- daniel On 12/6/12 11:04 AM, Alan Bateman wrote: > On 05/12/2012 16:17, Daniel Fuchs wrote: >> Hi, >> >> Please find below a revised version of the changes for >> the javax.xml.parsers package. >> >> It hopefully incorporates all comments I have received so far. >> >> >> >> >> * better wording/formating for Javadoc changes >> * using for( : ) syntax in findServiceProvider >> * improved // comments explaining why the additional layer of >> RuntimeException is needed when wrapping ServiceConfigurationError. >> >> best regards, >> >> -- daniel > You've addressed all my comments and I think this looks very good. > > One other comment. Now that the wording is "Otherwise the default > implementation, if present, is returned" it raises the question as to > how what happens if the default implementation is not present. A > suggestion is to just handle it in the next statement, something like > "In the case of a SCE or the default provider is not present, then FCE > will be thrown". > > I see Mandy's comment about the bullet item "Platform default > DocumentBuilderFactory instance". I hadn't noticed this but > I assume this should just be removed now. > > -Alan. From dl at cs.oswego.edu Thu Dec 6 17:38:34 2012 From: dl at cs.oswego.edu (Doug Lea) Date: Thu, 06 Dec 2012 12:38:34 -0500 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C0CF83.1080208@oracle.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> Message-ID: <50C0D81A.5030607@cs.oswego.edu> On 12/06/12 12:01, Akhil Arora wrote: > > redone - http://cr.openjdk.java.net/~akhil/8003246.1/webrev/ > Much better; thanks! As a minor matter, it probably makes sense to give that class a name. Even though it is a non-public static class, the name will be seen here and there by debuggers, stacktraces, etc, and the default "$" name will be confusing. As in: static final class SuppliedThreadLocal extends ThreadLocal .. public static ThreadLocal withInitial(Supplier supplier) { return new SuppliedThreadLocal(supplier); } From david.dehaven at oracle.com Thu Dec 6 17:41:14 2012 From: david.dehaven at oracle.com (David DeHaven) Date: Thu, 6 Dec 2012 09:41:14 -0800 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. In-Reply-To: References: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> <50C03083.4030102@oracle.com> Message-ID: New webrev posted: http://cr.openjdk.java.net/~ddehaven/8004042/webrev.2/ Summary: - Cleaned it up a bit by change to a for loop (eliminating done flag) - Throws RuntimeException instead of IOException, handles InterruptedException - Bumped retry count to 10 - Changed @run mode to "main/othervm" as suggested by Kumar -DrD- From Alan.Bateman at oracle.com Thu Dec 6 17:50:27 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 06 Dec 2012 17:50:27 +0000 Subject: Misleading documentation for class java.nio.charset.spi.CharsetProvider In-Reply-To: <50C0D532.90001@schulte.it> References: <50C0D532.90001@schulte.it> Message-ID: <50C0DAE3.3070905@oracle.com> On 06/12/2012 17:26, Christian Schulte wrote: > Hello, > > I am not sure if this is the correct mailing list to send this mail to. > Please apologize any inconvenience caused. > > The JDK 7 documentation of class java.nio.charset.spi.CharsetProvider > states the following: > > [...] > Charset providers are looked up via the current thread's context class > loader. > [...] > > Looking at method 'private static Iterator providers()' of class > 'java.nio.charset.Charset', the above documentation seems incorrect > since that method uses the system class loader. > > ClassLoader cl = ClassLoader.getSystemClassLoader(); > ServiceLoader sl = > ServiceLoader.load(CharsetProvider.class, cl); > > Is this intended ? > This is a long standing issue (going back to 1.4), we should remove this from the javadoc. -Alan. From akhil.arora at oracle.com Thu Dec 6 18:00:41 2012 From: akhil.arora at oracle.com (Akhil Arora) Date: Thu, 06 Dec 2012 10:00:41 -0800 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C0D81A.5030607@cs.oswego.edu> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> <50C0D81A.5030607@cs.oswego.edu> Message-ID: <50C0DD49.4060900@oracle.com> On 12/06/2012 09:38 AM, Doug Lea wrote: > Much better; thanks! > As a minor matter, it probably makes sense to give that class a > name. Even though it is a non-public static class, the name > will be seen here and there by debuggers, stacktraces, etc, > and the default "$" name will be confusing. As in: > > > static final class SuppliedThreadLocal extends ThreadLocal .. > > public static ThreadLocal withInitial(Supplier > supplier) { > return new SuppliedThreadLocal(supplier); > } http://cr.openjdk.java.net/~akhil/8003246.2/webrev/ - added SuppliedThreadLocal inner class - reverted javadoc changes to no-args constructor - added null check for Supplier Thanks From akhil.arora at oracle.com Thu Dec 6 18:15:22 2012 From: akhil.arora at oracle.com (Akhil Arora) Date: Thu, 06 Dec 2012 10:15:22 -0800 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C028DF.2030303@oracle.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> Message-ID: <50C0E0BA.5010005@oracle.com> On 12/05/2012 09:10 PM, David Holmes wrote: > Was there a CCC request for this? Yes, a CCC was submitted on Nov 12, but it was deferred pending a discussion on this alias. I just updated and resubmitted the CCC based on Doug and Remi's suggestions. From dl at cs.oswego.edu Thu Dec 6 18:29:06 2012 From: dl at cs.oswego.edu (Doug Lea) Date: Thu, 06 Dec 2012 13:29:06 -0500 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C0DD49.4060900@oracle.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> <50C0D81A.5030607@cs.oswego.edu> <50C0DD49.4060900@oracle.com> Message-ID: <50C0E3F2.9030004@cs.oswego.edu> On 12/06/12 13:00, Akhil Arora wrote: > http://cr.openjdk.java.net/~akhil/8003246.2/webrev/ > > - added SuppliedThreadLocal inner class > - reverted javadoc changes to no-args constructor > - added null check for Supplier > Great! Thanks for the quick response. -Doug From forax at univ-mlv.fr Thu Dec 6 18:47:46 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Thu, 06 Dec 2012 19:47:46 +0100 Subject: Review Request: 8004201: add reducers to primitive type wrappers In-Reply-To: <50C0D75F.3030705@oracle.com> References: <50B8FE8A.2030403@oracle.com> <50BC0576.4070202@oracle.com> <50BFBC49.9020200@oracle.com> <50BFDC75.6000306@oracle.com> <50C0D75F.3030705@oracle.com> Message-ID: <50C0E852.7090109@univ-mlv.fr> On 12/06/2012 06:35 PM, Brian Goetz wrote: > This suggestion makes me nervous, because we're already asking a great > deal of type inference. If you say > > reduce(Operators::plus) > > and there are eight versions of Operators to choose from (and add > boxing into the mix), I think we'll see a lot more inference errors. > If the user says Integer::plus, the user has already told us what we > want, and we're done. I think that rule for method references are strong enough (unlike lambda you don't have to guess the type of the formal parameter) to work here, but we should not play with the devil. R?mi > > On 12/5/2012 6:44 PM, Joseph Darcy wrote: >> Akhil, >> >> In javadoc like this >> >> 298 * as {@code BinaryOperator<Boolean>}. >> >> you don't have to use "<" and the like inside {@code}; please >> change to >> >> 298 * as {@code BinaryOperator}. >> >> As a general comment, if the operations for primitive type Foo are put >> into java.lang.Foo, then the type of the operation needs to be >> explicitly represented in the expression calling the method (unless >> static imports are used, etc.). Therefore, I suggest putting these sort >> of static methods all into one class to allow overloading to do its >> thing (java.lang.Operators?). Also, for methods like sum, I think it is >> worth considering returning a larger type than the operands to avoid >> problems from integer or floating-point overflow. For example, sum on >> byte and short would return int, sun on int would return long, etc. >> >> As an aside, to get a numerically robust result, the summation logic >> over a set of doubles needs to be more than just a set of raw double >> additions, but that can be tackled later. >> >> Cheers, >> >> -Joe >> >> >> On 12/5/2012 1:27 PM, Akhil Arora wrote: >>> Updated - http://cr.openjdk.java.net/~akhil/8004201.1/webrev/ >>> >>> - delegate to Math.min/max for int/long/float/double >>> - rename Boolean.and/or/xor to logicalAnd/logicalOr/logicalXor >>> - removed Character variants of min/max/sum >>> >>> On 12/02/2012 05:50 PM, David Holmes wrote: >>>> Hi Akhil, >>>> >>>> Is it really necessary/desirable to flag all of these as " Suitable >>>> for >>>> conversion as a method reference to functional interfaces such as >>>> ..." ? >>> Not necessary, but it does provide a hint as to their intended use to a >>> casual browser of these docs. >>> >>>> This style: >>>> >>>> + * @param a a boolean argument. >>>> + * @param b another boolean argument. >>>> >>>> is at odds with the style used elsewhere for new Functional APIs, and >>>> with the style of other methods in these classes. Can we just use >>>> "first >>>> operand" and "second operand" for all of these? >>> It is consistent with Math.min/max, which use the a/b style. Since >>> these >>> methods are not in one of the functional package, is'nt it better to >>> stick to the local style? >>> >>>> Character.sum does not make sense to me. Who adds together characters? >>>> I'm not even sure min and max are worth supporting for Character. >>> Good point - removed these methods for Character. >>> >>>> I disagree with other suggestions to use the Math functions for >>>> float/double. I think all these methods should use the underlying >>>> primitive operator regardless of type. >>> Are you disagreeing only for float/double or for int/long also? Can you >>> provide more information as to why you disagree? >>> >>> Thanks >>> >>>> Thanks, >>>> David >>>> ----- >>>> >>>> On 1/12/2012 4:44 AM, Akhil Arora wrote: >>>>> Hi >>>>> >>>>> Requesting review for some basic functionality related to lambdas - >>>>> >>>>> Add min, max, sum methods to the primitive wrapper classes - Byte, >>>>> Short, Integer, Long, Float, Double and Character so as to be able to >>>>> use them as reducers in lambda expressions. Add and, or, xor >>>>> methods to >>>>> Boolean. >>>>> >>>>> http://cr.openjdk.java.net/~akhil/8004201.0/webrev/ >>>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004201 >>>>> >>>>> Thanks >>> >> From peter.levart at gmail.com Thu Dec 6 19:01:41 2012 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 06 Dec 2012 20:01:41 +0100 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C089A1.3090500@cs.oswego.edu> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C089A1.3090500@cs.oswego.edu> Message-ID: <50C0EB95.6070800@gmail.com> There's a quick trick that guarantees in-lining of get/set/remove: public static class FastThreadLocal extends ThreadLocal { @Override public final T get() { return super.get(); } @Override public final void set(T value) { super.set(value); } @Override public final void remove() { super.remove(); } } ....just use static type FastThreadLocal everywhere in code. I tried it and it works. Regards, Peter On 12/06/2012 01:03 PM, Doug Lea wrote: > On 12/06/12 06:56, Vitaly Davidovich wrote: >> Doug, >> >> When you see the fast to slow ThreadLocal transition due to class >> loading >> invalidating inlined get(), do you not then see it get restored back >> to fast >> mode since the receiver type in your call sites is still the monomorphic >> ThreadLocal (and not the unrelated subclasses)? Just trying to >> understand what >> R?mi and you are saying. >> > > The possible outcomes are fairly non-deterministic, depending > on hotspot's mood about recompiles, tiered-compile interactions, > method size, Amddahl's law interactions, phase of moon, etc. > > (In j.u.c, we have learned that our users appreciate things > being predictably fast enough rather than being > unpredictably sometimes even faster but often slower. > So when we see such cases, as with ThreadLocal, they get added > to todo list.) > > -Doug > > > > From forax at univ-mlv.fr Thu Dec 6 19:02:33 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Thu, 06 Dec 2012 20:02:33 +0100 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C0E3F2.9030004@cs.oswego.edu> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> <50C0D81A.5030607@cs.oswego.edu> <50C0DD49.4060900@oracle.com> <50C0E3F2.9030004@cs.oswego.edu> Message-ID: <50C0EBC9.2070101@univ-mlv.fr> On 12/06/2012 07:29 PM, Doug Lea wrote: > On 12/06/12 13:00, Akhil Arora wrote: > >> http://cr.openjdk.java.net/~akhil/8003246.2/webrev/ >> >> - added SuppliedThreadLocal inner class >> - reverted javadoc changes to no-args constructor >> - added null check for Supplier >> > > Great! Thanks for the quick response. > > -Doug > > Yes, great ! just nitpicking, return new SuppliedThreadLocal(supplier); should be return new SuppliedThreadLocal<>(supplier); Also, can you add a @see in the constructor of ThreadLocal that references ThreadLocal.withInitialValue(Supplier). cheers, R?mi From mandy.chung at oracle.com Thu Dec 6 19:05:49 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 06 Dec 2012 11:05:49 -0800 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C0D805.5030509@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50C06DAC.5050500@oracle.com> <50C0D805.5030509@oracle.com> Message-ID: <50C0EC8D.3080606@oracle.com> On 12/6/12 9:38 AM, Daniel Fuchs wrote: > Updated the javadoc for newInstance(): > > > > Looks good to me. Nit: you may want to use @linkplain instead of @link for this: {@link java.util.ServiceConfigurationError service configuration error}, Thanks Mandy From forax at univ-mlv.fr Thu Dec 6 19:08:52 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Thu, 06 Dec 2012 20:08:52 +0100 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C0EB95.6070800@gmail.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C089A1.3090500@cs.oswego.edu> <50C0EB95.6070800@gmail.com> Message-ID: <50C0ED44.8030106@univ-mlv.fr> On 12/06/2012 08:01 PM, Peter Levart wrote: > There's a quick trick that guarantees in-lining of get/set/remove: > > public static class FastThreadLocal extends ThreadLocal { > @Override > public final T get() { return super.get(); } > > @Override > public final void set(T value) { super.set(value); } > > @Override > public final void remove() { super.remove(); } > } > > ....just use static type FastThreadLocal everywhere in code. > > I tried it and it works. No, there is no way to have such guarantee, here, it works either because the only class ThreadLocal you load is FastThreadLocal or because the VM has profiled the callsite see that you only use FastThreadLocal for a specific instruction. > > > Regards, Peter cheers, R?mi > > On 12/06/2012 01:03 PM, Doug Lea wrote: >> On 12/06/12 06:56, Vitaly Davidovich wrote: >>> Doug, >>> >>> When you see the fast to slow ThreadLocal transition due to class >>> loading >>> invalidating inlined get(), do you not then see it get restored back >>> to fast >>> mode since the receiver type in your call sites is still the >>> monomorphic >>> ThreadLocal (and not the unrelated subclasses)? Just trying to >>> understand what >>> R?mi and you are saying. >>> >> >> The possible outcomes are fairly non-deterministic, depending >> on hotspot's mood about recompiles, tiered-compile interactions, >> method size, Amddahl's law interactions, phase of moon, etc. >> >> (In j.u.c, we have learned that our users appreciate things >> being predictably fast enough rather than being >> unpredictably sometimes even faster but often slower. >> So when we see such cases, as with ThreadLocal, they get added >> to todo list.) >> >> -Doug >> >> >> >> > From Alan.Bateman at oracle.com Thu Dec 6 19:27:22 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 06 Dec 2012 19:27:22 +0000 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C0D805.5030509@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50C06DAC.5050500@oracle.com> <50C0D805.5030509@oracle.com> Message-ID: <50C0F19A.7080302@oracle.com> On 06/12/2012 17:38, Daniel Fuchs wrote: > Updated the javadoc for newInstance(): > > > > > -- daniel Thumbs up from me! -Alan From forax at univ-mlv.fr Thu Dec 6 19:25:18 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Thu, 06 Dec 2012 20:25:18 +0100 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C089A1.3090500@cs.oswego.edu> Message-ID: <50C0F11E.4060003@univ-mlv.fr> On 12/06/2012 01:12 PM, Vitaly Davidovich wrote: > Understood - I'm just trying to make sure I don't have the wrong mental > model of this in my mind. Taking pathology aside (e.g. code cache is full > when time to recompile, poor tiering interaction, etc), I'd expect the fast > inlined path to be restored assuming call site type profile (of the ones we > care about) doesn't change after other subclasses are loaded. Would be > good if someone can correct that if it's inaccurate. Apologies if this is > slightly hijacking the thread, but it's Remi's fault :). :) Usually, it's inline just fine because the code just stores the ThreadLocal in a static field, the VM profiles the code and you get the fast path. But some codes use a ThreadLocal in a non static field or use a map of ThreadLocal so the profile becomes bloated, and there is no inlining anymore. If all loaded codes always use the same ThreadLocal (using ThreadLocal.withSupplier()) then, the call to the supplier is not inlined but you don't care because it's not part of the fast path of get. cheers, R?mi > > Sent from my phone > On Dec 6, 2012 7:03 AM, "Doug Lea"
wrote: > >> On 12/06/12 06:56, Vitaly Davidovich wrote: >> >>> Doug, >>> >>> When you see the fast to slow ThreadLocal transition due to class loading >>> invalidating inlined get(), do you not then see it get restored back to >>> fast >>> mode since the receiver type in your call sites is still the monomorphic >>> ThreadLocal (and not the unrelated subclasses)? Just trying to understand >>> what >>> R?mi and you are saying. >>> >>> >> The possible outcomes are fairly non-deterministic, depending >> on hotspot's mood about recompiles, tiered-compile interactions, >> method size, Amddahl's law interactions, phase of moon, etc. >> >> (In j.u.c, we have learned that our users appreciate things >> being predictably fast enough rather than being >> unpredictably sometimes even faster but often slower. >> So when we see such cases, as with ThreadLocal, they get added >> to todo list.) >> >> -Doug >> >> >> >> >> From akhil.arora at oracle.com Thu Dec 6 19:43:21 2012 From: akhil.arora at oracle.com (Akhil Arora) Date: Thu, 06 Dec 2012 11:43:21 -0800 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C0EBC9.2070101@univ-mlv.fr> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> <50C0D81A.5030607@cs.oswego.edu> <50C0DD49.4060900@oracle.com> <50C0E3F2.9030004@cs.oswego.edu> <50C0EBC9.2070101@univ-mlv.fr> Message-ID: <50C0F559.5090600@oracle.com> On 12/06/2012 11:02 AM, Remi Forax wrote: > > just nitpicking, > return new SuppliedThreadLocal(supplier); > should be > return new SuppliedThreadLocal<>(supplier); > > Also, can you add a @see in the constructor of ThreadLocal that > references ThreadLocal.withInitialValue(Supplier). http://cr.openjdk.java.net/~akhil/8003246.3/webrev/ also incorporates a nitpick from Mike - Objects.requireNonNull returns its arg Thanks - nitpicking welcome :) From Alan.Bateman at oracle.com Thu Dec 6 19:59:10 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 06 Dec 2012 19:59:10 +0000 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C0F559.5090600@oracle.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> <50C0D81A.5030607@cs.oswego.edu> <50C0DD49.4060900@oracle.com> <50C0E3F2.9030004@cs.oswego.edu> <50C0EBC9.2070101@univ-mlv.fr> <50C0F559.5090600@oracle.com> Message-ID: <50C0F90E.6010404@oracle.com> On 06/12/2012 19:43, Akhil Arora wrote: > > http://cr.openjdk.java.net/~akhil/8003246.3/webrev/ > > also incorporates a nitpick from Mike - > Objects.requireNonNull returns its arg > > Thanks - nitpicking welcome :) Would it be worth including a note in the withInitial's javadoc to make it clear that the given Supplier needs to be thread-safe? -Alan. From peter.levart at gmail.com Thu Dec 6 20:38:02 2012 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 06 Dec 2012 21:38:02 +0100 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C0ED44.8030106@univ-mlv.fr> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C089A1.3090500@cs.oswego.edu> <50C0EB95.6070800@gmail.com> <50C0ED44.8030106@univ-mlv.fr> Message-ID: <50C1022A.8060202@gmail.com> On 12/06/2012 08:08 PM, Remi Forax wrote: > On 12/06/2012 08:01 PM, Peter Levart wrote: >> There's a quick trick that guarantees in-lining of get/set/remove: >> >> public static class FastThreadLocal extends ThreadLocal { >> @Override >> public final T get() { return super.get(); } >> >> @Override >> public final void set(T value) { super.set(value); } >> >> @Override >> public final void remove() { super.remove(); } >> } >> >> ....just use static type FastThreadLocal everywhere in code. >> >> I tried it and it works. > > No, there is no way to have such guarantee, here, it works either > because the only class ThreadLocal you load is FastThreadLocal or > because the VM has profiled the callsite see that you only use > FastThreadLocal for a specific instruction. Nothing is certain but death and taxes, I agree. But think deeper, Remi! How do you explain the following test: public class ThreadLocalTest { static class Int { int value; } static class TL0 extends ThreadLocal {} static class TL1 extends ThreadLocal { public Int get() { return super.get(); } } static class TL2 extends ThreadLocal { public Int get() { return super.get(); } } static class TL3 extends ThreadLocal { public Int get() { return super.get(); } } static class TL4 extends ThreadLocal { public Int get() { return super.get(); } } static long doTest(ThreadLocal tl) { long t0 = System.nanoTime(); for (int i = 0; i < 100000000; i++) tl.get().value++; return System.nanoTime() - t0; } static long doTest(FastThreadLocal tl) { long t0 = System.nanoTime(); for (int i = 0; i < 100000000; i++) tl.get().value++; return System.nanoTime() - t0; } static long test0(ThreadLocal tl) { if (tl instanceof FastThreadLocal) return doTest((FastThreadLocal)tl); else return doTest(tl); } static void test(ThreadLocal tl) { tl.set(new Int()); System.out.print(tl.getClass().getName() + ":"); for (int i = 0; i < 8; i++) System.out.print(" " + test0(tl)); System.out.println(); } public static void main(String[] args) { TL0 tl0 = new TL0(); test(tl0); test(new TL1()); test(new TL2()); test(new TL3()); test(new TL4()); test(tl0); } } Which prints the following (demonstrating almost 2x slowdown of TL0 - last line compared to first): test.ThreadLocalTest$TL0: 342716421 326105315 300744544 300654890 300726346 300752009 300700781 300735651 test.ThreadLocalTest$TL1: 321424139 312128166 312173383 312125203 312142144 312150949 316760957 313393554 test.ThreadLocalTest$TL2: 525661886 524169413 524184405 524215685 524162050 524400364 524174966 454370228 test.ThreadLocalTest$TL3: 472042229 471071328 464387909 468047355 464795171 464466481 464449567 464365974 test.ThreadLocalTest$TL4: 459651686 454142365 454129481 454180718 454217277 454109611 454119988 456978405 test.ThreadLocalTest$TL0: 582252322 582773455 582612509 582753610 582626360 582852195 582805654 582598285 Now with a simple change of: static class TL0 extends FastThreadLocal {} ...the same test prints: test.ThreadLocalTest$TL0: 330722181 325823711 301171182 309992192 321868979 308111417 303806979 300612033 test.ThreadLocalTest$TL1: 330263857 326448062 300607081 300575641 307442821 300616794 300548457 303462898 test.ThreadLocalTest$TL2: 319627165 311309477 311465815 311279612 311294427 311315803 311470291 311293823 test.ThreadLocalTest$TL3: 526849874 524209792 524421574 524166747 524396011 524163313 524395641 524165429 test.ThreadLocalTest$TL4: 464963126 455172216 455466304 455245487 455368318 455093735 455125038 455317375 test.ThreadLocalTest$TL0: 300472239 300695398 300480230 303459397 300451419 300679904 300445717 300451166 And that's very repeatable! Try it for yourself (on JDK8 of course). Regards, Peter > >> >> >> Regards, Peter > > cheers, > R?mi > >> >> On 12/06/2012 01:03 PM, Doug Lea wrote: >>> On 12/06/12 06:56, Vitaly Davidovich wrote: >>>> Doug, >>>> >>>> When you see the fast to slow ThreadLocal transition due to class >>>> loading >>>> invalidating inlined get(), do you not then see it get restored >>>> back to fast >>>> mode since the receiver type in your call sites is still the >>>> monomorphic >>>> ThreadLocal (and not the unrelated subclasses)? Just trying to >>>> understand what >>>> R?mi and you are saying. >>>> >>> >>> The possible outcomes are fairly non-deterministic, depending >>> on hotspot's mood about recompiles, tiered-compile interactions, >>> method size, Amddahl's law interactions, phase of moon, etc. >>> >>> (In j.u.c, we have learned that our users appreciate things >>> being predictably fast enough rather than being >>> unpredictably sometimes even faster but often slower. >>> So when we see such cases, as with ThreadLocal, they get added >>> to todo list.) >>> >>> -Doug >>> >>> >>> >>> >> > From lance.andersen at oracle.com Thu Dec 6 20:52:41 2012 From: lance.andersen at oracle.com (lance.andersen at oracle.com) Date: Thu, 06 Dec 2012 20:52:41 +0000 Subject: hg: jdk8/tl/jdk: 8004374: CachedRowSetSwriter.writeData reports wrong number of conflicts in SyncProviderException Message-ID: <20121206205310.E808047F56@hg.openjdk.java.net> Changeset: 41a1b110f34d Author: lancea Date: 2012-12-06 15:51 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/41a1b110f34d 8004374: CachedRowSetSwriter.writeData reports wrong number of conflicts in SyncProviderException Reviewed-by: naoto ! src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java From rob.mckenna at oracle.com Thu Dec 6 21:19:30 2012 From: rob.mckenna at oracle.com (Rob McKenna) Date: Thu, 06 Dec 2012 21:19:30 +0000 Subject: Request for review: 8000525: Java.net.httpcookie api does not support 2-digit year format Message-ID: <50C10BE2.5070006@oracle.com> Hi folks, According to HttpCookie.java: """ There are 3 http cookie specifications: Netscape draft RFC 2109 -/http://www.ietf.org/rfc/rfc2109.txt/ RFC 2965 -/http://www.ietf.org/rfc/rfc2965.txt/ HttpCookie class can accept all these 3 forms of syntax. """ According to http://www.ietf.org/rfc/rfc2109.txt section 10.1.2: """ Netscape's original proposal defined an Expires header that took a date value in a fixed-length variant format in place of Max-Age: Wdy, DD-Mon-YY HH:MM:SS GMT """ Thats in the "Historical" section provided to allow for compatibility with Netscape's implementation, which we also support: (as per http://docs.oracle.com/javase/6/docs/api/java/net/HttpCookie.html ) While we don't support the rfc explicitly, this change follows the format specified in section 5.1.1 of rfc 6265: """ 3. If the year-value is greater than or equal to 70 and less than or equal to 99, increment the year-value by 1900. 4. If the year-value is greater than or equal to 0 and less than or equal to 69, increment the year-value by 2000. 1. NOTE: Some existing user agents interpret two-digit years differently. """ The webrev is at: http://cr.openjdk.java.net/~robm/8000525/webrev.01/ Note: The addition of setLenient(false) has required changes to two existing testcases. -Rob From peter.levart at gmail.com Thu Dec 6 21:21:02 2012 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 06 Dec 2012 22:21:02 +0100 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C1022A.8060202@gmail.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C089A1.3090500@cs.oswego.edu> <50C0EB95.6070800@gmail.com> <50C0ED44.8030106@univ-mlv.fr> <50C1022A.8060202@gmail.com> Message-ID: <50C10C3E.4080404@gmail.com> Ok, I've got an explanation. It's not because of using different static type of variables in code with final methods, but because TL0 was redirected to a separate method with separate call sites. The same happens using this variant: static class TL0 extends ThreadLocal {} static class TL1 extends ThreadLocal { public Int get() { return super.get(); } } static class TL2 extends ThreadLocal { public Int get() { return super.get(); } } static class TL3 extends ThreadLocal { public Int get() { return super.get(); } } static class TL4 extends ThreadLocal { public Int get() { return super.get(); } } static long doTest(ThreadLocal tl) { long t0 = System.nanoTime(); for (int i = 0; i < 100000000; i++) tl.get().value++; return System.nanoTime() - t0; } static long doTest0(ThreadLocal tl) { long t0 = System.nanoTime(); for (int i = 0; i < 100000000; i++) tl.get().value++; return System.nanoTime() - t0; } static long test0(ThreadLocal tl) { if (tl instanceof TL0) return doTest0(tl); else return doTest(tl); } But I think that deoptimizations that Dough is talking about might be prevented by using the following variant of TL: public class FastThreadLocal extends ThreadLocal { public final T getFast() { return super.get(); } public final void setFast(T value) { super.set(value); } public final void removeFast() { super.remove(); } } and invoking the "fast" methods in code. Right? Regards, Peter On 12/06/2012 09:38 PM, Peter Levart wrote: > On 12/06/2012 08:08 PM, Remi Forax wrote: >> On 12/06/2012 08:01 PM, Peter Levart wrote: >>> There's a quick trick that guarantees in-lining of get/set/remove: >>> >>> public static class FastThreadLocal extends ThreadLocal { >>> @Override >>> public final T get() { return super.get(); } >>> >>> @Override >>> public final void set(T value) { super.set(value); } >>> >>> @Override >>> public final void remove() { super.remove(); } >>> } >>> >>> ....just use static type FastThreadLocal everywhere in code. >>> >>> I tried it and it works. >> >> No, there is no way to have such guarantee, here, it works either >> because the only class ThreadLocal you load is FastThreadLocal or >> because the VM has profiled the callsite see that you only use >> FastThreadLocal for a specific instruction. > > Nothing is certain but death and taxes, I agree. > > But think deeper, Remi! > > How do you explain the following test: > > public class ThreadLocalTest { > > static class Int { int value; } > > static class TL0 extends ThreadLocal {} > static class TL1 extends ThreadLocal { public Int get() { > return super.get(); } } > static class TL2 extends ThreadLocal { public Int get() { > return super.get(); } } > static class TL3 extends ThreadLocal { public Int get() { > return super.get(); } } > static class TL4 extends ThreadLocal { public Int get() { > return super.get(); } } > > static long doTest(ThreadLocal tl) { > long t0 = System.nanoTime(); > for (int i = 0; i < 100000000; i++) > tl.get().value++; > return System.nanoTime() - t0; > } > > static long doTest(FastThreadLocal tl) { > long t0 = System.nanoTime(); > for (int i = 0; i < 100000000; i++) > tl.get().value++; > return System.nanoTime() - t0; > } > > static long test0(ThreadLocal tl) { > if (tl instanceof FastThreadLocal) > return doTest((FastThreadLocal)tl); > else > return doTest(tl); > } > > static void test(ThreadLocal tl) { > tl.set(new Int()); > System.out.print(tl.getClass().getName() + ":"); > for (int i = 0; i < 8; i++) > System.out.print(" " + test0(tl)); > System.out.println(); > } > > public static void main(String[] args) { > TL0 tl0 = new TL0(); > test(tl0); > test(new TL1()); > test(new TL2()); > test(new TL3()); > test(new TL4()); > test(tl0); > } > } > > > Which prints the following (demonstrating almost 2x slowdown of TL0 - > last line compared to first): > > test.ThreadLocalTest$TL0: 342716421 326105315 300744544 300654890 > 300726346 300752009 300700781 300735651 > test.ThreadLocalTest$TL1: 321424139 312128166 312173383 312125203 > 312142144 312150949 316760957 313393554 > test.ThreadLocalTest$TL2: 525661886 524169413 524184405 524215685 > 524162050 524400364 524174966 454370228 > test.ThreadLocalTest$TL3: 472042229 471071328 464387909 468047355 > 464795171 464466481 464449567 464365974 > test.ThreadLocalTest$TL4: 459651686 454142365 454129481 454180718 > 454217277 454109611 454119988 456978405 > test.ThreadLocalTest$TL0: 582252322 582773455 582612509 582753610 > 582626360 582852195 582805654 582598285 > > Now with a simple change of: > > static class TL0 extends FastThreadLocal {} > > ...the same test prints: > > test.ThreadLocalTest$TL0: 330722181 325823711 301171182 309992192 > 321868979 308111417 303806979 300612033 > test.ThreadLocalTest$TL1: 330263857 326448062 300607081 300575641 > 307442821 300616794 300548457 303462898 > test.ThreadLocalTest$TL2: 319627165 311309477 311465815 311279612 > 311294427 311315803 311470291 311293823 > test.ThreadLocalTest$TL3: 526849874 524209792 524421574 524166747 > 524396011 524163313 524395641 524165429 > test.ThreadLocalTest$TL4: 464963126 455172216 455466304 455245487 > 455368318 455093735 455125038 455317375 > test.ThreadLocalTest$TL0: 300472239 300695398 300480230 303459397 > 300451419 300679904 300445717 300451166 > > > And that's very repeatable! Try it for yourself (on JDK8 of course). > > Regards, Peter > > >> >>> >>> >>> Regards, Peter >> >> cheers, >> R?mi >> >>> >>> On 12/06/2012 01:03 PM, Doug Lea wrote: >>>> On 12/06/12 06:56, Vitaly Davidovich wrote: >>>>> Doug, >>>>> >>>>> When you see the fast to slow ThreadLocal transition due to class >>>>> loading >>>>> invalidating inlined get(), do you not then see it get restored >>>>> back to fast >>>>> mode since the receiver type in your call sites is still the >>>>> monomorphic >>>>> ThreadLocal (and not the unrelated subclasses)? Just trying to >>>>> understand what >>>>> R?mi and you are saying. >>>>> >>>> >>>> The possible outcomes are fairly non-deterministic, depending >>>> on hotspot's mood about recompiles, tiered-compile interactions, >>>> method size, Amddahl's law interactions, phase of moon, etc. >>>> >>>> (In j.u.c, we have learned that our users appreciate things >>>> being predictably fast enough rather than being >>>> unpredictably sometimes even faster but often slower. >>>> So when we see such cases, as with ThreadLocal, they get added >>>> to todo list.) >>>> >>>> -Doug >>>> >>>> >>>> >>>> >>> >> > From rob.mckenna at oracle.com Thu Dec 6 21:22:26 2012 From: rob.mckenna at oracle.com (Rob McKenna) Date: Thu, 06 Dec 2012 21:22:26 +0000 Subject: Request for review: JDK-8004337: java/sql tests aren't run in test/Makefile Message-ID: <50C10C92.50605@oracle.com> Hi folks, There's a missing folder in the jdk_other test target: http://cr.openjdk.java.net/~robm/8004337/webrev.01/ -Rob From forax at univ-mlv.fr Thu Dec 6 21:20:54 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Thu, 06 Dec 2012 22:20:54 +0100 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C1022A.8060202@gmail.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C089A1.3090500@cs.oswego.edu> <50C0EB95.6070800@gmail.com> <50C0ED44.8030106@univ-mlv.fr> <50C1022A.8060202@gmail.com> Message-ID: <50C10C36.7010201@univ-mlv.fr> On 12/06/2012 09:38 PM, Peter Levart wrote: > On 12/06/2012 08:08 PM, Remi Forax wrote: >> On 12/06/2012 08:01 PM, Peter Levart wrote: >>> There's a quick trick that guarantees in-lining of get/set/remove: >>> >>> public static class FastThreadLocal extends ThreadLocal { >>> @Override >>> public final T get() { return super.get(); } >>> >>> @Override >>> public final void set(T value) { super.set(value); } >>> >>> @Override >>> public final void remove() { super.remove(); } >>> } >>> >>> ....just use static type FastThreadLocal everywhere in code. >>> >>> I tried it and it works. >> >> No, there is no way to have such guarantee, here, it works either >> because the only class ThreadLocal you load is FastThreadLocal or >> because the VM has profiled the callsite see that you only use >> FastThreadLocal for a specific instruction. > > Nothing is certain but death and taxes, I agree. > > But think deeper, Remi! I try, i try, i've trouble to understand what you mean > > How do you explain the following test: > > public class ThreadLocalTest { > > static class Int { int value; } > > static class TL0 extends ThreadLocal {} > static class TL1 extends ThreadLocal { public Int get() { > return super.get(); } } > static class TL2 extends ThreadLocal { public Int get() { > return super.get(); } } > static class TL3 extends ThreadLocal { public Int get() { > return super.get(); } } > static class TL4 extends ThreadLocal { public Int get() { > return super.get(); } } > > static long doTest(ThreadLocal tl) { > long t0 = System.nanoTime(); > for (int i = 0; i < 100000000; i++) > tl.get().value++; // > callsite 1 > return System.nanoTime() - t0; > } here, tl.get() (callsite 1) is called with TL0, TL1, TL2, TL3 and TL4, do tl.get() is a polymorphic call > > static long doTest(FastThreadLocal tl) { > long t0 = System.nanoTime(); > for (int i = 0; i < 100000000; i++) > tl.get().value++; // callsite 2 > return System.nanoTime() - t0; > } if TL0 is defined like as a FastThreadLocal. doTest is called and here tl.get() (callsite 2) is only called with a FastThreadLocal, so the call is inlined. > > static long test0(ThreadLocal tl) { > if (tl instanceof FastThreadLocal) > return doTest((FastThreadLocal)tl); > else > return doTest(tl); > } > > static void test(ThreadLocal tl) { > tl.set(new Int()); > System.out.print(tl.getClass().getName() + ":"); > for (int i = 0; i < 8; i++) > System.out.print(" " + test0(tl)); > System.out.println(); > } > > public static void main(String[] args) { > TL0 tl0 = new TL0(); > test(tl0); > test(new TL1()); > test(new TL2()); > test(new TL3()); > test(new TL4()); > test(tl0); > } > } > > > Which prints the following (demonstrating almost 2x slowdown of TL0 - > last line compared to first): > > test.ThreadLocalTest$TL0: 342716421 326105315 300744544 300654890 > 300726346 300752009 300700781 300735651 > test.ThreadLocalTest$TL1: 321424139 312128166 312173383 312125203 > 312142144 312150949 316760957 313393554 > test.ThreadLocalTest$TL2: 525661886 524169413 524184405 524215685 > 524162050 524400364 524174966 454370228 > test.ThreadLocalTest$TL3: 472042229 471071328 464387909 468047355 > 464795171 464466481 464449567 464365974 > test.ThreadLocalTest$TL4: 459651686 454142365 454129481 454180718 > 454217277 454109611 454119988 456978405 > test.ThreadLocalTest$TL0: 582252322 582773455 582612509 582753610 > 582626360 582852195 582805654 582598285 > > Now with a simple change of: > > static class TL0 extends FastThreadLocal {} > > ...the same test prints: > > test.ThreadLocalTest$TL0: 330722181 325823711 301171182 309992192 > 321868979 308111417 303806979 300612033 > test.ThreadLocalTest$TL1: 330263857 326448062 300607081 300575641 > 307442821 300616794 300548457 303462898 > test.ThreadLocalTest$TL2: 319627165 311309477 311465815 311279612 > 311294427 311315803 311470291 311293823 > test.ThreadLocalTest$TL3: 526849874 524209792 524421574 524166747 > 524396011 524163313 524395641 524165429 > test.ThreadLocalTest$TL4: 464963126 455172216 455466304 455245487 > 455368318 455093735 455125038 455317375 > test.ThreadLocalTest$TL0: 300472239 300695398 300480230 303459397 > 300451419 300679904 300445717 300451166 > > > And that's very repeatable! Try it for yourself (on JDK8 of course). > > Regards, Peter so to summarize, the tl.get() in doTest(ThreadLocal) is polymorphic and the one in doTest(FastThreadLocal) is monomorphic thus inlinable. It has nothing to do with the fact that FastThreadLocal override get, set and remove. You can comment the methods inside FastThreadLocal to see that it change nothing. regards, R?mi From Lance.Andersen at oracle.com Thu Dec 6 21:26:48 2012 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Thu, 6 Dec 2012 16:26:48 -0500 Subject: Request for review: JDK-8004337: java/sql tests aren't run in test/Makefile In-Reply-To: <50C10C92.50605@oracle.com> References: <50C10C92.50605@oracle.com> Message-ID: <210B31C0-2311-4973-B332-802F69223A21@oracle.com> Looks fine Rob On Dec 6, 2012, at 4:22 PM, Rob McKenna wrote: > Hi folks, > > There's a missing folder in the jdk_other test target: > > http://cr.openjdk.java.net/~robm/8004337/webrev.01/ > > -Rob -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From cs at schulte.it Thu Dec 6 22:03:11 2012 From: cs at schulte.it (Christian Schulte) Date: Thu, 06 Dec 2012 23:03:11 +0100 Subject: Misleading documentation for class java.nio.charset.spi.CharsetProvider In-Reply-To: <50C0DAE3.3070905@oracle.com> References: <50C0D532.90001@schulte.it> <50C0DAE3.3070905@oracle.com> Message-ID: <50C1161F.4070005@schulte.it> Am 12/06/12 18:50, schrieb Alan Bateman: > On 06/12/2012 17:26, Christian Schulte wrote: >> Hello, >> >> I am not sure if this is the correct mailing list to send this mail to. >> Please apologize any inconvenience caused. >> >> The JDK 7 documentation of class java.nio.charset.spi.CharsetProvider >> states the following: >> >> [...] >> Charset providers are looked up via the current thread's context class >> loader. >> [...] >> >> Looking at method 'private static Iterator providers()' of class >> 'java.nio.charset.Charset', the above documentation seems incorrect >> since that method uses the system class loader. >> >> ClassLoader cl = ClassLoader.getSystemClassLoader(); >> ServiceLoader sl = >> ServiceLoader.load(CharsetProvider.class, cl); >> >> Is this intended ? >> > This is a long standing issue (going back to 1.4), we should remove this > from the javadoc. Or update the code to use the thread context class loader if possible. This would allow using custom charset providers with e.g. Webstart. Anyway. Thanks for taking a look. -- Christian Schulte From jeffhain at rocketmail.com Thu Dec 6 22:05:13 2012 From: jeffhain at rocketmail.com (Jeff Hain) Date: Thu, 6 Dec 2012 22:05:13 +0000 (GMT) Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C0F559.5090600@oracle.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> <50C0D81A.5030607@cs.oswego.edu> <50C0DD49.4060900@oracle.com> <50C0E3F2.9030004@cs.oswego.edu> <50C0EBC9.2070101@univ-mlv.fr> <50C0F559.5090600@oracle.com> Message-ID: <1354831513.40215.YahooMailNeo@web132104.mail.ird.yahoo.com> >nitpicking welcome :) AFAIK (*), removing 'private' for supplier field could prevent javac to generate accessors for this field, in case it would be accessed from outside inner class (but since it's not, it would not yield better perfs, just smaller bytecode). (*) If I correctly undertood what R?mi once said :) -Jeff From mike.duigou at oracle.com Thu Dec 6 23:39:14 2012 From: mike.duigou at oracle.com (mike.duigou at oracle.com) Date: Thu, 06 Dec 2012 23:39:14 +0000 Subject: hg: jdk8/tl: 8004685: add java.util.function to CORE_PKGS.gmk Message-ID: <20121206233914.9C9E847F5F@hg.openjdk.java.net> Changeset: fb1bf5e5bc9e Author: henryjen Date: 2012-12-06 15:38 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/fb1bf5e5bc9e 8004685: add java.util.function to CORE_PKGS.gmk Reviewed-by: mduigou ! common/makefiles/javadoc/CORE_PKGS.gmk From forax at univ-mlv.fr Thu Dec 6 23:44:44 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Fri, 07 Dec 2012 00:44:44 +0100 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <1354831513.40215.YahooMailNeo@web132104.mail.ird.yahoo.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> <50C0D81A.5030607@cs.oswego.edu> <50C0DD49.4060900@oracle.com> <50C0E3F2.9030004@cs.oswego.edu> <50C0EBC9.2070101@univ-mlv.fr> <50C0F559.5090600@oracle.com> <1354831513.40215.YahooMailNeo@web132104.mail.ird.yahoo.com> Message-ID: <50C12DEC.9060006@univ-mlv.fr> On 12/06/2012 11:05 PM, Jeff Hain wrote: >> nitpicking welcome :) > AFAIK (*), removing 'private' for supplier field could prevent > javac to generate accessors for this field, in case it would be > accessed from outside inner class (but since it's not, it would > not yield better perfs, just smaller bytecode). > > (*) If I correctly undertood what R?mi once said :) It's true only if the field is accessed ouside the inner class but inside the enclosing class (or the enclosing class of the enclosing class). BTW, at some point, it will be a good idea to get ride of all these method access$000 in java.lang/java.util at least. > > -Jeff R?mi From stuart.marks at oracle.com Fri Dec 7 02:12:15 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Thu, 06 Dec 2012 18:12:15 -0800 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. In-Reply-To: References: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> <50C03083.4030102@oracle.com> Message-ID: <50C1507F.7040202@oracle.com> OK, looks pretty good. But.... One little thing is still bothering me. Suppose we get interrupted from the sleep() and bail out on that basis. If we got to the point where we're sleeping, we must have caught an AccessDeniedException previously. Unfortunately this exception is discarded if we were interrupted. This might lose valuable diagnostic information. So, what do we do with it? How about adding: ie.addSuppressed(cause); in the catch InterruptedException clause, before throwing the RuntimeException. (There's another issue which is that if there were previous retries, the ADEs from them are thrown away. But maybe we should save that one for another day.) s'marks On 12/6/12 9:41 AM, David DeHaven wrote: > > New webrev posted: > http://cr.openjdk.java.net/~ddehaven/8004042/webrev.2/ > > Summary: > - Cleaned it up a bit by change to a for loop (eliminating done flag) > - Throws RuntimeException instead of IOException, handles InterruptedException > - Bumped retry count to 10 > - Changed @run mode to "main/othervm" as suggested by Kumar > > -DrD- > From robert.field at oracle.com Fri Dec 7 05:57:22 2012 From: robert.field at oracle.com (robert.field at oracle.com) Date: Fri, 07 Dec 2012 05:57:22 +0000 Subject: hg: jdk8/tl/jdk: 8003881: Prevent lambda implementing inner classes from allowing the creation of new instances Message-ID: <20121207055741.6431447FA8@hg.openjdk.java.net> Changeset: 896d4af2ebfd Author: rfield Date: 2012-12-06 21:55 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/896d4af2ebfd 8003881: Prevent lambda implementing inner classes from allowing the creation of new instances Summary: Lambda implementing inner classes now has private constructor (thanks Kumar) Reviewed-by: ksrini ! src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java + test/java/lang/invoke/lambda/LambdaAccessControlDoPrivilegedTest.java + test/java/lang/invoke/lambda/LambdaAccessControlTest.java From huizhe.wang at oracle.com Fri Dec 7 08:04:45 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Fri, 07 Dec 2012 00:04:45 -0800 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C0D805.5030509@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50C06DAC.5050500@oracle.com> <50C0D805.5030509@oracle.com> Message-ID: <50C1A31D.1090805@oracle.com> I would think that it's good to merge the 3rd and 4th steps for a jdk in module mode. In regular mode or JDK8, where the existence of the default implementation is guaranteed, the last step is still necessary. It is a requirement for the API implementation. I probably was wrong to use "default" to refer to the jaxp ri at the 3rd step of the service mechanism. After reading your comments/discussions, I felt it might not be appropriate for regular JDKs or JDKs in regular mode. Users may well, as they should, take what's installed within the JDK as the "default" implementation and be confused with the statement that the "default" may not be present. So it looks like we need to differentiate regular from modular JDK, and more importantly the jaxp ri from the "default" implementation: 1) In regular JDK (e.g. JDK8), the service loader shall return the first provider (whether it's a 3rd-party impl or the jaxp ri, it's users' decision to put them on the classpath or in the endorsed directory) The 4th step is still "Platform default DocumentBuilderFactory instance." 2) In module mode, the default impl would be one of the modules. My understanding is that there would not be such a thing as a JAXP RI module. So merging 3rd and 4th steps are fine. But it may be necessary to clarify that it's for module mode. Thanks, Joe On 12/6/2012 9:38 AM, Daniel Fuchs wrote: > Updated the javadoc for newInstance(): > > > > > -- daniel > > On 12/6/12 11:04 AM, Alan Bateman wrote: >> On 05/12/2012 16:17, Daniel Fuchs wrote: >>> Hi, >>> >>> Please find below a revised version of the changes for >>> the javax.xml.parsers package. >>> >>> It hopefully incorporates all comments I have received so far. >>> >>> >>> >>> >>> >>> * better wording/formating for Javadoc changes >>> * using for( : ) syntax in findServiceProvider >>> * improved // comments explaining why the additional layer of >>> RuntimeException is needed when wrapping ServiceConfigurationError. >>> >>> best regards, >>> >>> -- daniel >> You've addressed all my comments and I think this looks very good. >> >> One other comment. Now that the wording is "Otherwise the default >> implementation, if present, is returned" it raises the question as to >> how what happens if the default implementation is not present. A >> suggestion is to just handle it in the next statement, something like >> "In the case of a SCE or the default provider is not present, then FCE >> will be thrown". >> >> I see Mandy's comment about the bullet item "Platform default >> DocumentBuilderFactory instance". I hadn't noticed this but >> I assume this should just be removed now. >> >> -Alan. > From peter.levart at gmail.com Fri Dec 7 09:09:18 2012 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 07 Dec 2012 10:09:18 +0100 Subject: Request for Review: CR#8001667, second attempt In-Reply-To: <50C041D3.9060703@oracle.com> References: <50C041D3.9060703@oracle.com> Message-ID: <50C1B23E.8010003@gmail.com> Hi Henry, I don't know what the plans are about moving the static methods in Comparators to the Comparator interface when static interface methods are enabled, but if that is planned, there will be a clash between Comparator.reverseOrder() default method and static method with same name and signature. Maybe rename static .reverseOrder() to .reverseNaturalOrder() (to long?), or rename the default method .reverseOrder() to .reverse(); Also, I like the natural-language-like fluent syntax when starting with Comparators.comparing(...).thenComparing(...).reverse[Order](), but the .thenComparing name is also overloaded with the variant for composing: .thenComparing(Comparator) which makes statements like: Comparators.comparing(x -> x.size).thenComparing(x -> x.y).thenComparing((x, y) -> some expression) a little confusing, because what you get is not a comparator that compares one value of "some expression" with some other value of the same expression, but a comparator that uses the value of expression to order two elements. I think that using the same method name for two different purposes is a little confusing. Maybe .compose(Comparator) or just plain .then(Comparator) would be better here. Regards, Peter On 12/06/2012 07:57 AM, Henry Jen wrote: > Hi, > > This update reflect changes based on feedbacks for last version, the > changes are > > - rename reverse() to reverseOrder() > - rename Comparator.compose to Comparator.thenComparing > - add 4 Comparator.thenComparing methods take [Int|Long|Double]Function > to enable fluent syntax like this example, > > people.sort(Comparators.comparing(People::getFirstName).thenComparing(People.getLastName)) > > vs previously, > > people.sort(Comparators.comparing(Person::getName)) > Comparator byLastFirst > = Comparators.comparing(Person::getLastName) > .compose(Comparators.comparing(Person::getFirstName)) > > Please review and comment on the webrev[1] and specdiff[2]. > > [1] http://cr.openjdk.java.net/~henryjen/ccc/8001667.1/webrev > [2] > http://cr.openjdk.java.net/~henryjen/ccc/8001667.1/specdiff/overview-summary.html > > Cheers, > Henry From Alan.Bateman at oracle.com Fri Dec 7 09:41:13 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 07 Dec 2012 09:41:13 +0000 Subject: Request for review: JDK-8004337: java/sql tests aren't run in test/Makefile In-Reply-To: <50C10C92.50605@oracle.com> References: <50C10C92.50605@oracle.com> Message-ID: <50C1B9B9.9040604@oracle.com> On 06/12/2012 21:22, Rob McKenna wrote: > Hi folks, > > There's a missing folder in the jdk_other test target: > > http://cr.openjdk.java.net/~robm/8004337/webrev.01/ > > > -Rob Thanks for catching this, looks good to me. -Alan From Alan.Bateman at oracle.com Fri Dec 7 09:43:02 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 07 Dec 2012 09:43:02 +0000 Subject: Misleading documentation for class java.nio.charset.spi.CharsetProvider In-Reply-To: <50C1161F.4070005@schulte.it> References: <50C0D532.90001@schulte.it> <50C0DAE3.3070905@oracle.com> <50C1161F.4070005@schulte.it> Message-ID: <50C1BA26.5020804@oracle.com> On 06/12/2012 22:03, Christian Schulte wrote: > : > Or update the code to use the thread context class loader if possible. > This would allow using custom charset providers with e.g. Webstart. > Anyway. Thanks for taking a look. > Using the TCCL for charset providers is highly problematic, this is a case where it would be preferable to just align the specification with the long standing behavior. -Alan From Alan.Bateman at oracle.com Fri Dec 7 13:12:33 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 07 Dec 2012 13:12:33 +0000 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C1A31D.1090805@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50C06DAC.5050500@oracle.com> <50C0D805.5030509@oracle.com> <50C1A31D.1090805@oracle.com> Message-ID: <50C1EB41.2010502@oracle.com> On 07/12/2012 08:04, Joe Wang wrote: > > I would think that it's good to merge the 3rd and 4th steps for a jdk > in module mode. In regular mode or JDK8, where the existence of the > default implementation is guaranteed, the last step is still > necessary. It is a requirement for the API implementation. > > I probably was wrong to use "default" to refer to the jaxp ri at the > 3rd step of the service mechanism. After reading your > comments/discussions, I felt it might not be appropriate for regular > JDKs or JDKs in regular mode. Users may well, as they should, take > what's installed within the JDK as the "default" implementation and be > confused with the statement that the "default" may not be present. > > So it looks like we need to differentiate regular from modular JDK, > and more importantly the jaxp ri from the "default" implementation: > > 1) In regular JDK (e.g. JDK8), the service loader shall return the > first provider (whether it's a 3rd-party impl or the jaxp ri, it's > users' decision to put them on the classpath or in the endorsed > directory) > > The 4th step is still "Platform default > DocumentBuilderFactory instance." > > 2) In module mode, the default impl would be one of the modules. My > understanding is that there would not be such a thing as a JAXP RI > module. So merging 3rd and 4th steps are fine. But it may be necessary > to clarify that it's for module mode. > I think it's a bit premature to talk about modules and "module mode" in this specification. To use those terms would require somewhere to reference and there won't be anything to reference in Java SE 8. Also as this is a standalone technology then it can be used with implementation of previous Java SE versions too. The way I look at this is that we are getting there in phases and a really important first phase for JAXP is to upgrade it to use ServiceLoader consistently. This is painful work due to under-specification and subtle compatibility issues that may arise due to these changes. Even without modules as a driver for this, then I think will be beneficial to JAXP anyway because it's cleaning up an area that is a mess today (not your fault, this pre-dates your watch). If we can bring you around to agreeing with this then I think the only point remaining is whether the API requires at least one implementation to be present. I see your point and this may be something that needs to be deferred to a later time, in which case this requires changing the javadoc to: "Otherwise the system-default implementation is returned." and "In case of {@link java.util.ServiceConfigurationError},then {@link FactoryConfigurationError} will be thrown." Would you be okay with that? I don't think the javadoc should mention the JAXP RI, that may or may not be the system-default implementation. -Alan. From dl at cs.oswego.edu Fri Dec 7 14:27:36 2012 From: dl at cs.oswego.edu (Doug Lea) Date: Fri, 07 Dec 2012 09:27:36 -0500 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C12DEC.9060006@univ-mlv.fr> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> <50C0D81A.5030607@cs.oswego.edu> <50C0DD49.4060900@oracle.com> <50C0E3F2.9030004@cs.oswego.edu> <50C0EBC9.2070101@univ-mlv.fr> <50C0F559.5090600@oracle.com> <1354831513.40215.YahooMailNeo@web132104.mail.ird.yahoo.com> <50C12DEC.9060006@univ-mlv.fr> Message-ID: <50C1FCD8.3030109@cs.oswego.edu> On 12/06/12 18:44, Remi Forax wrote: > BTW, at some point, it will be a good idea to get ride of all these method > access$000 in java.lang/java.util at least. > Maybe this is out of scope for this CR, but while in the neighborhood of ThreadLocal, it could be done here. There are a couple of annoying ones that kick in on any compile of anything involving ThreadLocals (try running with -XX:+PrintCompilation). To remove, replace "private" with "final" for methods, and just kill "private" for fields. -Doug From daniel.fuchs at oracle.com Fri Dec 7 15:15:05 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Fri, 07 Dec 2012 16:15:05 +0100 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C1EB41.2010502@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50C06DAC.5050500@oracle.com> <50C0D805.5030509@oracle.com> <50C1A31D.1090805@oracle.com> <50C1EB41.2010502@oracle.com> Message-ID: <50C207F9.5060307@oracle.com> Hi Alan, I have updated the webrev according to your suggestion. I think it makes things much clearer. The new version is there: On 12/7/12 2:12 PM, Alan Bateman wrote: > On 07/12/2012 08:04, Joe Wang wrote: >> >> I would think that it's good to merge the 3rd and 4th steps for a jdk >> in module mode. In regular mode or JDK8, where the existence of the >> default implementation is guaranteed, the last step is still >> necessary. It is a requirement for the API implementation. >> >> I probably was wrong to use "default" to refer to the jaxp ri at the >> 3rd step of the service mechanism. After reading your >> comments/discussions, I felt it might not be appropriate for regular >> JDKs or JDKs in regular mode. Users may well, as they should, take >> what's installed within the JDK as the "default" implementation and be >> confused with the statement that the "default" may not be present. >> >> So it looks like we need to differentiate regular from modular JDK, >> and more importantly the jaxp ri from the "default" implementation: >> >> 1) In regular JDK (e.g. JDK8), the service loader shall return the >> first provider (whether it's a 3rd-party impl or the jaxp ri, it's >> users' decision to put them on the classpath or in the endorsed >> directory) >> >> The 4th step is still "Platform default >> DocumentBuilderFactory instance." >> >> 2) In module mode, the default impl would be one of the modules. My >> understanding is that there would not be such a thing as a JAXP RI >> module. So merging 3rd and 4th steps are fine. But it may be necessary >> to clarify that it's for module mode. >> > I think it's a bit premature to talk about modules and "module mode" in > this specification. To use those terms would require somewhere to > reference and there won't be anything to reference in Java SE 8. Also as > this is a standalone technology then it can be used with implementation > of previous Java SE versions too. > > The way I look at this is that we are getting there in phases and a > really important first phase for JAXP is to upgrade it to use > ServiceLoader consistently. This is painful work due to > under-specification and subtle compatibility issues that may arise due > to these changes. Even without modules as a driver for this, then I > think will be beneficial to JAXP anyway because it's cleaning up an area > that is a mess today (not your fault, this pre-dates your watch). > > If we can bring you around to agreeing with this then I think the only > point remaining is whether the API requires at least one implementation > to be present. I see your point and this may be something that needs to > be deferred to a later time, in which case this requires changing the > javadoc to: > > "Otherwise the system-default implementation is returned." > > and > > "In case of {@link java.util.ServiceConfigurationError},then {@link > FactoryConfigurationError} will be thrown." > > Would you be okay with that? I don't think the javadoc should mention > the JAXP RI, that may or may not be the system-default implementation. > > -Alan. > > From chris.hegarty at oracle.com Fri Dec 7 15:34:40 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 07 Dec 2012 15:34:40 +0000 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C1FCD8.3030109@cs.oswego.edu> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> <50C0D81A.5030607@cs.oswego.edu> <50C0DD49.4060900@oracle.com> <50C0E3F2.9030004@cs.oswego.edu> <50C0EBC9.2070101@univ-mlv.fr> <50C0F559.5090600@oracle.com> <1354831513.40215.YahooMailNeo@web132104.mail.ird.yahoo.com> <50C12DEC.9060006@univ-mlv.fr> <50C1FCD8.3030109@cs.oswego.edu> Message-ID: <50C20C90.6070200@oracle.com> I filed 8004707: "Remove superfluous access$000 methods in java.util", to track this issue. I can file a separate issue for java.lang. I'm sure there are other ways, but a simple find reports them: :>pwd build/solaris-i586/classes/java/util :> find . -name "*.class" -exec javap -v {} \; | grep '\.access\$00' -Chris On 07/12/2012 14:27, Doug Lea wrote: > On 12/06/12 18:44, Remi Forax wrote: > >> BTW, at some point, it will be a good idea to get ride of all these >> method >> access$000 in java.lang/java.util at least. >> > > Maybe this is out of scope for this CR, but while in the > neighborhood of ThreadLocal, it could be done here. > There are a couple of annoying ones that kick in on any > compile of anything involving ThreadLocals (try running with > -XX:+PrintCompilation). To remove, replace "private" with > "final" for methods, and just kill "private" for fields. > > -Doug > > > From david.dehaven at oracle.com Fri Dec 7 15:38:34 2012 From: david.dehaven at oracle.com (David DeHaven) Date: Fri, 7 Dec 2012 07:38:34 -0800 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. In-Reply-To: <50C1507F.7040202@oracle.com> References: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> <50C03083.4030102@oracle.com> <50C1507F.7040202@oracle.com> Message-ID: <9365B2DD-5DFA-4B8D-9F37-8F4ED9D05772@oracle.com> > OK, looks pretty good. But.... > > One little thing is still bothering me. Suppose we get interrupted from the sleep() and bail out on that basis. If we got to the point where we're sleeping, we must have caught an AccessDeniedException previously. Unfortunately this exception is discarded if we were interrupted. This might lose valuable diagnostic information. So, what do we do with it? How about adding: > > ie.addSuppressed(cause); > > in the catch InterruptedException clause, before throwing the RuntimeException. Another good point... > (There's another issue which is that if there were previous retries, the ADEs from them are thrown away. But maybe we should save that one for another day.) I had the same thought, but aside from collecting and reporting all of them somehow I'm not sure what could be done about it. Maybe instead of: cause = ade; do: if (cause != null) { cause.addSuppressed(ade); } else { cause = ade; } Then they'll at least all be reported when RuntimeException is thrown. -DrD- From forax at univ-mlv.fr Fri Dec 7 15:46:34 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Fri, 07 Dec 2012 16:46:34 +0100 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C20C90.6070200@oracle.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> <50C0D81A.5030607@cs.oswego.edu> <50C0DD49.4060900@oracle.com> <50C0E3F2.9030004@cs.oswego.edu> <50C0EBC9.2070101@univ-mlv.fr> <50C0F559.5090600@oracle.com> <1354831513.40215.YahooMailNeo@web132104.mail.ird.yahoo.com> <50C12DEC.9060006@univ-mlv.fr> <50C1FCD8.3030109@cs.oswego.edu> <50C20C90.6070200@oracle.com> Message-ID: <50C20F5A.8060900@univ-mlv.fr> On 12/07/2012 04:34 PM, Chris Hegarty wrote: > I filed 8004707: "Remove superfluous access$000 methods in java.util", > to track this issue. I can file a separate issue for java.lang. yes, please do that. > > I'm sure there are other ways, but a simple find reports them: > :>pwd > build/solaris-i586/classes/java/util > :> find . -name "*.class" -exec javap -v {} \; | grep '\.access\$00' Technically, javac also generate constructor accessors that doesn't start by access00 but this should catch most of the generated accessors. once changeset for 8003246 will be pushed, I will send two patches one for java.lang and one for java.util. > > -Chris R?mi > > On 07/12/2012 14:27, Doug Lea wrote: >> On 12/06/12 18:44, Remi Forax wrote: >> >>> BTW, at some point, it will be a good idea to get ride of all these >>> method >>> access$000 in java.lang/java.util at least. >>> >> >> Maybe this is out of scope for this CR, but while in the >> neighborhood of ThreadLocal, it could be done here. >> There are a couple of annoying ones that kick in on any >> compile of anything involving ThreadLocals (try running with >> -XX:+PrintCompilation). To remove, replace "private" with >> "final" for methods, and just kill "private" for fields. >> >> -Doug >> >> >> From kumar.x.srinivasan at oracle.com Fri Dec 7 16:20:11 2012 From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan) Date: Fri, 07 Dec 2012 08:20:11 -0800 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. In-Reply-To: <9365B2DD-5DFA-4B8D-9F37-8F4ED9D05772@oracle.com> References: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> <50C03083.4030102@oracle.com> <50C1507F.7040202@oracle.com> <9365B2DD-5DFA-4B8D-9F37-8F4ED9D05772@oracle.com> Message-ID: <50C2173B.1030500@oracle.com> >> OK, looks pretty good. But.... >> >> One little thing is still bothering me. Suppose we get interrupted from the sleep() and bail out on that basis. If we got to the point where we're sleeping, we must have caught an AccessDeniedException previously. Unfortunately this exception is discarded if we were interrupted. This might lose valuable diagnostic information. So, what do we do with it? How about adding: >> >> ie.addSuppressed(cause); >> >> in the catch InterruptedException clause, before throwing the RuntimeException. > Another good point... > > >> (There's another issue which is that if there were previous retries, the ADEs from them are thrown away. But maybe we should save that one for another day.) > I had the same thought, but aside from collecting and reporting all of them somehow I'm not sure what could be done about it. > > Maybe instead of: > cause = ade; > > do: > if (cause != null) { > cause.addSuppressed(ade); > } else { > cause = ade; > } > > Then they'll at least all be reported when RuntimeException is thrown. Very good point indeed, how about we also capture/print unconditionally how many retries were made, this might give us some indication of the gremlin we are dealing with. Kumar > > -DrD- > From stuart.marks at oracle.com Fri Dec 7 16:22:16 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Fri, 07 Dec 2012 08:22:16 -0800 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. In-Reply-To: <9365B2DD-5DFA-4B8D-9F37-8F4ED9D05772@oracle.com> References: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> <50C03083.4030102@oracle.com> <50C1507F.7040202@oracle.com> <9365B2DD-5DFA-4B8D-9F37-8F4ED9D05772@oracle.com> Message-ID: <50C217B8.7050001@oracle.com> On 12/7/12 7:38 AM, David DeHaven wrote: >> (There's another issue which is that if there were previous retries, the ADEs from them are thrown away. But maybe we should save that one for another day.) > > I had the same thought, but aside from collecting and reporting all of them somehow I'm not sure what could be done about it. > > Maybe instead of: > cause = ade; > > do: > if (cause != null) { > cause.addSuppressed(ade); > } else { > cause = ade; > } > > Then they'll at least all be reported when RuntimeException is thrown. Ah, ok, this isn't bad at all! Let's go with this. Did you need somebody to push this for you? s'marks From Alan.Bateman at oracle.com Fri Dec 7 16:32:44 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 07 Dec 2012 16:32:44 +0000 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C207F9.5060307@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50C06DAC.5050500@oracle.com> <50C0D805.5030509@oracle.com> <50C1A31D.1090805@oracle.com> <50C1EB41.2010502@oracle.com> <50C207F9.5060307@oracle.com> Message-ID: <50C21A2C.8070503@oracle.com> On 07/12/2012 15:15, Daniel Fuchs wrote: > Hi Alan, > > I have updated the webrev according to your suggestion. I think it makes > things much clearer. > > The new version is there: > > > This looks good to me except that "implementation system default" should be "system-default implementation". -Alan From david.dehaven at oracle.com Fri Dec 7 16:39:32 2012 From: david.dehaven at oracle.com (David DeHaven) Date: Fri, 7 Dec 2012 08:39:32 -0800 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. In-Reply-To: <50C217B8.7050001@oracle.com> References: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> <50C03083.4030102@oracle.com> <50C1507F.7040202@oracle.com> <9365B2DD-5DFA-4B8D-9F37-8F4ED9D05772@oracle.com> <50C217B8.7050001@oracle.com> Message-ID: >>> (There's another issue which is that if there were previous retries, the ADEs from them are thrown away. But maybe we should save that one for another day.) >> >> I had the same thought, but aside from collecting and reporting all of them somehow I'm not sure what could be done about it. >> >> Maybe instead of: >> cause = ade; >> >> do: >> if (cause != null) { >> cause.addSuppressed(ade); >> } else { >> cause = ade; >> } >> >> Then they'll at least all be reported when RuntimeException is thrown. > > Ah, ok, this isn't bad at all! Let's go with this. Sounds like a plan :) > Did you need somebody to push this for you? Kumar is going to push for me. -DrD- From mark.sheppard at oracle.com Fri Dec 7 16:57:59 2012 From: mark.sheppard at oracle.com (Mark Sheppard) Date: Fri, 7 Dec 2012 08:57:59 -0800 (PST) Subject: RFR: JDK-8003890: modify test scripts to pass VMOPTIONS Message-ID: <780ee521-ef19-401b-9ed9-8c5cce2cb91c@default> test scripts have been updated to invoke the JVM with an env variable TESTVMOPTS which carries the vm options to be passed when the jvm is invoked in the test. webrev location: http://cr.openjdk.java.net/~chegar/8003890/webrev.00/ regards Mark From henry.jen at oracle.com Fri Dec 7 17:27:02 2012 From: henry.jen at oracle.com (Henry Jen) Date: Fri, 7 Dec 2012 09:27:02 -0800 Subject: Request for Review: CR#8001667, second attempt In-Reply-To: <50C1B23E.8010003@gmail.com> References: <50C041D3.9060703@oracle.com> <50C1B23E.8010003@gmail.com> Message-ID: <32DA82DE-9FFF-4ABA-BD38-480057EADE7A@oracle.com> On Dec 7, 2012, at 1:09 AM, Peter Levart wrote: > Hi Henry, > > I don't know what the plans are about moving the static methods in Comparators to the Comparator interface when static interface methods are enabled, but if that is planned, there will be a clash between Comparator.reverseOrder() default method and static method with same name and signature. > We will be exploring that along with other classes given static default method support ready. Cheers, Henry From david.dehaven at oracle.com Fri Dec 7 18:09:04 2012 From: david.dehaven at oracle.com (David DeHaven) Date: Fri, 7 Dec 2012 10:09:04 -0800 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. In-Reply-To: References: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> <50C03083.4030102@oracle.com> <50C1507F.7040202@oracle.com> <9365B2DD-5DFA-4B8D-9F37-8F4ED9D05772@oracle.com> <50C217B8.7050001@oracle.com> Message-ID: <025D881F-A63C-4DDB-95B9-C75A939F91D4@oracle.com> >>>> (There's another issue which is that if there were previous retries, the ADEs from them are thrown away. But maybe we should save that one for another day.) >>> >>> I had the same thought, but aside from collecting and reporting all of them somehow I'm not sure what could be done about it. >>> >>> Maybe instead of: >>> cause = ade; >>> >>> do: >>> if (cause != null) { >>> cause.addSuppressed(ade); >>> } else { >>> cause = ade; >>> } >>> >>> Then they'll at least all be reported when RuntimeException is thrown. >> >> Ah, ok, this isn't bad at all! Let's go with this. > > Sounds like a plan :) > > >> Did you need somebody to push this for you? > > Kumar is going to push for me. I updated the webrev, unfortunately I lost count and updated the same webrev so it's still at webrev.2. I'm doing a final sanity check and will submit a JPRT run when that's done. http://cr.openjdk.java.net/~ddehaven/8004042/webrev.2/ -DrD- From mandy.chung at oracle.com Fri Dec 7 18:37:09 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 07 Dec 2012 10:37:09 -0800 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C21A2C.8070503@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50C06DAC.5050500@oracle.com> <50C0D805.5030509@oracle.com> <50C1A31D.1090805@oracle.com> <50C1EB41.2010502@oracle.com> <50C207F9.5060307@oracle.com> <50C21A2C.8070503@oracle.com> Message-ID: <50C23755.5030503@oracle.com> On 12/7/12 8:32 AM, Alan Bateman wrote: > On 07/12/2012 15:15, Daniel Fuchs wrote: >> Hi Alan, >> >> I have updated the webrev according to your suggestion. I think it makes >> things much clearer. >> >> The new version is there: >> >> >> > This looks good to me except that "implementation system default" > should be "system-default implementation". > Looks good to me too with the change to "system-default implementation". Mandy From jim.gish at oracle.com Fri Dec 7 19:18:38 2012 From: jim.gish at oracle.com (Jim Gish) Date: Fri, 07 Dec 2012 14:18:38 -0500 Subject: RFR: 8004651 - TEST: java/util/logging/CheckLockLocationTest.java failed to delete file (win) Message-ID: <50C2410E.7040200@oracle.com> Please review http://cr.openjdk.java.net/~jgish/Bug8004651-CheckLockLocationTest-Windows-delete-file-fix/ Summary -- failure to delete a test log should be a warning instead of a failure. Also, while fixing this problem another one popped up -- not all platforms generate the same message in the FileSystemException ("Not a directory"), so removing the exception content check. Thanks, Jim -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From Alan.Bateman at oracle.com Fri Dec 7 19:18:58 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 07 Dec 2012 19:18:58 +0000 Subject: RFR: JDK-8003890: modify test scripts to pass VMOPTIONS In-Reply-To: <780ee521-ef19-401b-9ed9-8c5cce2cb91c@default> References: <780ee521-ef19-401b-9ed9-8c5cce2cb91c@default> Message-ID: <50C24122.10302@oracle.com> On 07/12/2012 16:57, Mark Sheppard wrote: > > > test scripts have been updated to invoke the JVM with an env variable TESTVMOPTS > which carries the vm options to be passed when the jvm is invoked in the test. > > webrev location: > > http://cr.openjdk.java.net/~chegar/8003890/webrev.00/ > > regards > Mark This is long overdue, thank you! With your changes it means that these tests will actually test what we think they are testing, eg: "jtreg -vmoption:-client" will actually use the client VM to give a simple example. Also it means that finally we can control the heap size of these tests, really important when running tests concurrently. Finally it means that we can do code coverage and use other tool agents with the shell tests, impossible until now. Clearly we need to try to replace as many of these shell tests as possible over time but that is a much longer term effort. I skimmed over the patch file and nothing obvious jumped out. The main thing that I looked for was tests that were specifying VM options that might conflict with options passed into jtreg. A few minor comments: - it's okay to ignore java/nio/Buffer/genBasic.sh and java/nio/Buffer/genCopyDirectMemory.sh as they are used to generate the tests and so aren't used in the actual test execution. - java/nio/channels/AsynchronousChannelGroup/run_any_task.sh, I see this is using -XX:-UseVMInterruptibleIO. This isn't needed any more so you can remove it while you are there. One final point is that jdk/test/Makefile will likely require changes too but that is separate to your changes. -Alan From mandy.chung at oracle.com Fri Dec 7 19:38:07 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 07 Dec 2012 11:38:07 -0800 Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present In-Reply-To: <50BF994B.5020308@oracle.com> References: <50BF994B.5020308@oracle.com> Message-ID: <50C2459F.6080102@oracle.com> On 12/5/12 10:58 AM, Alan Bateman wrote: > http://cr.openjdk.java.net/~alanb/8004371/webrev/ > Yay! Properties no longer requires JAXP to be present in order to load/store properties in XML format. This looks okay to me. Some minor comments: XMLStreamWriterImpl.isEncodingSupported - it returns true if any string != "UTF-32" that assumes the given encoding is one of the few known values. Would it be better to check the explicit list of supported encoding? private boolean isEncodingSupported(String encoding) { if (encoding.equalsIgnoreCase("UTF-32")) { return false; } return true; } PropertiesDefaultHandler.java L115-116: can be replaced with Properties.stringPropertyNames() and foreach. XMLStreamWriterImpl.java L156 - since the caller needs to unwrap XMLStreamException to determine if the encoding is supported or not, maybe better to throw this constructor to throw UnsupportedEncodingException. Perhaps s/SAXParserImp/SAXParserImpl be consistent with the other classname e.g. XMLStreamWriterImpl. As you mentioned, there is still a good bit of clean-up required and I skip the style and coding convention comments. One question though - jdk.internal.org.xml.sax.** are copied from JAXP source. What should the copyright years be? It currently retains the same value from the original copy. > One issue that I'm still mulling over, as least for the profiles > effort, is whether to only include the fallback provider in the > smallest profile as it won't be used otherwise. If the eventual size > isn't too significant then it might not be worth it of course. Do you plan to include jdk.internal.util.xml.BasicXmlPropertiesProvider in META-INF/services/sun.util.spi.XmlPropertiesProvider? I guess you are referring to what makefile change should be depending on the decision? Mandy From mike.duigou at oracle.com Fri Dec 7 21:02:09 2012 From: mike.duigou at oracle.com (Mike Duigou) Date: Fri, 7 Dec 2012 13:02:09 -0800 Subject: Request for Review : CR#8004015 : [final (?) pass] Add interface extends and defaults for basic functional interfaces In-Reply-To: <50C088BE.1040403@oracle.com> References: <0CABE1EF-B971-43A0-ABB8-3EE3D82DC029@oracle.com> <50C035F5.4050007@oracle.com> <50C088BE.1040403@oracle.com> Message-ID: <2D5B0B63-59C9-4989-B8C7-D5A9D41FF7C0@oracle.com> On Dec 6 2012, at 03:59 , Chris Hegarty wrote: > Mike, > > Some small comments. > > 1) IntUnaryOperator.java > > Typo in: > + 30 *

This is the primitive type specialization of {@link IntUnaryOperator} for > + 31 * {@code int} and also may be used as a {@code IntUnaryOperator}. When > + 32 * used as a {@code IntUnaryOperator} the default {@code operate} implementation > + 33 * provided by this interface neither accepts null parameters nor does it return > + 34 * null results. > > IntUnaryOperator -> UnaryOperator Corrected. > > 2) Double/Int/Long Function > > "When used as a Function the default apply implementation provided > by this interface neither accepts null parameters nor does it > return null results." > > "When used as a Function", is this really necessary, or should the > behavior of the default apply method just be described? I agree that this is somewhat awkward. I will see if I can't think of something better. > Why the restriction on null parameters, it seems overly restrictive > since applyAsXXXX accepts nulls, right? Corrected. Thank you for noticing this. > 3) package description > > "null values are accepted and returned by these functional > interfaces according to the constraints of the specification in > which the functional interfaces are used. The functional interfaces > themselves do not constrain or mandate use of null values. Most > usages of the functional interfaces will define the role, if any, > of null for that context." > > Given these changes, doesn't this need to be reworked ( to indicate > that some methods specify null value behavior)? > > 4) Trivially, IntSupplier is missing a '

', before "This is the > primitive type..." > > 5) I agree with David, NPE should be defined where applicable. I am adding these though I am still somewhat resistant for reasons I will mention in next review cycle thread Mike From david.dehaven at oracle.com Fri Dec 7 21:39:29 2012 From: david.dehaven at oracle.com (David DeHaven) Date: Fri, 7 Dec 2012 13:39:29 -0800 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. In-Reply-To: <025D881F-A63C-4DDB-95B9-C75A939F91D4@oracle.com> References: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> <50C03083.4030102@oracle.com> <50C1507F.7040202@oracle.com> <9365B2DD-5DFA-4B8D-9F37-8F4ED9D05772@oracle.com> <50C217B8.7050001@oracle.com> <025D881F-A63C-4DDB-95B9-C75A939F91D4@oracle.com> Message-ID: Hopefully final webrev for this change: http://cr.openjdk.java.net/~ddehaven/8004042/webrev.3/ I moved the createBatFile method to TestHelper as I thought it could be useful to other tests and added more diagnostic info. It turns out the culprit on my machine was Windows' "Application Experience" service. Each time the batch file is launched svchost.exe tries to access the file, if it doesn't release it's file locks quickly enough then when java attempts to create a new file it fails with AccessDeniedException. In procmon this was showing up as a "DELETE PENDING" result, followed by svchost.exe getting the same result at least twice then giving up. Disabling that service allowed me to run my filesystem tests unpatched without failing. I don't see any other option to fix this as this is somewhat expected of asynchronous access in a multitasking environment. Maybe there's some means to synchronously delete files... -DrD- From mandy.chung at oracle.com Fri Dec 7 21:55:36 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 07 Dec 2012 13:55:36 -0800 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50BFF69E.1040805@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> Message-ID: <50C265D8.3050107@oracle.com> This is the updated webrev. It includes Erik's makefile changes and small change - be consistent with javap, jdeps can take classnames as the input argument or wildcard "*" to analyze all class files that replaces the "-all" option. Webrev: http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.03/ Mandy On 12/5/12 5:36 PM, Mandy Chung wrote: > This review request (add a new jdeps tool in the JDK) include changes in > langtools and the jdk build. I would need reviewers from the langtools > and the build-infra team. > > Webrev for review: > > http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/langtools-webrev.02/ > http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/jdk-webrev.02/ > > The jdeps source is in the langtools repo. The change in the jdk repo is > to add the new jdeps executable. I made change in the old and new build > for the addition of this new jdeps tool. I discussed with Jon whether I > should modify langtools/make/build.xml to add a new jdeps target. Since > the old build will be replaced by the new build soon, I simply add > com/sun/tools/jdeps as part of javap.includes. > > Alan, > > The -d option is kept as a hidden option and use as implementation. We > can remove it when it's determined not useful in the future. I also > rename -v:summary to -summary. > > Thanks > Mandy > > ---------------------------- > > $ jdep -h > Usage: jdeps > where possible options include: > -version Version information > -classpath Specify where to find class files > -summary Print dependency summary only > -v:class Print class-level dependencies > -v:package Print package-level dependencies > -p Restrict analysis to classes in this package > (may be given multiple times) > -e Restrict analysis to packages matching pattern > (-p and -e are exclusive) > -P --profile Show profile or the file containing a package > -R --recursive Traverse all dependencies recursively > -all Process all classes specified in -classpath > > $ jdep Notepad.jar Ensemble.jar > Notepad.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar > (Notepad.jar) > -> java.awt > -> java.awt.event > -> java.beans > -> java.io > -> java.lang > -> java.net > -> java.util > -> java.util.logging > -> javax.swing > -> javax.swing.border > -> javax.swing.event > -> javax.swing.text > -> javax.swing.tree > -> javax.swing.undo > > Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\jfxrt.jar > Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar > com.javafx.main (Ensemble.jar) > -> java.applet > -> java.awt > -> java.awt.event > -> java.io > -> java.lang > -> java.lang.reflect > -> java.net > -> java.security > -> java.util > -> java.util.jar > -> javax.swing > -> sun.misc JDK internal API > (rt.jar) From Alan.Bateman at oracle.com Fri Dec 7 22:14:09 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 07 Dec 2012 22:14:09 +0000 Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present In-Reply-To: <50C2459F.6080102@oracle.com> References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com> Message-ID: <50C26A31.1070100@oracle.com> On 07/12/2012 19:38, Mandy Chung wrote: > : > Yay! Properties no longer requires JAXP to be present in order to > load/store properties in XML format. This looks okay to me. Some > minor comments: Thanks for going through it, I'll leave it Joe to respond as he did the work. > : > > As you mentioned, there is still a good bit of clean-up required and I > skip the style and coding convention comments. One question though - > jdk.internal.org.xml.sax.** are copied from JAXP source. What should > the copyright years be? It currently retains the same value from the > original copy. As the package has changed then the end year should probably be changed (which should happen anyway when the script to do bulk updates is run again). > >> One issue that I'm still mulling over, as least for the profiles >> effort, is whether to only include the fallback provider in the >> smallest profile as it won't be used otherwise. If the eventual size >> isn't too significant then it might not be worth it of course. > > Do you plan to include > jdk.internal.util.xml.BasicXmlPropertiesProvider in > META-INF/services/sun.util.spi.XmlPropertiesProvider? > > I guess you are referring to what makefile change should be depending > on the decision? For profiles then I think it should only be in compact1 but that would complicate the build. It's something for David Holmes to comment on as he is doing the build work in jdk8/profiles. For modules then we can include it in the base module or else put it into its own service provider module. -Alan From mandy.chung at oracle.com Fri Dec 7 22:25:49 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 07 Dec 2012 14:25:49 -0800 Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present In-Reply-To: <50C26A31.1070100@oracle.com> References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com> <50C26A31.1070100@oracle.com> Message-ID: <50C26CED.2070701@oracle.com> On 12/7/12 2:14 PM, Alan Bateman wrote: >> One question though - jdk.internal.org.xml.sax.** are copied from >> JAXP source. What should the copyright years be? It currently >> retains the same value from the original copy. > As the package has changed then the end year should probably be > changed (which should happen anyway when the script to do bulk updates > is run again). To be specific, what should the start year be in the new copy? Mandy From huizhe.wang at oracle.com Fri Dec 7 23:24:49 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Fri, 07 Dec 2012 15:24:49 -0800 Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present In-Reply-To: <50C2459F.6080102@oracle.com> References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com> Message-ID: <50C27AC1.2050600@oracle.com> Thanks for reviewing the changes. Please see comments inline. On 12/7/2012 11:38 AM, Mandy Chung wrote: > On 12/5/12 10:58 AM, Alan Bateman wrote: >> http://cr.openjdk.java.net/~alanb/8004371/webrev/ >> > > Yay! Properties no longer requires JAXP to be present in order to > load/store properties in XML format. This looks okay to me. Some > minor comments: > > XMLStreamWriterImpl.isEncodingSupported - it returns true if any > string != "UTF-32" that assumes the given encoding is one of the few > known values. Would it be better to check the explicit list of > supported encoding? > private boolean isEncodingSupported(String encoding) { > if (encoding.equalsIgnoreCase("UTF-32")) { > return false; > } > return true; > } The spec only requires UTF-8 and 16. But the writer can actually handle most of the encodings. An explicit list would be quite long and require comprehensive tests. Since the ukit parser explicitly rejects UTF-32, I chose to do the same. Other than that, the XMLWriter leaves it to java.nio.charset.Charset to determine if a specified encoding is supported through this call: try { cs = Charset.forName(encoding); } catch (IllegalCharsetNameException | UnsupportedCharsetException ex) { throw new XMLStreamException(new UnsupportedEncodingException(encoding)); } > > PropertiesDefaultHandler.java L115-116: can be replaced with > Properties.stringPropertyNames() and foreach. Done. Will send update to Alan. > > XMLStreamWriterImpl.java L156 - since the caller needs to unwrap > XMLStreamException to determine if the encoding is supported or not, > maybe better to throw this constructor to throw > UnsupportedEncodingException. The writer implements partially the original StAX API. So I tried not to change the writer API. But java.util.Properties expect UnsupportedEncodingException in case of invalid encoding, thus the compromise. > > Perhaps s/SAXParserImp/SAXParserImpl be consistent with the other > classname e.g. XMLStreamWriterImpl. SAXParserImp was from UKit, but I followed StAX's convention for XMLStreamWriterImpl :) I'll rename SAXParserImp to SAXParserImpl. > > As you mentioned, there is still a good bit of clean-up required and I > skip the style and coding convention comments. One question though - > jdk.internal.org.xml.sax.** are copied from JAXP source. What should > the copyright years be? It currently retains the same value from the > original copy. I thought the rule was that the copyright years be retained if there's no material change. But I saw Alan's comment that it'd be done by a script. So I'll leave it as is for now. Thanks, Joe > >> One issue that I'm still mulling over, as least for the profiles >> effort, is whether to only include the fallback provider in the >> smallest profile as it won't be used otherwise. If the eventual size >> isn't too significant then it might not be worth it of course. > > Do you plan to include > jdk.internal.util.xml.BasicXmlPropertiesProvider in > META-INF/services/sun.util.spi.XmlPropertiesProvider? > > I guess you are referring to what makefile change should be depending > on the decision? > > Mandy From mandy.chung at oracle.com Fri Dec 7 23:37:30 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 07 Dec 2012 15:37:30 -0800 Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present In-Reply-To: <50C27AC1.2050600@oracle.com> References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com> <50C27AC1.2050600@oracle.com> Message-ID: <50C27DBA.3050808@oracle.com> On 12/7/12 3:24 PM, Joe Wang wrote: > Thanks for reviewing the changes. Please see comments inline. > > On 12/7/2012 11:38 AM, Mandy Chung wrote: >> On 12/5/12 10:58 AM, Alan Bateman wrote: >>> http://cr.openjdk.java.net/~alanb/8004371/webrev/ >>> >> >> Yay! Properties no longer requires JAXP to be present in order to >> load/store properties in XML format. This looks okay to me. Some >> minor comments: >> >> XMLStreamWriterImpl.isEncodingSupported - it returns true if any >> string != "UTF-32" that assumes the given encoding is one of the few >> known values. Would it be better to check the explicit list of >> supported encoding? >> private boolean isEncodingSupported(String encoding) { >> if (encoding.equalsIgnoreCase("UTF-32")) { >> return false; >> } >> return true; >> } > > The spec only requires UTF-8 and 16. But the writer can actually > handle most of the encodings. An explicit list would be quite long and > require comprehensive tests. Since the ukit parser explicitly rejects > UTF-32, I chose to do the same. Other than that, the XMLWriter leaves > it to java.nio.charset.Charset to determine if a specified encoding is > supported through this call: > try { > cs = Charset.forName(encoding); > } catch (IllegalCharsetNameException | > UnsupportedCharsetException ex) { > throw new XMLStreamException(new > UnsupportedEncodingException(encoding)); > } OK - you leave it for XMLWriter to check if it's a valid encoding. It may be better to include Charset.forName check in the isEncodingSupporting method that would avoid confusion. >> >> PropertiesDefaultHandler.java L115-116: can be replaced with >> Properties.stringPropertyNames() and foreach. > > Done. Will send update to Alan. > >> >> XMLStreamWriterImpl.java L156 - since the caller needs to unwrap >> XMLStreamException to determine if the encoding is supported or not, >> maybe better to throw this constructor to throw >> UnsupportedEncodingException. > > The writer implements partially the original StAX API. So I tried not > to change the writer API. But java.util.Properties expect > UnsupportedEncodingException in case of invalid encoding, thus the > compromise. > OK - PropertiesDefaultHandler uses the XMLStreamWriter API. That's fine with me. Thanks Mandy From mandy.chung at oracle.com Fri Dec 7 23:46:46 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 07 Dec 2012 15:46:46 -0800 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50BF371A.1060604@oracle.com> References: <50BF371A.1060604@oracle.com> Message-ID: <50C27FE6.1050107@oracle.com> On 12/5/12 3:59 AM, David Holmes wrote: > Java 7 introduced support for parallel classloading by adding to each > class loader a ConcurrentHashMap, referenced through a new field, > parallelLockMap. This contains a mapping from class names to Objects > to use as a classloading lock for that class name. This scheme has a > number of inefficiencies. To address this we propose for Java 8 the > notion of a fully concurrent classloader ... > > This is a fairly simple proposal that I've written up as a blog entry: > > https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent > > It's a good and simple proposal and also handles the backward compatibility nicely. I think having getClassLoadingLock() to return null for a fully concurrent loader is a good idea. In case if any code synchronizes on the returned value after migrating to fully concurrent class loader, it will catch such usage (it might be very rare)/ I agree with Alan's suggestion - we should consider deprecating registerAsParallelCapable. Mandy From stuart.marks at oracle.com Sat Dec 8 00:58:24 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Fri, 07 Dec 2012 16:58:24 -0800 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. In-Reply-To: References: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> <50C03083.4030102@oracle.com> <50C1507F.7040202@oracle.com> <9365B2DD-5DFA-4B8D-9F37-8F4ED9D05772@oracle.com> <50C217B8.7050001@oracle.com> <025D881F-A63C-4DDB-95B9-C75A939F91D4@oracle.com> Message-ID: <50C290B0.10802@oracle.com> On 12/7/12 1:39 PM, David DeHaven wrote: > > Hopefully final webrev for this change: > http://cr.openjdk.java.net/~ddehaven/8004042/webrev.3/ > > I moved the createBatFile method to TestHelper as I thought it could be useful to other tests and added more diagnostic info. > > It turns out the culprit on my machine was Windows' "Application Experience" service. Each time the batch file is launched svchost.exe tries to access the file, if it doesn't release it's file locks quickly enough then when java attempts to create a new file it fails with AccessDeniedException. In procmon this was showing up as a "DELETE PENDING" result, followed by svchost.exe getting the same result at least twice then giving up. Disabling that service allowed me to run my filesystem tests unpatched without failing. > > I don't see any other option to fix this as this is somewhat expected of asynchronous access in a multitasking environment. Maybe there's some means to synchronously delete files... Ah, the mysteries of Windows. The test looks fine. s'marks From akhil.arora at oracle.com Sat Dec 8 01:42:28 2012 From: akhil.arora at oracle.com (Akhil Arora) Date: Fri, 07 Dec 2012 17:42:28 -0800 Subject: RFR: 8001647: In-place methods on Collection/List Message-ID: <50C29B04.5070508@oracle.com> As part of the Library Lambdafication, this patch adds the following default methods to Collections - Iterable.forEach(Block) Collection.removeAll(Predicate) List.sort(Comparator) List.replaceAll(UnaryOperator) It also provides more efficient implementations of these methods for ArrayList, Vector and CopyOnWriteArrayList. Please review. http://cr.openjdk.java.net/~akhil/8001647.1/webrev/ Thanks to the many people who have already contributed to this patch. From Alan.Bateman at oracle.com Sat Dec 8 10:37:29 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 08 Dec 2012 10:37:29 +0000 Subject: Review request: 8004042 : Arrrghs.java test failed on windows with access error. In-Reply-To: References: <99E014EB-0210-4C77-BE43-88CED80B1825@oracle.com> <50C03083.4030102@oracle.com> <50C1507F.7040202@oracle.com> <9365B2DD-5DFA-4B8D-9F37-8F4ED9D05772@oracle.com> <50C217B8.7050001@oracle.com> <025D881F-A63C-4DDB-95B9-C75A939F91D4@oracle.com> Message-ID: <50C31869.5030109@oracle.com> On 07/12/2012 21:39, David DeHaven wrote: > It turns out the culprit on my machine was Windows' "Application Experience" service. Each time the batch file is launched svchost.exe tries to access the file, if it doesn't release it's file locks quickly enough then when java attempts to create a new file it fails with AccessDeniedException. In procmon this was showing up as a "DELETE PENDING" result, followed by svchost.exe getting the same result at least twice then giving up. Disabling that service allowed me to run my filesystem tests unpatched without failing. > Good sleuthing, I guess some of us owe at least one AV vendor a written apology :-) I wonder if we should submit a bug to Microsoft, it's very surprising to have a service running by default that causes interference like this. This investigation also makes me wonder if java/lang/Runtime/exec/WinCommand.java might be another victim. -Alan From peter.levart at gmail.com Sat Dec 8 12:41:20 2012 From: peter.levart at gmail.com (Peter Levart) Date: Sat, 08 Dec 2012 13:41:20 +0100 Subject: Request for Review: CR#8001667, second attempt In-Reply-To: <32DA82DE-9FFF-4ABA-BD38-480057EADE7A@oracle.com> References: <50C041D3.9060703@oracle.com> <50C1B23E.8010003@gmail.com> <32DA82DE-9FFF-4ABA-BD38-480057EADE7A@oracle.com> Message-ID: <50C33570.9020202@gmail.com> On 12/07/2012 06:27 PM, Henry Jen wrote: > On Dec 7, 2012, at 1:09 AM, Peter Levart wrote: > >> Hi Henry, >> >> I don't know what the plans are about moving the static methods in Comparators to the Comparator interface when static interface methods are enabled, but if that is planned, there will be a clash between Comparator.reverseOrder() default method and static method with same name and signature. >> > We will be exploring that along with other classes given static default method support ready. > > Cheers, > Henry > And what about the aComparator.thenComparing(Comparator) method name? Do you think it's ok to use the same name as in aComparator.thenComparing(Function) ? A suitable alternative might be aComparator.thenUsing(Comparator). Regards, Peter From peter.levart at gmail.com Sat Dec 8 13:27:10 2012 From: peter.levart at gmail.com (Peter Levart) Date: Sat, 08 Dec 2012 14:27:10 +0100 Subject: RFR: 8001647: In-place methods on Collection/List In-Reply-To: <50C29B04.5070508@oracle.com> References: <50C29B04.5070508@oracle.com> Message-ID: <50C3402E.9050608@gmail.com> On 12/08/2012 02:42 AM, Akhil Arora wrote: > As part of the Library Lambdafication, this patch adds the following > default methods to Collections - > > Iterable.forEach(Block) > Collection.removeAll(Predicate) > List.sort(Comparator) > List.replaceAll(UnaryOperator) > > It also provides more efficient implementations of these methods for > ArrayList, Vector and CopyOnWriteArrayList. Please review. Yes! There's finally a way to sort ArrayList's array in-place. Until now you either had to resort to using arrays or a sub-optimal Collections.sort(List) method. Regards, Peter From kumar.x.srinivasan at oracle.com Sun Dec 9 17:17:55 2012 From: kumar.x.srinivasan at oracle.com (kumar.x.srinivasan at oracle.com) Date: Sun, 09 Dec 2012 17:17:55 +0000 Subject: hg: jdk8/tl/jdk: 8004042: Arrrghs.java test failed on windows with access error. Message-ID: <20121209171842.20CC747FF6@hg.openjdk.java.net> Changeset: da387f0cecb7 Author: ksrini Date: 2012-12-09 07:43 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/da387f0cecb7 8004042: Arrrghs.java test failed on windows with access error. Reviewed-by: smarks, jjh, ksrini Contributed-by: david.dehaven at oracle.com ! test/tools/launcher/Arrrghs.java ! test/tools/launcher/TestHelper.java From alan.bateman at oracle.com Sun Dec 9 19:13:03 2012 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Sun, 09 Dec 2012 19:13:03 +0000 Subject: hg: jdk8/tl/jdk: 7194370: (fs) WatchService fails if volume S/N is 0 [win] Message-ID: <20121209191314.ADFA647FF9@hg.openjdk.java.net> Changeset: 343615aa0539 Author: dxu Date: 2012-12-09 19:13 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/343615aa0539 7194370: (fs) WatchService fails if volume S/N is 0 [win] Reviewed-by: alanb, forax ! src/windows/classes/sun/nio/fs/WindowsFileAttributes.java From masayoshi.okutsu at oracle.com Mon Dec 10 02:01:06 2012 From: masayoshi.okutsu at oracle.com (masayoshi.okutsu at oracle.com) Date: Mon, 10 Dec 2012 02:01:06 +0000 Subject: hg: jdk8/tl/jdk: 8000983: Support narrow display names for calendar fields; ... Message-ID: <20121210020127.5EB7747FFC@hg.openjdk.java.net> Changeset: fda257689786 Author: okutsu Date: 2012-12-10 10:52 +0900 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/fda257689786 8000983: Support narrow display names for calendar fields 8003267: Support generic time zone names in TimeZoneNameProvider (SPI) Reviewed-by: naoto ! make/tools/src/build/tools/cldrconverter/Bundle.java ! make/tools/src/build/tools/cldrconverter/BundleGenerator.java ! make/tools/src/build/tools/cldrconverter/CLDRConverter.java ! make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java ! make/tools/src/build/tools/cldrconverter/MetaZonesParseHandler.java ! make/tools/src/build/tools/cldrconverter/ResourceBundleGenerator.java ! src/share/classes/java/text/DateFormatSymbols.java ! src/share/classes/java/text/SimpleDateFormat.java ! src/share/classes/java/util/Calendar.java ! src/share/classes/java/util/JapaneseImperialCalendar.java ! src/share/classes/java/util/TimeZone.java ! src/share/classes/java/util/spi/CalendarNameProvider.java ! src/share/classes/java/util/spi/TimeZoneNameProvider.java ! src/share/classes/sun/text/resources/FormatData.java ! src/share/classes/sun/text/resources/ar/FormatData_ar.java ! src/share/classes/sun/text/resources/be/FormatData_be.java ! src/share/classes/sun/text/resources/bg/FormatData_bg.java ! src/share/classes/sun/text/resources/ca/FormatData_ca.java ! src/share/classes/sun/text/resources/cs/FormatData_cs.java ! src/share/classes/sun/text/resources/da/FormatData_da.java ! src/share/classes/sun/text/resources/de/FormatData_de.java ! src/share/classes/sun/text/resources/el/FormatData_el.java ! src/share/classes/sun/text/resources/es/FormatData_es.java ! src/share/classes/sun/text/resources/et/FormatData_et.java ! src/share/classes/sun/text/resources/fi/FormatData_fi.java ! src/share/classes/sun/text/resources/fr/FormatData_fr.java ! src/share/classes/sun/text/resources/hi/FormatData_hi_IN.java ! src/share/classes/sun/text/resources/hr/FormatData_hr.java ! src/share/classes/sun/text/resources/hu/FormatData_hu.java ! src/share/classes/sun/text/resources/is/FormatData_is.java ! src/share/classes/sun/text/resources/it/FormatData_it.java ! src/share/classes/sun/text/resources/iw/FormatData_iw.java ! src/share/classes/sun/text/resources/ja/FormatData_ja.java ! src/share/classes/sun/text/resources/ko/FormatData_ko.java ! src/share/classes/sun/text/resources/lt/FormatData_lt.java ! src/share/classes/sun/text/resources/lv/FormatData_lv.java ! src/share/classes/sun/text/resources/mk/FormatData_mk.java ! src/share/classes/sun/text/resources/ms/FormatData_ms.java ! src/share/classes/sun/text/resources/mt/FormatData_mt.java ! src/share/classes/sun/text/resources/nl/FormatData_nl.java ! src/share/classes/sun/text/resources/pl/FormatData_pl.java ! src/share/classes/sun/text/resources/pt/FormatData_pt.java ! src/share/classes/sun/text/resources/ro/FormatData_ro.java ! src/share/classes/sun/text/resources/ru/FormatData_ru.java ! src/share/classes/sun/text/resources/sk/FormatData_sk.java ! src/share/classes/sun/text/resources/sl/FormatData_sl.java ! src/share/classes/sun/text/resources/sq/FormatData_sq.java ! src/share/classes/sun/text/resources/sr/FormatData_sr.java ! src/share/classes/sun/text/resources/sv/FormatData_sv.java ! src/share/classes/sun/text/resources/th/FormatData_th.java ! src/share/classes/sun/text/resources/tr/FormatData_tr.java ! src/share/classes/sun/text/resources/uk/FormatData_uk.java ! src/share/classes/sun/text/resources/vi/FormatData_vi.java ! src/share/classes/sun/text/resources/zh/FormatData_zh.java ! src/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java ! src/share/classes/sun/util/locale/provider/CalendarDataUtility.java ! src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java ! src/share/classes/sun/util/locale/provider/LocaleResources.java ! src/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java ! src/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java ! src/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java ! src/share/classes/sun/util/resources/LocaleData.java ! src/share/classes/sun/util/resources/OpenListResourceBundle.java ! src/share/classes/sun/util/resources/TimeZoneNames.java ! src/share/classes/sun/util/resources/TimeZoneNamesBundle.java + test/java/util/Calendar/GenericTimeZoneNamesTest.java + test/java/util/Calendar/GenericTimeZoneNamesTest.sh + test/java/util/Calendar/NarrowNamesTest.java + test/java/util/Calendar/NarrowNamesTest.sh ! test/java/util/PluggableLocale/GenericTest.java ! test/java/util/PluggableLocale/TimeZoneNameProviderTest.java ! test/java/util/PluggableLocale/TimeZoneNameProviderTest.sh ! test/java/util/PluggableLocale/barprovider.jar + test/java/util/PluggableLocale/providersrc/GenericTimeZoneNameProviderImpl.java ! test/java/util/PluggableLocale/providersrc/Makefile ! test/java/util/PluggableLocale/providersrc/java.util.spi.TimeZoneNameProvider ! test/sun/text/resources/LocaleData ! test/sun/text/resources/LocaleDataTest.java From david.holmes at oracle.com Mon Dec 10 03:53:21 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 10 Dec 2012 13:53:21 +1000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C08264.80804@gmail.com> References: <50BF371A.1060604@oracle.com> <50C08264.80804@gmail.com> Message-ID: <50C55CB1.3000901@oracle.com> Hi Peter, I think your middle-ground sounds like it may have been a better choice for JDK 7. But for this proposal I want to try and leave parallel loaders behind and move to the fully concurrent model. The real crux of my proposal is how often you really do get concurrent load attempts and so waste effort doing concurrent findClass for the same class. Obviously you can easily construct the pathological microbenchmark for this, but I'd like to base this on real experiences. The question then is whether some additional flow-control can be added to the fully concurrent model, if it proves necessary. Thanks, David On 6/12/2012 9:32 PM, Peter Levart wrote: > Hi David, > > What about a middle-ground mode where findLoadedClass() and delegation > to parent would be called without locks and only findClass() would be > guarded by a per-class-name-per-classloader lock? In this mode > concurrent attempts to define the same class would still be possible, > but the possibility would be much lower. Usually findClass() involves > non-ignorable level of resource-intensive work (ZIP, IO, NET) before it > calls defineClass()... > Also, in this mode, the Map of locks could be implemented so that lock > objects would be Weak(ly)Reference(d), since requests for already loaded > classes would be satisfied by findLoadedClass() already. We'd just need > a ConcurrentWeakValuesHashMap. > > There must be something I'm missing here, isn't it? > > Regards, Peter > > On 12/05/2012 12:59 PM, David Holmes wrote: >> Java 7 introduced support for parallel classloading by adding to each >> class loader a ConcurrentHashMap, referenced through a new field, >> parallelLockMap. This contains a mapping from class names to Objects >> to use as a classloading lock for that class name. This scheme has a >> number of inefficiencies. To address this we propose for Java 8 the >> notion of a fully concurrent classloader ... >> >> This is a fairly simple proposal that I've written up as a blog entry: >> >> https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent >> >> >> Please discuss this proposal here. >> >> Thanks, >> David Holmes >> > From david.holmes at oracle.com Mon Dec 10 03:54:26 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 10 Dec 2012 13:54:26 +1000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C08305.90907@oracle.com> References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com> Message-ID: <50C55CF2.3050809@oracle.com> On 6/12/2012 9:35 PM, Alan Bateman wrote: > On 05/12/2012 11:59, David Holmes wrote: >> Java 7 introduced support for parallel classloading by adding to each >> class loader a ConcurrentHashMap, referenced through a new field, >> parallelLockMap. This contains a mapping from class names to Objects >> to use as a classloading lock for that class name. This scheme has a >> number of inefficiencies. To address this we propose for Java 8 the >> notion of a fully concurrent classloader ... >> >> This is a fairly simple proposal that I've written up as a blog entry: >> >> https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent >> > The jdk7 implementation is very unfortunate, it's a pity this wasn't > caught before 7 shipped. > > I think the proposal is good, it preserves compatibility, and if there > are loaders calling registerAsParallelCapable now (probably very few) > then it they may be able to change to using registerAsFullyConcurrent > without too much work. Thanks for your comments and support Alan. > I am tempted to suggest that registerAsParallelCapable should be > deprecated too. I think that may be premature for 8, perhaps for 9? David > -Alan. From david.holmes at oracle.com Mon Dec 10 04:03:29 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 10 Dec 2012 14:03:29 +1000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C0B490.7050005@redhat.com> References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com> <50C0B490.7050005@redhat.com> Message-ID: <50C55F11.6020801@oracle.com> Hi David, On 7/12/2012 1:06 AM, David M. Lloyd wrote: > On 12/06/2012 05:35 AM, Alan Bateman wrote: >> On 05/12/2012 11:59, David Holmes wrote: >>> Java 7 introduced support for parallel classloading by adding to each >>> class loader a ConcurrentHashMap, referenced through a new field, >>> parallelLockMap. This contains a mapping from class names to Objects >>> to use as a classloading lock for that class name. This scheme has a >>> number of inefficiencies. To address this we propose for Java 8 the >>> notion of a fully concurrent classloader ... >>> >>> This is a fairly simple proposal that I've written up as a blog entry: >>> >>> https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent >>> >>> >> The jdk7 implementation is very unfortunate, it's a pity this wasn't >> caught before 7 shipped. >> >> I think the proposal is good, it preserves compatibility, and if there >> are loaders calling registerAsParallelCapable now (probably very few) >> then it they may be able to change to using registerAsFullyConcurrent >> without too much work. >> >> I am tempted to suggest that registerAsParallelCapable should be >> deprecated too. > > I'm sorry I missed the original post, and I just want to add my > wholehearted support for this idea. Our application server's class > loader implementation can be configured (on certain JVMs) to run in a > lock-free mode and we have seen good performance and memory footprint as > a result on these particular JVMs. That sounds promising. Are you in a position to try out this proposal on a testbed with your app server? > As far as the defineClass concurrent redefine issue goes - our current > implementation simply does a try/catch for redefinition exceptions. If > such an exception occurs, we load the concurrently defined class and > return that. In practice, even with many threads, we would see > relatively few such collisions. But, a tryDefineClass or > defineClassIfNotPresent would be a welcome addition for certain. To be clear, in this proposal defineClass, at the VM level (SystemDictionary::find_or_define_instance_class), acts as a defineClassIfNotPresent, and simply returns the class that has already been defined if a race occurs. > I'm very glad to see that Mr. Holmes has taken this initiative and found > solutions to the various stumbling blocks. This still requires extensive validation but I'm hopeful that this will at least ameliorate the situation with the JDK's own classloaders, and hopefully enable others to utilise fully concurrent loaders. Thanks, David From david.holmes at oracle.com Mon Dec 10 04:08:51 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 10 Dec 2012 14:08:51 +1000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C27FE6.1050107@oracle.com> References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> Message-ID: <50C56053.1060306@oracle.com> Thanks for the comments Mandy. On 8/12/2012 9:46 AM, Mandy Chung wrote: > On 12/5/12 3:59 AM, David Holmes wrote: >> Java 7 introduced support for parallel classloading by adding to each >> class loader a ConcurrentHashMap, referenced through a new field, >> parallelLockMap. This contains a mapping from class names to Objects >> to use as a classloading lock for that class name. This scheme has a >> number of inefficiencies. To address this we propose for Java 8 the >> notion of a fully concurrent classloader ... >> >> This is a fairly simple proposal that I've written up as a blog entry: >> >> https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent >> >> > It's a good and simple proposal and also handles the backward > compatibility nicely. > > I think having getClassLoadingLock() to return null for a fully > concurrent loader is a good idea. In case if any code synchronizes on > the returned value after migrating to fully concurrent class loader, it > will catch such usage (it might be very rare)/ The only glitch with this is that a concurrent loader is-a parallel loader, so anyone trying work with an arbitrary parallel loader will encounter a problem with a concurrent loader if they don't make their code concurrent-loader aware. I am hopeful that the parallelLockMap is only being used internally by the classloaders themselves, and that there are no, or very few, external clients. > I agree with Alan's suggestion - we should consider deprecating > registerAsParallelCapable. Definitely a consideration, though as I said perhaps for 9 rather than 8. Thanks, David > > Mandy > From david.holmes at oracle.com Mon Dec 10 06:18:24 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 10 Dec 2012 16:18:24 +1000 Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch In-Reply-To: <50BC57A0.8000108@gmail.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> Message-ID: <50C57EB0.1000202@oracle.com> Hi Peter, Sorry for the delay on this. Generally your VolatileData and my ReflectionHelper are doing a similar job. But I agree with your reasoning that all of the cached SoftReferences are likely to be cleared at once, and so a SoftReference to a helper object with direct references, is more effective than a direct reference to a helper object with SoftReferences. My initial stance with this was very conservative as the more change that is introduced the more uncertainty there is about the impact. I say the above primarily because I think, if I am to proceed with this, I will need to separate out the general reflection caching changes from the annotation changes. There are a number of reasons for this: First, I'm not at all familiar with the implementation of annotations at the VM or Java level, and the recent changes in this area just exacerbate my ignorance of the mechanics. So I don't feel qualified to evaluate that aspect. Second, the bulk of the reflection caching code is simplified by the fact that due to current constraints on class redefinition the caching is effectively idempotent for fields/methods/constructors. But that is not the case for annotations. Finally, the use of synchronization with the annotations method is perplexing me. I sent Joe a private email on this but I may as well raise it here - and I think you have alluded to this in your earlier emails as well: initAnnotationsIfNecessary() is a synchronized instance method but I can not find any other code in the VM that synchronizes on the Class object's monitor. So if this synchronization is trying to establish consistency in the face of class redefinition, I do not see where class redefinition is participating in the synchronization! So what I would like to do is take your basic VolatileData part of the patch and run with it for JEP-149 purposes, while separating the annotations issue so they can be dealt with by the experts in that particular area. I'm sorry it has taken so long to arrive at a fairly negative position, but I need someone else to take up the annotations gauntlet and run with it. Thanks, David On 3/12/2012 5:41 PM, Peter Levart wrote: > Hi David, Alan, Alexander and others, > > In the meanwhile I have added another annotations space optimization to > the patch. If a Class doesn't inherit any annotations from a superclass, > which I think is a common case, it assigns the same Map instance to > "annotations" as well as "declaredAnnotations" fields. Previously - and > in the original code - this only happened for java.lang.Object and > interfaces. > > Here's the updated webrev: > > http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html > > I have also rewritten the performance micro-benchmarks. With the > addition of repeating annotations, one performance aspect surfaces: when > asking for a particular annotation type on a Class and that annotation > is not present, the new repeating annotations support method > AnnotationSupport.getOneAnnotation asks for @ContainedBy meta-annotation > on the annotation type. This can result in an even more apparent > synchronization hot-spot with original code that uses synchronized > initAnnotationsIfNecessary(). This aspect is tested with the 3rd test. > Other 2 tests test the same thing as before but are more stable now, > since now they measure retrieval of 5 different annotation types from > each AnnotatedElement, previously they only measured retrieval of 1 > which was very sensitive to HashMap irregularities (it could happen that > a particular key mapped to a bucket that was overloaded in one test-run > and not in another)... > > Here're the new tests: > > https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java > > And the corresponding results when run on an i7 CPU on Linux: > > https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt > > > Regards, Peter > > > > On 12/03/2012 02:15 AM, David Holmes wrote: >> On 1/12/2012 4:54 AM, Alan Bateman wrote: >>> On 30/11/2012 18:36, Peter Levart wrote: >>>> : >>>> >>>> So, what do you think? What kind of tests should I prepare in addidion >>>> to those 3 so that the patch might get a consideration? >>> I think this is good work and thanks for re-basing your patch. I know >>> David plans to do a detail review. I think it will require extensive >>> performance testing too, perhaps with some large applications. >> >> Indeed I do plan a detailed review and have initiated some initial >> performance tests. >> >> I am also swamped but will try to get to the review this week - and >> will also need to check the referenced annotations updates. >> >> David >> >>> -Alan >>> > From david.buck at oracle.com Mon Dec 10 06:25:54 2012 From: david.buck at oracle.com (David Buck) Date: Mon, 10 Dec 2012 15:25:54 +0900 Subject: code review request : 8003147 port fix for BCEL bug 39695 Message-ID: <50C58072.4060802@oracle.com> Hi! I would like to request a code review of my JDK8 fix for the following issue: [ 8003147 : port fix for BCEL bug 39695 to our copy bundled as part of jaxp ] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8003147 In addition to the fix that the BCEL project had for this issue, I needed to "port" some of their support for LocalVariableTypeTable:s to our copy of BCEL as well. Implementing support for LVTT is very straightforward and does not add much to the complexity or risk of this change (especially considering the limited scope of jaxp's use of BCEL). Here is the webrev for my fix: [ Code Review for jaxp ] http://cr.openjdk.java.net/~dbuck/8003147/webrev.00/ My understanding is that the test cases for our copy of the jaxp code are handled in a separate repository / test suite. I have been in contact with Patrick Zhang (Oracle QA) and Joe Wang and have provided a junit test for this issue as requested. Please see bug report for a simpler (non-junit) test-case. If for some reason anyone wants to see the junit-based test, please let me know and I can provide a copy of that as well. Best Regards, -Buck From dingxmin at linux.vnet.ibm.com Mon Dec 10 07:44:33 2012 From: dingxmin at linux.vnet.ibm.com (Frank Ding) Date: Mon, 10 Dec 2012 15:44:33 +0800 Subject: Review needed: 8004374 : Fwd: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData In-Reply-To: References: Message-ID: <50C592E1.9050400@linux.vnet.ibm.com> Hi Lance, The code refactory looks good. By the way, the newly added unit test is not jtreg test case? Best regards, Frank On 12/5/2012 4:38 AM, Lance Andersen - Oracle wrote: > All, > > Attached is the patch for: 8004374 based off the issue that Frank > reported. > > for http://cr.openjdk.java.net/~lancea/8004374/webrev.00/ > > > The TCK, SQE and the JDBC Unit Tests run clean. I added a new Unit > Test to validate the issue. > > Frank, I did not use your fix as I was able to clean the code up a bit > more and get rid of more crud while addressing it. It is similar though. > > Best > Lance > > > > > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > From Alan.Bateman at oracle.com Mon Dec 10 10:08:11 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 10 Dec 2012 10:08:11 +0000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C55CF2.3050809@oracle.com> References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com> <50C55CF2.3050809@oracle.com> Message-ID: <50C5B48B.60906@oracle.com> On 10/12/2012 03:54, David Holmes wrote: > : > >> I am tempted to suggest that registerAsParallelCapable should be >> deprecated too. > > I think that may be premature for 8, perhaps for 9? I think we should just it over with and deprecate it is now to discourage usage. I don't have data but I'll bet that there are only are handful of frameworks or app servers using it. -Alan From erik.joelsson at oracle.com Mon Dec 10 10:30:10 2012 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Mon, 10 Dec 2012 02:30:10 -0800 (PST) Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50C265D8.3050107@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> Message-ID: <50C5B9B2.2050705@oracle.com> Looks good. /Erik On 2012-12-07 22:55, Mandy Chung wrote: > This is the updated webrev. It includes Erik's makefile changes and > small change - be consistent with javap, jdeps can take classnames as > the input argument or wildcard "*" to analyze all class files that > replaces the "-all" option. > > Webrev: > http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.03/ > > Mandy > > On 12/5/12 5:36 PM, Mandy Chung wrote: >> This review request (add a new jdeps tool in the JDK) include changes in >> langtools and the jdk build. I would need reviewers from the langtools >> and the build-infra team. >> >> Webrev for review: >> >> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/langtools-webrev.02/ >> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/jdk-webrev.02/ >> >> The jdeps source is in the langtools repo. The change in the jdk >> repo is >> to add the new jdeps executable. I made change in the old and new build >> for the addition of this new jdeps tool. I discussed with Jon whether I >> should modify langtools/make/build.xml to add a new jdeps target. Since >> the old build will be replaced by the new build soon, I simply add >> com/sun/tools/jdeps as part of javap.includes. >> >> Alan, >> >> The -d option is kept as a hidden option and use as implementation. We >> can remove it when it's determined not useful in the future. I also >> rename -v:summary to -summary. >> >> Thanks >> Mandy >> >> ---------------------------- >> >> $ jdep -h >> Usage: jdeps >> where possible options include: >> -version Version information >> -classpath Specify where to find class files >> -summary Print dependency summary only >> -v:class Print class-level dependencies >> -v:package Print package-level dependencies >> -p Restrict analysis to classes in this package >> (may be given multiple times) >> -e Restrict analysis to packages matching >> pattern >> (-p and -e are exclusive) >> -P --profile Show profile or the file containing a package >> -R --recursive Traverse all dependencies recursively >> -all Process all classes specified in -classpath >> >> $ jdep Notepad.jar Ensemble.jar >> Notepad.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar >> (Notepad.jar) >> -> java.awt >> -> java.awt.event >> -> java.beans >> -> java.io >> -> java.lang >> -> java.net >> -> java.util >> -> java.util.logging >> -> javax.swing >> -> javax.swing.border >> -> javax.swing.event >> -> javax.swing.text >> -> javax.swing.tree >> -> javax.swing.undo >> >> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\jfxrt.jar >> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar >> com.javafx.main (Ensemble.jar) >> -> java.applet >> -> java.awt >> -> java.awt.event >> -> java.io >> -> java.lang >> -> java.lang.reflect >> -> java.net >> -> java.security >> -> java.util >> -> java.util.jar >> -> javax.swing >> -> sun.misc JDK internal API >> (rt.jar) > From chris.hegarty at oracle.com Mon Dec 10 10:33:52 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 10 Dec 2012 02:33:52 -0800 (PST) Subject: Request for Review : CR#8004015 : [final (?) pass] Add interface extends and defaults for basic functional interfaces In-Reply-To: <2D5B0B63-59C9-4989-B8C7-D5A9D41FF7C0@oracle.com> References: <0CABE1EF-B971-43A0-ABB8-3EE3D82DC029@oracle.com> <50C035F5.4050007@oracle.com> <50C088BE.1040403@oracle.com> <2D5B0B63-59C9-4989-B8C7-D5A9D41FF7C0@oracle.com> Message-ID: <50C5BA90.9010204@oracle.com> On 07/12/2012 21:02, Mike Duigou wrote: > ... >> 5) I agree with David, NPE should be defined where applicable. > > I am adding these though I am still somewhat resistant for reasons I will mention in next review cycle thread I don't want to to get bogged down in a debate over this, I'm really happy too see these changes making their way into jdk8. Maybe some text in the package description that indicates that "an exception" will be thrown in cases where the API specifies a non-null argument? I'll leave it to you to decide. All in all, this is looking good. -Chris. > > Mike > > > From chris.hegarty at oracle.com Mon Dec 10 10:51:13 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 10 Dec 2012 10:51:13 +0000 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C20F5A.8060900@univ-mlv.fr> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> <50C0D81A.5030607@cs.oswego.edu> <50C0DD49.4060900@oracle.com> <50C0E3F2.9030004@cs.oswego.edu> <50C0EBC9.2070101@univ-mlv.fr> <50C0F559.5090600@oracle.com> <1354831513.40215.YahooMailNeo@web132104.mail.ird.yahoo.com> <50C12DEC.9060006@univ-mlv.fr> <50C1FCD8.3030109@cs.oswego.edu> <50C20C90.6070200@oracle.com> <50C20F5A.8060900@univ-mlv.fr> Message-ID: <50C5BEA1.3080707@oracle.com> On 07/12/2012 15:46, Remi Forax wrote: > On 12/07/2012 04:34 PM, Chris Hegarty wrote: >> I filed 8004707: "Remove superfluous access$000 methods in java.util", >> to track this issue. I can file a separate issue for java.lang. > > yes, please do that. I filed 8004797: "Remove superfluous access$000 methods in java.lang" -Chris. > >> >> I'm sure there are other ways, but a simple find reports them: >> :>pwd >> build/solaris-i586/classes/java/util >> :> find . -name "*.class" -exec javap -v {} \; | grep '\.access\$00' > > Technically, javac also generate constructor accessors that doesn't > start by access00 but this should catch most of the generated accessors. > > once changeset for 8003246 will be pushed, I will send two patches one > for java.lang and one for java.util. > >> >> -Chris > > R?mi > >> >> On 07/12/2012 14:27, Doug Lea wrote: >>> On 12/06/12 18:44, Remi Forax wrote: >>> >>>> BTW, at some point, it will be a good idea to get ride of all these >>>> method >>>> access$000 in java.lang/java.util at least. >>>> >>> >>> Maybe this is out of scope for this CR, but while in the >>> neighborhood of ThreadLocal, it could be done here. >>> There are a couple of annoying ones that kick in on any >>> compile of anything involving ThreadLocals (try running with >>> -XX:+PrintCompilation). To remove, replace "private" with >>> "final" for methods, and just kill "private" for fields. >>> >>> -Doug >>> >>> >>> > From chris.hegarty at oracle.com Mon Dec 10 11:13:46 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 10 Dec 2012 11:13:46 +0000 Subject: RFR: JDK-8003890: modify test scripts to pass VMOPTIONS In-Reply-To: <780ee521-ef19-401b-9ed9-8c5cce2cb91c@default> References: <780ee521-ef19-401b-9ed9-8c5cce2cb91c@default> Message-ID: <50C5C3EA.4080802@oracle.com> Thank you Mark, this is a really useful contribution. I noticed that a few tests (below) specify either -client or -server. If the vmoptions contain either of these arguments, and this seems to be the way our test/Makefile is passing them, then it may result in the test using the wrong vm. I think we should remove TESTVMOPTS from these tests, but then we lose other potential opts, like heap size, etc. java/rmi/reliability/benchmark/runRmiBench.sh java/rmi/reliability/benchmark/runSerialBench.sh sun/management/jmxremote/startstop/JMXStartStopTest.sh -Chris. On 07/12/2012 16:57, Mark Sheppard wrote: > > > > test scripts have been updated to invoke the JVM with an env variable TESTVMOPTS > which carries the vm options to be passed when the jvm is invoked in the test. > > webrev location: > > http://cr.openjdk.java.net/~chegar/8003890/webrev.00/ > > regards > Mark From Alan.Bateman at oracle.com Mon Dec 10 11:25:49 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 10 Dec 2012 11:25:49 +0000 Subject: RFR: JDK-8003890: modify test scripts to pass VMOPTIONS In-Reply-To: <50C5C3EA.4080802@oracle.com> References: <780ee521-ef19-401b-9ed9-8c5cce2cb91c@default> <50C5C3EA.4080802@oracle.com> Message-ID: <50C5C6BD.3090609@oracle.com> On 10/12/2012 11:13, Chris Hegarty wrote: > Thank you Mark, this is a really useful contribution. > > I noticed that a few tests (below) specify either -client or -server. > If the vmoptions contain either of these arguments, and this seems to > be the way our test/Makefile is passing them, then it may result in > the test using the wrong vm. I think we should remove TESTVMOPTS from > these tests, but then we lose other potential opts, like heap size, etc. > > java/rmi/reliability/benchmark/runRmiBench.sh > java/rmi/reliability/benchmark/runSerialBench.sh > sun/management/jmxremote/startstop/JMXStartStopTest.sh You're right, this will cause conflict. In the case of JMXStartStopTest.sh and runSerialBench.sh then it might be better to remove the -server. Stuart might have an opinion on runRmiBench.sh but one idea is to change is so that when run interactively (TESTJAVA not set) then it works as it does now and runs the benchmark twice. If TESTJAVA is not set then it runs the benchmark once, with whatever VM options are in use. -Alan From chris.hegarty at oracle.com Mon Dec 10 11:33:39 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 10 Dec 2012 11:33:39 +0000 Subject: RFR: JDK-8003890: modify test scripts to pass VMOPTIONS In-Reply-To: <50C5C6BD.3090609@oracle.com> References: <780ee521-ef19-401b-9ed9-8c5cce2cb91c@default> <50C5C3EA.4080802@oracle.com> <50C5C6BD.3090609@oracle.com> Message-ID: <50C5C893.4090600@oracle.com> On 10/12/2012 11:25, Alan Bateman wrote: > On 10/12/2012 11:13, Chris Hegarty wrote: >> Thank you Mark, this is a really useful contribution. >> >> I noticed that a few tests (below) specify either -client or -server. >> If the vmoptions contain either of these arguments, and this seems to >> be the way our test/Makefile is passing them, then it may result in >> the test using the wrong vm. I think we should remove TESTVMOPTS from >> these tests, but then we lose other potential opts, like heap size, etc. >> >> java/rmi/reliability/benchmark/runRmiBench.sh >> java/rmi/reliability/benchmark/runSerialBench.sh >> sun/management/jmxremote/startstop/JMXStartStopTest.sh > You're right, this will cause conflict. > > In the case of JMXStartStopTest.sh and runSerialBench.sh then it might > be better to remove the -server. Agreed. I see no reason for specifying the vm. TESTVMOPTS will give us better coverage. > Stuart might have an opinion on runRmiBench.sh but one idea is to change > is so that when run interactively (TESTJAVA not set) then it works as it > does now and runs the benchmark twice. If TESTJAVA is not set then it > runs the benchmark once, with whatever VM options are in use. Sounds reasonable. -Chris. > > -Alan > > > From Lance.Andersen at oracle.com Mon Dec 10 11:49:18 2012 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Mon, 10 Dec 2012 06:49:18 -0500 Subject: Review needed: 8004374 : Fwd: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData In-Reply-To: <50C592E1.9050400@linux.vnet.ibm.com> References: <50C592E1.9050400@linux.vnet.ibm.com> Message-ID: Hi Frank, As I explained in one of my earlier emails, tests that require a database will not be added to jtreg. I have a unit test suite which i use for that but that is not external Best Lance On Dec 10, 2012, at 2:44 AM, Frank Ding wrote: > Hi Lance, > The code refactory looks good. By the way, the newly added unit test is not jtreg test case? > > Best regards, > Frank > > On 12/5/2012 4:38 AM, Lance Andersen - Oracle wrote: >> All, >> >> Attached is the patch for: 8004374 based off the issue that Frank reported. >> >> for http://cr.openjdk.java.net/~lancea/8004374/webrev.00/ >> >> The TCK, SQE and the JDBC Unit Tests run clean. I added a new Unit Test to validate the issue. >> >> Frank, I did not use your fix as I was able to clean the code up a bit more and get rid of more crud while addressing it. It is similar though. >> >> Best >> Lance >> >> >> >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> >> > -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From maurizio.cimadamore at oracle.com Mon Dec 10 12:31:47 2012 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Mon, 10 Dec 2012 12:31:47 +0000 Subject: hg: jdk8/tl/langtools: 8004094: Javac compiler error - synthetic method accessor generated with duplicate name Message-ID: <20121210123154.906744700B@hg.openjdk.java.net> Changeset: c78acf6c2f3e Author: mcimadamore Date: 2012-12-10 12:10 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/c78acf6c2f3e 8004094: Javac compiler error - synthetic method accessor generated with duplicate name Summary: method clash check logic should skip methods marked with ACC_SYNTHETIC Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/comp/Check.java + test/tools/javac/generics/8004094/B.java + test/tools/javac/generics/8004094/T8004094.java From Alan.Bateman at oracle.com Mon Dec 10 13:28:11 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 10 Dec 2012 13:28:11 +0000 Subject: RFR: 8001647: In-place methods on Collection/List In-Reply-To: <50C29B04.5070508@oracle.com> References: <50C29B04.5070508@oracle.com> Message-ID: <50C5E36B.2040005@oracle.com> On 08/12/2012 01:42, Akhil Arora wrote: > As part of the Library Lambdafication, this patch adds the following > default methods to Collections - > > Iterable.forEach(Block) > Collection.removeAll(Predicate) > List.sort(Comparator) > List.replaceAll(UnaryOperator) > > It also provides more efficient implementations of these methods for > ArrayList, Vector and CopyOnWriteArrayList. Please review. > > http://cr.openjdk.java.net/~akhil/8001647.1/webrev/ > > Thanks to the many people who have already contributed to this patch. > This may be bikeshed territory but we usually don't use the "public" modifier on methods defined by interfaces as they are public anyway. It seems inconsistent to me to have it on the default methods. Perhaps this has been discussed before, in which case ignore this. BTW: The only reason I'm bringing this up is because there are lots of default methods to come and it would be nice to establish a convention and consistency from the start. One small comment on ArrayList.removeAll is that it might be more efficient to keep a count of the number of elements to remove rather than using the cardinality method (to avoid the bit scan). For the supporting classes in testlibrary then is @library needed? (I haven't fully groked how jtreg supports TestNG so perhaps @library without specifying a location or JAR file has some meaning). -Alan. From david.lloyd at redhat.com Mon Dec 10 13:53:45 2012 From: david.lloyd at redhat.com (David M. Lloyd) Date: Mon, 10 Dec 2012 07:53:45 -0600 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C55F11.6020801@oracle.com> References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com> <50C0B490.7050005@redhat.com> <50C55F11.6020801@oracle.com> Message-ID: <50C5E969.5040602@redhat.com> On 12/09/2012 10:03 PM, David Holmes wrote: > Hi David, > > On 7/12/2012 1:06 AM, David M. Lloyd wrote: >> On 12/06/2012 05:35 AM, Alan Bateman wrote: >>> On 05/12/2012 11:59, David Holmes wrote: >>>> Java 7 introduced support for parallel classloading by adding to each >>>> class loader a ConcurrentHashMap, referenced through a new field, >>>> parallelLockMap. This contains a mapping from class names to Objects >>>> to use as a classloading lock for that class name. This scheme has a >>>> number of inefficiencies. To address this we propose for Java 8 the >>>> notion of a fully concurrent classloader ... >>>> >>>> This is a fairly simple proposal that I've written up as a blog entry: >>>> >>>> https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent >>>> >>>> >>>> >>> The jdk7 implementation is very unfortunate, it's a pity this wasn't >>> caught before 7 shipped. >>> >>> I think the proposal is good, it preserves compatibility, and if there >>> are loaders calling registerAsParallelCapable now (probably very few) >>> then it they may be able to change to using registerAsFullyConcurrent >>> without too much work. >>> >>> I am tempted to suggest that registerAsParallelCapable should be >>> deprecated too. >> >> I'm sorry I missed the original post, and I just want to add my >> wholehearted support for this idea. Our application server's class >> loader implementation can be configured (on certain JVMs) to run in a >> lock-free mode and we have seen good performance and memory footprint as >> a result on these particular JVMs. > > That sounds promising. Are you in a position to try out this proposal on > a testbed with your app server? Sure, I'd love to. What tree should I build? -- - DML From peter.levart at gmail.com Mon Dec 10 14:59:26 2012 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 10 Dec 2012 15:59:26 +0100 Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch In-Reply-To: <50C57EB0.1000202@oracle.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com> Message-ID: <50C5F8CE.3080006@gmail.com> On 12/10/2012 07:18 AM, David Holmes wrote: > Hi Peter, > > Sorry for the delay on this. Thank you for taking it into consideration. I can only imagine how busy you are with other things. > > Generally your VolatileData and my ReflectionHelper are doing a > similar job. But I agree with your reasoning that all of the cached > SoftReferences are likely to be cleared at once, and so a > SoftReference to a helper object with direct references, is more > effective than a direct reference to a helper object with > SoftReferences. My initial stance with this was very conservative as > the more change that is introduced the more uncertainty there is about > the impact. > > I say the above primarily because I think, if I am to proceed with > this, I will need to separate out the general reflection caching > changes from the annotation changes. > There are a number of reasons for this: > > First, I'm not at all familiar with the implementation of annotations > at the VM or Java level, and the recent changes in this area just > exacerbate my ignorance of the mechanics. So I don't feel qualified to > evaluate that aspect. > > Second, the bulk of the reflection caching code is simplified by the > fact that due to current constraints on class redefinition the caching > is effectively idempotent for fields/methods/constructors. But that is > not the case for annotations. I think that on the Class-level these two aspects can be separated. But not on the Field/Method/Constructor level, because annotations are referenced by Field/Method/Constructor objects and there is no invalidation logic - like on the Class-level - that would just invalidate the sets of annotations on Field/Method/Constructor, leaving Field/Method/Constructor objects still valid. So these two aspects are connected - it may be - I haven't looked at history yet - that invalidation of Field/Method/Constructor was introduced just because of annotations. Also, the following bug (currently not accessible): http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5002251 has references to docs that suggest that current class redefinition can introduce new methods, so If this is correct, then redefinition is not idempotent for basic reflection data. > > Finally, the use of synchronization with the annotations method is > perplexing me. I sent Joe a private email on this but I may as well > raise it here - and I think you have alluded to this in your earlier > emails as well: initAnnotationsIfNecessary() is a synchronized > instance method but I can not find any other code in the VM that > synchronizes on the Class object's monitor. So if this synchronization > is trying to establish consistency in the face of class redefinition, > I do not see where class redefinition is participating in the > synchronization! I think that the intent was merely synchronized access to / lazy initialization of cached 'annotations' and 'declaredAnnotations' Maps. Field[], Method[], Constructor[] arrays are published to other threads via volatile fields one field at a time, but initAnnotationsIfNecessary() was designed to publish two references ('annotations' and 'declaredAnnotations') atomically at the same time, so the author of the code choose to use synchronized block. I also have a feeling that this might have simply been the author's preferred style of synchronization, since the same approach is used also in Field/Method/Constructor/Executable although there's just one field of annotations that is published at a time. It is indicative that initAnnotationsIfNecessary() synchronized method also contains the call to clearCachesOnClassRedefinition(), so at first it seems that the synchronization is also meant to serialize access to invalidation logic which invalidates both Field/Method/Constructor and annotation fields, but that all falls-apart because clearCachesOnClassRedefinition() is also called from elsewhere, not guarded by the synchronization. So all in all the two aspects - annotations and basic reflection stuff - are quite intermingled in current code, unfortunately very inconsistently. I'm afraid that doing one thing and not touching the other is possible, but that would not solve the problems that this thread was starting to address (bottleneck by java.lang.Class.getAnnotations()) and evident dead-lock bugs. We can approach the problem so that we separate the aspects of caching Class-level annotations and Field/Method/Constructor arrays but using the same approach for both. And that would only make sense if there was a reason to separately cache Class-level annotations and Field/Method/Constructor arrays. I haven't yet been able to think of one such reason. So anyone with more insight (the author of annotations code?) is invited to participate in investigation. My approach of including the Class-level annotations together with Field/Method/Constructor arrays was guided by: - consistency - why should Class-level annotations be cached with hard references, while Field/Method/Constructor annotations are indirectly SoftReference(d)? Are they more important? - simplicity - space efficiency - correctness - unsynchronized calls to clearCachesOnClassRedefinition() followed by unsynchronized lazy initialization have - as I have shown - theoretical races that could result in caching the old versions of data instead of new. The approach I have chosen with the logic in getVolatileData() is a kind of MVCC rather than synchronization. But as said, the two aspects of caching can be separated. We can also leave the Class-level annotation aspect untouched by re-introducing the 'annotations' and 'declaredAnnotations' fields and also the 'lastRedefinedCount' field on the Class-level and re-introducing the synchronized initAnnotationsIfNecessary() method and a clearCachesOnClassRedefinition() which would just invalidate the two annotations fields. To recap. How to continue? a) as proposed; b) separate caching of annotations and Field/Method/Constructor arrays but with the same unblocking MVCC-like approach for both - with possible variation in that annotations be hardly referenced and Field/Method/Constructor arrays be softly; c) undo the annotations caching changes and only do MVCC for Field/Method/Constructor arrays. I can do b) but prepare two independent patches - one for VolatileData (rename it to MemberData?) and one for AnnotationData. So by applying only the first, we achieve c) and can later apply the second to upgrade to b). But it is unfortunately a) that is most efficient space-saving wise. What do you say about the trivial changes in Field/Method/Constructor/Executable to accommodate caching on the 'root' instance instead of on the copies? Regards, Peter > > So what I would like to do is take your basic VolatileData part of the > patch and run with it for JEP-149 purposes, while separating the > annotations issue so they can be dealt with by the experts in that > particular area. > > I'm sorry it has taken so long to arrive at a fairly negative > position, but I need someone else to take up the annotations gauntlet > and run with it. > > Thanks, > David > > On 3/12/2012 5:41 PM, Peter Levart wrote: >> Hi David, Alan, Alexander and others, >> >> In the meanwhile I have added another annotations space optimization to >> the patch. If a Class doesn't inherit any annotations from a superclass, >> which I think is a common case, it assigns the same Map instance to >> "annotations" as well as "declaredAnnotations" fields. Previously - and >> in the original code - this only happened for java.lang.Object and >> interfaces. >> >> Here's the updated webrev: >> >> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html >> >> I have also rewritten the performance micro-benchmarks. With the >> addition of repeating annotations, one performance aspect surfaces: when >> asking for a particular annotation type on a Class and that annotation >> is not present, the new repeating annotations support method >> AnnotationSupport.getOneAnnotation asks for @ContainedBy meta-annotation >> on the annotation type. This can result in an even more apparent >> synchronization hot-spot with original code that uses synchronized >> initAnnotationsIfNecessary(). This aspect is tested with the 3rd test. >> Other 2 tests test the same thing as before but are more stable now, >> since now they measure retrieval of 5 different annotation types from >> each AnnotatedElement, previously they only measured retrieval of 1 >> which was very sensitive to HashMap irregularities (it could happen that >> a particular key mapped to a bucket that was overloaded in one test-run >> and not in another)... >> >> Here're the new tests: >> >> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java >> >> >> And the corresponding results when run on an i7 CPU on Linux: >> >> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt >> >> >> >> Regards, Peter >> >> >> >> On 12/03/2012 02:15 AM, David Holmes wrote: >>> On 1/12/2012 4:54 AM, Alan Bateman wrote: >>>> On 30/11/2012 18:36, Peter Levart wrote: >>>>> : >>>>> >>>>> So, what do you think? What kind of tests should I prepare in >>>>> addidion >>>>> to those 3 so that the patch might get a consideration? >>>> I think this is good work and thanks for re-basing your patch. I know >>>> David plans to do a detail review. I think it will require extensive >>>> performance testing too, perhaps with some large applications. >>> >>> Indeed I do plan a detailed review and have initiated some initial >>> performance tests. >>> >>> I am also swamped but will try to get to the review this week - and >>> will also need to check the referenced annotations updates. >>> >>> David >>> >>>> -Alan >>>> >> From michael.x.mcmahon at oracle.com Mon Dec 10 15:06:03 2012 From: michael.x.mcmahon at oracle.com (michael.x.mcmahon at oracle.com) Date: Mon, 10 Dec 2012 15:06:03 +0000 Subject: hg: jdk8/tl/jdk: 8003948: NTLM/Negotiate authentication problem Message-ID: <20121210150632.D753A47015@hg.openjdk.java.net> Changeset: fda2b2b5b98b Author: michaelm Date: 2012-12-10 14:56 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/fda2b2b5b98b 8003948: NTLM/Negotiate authentication problem Reviewed-by: chegar, weijun ! src/share/classes/sun/net/www/MessageHeader.java ! src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java + test/sun/net/www/MessageHeaderTest.java From forax at univ-mlv.fr Mon Dec 10 15:10:56 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Mon, 10 Dec 2012 16:10:56 +0100 Subject: RFR: 8003246: Add Supplier to ThreadLocal In-Reply-To: <50C5BEA1.3080707@oracle.com> References: <50BFA2FC.4010201@oracle.com> <50C028DF.2030303@oracle.com> <50C055ED.1040602@univ-mlv.fr> <50C08253.9030904@cs.oswego.edu> <50C0CF83.1080208@oracle.com> <50C0D81A.5030607@cs.oswego.edu> <50C0DD49.4060900@oracle.com> <50C0E3F2.9030004@cs.oswego.edu> <50C0EBC9.2070101@univ-mlv.fr> <50C0F559.5090600@oracle.com> <1354831513.40215.YahooMailNeo@web132104.mail.ird.yahoo.com> <50C12DEC.9060006@univ-mlv.fr> <50C1FCD8.3030109@cs.oswego.edu> <50C20C90.6070200@oracle.com> <50C20F5A.8060900@univ-mlv.fr> <50C5BEA1.3080707@oracle.com> Message-ID: <50C5FB80.7090004@univ-mlv.fr> On 12/10/2012 11:51 AM, Chris Hegarty wrote: > > > On 07/12/2012 15:46, Remi Forax wrote: >> On 12/07/2012 04:34 PM, Chris Hegarty wrote: >>> I filed 8004707: "Remove superfluous access$000 methods in java.util", >>> to track this issue. I can file a separate issue for java.lang. >> >> yes, please do that. > > I filed 8004797: "Remove superfluous access$000 methods in java.lang" > > -Chris. thanks. R?mi From peter.levart at gmail.com Mon Dec 10 16:13:57 2012 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 10 Dec 2012 17:13:57 +0100 Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch In-Reply-To: <50C5F8CE.3080006@gmail.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com> <50C5F8CE.3080006@gmail.com> Message-ID: <50C60A45.9020807@gmail.com> Hi David, It would be informative to look at how java.lang.Class evolved during history. The oldest revision I can access is from 1st of Dec. 2007, which already contains Java 1.5 code (annotations) and is more or less unchanged until now. The most interesting changesets would be those that introduced annotations. Regards, Peter On 12/10/2012 03:59 PM, Peter Levart wrote: > On 12/10/2012 07:18 AM, David Holmes wrote: >> Hi Peter, >> >> Sorry for the delay on this. > > Thank you for taking it into consideration. I can only imagine how > busy you are with other things. > >> >> Generally your VolatileData and my ReflectionHelper are doing a >> similar job. But I agree with your reasoning that all of the cached >> SoftReferences are likely to be cleared at once, and so a >> SoftReference to a helper object with direct references, is more >> effective than a direct reference to a helper object with >> SoftReferences. My initial stance with this was very conservative as >> the more change that is introduced the more uncertainty there is >> about the impact. >> >> I say the above primarily because I think, if I am to proceed with >> this, I will need to separate out the general reflection caching >> changes from the annotation changes. There are a number of reasons >> for this: >> >> First, I'm not at all familiar with the implementation of annotations >> at the VM or Java level, and the recent changes in this area just >> exacerbate my ignorance of the mechanics. So I don't feel qualified >> to evaluate that aspect. >> >> Second, the bulk of the reflection caching code is simplified by the >> fact that due to current constraints on class redefinition the >> caching is effectively idempotent for fields/methods/constructors. >> But that is not the case for annotations. > > I think that on the Class-level these two aspects can be separated. > But not on the Field/Method/Constructor level, because annotations are > referenced by Field/Method/Constructor objects and there is no > invalidation logic - like on the Class-level - that would just > invalidate the sets of annotations on Field/Method/Constructor, > leaving Field/Method/Constructor objects still valid. So these two > aspects are connected - it may be - I haven't looked at history yet - > that invalidation of Field/Method/Constructor was introduced just > because of annotations. > > Also, the following bug (currently not accessible): > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5002251 has > references to docs that suggest that current class redefinition can > introduce new methods, so If this is correct, then redefinition is not > idempotent for basic reflection data. > >> >> Finally, the use of synchronization with the annotations method is >> perplexing me. I sent Joe a private email on this but I may as well >> raise it here - and I think you have alluded to this in your earlier >> emails as well: initAnnotationsIfNecessary() is a synchronized >> instance method but I can not find any other code in the VM that >> synchronizes on the Class object's monitor. So if this >> synchronization is trying to establish consistency in the face of >> class redefinition, I do not see where class redefinition is >> participating in the synchronization! > > I think that the intent was merely synchronized access to / lazy > initialization of cached 'annotations' and 'declaredAnnotations' Maps. > Field[], Method[], Constructor[] arrays are published to other threads > via volatile fields one field at a time, but > initAnnotationsIfNecessary() was designed to publish two references > ('annotations' and 'declaredAnnotations') atomically at the same time, > so the author of the code choose to use synchronized block. I also > have a feeling that this might have simply been the author's preferred > style of synchronization, since the same approach is used also in > Field/Method/Constructor/Executable although there's just one field of > annotations that is published at a time. > > It is indicative that initAnnotationsIfNecessary() synchronized method > also contains the call to clearCachesOnClassRedefinition(), so at > first it seems that the synchronization is also meant to serialize > access to invalidation logic which invalidates both > Field/Method/Constructor and annotation fields, but that all > falls-apart because clearCachesOnClassRedefinition() is also called > from elsewhere, not guarded by the synchronization. > > So all in all the two aspects - annotations and basic reflection stuff > - are quite intermingled in current code, unfortunately very > inconsistently. I'm afraid that doing one thing and not touching the > other is possible, but that would not solve the problems that this > thread was starting to address (bottleneck by > java.lang.Class.getAnnotations()) and evident dead-lock bugs. > > We can approach the problem so that we separate the aspects of caching > Class-level annotations and Field/Method/Constructor arrays but using > the same approach for both. And that would only make sense if there > was a reason to separately cache Class-level annotations and > Field/Method/Constructor arrays. I haven't yet been able to think of > one such reason. So anyone with more insight (the author of > annotations code?) is invited to participate in investigation. > > My approach of including the Class-level annotations together with > Field/Method/Constructor arrays was guided by: > - consistency - why should Class-level annotations be cached with hard > references, while Field/Method/Constructor annotations are indirectly > SoftReference(d)? Are they more important? > - simplicity > - space efficiency > - correctness - unsynchronized calls to > clearCachesOnClassRedefinition() followed by unsynchronized lazy > initialization have - as I have shown - theoretical races that could > result in caching the old versions of data instead of new. The > approach I have chosen with the logic in getVolatileData() is a kind > of MVCC rather than synchronization. > > But as said, the two aspects of caching can be separated. > > We can also leave the Class-level annotation aspect untouched by > re-introducing the 'annotations' and 'declaredAnnotations' fields and > also the 'lastRedefinedCount' field on the Class-level and > re-introducing the synchronized initAnnotationsIfNecessary() method > and a clearCachesOnClassRedefinition() which would just invalidate the > two annotations fields. > > To recap. How to continue? > a) as proposed; > b) separate caching of annotations and Field/Method/Constructor arrays > but with the same unblocking MVCC-like approach for both - with > possible variation in that annotations be hardly referenced and > Field/Method/Constructor arrays be softly; > c) undo the annotations caching changes and only do MVCC for > Field/Method/Constructor arrays. > > I can do b) but prepare two independent patches - one for VolatileData > (rename it to MemberData?) and one for AnnotationData. So by applying > only the first, we achieve c) and can later apply the second to > upgrade to b). But it is unfortunately a) that is most efficient > space-saving wise. > > What do you say about the trivial changes in > Field/Method/Constructor/Executable to accommodate caching on the > 'root' instance instead of on the copies? > > Regards, Peter > >> >> So what I would like to do is take your basic VolatileData part of >> the patch and run with it for JEP-149 purposes, while separating the >> annotations issue so they can be dealt with by the experts in that >> particular area. >> >> I'm sorry it has taken so long to arrive at a fairly negative >> position, but I need someone else to take up the annotations gauntlet >> and run with it. >> >> Thanks, >> David >> >> On 3/12/2012 5:41 PM, Peter Levart wrote: >>> Hi David, Alan, Alexander and others, >>> >>> In the meanwhile I have added another annotations space optimization to >>> the patch. If a Class doesn't inherit any annotations from a >>> superclass, >>> which I think is a common case, it assigns the same Map instance to >>> "annotations" as well as "declaredAnnotations" fields. Previously - and >>> in the original code - this only happened for java.lang.Object and >>> interfaces. >>> >>> Here's the updated webrev: >>> >>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html >>> >>> I have also rewritten the performance micro-benchmarks. With the >>> addition of repeating annotations, one performance aspect surfaces: >>> when >>> asking for a particular annotation type on a Class and that annotation >>> is not present, the new repeating annotations support method >>> AnnotationSupport.getOneAnnotation asks for @ContainedBy >>> meta-annotation >>> on the annotation type. This can result in an even more apparent >>> synchronization hot-spot with original code that uses synchronized >>> initAnnotationsIfNecessary(). This aspect is tested with the 3rd test. >>> Other 2 tests test the same thing as before but are more stable now, >>> since now they measure retrieval of 5 different annotation types from >>> each AnnotatedElement, previously they only measured retrieval of 1 >>> which was very sensitive to HashMap irregularities (it could happen >>> that >>> a particular key mapped to a bucket that was overloaded in one test-run >>> and not in another)... >>> >>> Here're the new tests: >>> >>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java >>> >>> >>> And the corresponding results when run on an i7 CPU on Linux: >>> >>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt >>> >>> >>> >>> Regards, Peter >>> >>> >>> >>> On 12/03/2012 02:15 AM, David Holmes wrote: >>>> On 1/12/2012 4:54 AM, Alan Bateman wrote: >>>>> On 30/11/2012 18:36, Peter Levart wrote: >>>>>> : >>>>>> >>>>>> So, what do you think? What kind of tests should I prepare in >>>>>> addidion >>>>>> to those 3 so that the patch might get a consideration? >>>>> I think this is good work and thanks for re-basing your patch. I know >>>>> David plans to do a detail review. I think it will require extensive >>>>> performance testing too, perhaps with some large applications. >>>> >>>> Indeed I do plan a detailed review and have initiated some initial >>>> performance tests. >>>> >>>> I am also swamped but will try to get to the review this week - and >>>> will also need to check the referenced annotations updates. >>>> >>>> David >>>> >>>>> -Alan >>>>> >>> > From peter.levart at gmail.com Mon Dec 10 16:41:07 2012 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 10 Dec 2012 17:41:07 +0100 Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch In-Reply-To: <50C60A45.9020807@gmail.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com> <50C5F8CE.3080006@gmail.com> <50C60A45.9020807@gmail.com> Message-ID: <50C610A3.7020704@gmail.com> Ok, I've got it. Downloaded j2sdk1.4_19 and unpacked src.zip ... There are SoftReferences for individual Field/Method/Constructor arrays: // Caches for certain reflective results private static boolean useCaches = true; private volatile transient SoftReference declaredFields; private volatile transient SoftReference publicFields; private volatile transient SoftReference declaredMethods; private volatile transient SoftReference publicMethods; private volatile transient SoftReference declaredConstructors; private volatile transient SoftReference publicConstructors; // Intermediate results for getFields and getMethods private volatile transient SoftReference declaredPublicFields; private volatile transient SoftReference declaredPublicMethods; ...but there's no mechanism yet for invalidation. So my assumption that invalidation was introduced just because of annotations might be correct. Annotations were just glued on top of the existing unchanged structures. Regards, Peter P.S. I've got an Idea how to approach another variant where Class-level annotations would still be directly referenced from the Class instance and Field/Method/Constructor arrays would hang off a single SoftReference in a way that would have same space efficiency that my current integrated approach. The idea is to subclass the SoftReference and have the additional fields on it: static class VolatileData extends SoftReference { volatile Map annotations, declaredAnnotations; final int redefinedCount; } ...and MemberData only containing volatile Fileld[], Method[], Constructor[] fields... I also know how to correctly synchronize access to this structure so that annotations are not invalidated when SoftReference is cleared. Let this be variant a2). I rest now and wait for your pointers. Regards, Peter On 12/10/2012 05:13 PM, Peter Levart wrote: > Hi David, > > It would be informative to look at how java.lang.Class evolved during > history. The oldest revision I can access is from 1st of Dec. 2007, > which already contains Java 1.5 code (annotations) and is more or less > unchanged until now. The most interesting changesets would be those > that introduced annotations. > > Regards, Peter > > > On 12/10/2012 03:59 PM, Peter Levart wrote: >> On 12/10/2012 07:18 AM, David Holmes wrote: >>> Hi Peter, >>> >>> Sorry for the delay on this. >> >> Thank you for taking it into consideration. I can only imagine how >> busy you are with other things. >> >>> >>> Generally your VolatileData and my ReflectionHelper are doing a >>> similar job. But I agree with your reasoning that all of the cached >>> SoftReferences are likely to be cleared at once, and so a >>> SoftReference to a helper object with direct references, is more >>> effective than a direct reference to a helper object with >>> SoftReferences. My initial stance with this was very conservative as >>> the more change that is introduced the more uncertainty there is >>> about the impact. >>> >>> I say the above primarily because I think, if I am to proceed with >>> this, I will need to separate out the general reflection caching >>> changes from the annotation changes. There are a number of reasons >>> for this: >>> >>> First, I'm not at all familiar with the implementation of >>> annotations at the VM or Java level, and the recent changes in this >>> area just exacerbate my ignorance of the mechanics. So I don't feel >>> qualified to evaluate that aspect. >>> >>> Second, the bulk of the reflection caching code is simplified by the >>> fact that due to current constraints on class redefinition the >>> caching is effectively idempotent for fields/methods/constructors. >>> But that is not the case for annotations. >> >> I think that on the Class-level these two aspects can be separated. >> But not on the Field/Method/Constructor level, because annotations >> are referenced by Field/Method/Constructor objects and there is no >> invalidation logic - like on the Class-level - that would just >> invalidate the sets of annotations on Field/Method/Constructor, >> leaving Field/Method/Constructor objects still valid. So these two >> aspects are connected - it may be - I haven't looked at history yet - >> that invalidation of Field/Method/Constructor was introduced just >> because of annotations. >> >> Also, the following bug (currently not accessible): >> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5002251 has >> references to docs that suggest that current class redefinition can >> introduce new methods, so If this is correct, then redefinition is >> not idempotent for basic reflection data. >> >>> >>> Finally, the use of synchronization with the annotations method is >>> perplexing me. I sent Joe a private email on this but I may as well >>> raise it here - and I think you have alluded to this in your earlier >>> emails as well: initAnnotationsIfNecessary() is a synchronized >>> instance method but I can not find any other code in the VM that >>> synchronizes on the Class object's monitor. So if this >>> synchronization is trying to establish consistency in the face of >>> class redefinition, I do not see where class redefinition is >>> participating in the synchronization! >> >> I think that the intent was merely synchronized access to / lazy >> initialization of cached 'annotations' and 'declaredAnnotations' >> Maps. Field[], Method[], Constructor[] arrays are published to other >> threads via volatile fields one field at a time, but >> initAnnotationsIfNecessary() was designed to publish two references >> ('annotations' and 'declaredAnnotations') atomically at the same >> time, so the author of the code choose to use synchronized block. I >> also have a feeling that this might have simply been the author's >> preferred style of synchronization, since the same approach is used >> also in Field/Method/Constructor/Executable although there's just one >> field of annotations that is published at a time. >> >> It is indicative that initAnnotationsIfNecessary() synchronized >> method also contains the call to clearCachesOnClassRedefinition(), so >> at first it seems that the synchronization is also meant to serialize >> access to invalidation logic which invalidates both >> Field/Method/Constructor and annotation fields, but that all >> falls-apart because clearCachesOnClassRedefinition() is also called >> from elsewhere, not guarded by the synchronization. >> >> So all in all the two aspects - annotations and basic reflection >> stuff - are quite intermingled in current code, unfortunately very >> inconsistently. I'm afraid that doing one thing and not touching the >> other is possible, but that would not solve the problems that this >> thread was starting to address (bottleneck by >> java.lang.Class.getAnnotations()) and evident dead-lock bugs. >> >> We can approach the problem so that we separate the aspects of >> caching Class-level annotations and Field/Method/Constructor arrays >> but using the same approach for both. And that would only make sense >> if there was a reason to separately cache Class-level annotations and >> Field/Method/Constructor arrays. I haven't yet been able to think of >> one such reason. So anyone with more insight (the author of >> annotations code?) is invited to participate in investigation. >> >> My approach of including the Class-level annotations together with >> Field/Method/Constructor arrays was guided by: >> - consistency - why should Class-level annotations be cached with >> hard references, while Field/Method/Constructor annotations are >> indirectly SoftReference(d)? Are they more important? >> - simplicity >> - space efficiency >> - correctness - unsynchronized calls to >> clearCachesOnClassRedefinition() followed by unsynchronized lazy >> initialization have - as I have shown - theoretical races that could >> result in caching the old versions of data instead of new. The >> approach I have chosen with the logic in getVolatileData() is a kind >> of MVCC rather than synchronization. >> >> But as said, the two aspects of caching can be separated. >> >> We can also leave the Class-level annotation aspect untouched by >> re-introducing the 'annotations' and 'declaredAnnotations' fields and >> also the 'lastRedefinedCount' field on the Class-level and >> re-introducing the synchronized initAnnotationsIfNecessary() method >> and a clearCachesOnClassRedefinition() which would just invalidate >> the two annotations fields. >> >> To recap. How to continue? >> a) as proposed; >> b) separate caching of annotations and Field/Method/Constructor >> arrays but with the same unblocking MVCC-like approach for both - >> with possible variation in that annotations be hardly referenced and >> Field/Method/Constructor arrays be softly; >> c) undo the annotations caching changes and only do MVCC for >> Field/Method/Constructor arrays. >> >> I can do b) but prepare two independent patches - one for >> VolatileData (rename it to MemberData?) and one for AnnotationData. >> So by applying only the first, we achieve c) and can later apply the >> second to upgrade to b). But it is unfortunately a) that is most >> efficient space-saving wise. >> >> What do you say about the trivial changes in >> Field/Method/Constructor/Executable to accommodate caching on the >> 'root' instance instead of on the copies? >> >> Regards, Peter >> >>> >>> So what I would like to do is take your basic VolatileData part of >>> the patch and run with it for JEP-149 purposes, while separating the >>> annotations issue so they can be dealt with by the experts in that >>> particular area. >>> >>> I'm sorry it has taken so long to arrive at a fairly negative >>> position, but I need someone else to take up the annotations >>> gauntlet and run with it. >>> >>> Thanks, >>> David >>> >>> On 3/12/2012 5:41 PM, Peter Levart wrote: >>>> Hi David, Alan, Alexander and others, >>>> >>>> In the meanwhile I have added another annotations space >>>> optimization to >>>> the patch. If a Class doesn't inherit any annotations from a >>>> superclass, >>>> which I think is a common case, it assigns the same Map instance to >>>> "annotations" as well as "declaredAnnotations" fields. Previously - >>>> and >>>> in the original code - this only happened for java.lang.Object and >>>> interfaces. >>>> >>>> Here's the updated webrev: >>>> >>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html >>>> >>>> I have also rewritten the performance micro-benchmarks. With the >>>> addition of repeating annotations, one performance aspect surfaces: >>>> when >>>> asking for a particular annotation type on a Class and that annotation >>>> is not present, the new repeating annotations support method >>>> AnnotationSupport.getOneAnnotation asks for @ContainedBy >>>> meta-annotation >>>> on the annotation type. This can result in an even more apparent >>>> synchronization hot-spot with original code that uses synchronized >>>> initAnnotationsIfNecessary(). This aspect is tested with the 3rd test. >>>> Other 2 tests test the same thing as before but are more stable now, >>>> since now they measure retrieval of 5 different annotation types from >>>> each AnnotatedElement, previously they only measured retrieval of 1 >>>> which was very sensitive to HashMap irregularities (it could happen >>>> that >>>> a particular key mapped to a bucket that was overloaded in one >>>> test-run >>>> and not in another)... >>>> >>>> Here're the new tests: >>>> >>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java >>>> >>>> >>>> And the corresponding results when run on an i7 CPU on Linux: >>>> >>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt >>>> >>>> >>>> >>>> Regards, Peter >>>> >>>> >>>> >>>> On 12/03/2012 02:15 AM, David Holmes wrote: >>>>> On 1/12/2012 4:54 AM, Alan Bateman wrote: >>>>>> On 30/11/2012 18:36, Peter Levart wrote: >>>>>>> : >>>>>>> >>>>>>> So, what do you think? What kind of tests should I prepare in >>>>>>> addidion >>>>>>> to those 3 so that the patch might get a consideration? >>>>>> I think this is good work and thanks for re-basing your patch. I >>>>>> know >>>>>> David plans to do a detail review. I think it will require extensive >>>>>> performance testing too, perhaps with some large applications. >>>>> >>>>> Indeed I do plan a detailed review and have initiated some initial >>>>> performance tests. >>>>> >>>>> I am also swamped but will try to get to the review this week - and >>>>> will also need to check the referenced annotations updates. >>>>> >>>>> David >>>>> >>>>>> -Alan >>>>>> >>>> >> > From chris.hegarty at oracle.com Mon Dec 10 16:59:10 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Mon, 10 Dec 2012 16:59:10 +0000 Subject: Request for review: 8000525: Java.net.httpcookie api does not support 2-digit year format In-Reply-To: <50C10BE2.5070006@oracle.com> References: <50C10BE2.5070006@oracle.com> Message-ID: <50C614DE.6090208@oracle.com> Shouldn't 'cal.set(1970, 0, 1, 0, 0, 0)' be inside the for loop? The test can simply throw Exception, rather can catching. Otherwise, looks fine to me. -Crhis. On 06/12/2012 21:19, Rob McKenna wrote: > Hi folks, > > According to HttpCookie.java: > > """ > There are 3 http cookie specifications: > > Netscape draft > RFC 2109 -/http://www.ietf.org/rfc/rfc2109.txt/ > RFC 2965 -/http://www.ietf.org/rfc/rfc2965.txt/ > > HttpCookie class can accept all these 3 forms of syntax. > """ > > According to http://www.ietf.org/rfc/rfc2109.txt section 10.1.2: > > """ > Netscape's original proposal defined an Expires header that took a date > value in a fixed-length variant format in place of Max-Age: Wdy, > DD-Mon-YY HH:MM:SS GMT > """ > > Thats in the "Historical" section provided to allow for compatibility > with Netscape's implementation, which we also support: (as per > http://docs.oracle.com/javase/6/docs/api/java/net/HttpCookie.html ) > > While we don't support the rfc explicitly, this change follows the > format specified in section 5.1.1 of rfc 6265: > > """ > 3. If the year-value is greater than or equal to 70 and less than or > equal to 99, increment the year-value by 1900. > 4. If the year-value is greater than or equal to 0 and less than or > equal to 69, increment the year-value by 2000. > 1. NOTE: Some existing user agents interpret two-digit years differently. > """ > > The webrev is at: > > http://cr.openjdk.java.net/~robm/8000525/webrev.01/ > > > Note: The addition of setLenient(false) has required changes to two > existing testcases. > > -Rob From daniel.fuchs at oracle.com Mon Dec 10 17:12:59 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Mon, 10 Dec 2012 18:12:59 +0100 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C23755.5030503@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50C06DAC.5050500@oracle.com> <50C0D805.5030509@oracle.com> <50C1A31D.1090805@oracle.com> <50C1EB41.2010502@oracle.com> <50C207F9.5060307@oracle.com> <50C21A2C.8070503@oracle.com> <50C23755.5030503@oracle.com> Message-ID: <50C6181B.70005@oracle.com> Hi, After further discussion with Joe & Alan, I changed the call to ServiceLoader to simply return the first provider it finds, or null. This is closer to what was present in JDK 7 - and looping is not necessary in JDK 8 since the default implementation is not returned as a service provider. So here is a new - and hopefully simpler webrev: best regards, -- daniel On 12/7/12 7:37 PM, Mandy Chung wrote: > On 12/7/12 8:32 AM, Alan Bateman wrote: >> On 07/12/2012 15:15, Daniel Fuchs wrote: >>> Hi Alan, >>> >>> I have updated the webrev according to your suggestion. I think it makes >>> things much clearer. >>> >>> The new version is there: >>> >>> >>> >> This looks good to me except that "implementation system default" >> should be "system-default implementation". >> > Looks good to me too with the change to "system-default implementation". > > Mandy > From huizhe.wang at oracle.com Mon Dec 10 17:26:35 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Mon, 10 Dec 2012 09:26:35 -0800 Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present In-Reply-To: <50C27DBA.3050808@oracle.com> References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com> <50C27AC1.2050600@oracle.com> <50C27DBA.3050808@oracle.com> Message-ID: <50C61B4B.1080901@oracle.com> On 12/7/2012 3:37 PM, Mandy Chung wrote: > On 12/7/12 3:24 PM, Joe Wang wrote: >> Thanks for reviewing the changes. Please see comments inline. >> >> On 12/7/2012 11:38 AM, Mandy Chung wrote: >>> On 12/5/12 10:58 AM, Alan Bateman wrote: >>>> http://cr.openjdk.java.net/~alanb/8004371/webrev/ >>>> >>> >>> Yay! Properties no longer requires JAXP to be present in order to >>> load/store properties in XML format. This looks okay to me. Some >>> minor comments: >>> >>> XMLStreamWriterImpl.isEncodingSupported - it returns true if any >>> string != "UTF-32" that assumes the given encoding is one of the few >>> known values. Would it be better to check the explicit list of >>> supported encoding? >>> private boolean isEncodingSupported(String encoding) { >>> if (encoding.equalsIgnoreCase("UTF-32")) { >>> return false; >>> } >>> return true; >>> } >> >> The spec only requires UTF-8 and 16. But the writer can actually >> handle most of the encodings. An explicit list would be quite long >> and require comprehensive tests. Since the ukit parser explicitly >> rejects UTF-32, I chose to do the same. Other than that, the >> XMLWriter leaves it to java.nio.charset.Charset to determine if a >> specified encoding is supported through this call: >> try { >> cs = Charset.forName(encoding); >> } catch (IllegalCharsetNameException | >> UnsupportedCharsetException ex) { >> throw new XMLStreamException(new >> UnsupportedEncodingException(encoding)); >> } > > OK - you leave it for XMLWriter to check if it's a valid encoding. It > may be better to include Charset.forName check in the > isEncodingSupporting method that would avoid confusion. Sure. Will move this code into isEncodingSupported and change the method name to getCharset so that it'd return the charset if the encoding is not UTF32 and supported by the jdk. > >>> >>> PropertiesDefaultHandler.java L115-116: can be replaced with >>> Properties.stringPropertyNames() and foreach. >> >> Done. Will send update to Alan. >> >>> >>> XMLStreamWriterImpl.java L156 - since the caller needs to unwrap >>> XMLStreamException to determine if the encoding is supported or not, >>> maybe better to throw this constructor to throw >>> UnsupportedEncodingException. >> >> The writer implements partially the original StAX API. So I tried >> not to change the writer API. But java.util.Properties expect >> UnsupportedEncodingException in case of invalid encoding, thus the >> compromise. >> > OK - PropertiesDefaultHandler uses the XMLStreamWriter API. That's > fine with me. Thanks, Joe > > Thanks > Mandy From huizhe.wang at oracle.com Mon Dec 10 17:47:46 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Mon, 10 Dec 2012 09:47:46 -0800 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C6181B.70005@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50C06DAC.5050500@oracle.com> <50C0D805.5030509@oracle.com> <50C1A31D.1090805@oracle.com> <50C1EB41.2010502@oracle.com> <50C207F9.5060307@oracle.com> <50C21A2C.8070503@oracle.com> <50C23755.5030503@oracle.com> <50C6181B.70005@oracle.com> Message-ID: <50C62042.4000600@oracle.com> Hi Daniel, Looks good! Joe On 12/10/2012 9:12 AM, Daniel Fuchs wrote: > Hi, > > After further discussion with Joe & Alan, I changed the call > to ServiceLoader to simply return the first provider it finds, > or null. > > This is closer to what was present in JDK 7 - and looping is > not necessary in JDK 8 since the default implementation is > not returned as a service provider. > > So here is a new - and hopefully simpler webrev: > > > > > best regards, > > -- daniel > > On 12/7/12 7:37 PM, Mandy Chung wrote: >> On 12/7/12 8:32 AM, Alan Bateman wrote: >>> On 07/12/2012 15:15, Daniel Fuchs wrote: >>>> Hi Alan, >>>> >>>> I have updated the webrev according to your suggestion. I think it >>>> makes >>>> things much clearer. >>>> >>>> The new version is there: >>>> >>>> >>>> >>>> >>> This looks good to me except that "implementation system default" >>> should be "system-default implementation". >>> >> Looks good to me too with the change to "system-default >> implementation". >> >> Mandy >> > From joe.darcy at oracle.com Mon Dec 10 20:52:57 2012 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 10 Dec 2012 12:52:57 -0800 Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch In-Reply-To: <50C60A45.9020807@gmail.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com> <50C5F8CE.3080006@gmail.com> <50C60A45.9020807@gmail.com> Message-ID: <50C64BA9.1090500@oracle.com> Yes; the OpenJDK sources only go back to circa 2007, which was part-way into the JDK 7 release. The exact changesets of how annotations were added back in JDK 5 are not available publicly. However, the final results of that process may be mostly visible in the src.zip from JDK 5. HTH, -Joe On 12/10/2012 8:13 AM, Peter Levart wrote: > Hi David, > > It would be informative to look at how java.lang.Class evolved during > history. The oldest revision I can access is from 1st of Dec. 2007, > which already contains Java 1.5 code (annotations) and is more or less > unchanged until now. The most interesting changesets would be those > that introduced annotations. > > Regards, Peter > > > On 12/10/2012 03:59 PM, Peter Levart wrote: >> On 12/10/2012 07:18 AM, David Holmes wrote: >>> Hi Peter, >>> >>> Sorry for the delay on this. >> >> Thank you for taking it into consideration. I can only imagine how >> busy you are with other things. >> >>> >>> Generally your VolatileData and my ReflectionHelper are doing a >>> similar job. But I agree with your reasoning that all of the cached >>> SoftReferences are likely to be cleared at once, and so a >>> SoftReference to a helper object with direct references, is more >>> effective than a direct reference to a helper object with >>> SoftReferences. My initial stance with this was very conservative as >>> the more change that is introduced the more uncertainty there is >>> about the impact. >>> >>> I say the above primarily because I think, if I am to proceed with >>> this, I will need to separate out the general reflection caching >>> changes from the annotation changes. There are a number of reasons >>> for this: >>> >>> First, I'm not at all familiar with the implementation of >>> annotations at the VM or Java level, and the recent changes in this >>> area just exacerbate my ignorance of the mechanics. So I don't feel >>> qualified to evaluate that aspect. >>> >>> Second, the bulk of the reflection caching code is simplified by the >>> fact that due to current constraints on class redefinition the >>> caching is effectively idempotent for fields/methods/constructors. >>> But that is not the case for annotations. >> >> I think that on the Class-level these two aspects can be separated. >> But not on the Field/Method/Constructor level, because annotations >> are referenced by Field/Method/Constructor objects and there is no >> invalidation logic - like on the Class-level - that would just >> invalidate the sets of annotations on Field/Method/Constructor, >> leaving Field/Method/Constructor objects still valid. So these two >> aspects are connected - it may be - I haven't looked at history yet - >> that invalidation of Field/Method/Constructor was introduced just >> because of annotations. >> >> Also, the following bug (currently not accessible): >> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5002251 has >> references to docs that suggest that current class redefinition can >> introduce new methods, so If this is correct, then redefinition is >> not idempotent for basic reflection data. >> >>> >>> Finally, the use of synchronization with the annotations method is >>> perplexing me. I sent Joe a private email on this but I may as well >>> raise it here - and I think you have alluded to this in your earlier >>> emails as well: initAnnotationsIfNecessary() is a synchronized >>> instance method but I can not find any other code in the VM that >>> synchronizes on the Class object's monitor. So if this >>> synchronization is trying to establish consistency in the face of >>> class redefinition, I do not see where class redefinition is >>> participating in the synchronization! >> >> I think that the intent was merely synchronized access to / lazy >> initialization of cached 'annotations' and 'declaredAnnotations' >> Maps. Field[], Method[], Constructor[] arrays are published to other >> threads via volatile fields one field at a time, but >> initAnnotationsIfNecessary() was designed to publish two references >> ('annotations' and 'declaredAnnotations') atomically at the same >> time, so the author of the code choose to use synchronized block. I >> also have a feeling that this might have simply been the author's >> preferred style of synchronization, since the same approach is used >> also in Field/Method/Constructor/Executable although there's just one >> field of annotations that is published at a time. >> >> It is indicative that initAnnotationsIfNecessary() synchronized >> method also contains the call to clearCachesOnClassRedefinition(), so >> at first it seems that the synchronization is also meant to serialize >> access to invalidation logic which invalidates both >> Field/Method/Constructor and annotation fields, but that all >> falls-apart because clearCachesOnClassRedefinition() is also called >> from elsewhere, not guarded by the synchronization. >> >> So all in all the two aspects - annotations and basic reflection >> stuff - are quite intermingled in current code, unfortunately very >> inconsistently. I'm afraid that doing one thing and not touching the >> other is possible, but that would not solve the problems that this >> thread was starting to address (bottleneck by >> java.lang.Class.getAnnotations()) and evident dead-lock bugs. >> >> We can approach the problem so that we separate the aspects of >> caching Class-level annotations and Field/Method/Constructor arrays >> but using the same approach for both. And that would only make sense >> if there was a reason to separately cache Class-level annotations and >> Field/Method/Constructor arrays. I haven't yet been able to think of >> one such reason. So anyone with more insight (the author of >> annotations code?) is invited to participate in investigation. >> >> My approach of including the Class-level annotations together with >> Field/Method/Constructor arrays was guided by: >> - consistency - why should Class-level annotations be cached with >> hard references, while Field/Method/Constructor annotations are >> indirectly SoftReference(d)? Are they more important? >> - simplicity >> - space efficiency >> - correctness - unsynchronized calls to >> clearCachesOnClassRedefinition() followed by unsynchronized lazy >> initialization have - as I have shown - theoretical races that could >> result in caching the old versions of data instead of new. The >> approach I have chosen with the logic in getVolatileData() is a kind >> of MVCC rather than synchronization. >> >> But as said, the two aspects of caching can be separated. >> >> We can also leave the Class-level annotation aspect untouched by >> re-introducing the 'annotations' and 'declaredAnnotations' fields and >> also the 'lastRedefinedCount' field on the Class-level and >> re-introducing the synchronized initAnnotationsIfNecessary() method >> and a clearCachesOnClassRedefinition() which would just invalidate >> the two annotations fields. >> >> To recap. How to continue? >> a) as proposed; >> b) separate caching of annotations and Field/Method/Constructor >> arrays but with the same unblocking MVCC-like approach for both - >> with possible variation in that annotations be hardly referenced and >> Field/Method/Constructor arrays be softly; >> c) undo the annotations caching changes and only do MVCC for >> Field/Method/Constructor arrays. >> >> I can do b) but prepare two independent patches - one for >> VolatileData (rename it to MemberData?) and one for AnnotationData. >> So by applying only the first, we achieve c) and can later apply the >> second to upgrade to b). But it is unfortunately a) that is most >> efficient space-saving wise. >> >> What do you say about the trivial changes in >> Field/Method/Constructor/Executable to accommodate caching on the >> 'root' instance instead of on the copies? >> >> Regards, Peter >> >>> >>> So what I would like to do is take your basic VolatileData part of >>> the patch and run with it for JEP-149 purposes, while separating the >>> annotations issue so they can be dealt with by the experts in that >>> particular area. >>> >>> I'm sorry it has taken so long to arrive at a fairly negative >>> position, but I need someone else to take up the annotations >>> gauntlet and run with it. >>> >>> Thanks, >>> David >>> >>> On 3/12/2012 5:41 PM, Peter Levart wrote: >>>> Hi David, Alan, Alexander and others, >>>> >>>> In the meanwhile I have added another annotations space >>>> optimization to >>>> the patch. If a Class doesn't inherit any annotations from a >>>> superclass, >>>> which I think is a common case, it assigns the same Map instance to >>>> "annotations" as well as "declaredAnnotations" fields. Previously - >>>> and >>>> in the original code - this only happened for java.lang.Object and >>>> interfaces. >>>> >>>> Here's the updated webrev: >>>> >>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html >>>> >>>> I have also rewritten the performance micro-benchmarks. With the >>>> addition of repeating annotations, one performance aspect surfaces: >>>> when >>>> asking for a particular annotation type on a Class and that annotation >>>> is not present, the new repeating annotations support method >>>> AnnotationSupport.getOneAnnotation asks for @ContainedBy >>>> meta-annotation >>>> on the annotation type. This can result in an even more apparent >>>> synchronization hot-spot with original code that uses synchronized >>>> initAnnotationsIfNecessary(). This aspect is tested with the 3rd test. >>>> Other 2 tests test the same thing as before but are more stable now, >>>> since now they measure retrieval of 5 different annotation types from >>>> each AnnotatedElement, previously they only measured retrieval of 1 >>>> which was very sensitive to HashMap irregularities (it could happen >>>> that >>>> a particular key mapped to a bucket that was overloaded in one >>>> test-run >>>> and not in another)... >>>> >>>> Here're the new tests: >>>> >>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java >>>> >>>> >>>> And the corresponding results when run on an i7 CPU on Linux: >>>> >>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt >>>> >>>> >>>> >>>> Regards, Peter >>>> >>>> >>>> >>>> On 12/03/2012 02:15 AM, David Holmes wrote: >>>>> On 1/12/2012 4:54 AM, Alan Bateman wrote: >>>>>> On 30/11/2012 18:36, Peter Levart wrote: >>>>>>> : >>>>>>> >>>>>>> So, what do you think? What kind of tests should I prepare in >>>>>>> addidion >>>>>>> to those 3 so that the patch might get a consideration? >>>>>> I think this is good work and thanks for re-basing your patch. I >>>>>> know >>>>>> David plans to do a detail review. I think it will require extensive >>>>>> performance testing too, perhaps with some large applications. >>>>> >>>>> Indeed I do plan a detailed review and have initiated some initial >>>>> performance tests. >>>>> >>>>> I am also swamped but will try to get to the review this week - and >>>>> will also need to check the referenced annotations updates. >>>>> >>>>> David >>>>> >>>>>> -Alan >>>>>> >>>> >> > From akhil.arora at oracle.com Mon Dec 10 21:48:25 2012 From: akhil.arora at oracle.com (Akhil Arora) Date: Mon, 10 Dec 2012 13:48:25 -0800 Subject: RFR: 8001647: In-place methods on Collection/List In-Reply-To: <50C34AAE.4498.1080E1A4@v.a.ammodytes.googlemail.com> References: <50C34AAE.4498.1080E1A4@v.a.ammodytes.googlemail.com> Message-ID: <50C658A9.30607@oracle.com> Updated with yours and Alan's comments - http://cr.openjdk.java.net/~akhil/8001647.2/webrev/ - removed null check for removeSet - cache this.size in removeAll, replaceAll (for ArrayList, Vector and CopyOnWriteArrayList) - calculate removeCount instead of BitCount.cardinality() - removed unnecessary @library from test support classes Catching IndexOOB and throwing CME in forEach/removeAll/replaceAll seems unecessary... did you have a use-case in mind where an IndexOOB can occur with these methods? Thanks On 12/08/2012 05:11 AM, Arne Siegel wrote: > ArrayList.java, line 1171: > final boolean anyToRemove = (removeSet != null) && !removeSet.isEmpty(); > As removeSet will never be null, this line can be simplified. This is a left-over from the > preceding implementation (see b67). > > ArrayList.java, method forEach optimizes the loop by reducing the number of heap accesses: > final int size = this.size; > for (int i=0; modCount == expectedModCount && i < size; i++) { > ... > This trick might also be introduced to methods removeAll and replaceAll. > > In the ListIterator implementation of ArrayList, there are various appearances of the idiom: > try { > ... > } catch (IndexOutOfBoundsException ex) { > throw new ConcurrentModificationException(); > } > This technique might also be used in forEach, removeAll, and replaceAll (though not likely to > be of any importance). > > Regards > Arne Siegel > From mike.duigou at oracle.com Mon Dec 10 21:59:02 2012 From: mike.duigou at oracle.com (Mike Duigou) Date: Mon, 10 Dec 2012 13:59:02 -0800 Subject: RFR: 8001647: In-place methods on Collection/List In-Reply-To: <50C5E36B.2040005@oracle.com> References: <50C29B04.5070508@oracle.com> <50C5E36B.2040005@oracle.com> Message-ID: <65E39782-6530-47CB-A1FC-741A5B9ED4E2@oracle.com> On Dec 10 2012, at 05:28 , Alan Bateman wrote: > On 08/12/2012 01:42, Akhil Arora wrote: >> As part of the Library Lambdafication, this patch adds the following >> default methods to Collections - >> > This may be bikeshed territory but we usually don't use the "public" modifier on methods defined by interfaces as they are public anyway. Adding "public" was at my suggestion. > It seems inconsistent to me to have it on the default methods. Perhaps this has been discussed before, in which case ignore this. BTW: The only reason I'm bringing this up is because there are lots of default methods to come and it would be nice to establish a convention and consistency from the start. Agreed that we should be consistent. The suggestion to add "public" isn't related specifically to the default but anticipates, perhaps prematurely, future addition of "package" "module" and "protected" modifiers. When those modifiers are added it will make sense to be explicit about the access of a method. Additionally, some have complained about the difference in default access between interfaces and classes (public vs package) and prefer to explicit so that the intent is obvious and that method signature text in interfaces and classes look the same. So, worthwhile or not? Mike From peter.levart at gmail.com Mon Dec 10 22:23:25 2012 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 10 Dec 2012 23:23:25 +0100 Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch In-Reply-To: <50C64BA9.1090500@oracle.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com> <50C5F8CE.3080006@gmail.com> <50C60A45.9020807@gmail.com> <50C64BA9.1090500@oracle.com> Message-ID: <50C660DD.2000605@gmail.com> Hi David, Joe, I unpacked the src.zip of the first release of JDK 1.5.0. Here's the relevant part: private transient Map annotations; private transient Map declaredAnnotations; private synchronized void initAnnotationsIfNecessary() { if (annotations != null) return; declaredAnnotations = AnnotationParser.parseAnnotations( getRawAnnotations(), getConstantPool(), this); Class superClass = getSuperclass(); if (superClass == null) { annotations = declaredAnnotations; } else { annotations = new HashMap(); superClass.initAnnotationsIfNecessary(); for (Map.Entry e : superClass.annotations.entrySet()) { Class annotationClass = e.getKey(); if (AnnotationType.getInstance(annotationClass).isInherited()) annotations.put(annotationClass, e.getValue()); } annotations.putAll(declaredAnnotations); } } ...there's no sign of invalidation logic here yet. Neither for annotations nor for fields/methods/constructors. This appears to have been added later, presumably to accommodate class redefinition changing annotations. I would also like to see the source of AnnotationType to see if it used the same logic and synchronization, but that's not part of src.zip sources... Regards, Peter On 12/10/2012 09:52 PM, Joe Darcy wrote: > Yes; the OpenJDK sources only go back to circa 2007, which was > part-way into the JDK 7 release. The exact changesets of how > annotations were added back in JDK 5 are not available publicly. > However, the final results of that process may be mostly visible in > the src.zip from JDK 5. > > HTH, > > -Joe > > On 12/10/2012 8:13 AM, Peter Levart wrote: >> Hi David, >> >> It would be informative to look at how java.lang.Class evolved during >> history. The oldest revision I can access is from 1st of Dec. 2007, >> which already contains Java 1.5 code (annotations) and is more or >> less unchanged until now. The most interesting changesets would be >> those that introduced annotations. >> >> Regards, Peter >> >> >> On 12/10/2012 03:59 PM, Peter Levart wrote: >>> On 12/10/2012 07:18 AM, David Holmes wrote: >>>> Hi Peter, >>>> >>>> Sorry for the delay on this. >>> >>> Thank you for taking it into consideration. I can only imagine how >>> busy you are with other things. >>> >>>> >>>> Generally your VolatileData and my ReflectionHelper are doing a >>>> similar job. But I agree with your reasoning that all of the cached >>>> SoftReferences are likely to be cleared at once, and so a >>>> SoftReference to a helper object with direct references, is more >>>> effective than a direct reference to a helper object with >>>> SoftReferences. My initial stance with this was very conservative >>>> as the more change that is introduced the more uncertainty there is >>>> about the impact. >>>> >>>> I say the above primarily because I think, if I am to proceed with >>>> this, I will need to separate out the general reflection caching >>>> changes from the annotation changes. There are a number of reasons >>>> for this: >>>> >>>> First, I'm not at all familiar with the implementation of >>>> annotations at the VM or Java level, and the recent changes in this >>>> area just exacerbate my ignorance of the mechanics. So I don't feel >>>> qualified to evaluate that aspect. >>>> >>>> Second, the bulk of the reflection caching code is simplified by >>>> the fact that due to current constraints on class redefinition the >>>> caching is effectively idempotent for fields/methods/constructors. >>>> But that is not the case for annotations. >>> >>> I think that on the Class-level these two aspects can be separated. >>> But not on the Field/Method/Constructor level, because annotations >>> are referenced by Field/Method/Constructor objects and there is no >>> invalidation logic - like on the Class-level - that would just >>> invalidate the sets of annotations on Field/Method/Constructor, >>> leaving Field/Method/Constructor objects still valid. So these two >>> aspects are connected - it may be - I haven't looked at history yet >>> - that invalidation of Field/Method/Constructor was introduced just >>> because of annotations. >>> >>> Also, the following bug (currently not accessible): >>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5002251 has >>> references to docs that suggest that current class redefinition can >>> introduce new methods, so If this is correct, then redefinition is >>> not idempotent for basic reflection data. >>> >>>> >>>> Finally, the use of synchronization with the annotations method is >>>> perplexing me. I sent Joe a private email on this but I may as well >>>> raise it here - and I think you have alluded to this in your >>>> earlier emails as well: initAnnotationsIfNecessary() is a >>>> synchronized instance method but I can not find any other code in >>>> the VM that synchronizes on the Class object's monitor. So if this >>>> synchronization is trying to establish consistency in the face of >>>> class redefinition, I do not see where class redefinition is >>>> participating in the synchronization! >>> >>> I think that the intent was merely synchronized access to / lazy >>> initialization of cached 'annotations' and 'declaredAnnotations' >>> Maps. Field[], Method[], Constructor[] arrays are published to other >>> threads via volatile fields one field at a time, but >>> initAnnotationsIfNecessary() was designed to publish two references >>> ('annotations' and 'declaredAnnotations') atomically at the same >>> time, so the author of the code choose to use synchronized block. I >>> also have a feeling that this might have simply been the author's >>> preferred style of synchronization, since the same approach is used >>> also in Field/Method/Constructor/Executable although there's just >>> one field of annotations that is published at a time. >>> >>> It is indicative that initAnnotationsIfNecessary() synchronized >>> method also contains the call to clearCachesOnClassRedefinition(), >>> so at first it seems that the synchronization is also meant to >>> serialize access to invalidation logic which invalidates both >>> Field/Method/Constructor and annotation fields, but that all >>> falls-apart because clearCachesOnClassRedefinition() is also called >>> from elsewhere, not guarded by the synchronization. >>> >>> So all in all the two aspects - annotations and basic reflection >>> stuff - are quite intermingled in current code, unfortunately very >>> inconsistently. I'm afraid that doing one thing and not touching the >>> other is possible, but that would not solve the problems that this >>> thread was starting to address (bottleneck by >>> java.lang.Class.getAnnotations()) and evident dead-lock bugs. >>> >>> We can approach the problem so that we separate the aspects of >>> caching Class-level annotations and Field/Method/Constructor arrays >>> but using the same approach for both. And that would only make sense >>> if there was a reason to separately cache Class-level annotations >>> and Field/Method/Constructor arrays. I haven't yet been able to >>> think of one such reason. So anyone with more insight (the author of >>> annotations code?) is invited to participate in investigation. >>> >>> My approach of including the Class-level annotations together with >>> Field/Method/Constructor arrays was guided by: >>> - consistency - why should Class-level annotations be cached with >>> hard references, while Field/Method/Constructor annotations are >>> indirectly SoftReference(d)? Are they more important? >>> - simplicity >>> - space efficiency >>> - correctness - unsynchronized calls to >>> clearCachesOnClassRedefinition() followed by unsynchronized lazy >>> initialization have - as I have shown - theoretical races that could >>> result in caching the old versions of data instead of new. The >>> approach I have chosen with the logic in getVolatileData() is a kind >>> of MVCC rather than synchronization. >>> >>> But as said, the two aspects of caching can be separated. >>> >>> We can also leave the Class-level annotation aspect untouched by >>> re-introducing the 'annotations' and 'declaredAnnotations' fields >>> and also the 'lastRedefinedCount' field on the Class-level and >>> re-introducing the synchronized initAnnotationsIfNecessary() method >>> and a clearCachesOnClassRedefinition() which would just invalidate >>> the two annotations fields. >>> >>> To recap. How to continue? >>> a) as proposed; >>> b) separate caching of annotations and Field/Method/Constructor >>> arrays but with the same unblocking MVCC-like approach for both - >>> with possible variation in that annotations be hardly referenced and >>> Field/Method/Constructor arrays be softly; >>> c) undo the annotations caching changes and only do MVCC for >>> Field/Method/Constructor arrays. >>> >>> I can do b) but prepare two independent patches - one for >>> VolatileData (rename it to MemberData?) and one for AnnotationData. >>> So by applying only the first, we achieve c) and can later apply the >>> second to upgrade to b). But it is unfortunately a) that is most >>> efficient space-saving wise. >>> >>> What do you say about the trivial changes in >>> Field/Method/Constructor/Executable to accommodate caching on the >>> 'root' instance instead of on the copies? >>> >>> Regards, Peter >>> >>>> >>>> So what I would like to do is take your basic VolatileData part of >>>> the patch and run with it for JEP-149 purposes, while separating >>>> the annotations issue so they can be dealt with by the experts in >>>> that particular area. >>>> >>>> I'm sorry it has taken so long to arrive at a fairly negative >>>> position, but I need someone else to take up the annotations >>>> gauntlet and run with it. >>>> >>>> Thanks, >>>> David >>>> >>>> On 3/12/2012 5:41 PM, Peter Levart wrote: >>>>> Hi David, Alan, Alexander and others, >>>>> >>>>> In the meanwhile I have added another annotations space >>>>> optimization to >>>>> the patch. If a Class doesn't inherit any annotations from a >>>>> superclass, >>>>> which I think is a common case, it assigns the same Map instance to >>>>> "annotations" as well as "declaredAnnotations" fields. Previously >>>>> - and >>>>> in the original code - this only happened for java.lang.Object and >>>>> interfaces. >>>>> >>>>> Here's the updated webrev: >>>>> >>>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html >>>>> >>>>> >>>>> I have also rewritten the performance micro-benchmarks. With the >>>>> addition of repeating annotations, one performance aspect >>>>> surfaces: when >>>>> asking for a particular annotation type on a Class and that >>>>> annotation >>>>> is not present, the new repeating annotations support method >>>>> AnnotationSupport.getOneAnnotation asks for @ContainedBy >>>>> meta-annotation >>>>> on the annotation type. This can result in an even more apparent >>>>> synchronization hot-spot with original code that uses synchronized >>>>> initAnnotationsIfNecessary(). This aspect is tested with the 3rd >>>>> test. >>>>> Other 2 tests test the same thing as before but are more stable now, >>>>> since now they measure retrieval of 5 different annotation types from >>>>> each AnnotatedElement, previously they only measured retrieval of 1 >>>>> which was very sensitive to HashMap irregularities (it could >>>>> happen that >>>>> a particular key mapped to a bucket that was overloaded in one >>>>> test-run >>>>> and not in another)... >>>>> >>>>> Here're the new tests: >>>>> >>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java >>>>> >>>>> >>>>> And the corresponding results when run on an i7 CPU on Linux: >>>>> >>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt >>>>> >>>>> >>>>> >>>>> Regards, Peter >>>>> >>>>> >>>>> >>>>> On 12/03/2012 02:15 AM, David Holmes wrote: >>>>>> On 1/12/2012 4:54 AM, Alan Bateman wrote: >>>>>>> On 30/11/2012 18:36, Peter Levart wrote: >>>>>>>> : >>>>>>>> >>>>>>>> So, what do you think? What kind of tests should I prepare in >>>>>>>> addidion >>>>>>>> to those 3 so that the patch might get a consideration? >>>>>>> I think this is good work and thanks for re-basing your patch. I >>>>>>> know >>>>>>> David plans to do a detail review. I think it will require >>>>>>> extensive >>>>>>> performance testing too, perhaps with some large applications. >>>>>> >>>>>> Indeed I do plan a detailed review and have initiated some initial >>>>>> performance tests. >>>>>> >>>>>> I am also swamped but will try to get to the review this week - and >>>>>> will also need to check the referenced annotations updates. >>>>>> >>>>>> David >>>>>> >>>>>>> -Alan >>>>>>> >>>>> >>> >> > From jim.gish at oracle.com Mon Dec 10 22:44:59 2012 From: jim.gish at oracle.com (Jim Gish) Date: Mon, 10 Dec 2012 17:44:59 -0500 Subject: RFR (ultra-trivial review): Typo in http://java.sun.com/j2se/1.4.1/docs/api/java/util/logging/LogManager.html Message-ID: <50C665EB.3020907@oracle.com> Please review and push this ridiculously trivial fix: http://cr.openjdk.java.net/~jgish/Bug4819681-Day1-typo-in-LogManager/ I'd love to know how many people have stumbled on this ridiculous one-letter capitalization bug which has been around since day-1 of the introduction of logging and kept pushing it under the rug for others to stumble on instead of just fixing the thing and getting it out of the way. Why do we continue to carry this kind of nonsense around? I can just imagine the number of reports that have been generated over the years for every single release since 1.4, where someone has just said "Ah that one. It's trivial. Just forget it." Jeez! (rant over :-) ) Thanks, Jim -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From joe.darcy at oracle.com Mon Dec 10 22:59:45 2012 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 10 Dec 2012 14:59:45 -0800 Subject: RFR (ultra-trivial review): Typo in http://java.sun.com/j2se/1.4.1/docs/api/java/util/logging/LogManager.html In-Reply-To: <50C665EB.3020907@oracle.com> References: <50C665EB.3020907@oracle.com> Message-ID: <50C66961.6020300@oracle.com> Approved! -Joe On 12/10/2012 02:44 PM, Jim Gish wrote: > Please review and push this ridiculously trivial fix: > http://cr.openjdk.java.net/~jgish/Bug4819681-Day1-typo-in-LogManager/ > > > I'd love to know how many people have stumbled on this ridiculous > one-letter capitalization bug which has been around since day-1 of the > introduction of logging and kept pushing it under the rug for others > to stumble on instead of just fixing the thing and getting it out of > the way. Why do we continue to carry this kind of nonsense around? I > can just imagine the number of reports that have been generated over > the years for every single release since 1.4, where someone has just > said "Ah that one. It's trivial. Just forget it." Jeez! (rant over > :-) ) > > Thanks, > Jim > From mandy.chung at oracle.com Mon Dec 10 23:15:06 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 10 Dec 2012 15:15:06 -0800 Subject: RFR (ultra-trivial review): Typo in http://java.sun.com/j2se/1.4.1/docs/api/java/util/logging/LogManager.html In-Reply-To: <50C66961.6020300@oracle.com> References: <50C665EB.3020907@oracle.com> <50C66961.6020300@oracle.com> Message-ID: <50C66CFA.2010400@oracle.com> I am pushing the typo fix for you - Jim. Mandy On 12/10/2012 2:59 PM, Joe Darcy wrote: > Approved! > > -Joe > > On 12/10/2012 02:44 PM, Jim Gish wrote: >> Please review and push this ridiculously trivial fix: >> http://cr.openjdk.java.net/~jgish/Bug4819681-Day1-typo-in-LogManager/ >> >> >> >> I'd love to know how many people have stumbled on this ridiculous >> one-letter capitalization bug which has been around since day-1 of >> the introduction of logging and kept pushing it under the rug for >> others to stumble on instead of just fixing the thing and getting it >> out of the way. Why do we continue to carry this kind of nonsense >> around? I can just imagine the number of reports that have been >> generated over the years for every single release since 1.4, where >> someone has just said "Ah that one. It's trivial. Just forget it." >> Jeez! (rant over :-) ) >> >> Thanks, >> Jim >> > From mandy.chung at oracle.com Mon Dec 10 23:17:53 2012 From: mandy.chung at oracle.com (mandy.chung at oracle.com) Date: Mon, 10 Dec 2012 23:17:53 +0000 Subject: hg: jdk8/tl/jdk: 4819681: Typo in http://java.sun.com/j2se/1.4.1/docs/api/java/util/logging/LogManager.html Message-ID: <20121210231812.B49ED47020@hg.openjdk.java.net> Changeset: cac1bfaceaaa Author: mchung Date: 2012-12-10 15:15 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/cac1bfaceaaa 4819681: Typo in http://java.sun.com/j2se/1.4.1/docs/api/java/util/logging/LogManager.html Summary: Simple capitalization typo in LogManager() description Reviewed-by: darcy, mchung ! src/share/classes/java/util/logging/LogManager.java From mandy.chung at oracle.com Mon Dec 10 23:21:19 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 10 Dec 2012 15:21:19 -0800 Subject: RFR (ultra-trivial review): Typo in http://java.sun.com/j2se/1.4.1/docs/api/java/util/logging/LogManager.html In-Reply-To: <50C665EB.3020907@oracle.com> References: <50C665EB.3020907@oracle.com> Message-ID: <50C66E6F.3090708@oracle.com> Jim, Pushed [1]. I'm sorry that I missed to set the user when creating the changeset and it was too late when I noticed that and attempted to kill the hg push comment. Hope you don't mind. Mandy [1] http://hg.openjdk.java.net/jdk8/tl/jdk/rev/cac1bfaceaaa On 12/10/2012 2:44 PM, Jim Gish wrote: > Please review and push this ridiculously trivial fix: > http://cr.openjdk.java.net/~jgish/Bug4819681-Day1-typo-in-LogManager/ > > > I'd love to know how many people have stumbled on this ridiculous > one-letter capitalization bug which has been around since day-1 of the > introduction of logging and kept pushing it under the rug for others > to stumble on instead of just fixing the thing and getting it out of > the way. Why do we continue to carry this kind of nonsense around? I > can just imagine the number of reports that have been generated over > the years for every single release since 1.4, where someone has just > said "Ah that one. It's trivial. Just forget it." Jeez! (rant over > :-) ) > > Thanks, > Jim > From akhil.arora at oracle.com Mon Dec 10 23:45:27 2012 From: akhil.arora at oracle.com (Akhil Arora) Date: Mon, 10 Dec 2012 15:45:27 -0800 Subject: Review Request: 8004201: add reducers to primitive type wrappers In-Reply-To: <50BFDC75.6000306@oracle.com> References: <50B8FE8A.2030403@oracle.com> <50BC0576.4070202@oracle.com> <50BFBC49.9020200@oracle.com> <50BFDC75.6000306@oracle.com> Message-ID: <50C67417.2030205@oracle.com> http://cr.openjdk.java.net/~akhil/8004201.2/webrev/ - replaced "Suitable for conversion as a method reference to functional interfaces such as ..." with @see java.util.function.BinaryOperator - javadoc - replaced 'a argument'/'another argument' with 'the first operand'/'the second operand' - did not widen return types - widening the return type makes these methods unusable as reducers, since BinaryOperator is declared T operate(T left, T right) Thanks On 12/05/2012 03:44 PM, Joseph Darcy wrote: > Akhil, > > In javadoc like this > > 298 * as {@code BinaryOperator<Boolean>}. > > you don't have to use "<" and the like inside {@code}; please change to > > 298 * as {@code BinaryOperator}. > > As a general comment, if the operations for primitive type Foo are put > into java.lang.Foo, then the type of the operation needs to be > explicitly represented in the expression calling the method (unless > static imports are used, etc.). Therefore, I suggest putting these sort > of static methods all into one class to allow overloading to do its > thing (java.lang.Operators?). Also, for methods like sum, I think it is > worth considering returning a larger type than the operands to avoid > problems from integer or floating-point overflow. For example, sum on > byte and short would return int, sun on int would return long, etc. > > As an aside, to get a numerically robust result, the summation logic > over a set of doubles needs to be more than just a set of raw double > additions, but that can be tackled later. > > Cheers, > > -Joe > > > On 12/5/2012 1:27 PM, Akhil Arora wrote: >> Updated - http://cr.openjdk.java.net/~akhil/8004201.1/webrev/ >> >> - delegate to Math.min/max for int/long/float/double >> - rename Boolean.and/or/xor to logicalAnd/logicalOr/logicalXor >> - removed Character variants of min/max/sum >> >> On 12/02/2012 05:50 PM, David Holmes wrote: >>> Hi Akhil, >>> >>> Is it really necessary/desirable to flag all of these as " Suitable for >>> conversion as a method reference to functional interfaces such as ..." ? >> Not necessary, but it does provide a hint as to their intended use to a >> casual browser of these docs. >> >>> This style: >>> >>> + * @param a a boolean argument. >>> + * @param b another boolean argument. >>> >>> is at odds with the style used elsewhere for new Functional APIs, and >>> with the style of other methods in these classes. Can we just use "first >>> operand" and "second operand" for all of these? >> It is consistent with Math.min/max, which use the a/b style. Since these >> methods are not in one of the functional package, is'nt it better to >> stick to the local style? >> >>> Character.sum does not make sense to me. Who adds together characters? >>> I'm not even sure min and max are worth supporting for Character. >> Good point - removed these methods for Character. >> >>> I disagree with other suggestions to use the Math functions for >>> float/double. I think all these methods should use the underlying >>> primitive operator regardless of type. >> Are you disagreeing only for float/double or for int/long also? Can you >> provide more information as to why you disagree? >> >> Thanks >> >>> Thanks, >>> David >>> ----- >>> >>> On 1/12/2012 4:44 AM, Akhil Arora wrote: >>>> Hi >>>> >>>> Requesting review for some basic functionality related to lambdas - >>>> >>>> Add min, max, sum methods to the primitive wrapper classes - Byte, >>>> Short, Integer, Long, Float, Double and Character so as to be able to >>>> use them as reducers in lambda expressions. Add and, or, xor methods to >>>> Boolean. >>>> >>>> http://cr.openjdk.java.net/~akhil/8004201.0/webrev/ >>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004201 >>>> >>>> Thanks >> > From stuart.marks at oracle.com Mon Dec 10 23:48:28 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Mon, 10 Dec 2012 15:48:28 -0800 Subject: RFR: JDK-8003890: modify test scripts to pass VMOPTIONS In-Reply-To: <50C5C6BD.3090609@oracle.com> References: <780ee521-ef19-401b-9ed9-8c5cce2cb91c@default> <50C5C3EA.4080802@oracle.com> <50C5C6BD.3090609@oracle.com> Message-ID: <50C674CC.2090800@oracle.com> On 12/10/12 3:25 AM, Alan Bateman wrote: > On 10/12/2012 11:13, Chris Hegarty wrote: >> Thank you Mark, this is a really useful contribution. >> >> I noticed that a few tests (below) specify either -client or -server. If the >> vmoptions contain either of these arguments, and this seems to be the way our >> test/Makefile is passing them, then it may result in the test using the wrong >> vm. I think we should remove TESTVMOPTS from these tests, but then we lose >> other potential opts, like heap size, etc. >> >> java/rmi/reliability/benchmark/runRmiBench.sh >> java/rmi/reliability/benchmark/runSerialBench.sh >> sun/management/jmxremote/startstop/JMXStartStopTest.sh > You're right, this will cause conflict. > > In the case of JMXStartStopTest.sh and runSerialBench.sh then it might be > better to remove the -server. > > Stuart might have an opinion on runRmiBench.sh but one idea is to change is so > that when run interactively (TESTJAVA not set) then it works as it does now and > runs the benchmark twice. If TESTJAVA is not set then it runs the benchmark > once, with whatever VM options are in use. For runRmiBench.sh the benchmark actually runs two JVMs, one as the RMI server and the other as the RMI client. Note that -client and -server are passed as arguments to the bench.rmi.Main start-class, which causes them to behave differently. I'm wondering if whoever wrote the script originally confused the arguments to Main with the arguments to the JVMs. Or, perhaps some tenuous line of reasoning was used, such as "the RMI server is probably running on a server and so should be running the server VM, and same for the RMI client." So, I think that the JVM -server and -client args should be replaced by $TESTVMOPTS. But of course please leave -server and -client args to the Main class unchanged. (Note, the runRmiBench.sh test is currently on the problem list so it's not run right now anyway.) For runSerialBench.sh, yes, I think removing -server and adding $TESTVMOPTS is the right thing. * * * I've looked over the test/java/io/Serializable and the test/java/rmi changes and they look fine. I haven't looked at the other changes though. I can look at more files too if you need to spread out the reviewing load. s'marks From david.holmes at oracle.com Tue Dec 11 00:36:04 2012 From: david.holmes at oracle.com (David Holmes) Date: Tue, 11 Dec 2012 10:36:04 +1000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C5E969.5040602@redhat.com> References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com> <50C0B490.7050005@redhat.com> <50C55F11.6020801@oracle.com> <50C5E969.5040602@redhat.com> Message-ID: <50C67FF4.6050506@oracle.com> On 10/12/2012 11:53 PM, David M. Lloyd wrote: > On 12/09/2012 10:03 PM, David Holmes wrote: >> That sounds promising. Are you in a position to try out this proposal on >> a testbed with your app server? > > Sure, I'd love to. What tree should I build? Please apply the patches from the webrevs here: http://cr.openjdk.java.net/~dholmes/concurrent-loaders/webrev.hotspot/ http://cr.openjdk.java.net/~dholmes/concurrent-loaders/webrev.jdk/ They should apply to a jdk8 or tl forest. (And I hope I didn't mess something up generating the webrev ;-) ) Thanks, David From stuart.marks at oracle.com Tue Dec 11 00:47:14 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Mon, 10 Dec 2012 16:47:14 -0800 Subject: RFR: 8004651 - TEST: java/util/logging/CheckLockLocationTest.java failed to delete file (win) In-Reply-To: <50C2410E.7040200@oracle.com> References: <50C2410E.7040200@oracle.com> Message-ID: <50C68292.4030404@oracle.com> Hi Jim, Catching IOException from delete() is a bit odd. The only thing in the delete() method that throws an IOE is the explicit throw of FileNotFoundException... so in that case we'd throw FNFE and then catch the IOE at the caller and print a warning. Would it be better to just print a warning from within the delete() method, and remove "throws IOException" ? There's only one other caller to delete() and it seems indifferent to this change. Now that we're no longer checking the message of FileSystemException, it's possible to change the instanceof check into a separate catch-clause of FileSystemException, which simply ignores that exception. The catch clause for IOException can be simplified to unconditionally wrap the IOE in a RuntimeException and rethrow it. Actually it's not clear to me that's even necessary since runTests() is declared to throw IOException, so we might not even need to catch IOE here at all; we can just let it propagate to the caller. Looks like similar simplifications apply to tests 2 and 4 as well. s'marks On 12/7/12 11:18 AM, Jim Gish wrote: > Please review > http://cr.openjdk.java.net/~jgish/Bug8004651-CheckLockLocationTest-Windows-delete-file-fix/ > > > > Summary -- failure to delete a test log should be a warning instead of a > failure. Also, while fixing this problem another one popped up -- not all > platforms generate the same message in the FileSystemException ("Not a > directory"), so removing the exception content check. > > Thanks, > Jim > From joe.darcy at oracle.com Tue Dec 11 02:14:40 2012 From: joe.darcy at oracle.com (Joe Darcy) Date: Mon, 10 Dec 2012 18:14:40 -0800 Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch In-Reply-To: <50C660DD.2000605@gmail.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com> <50C5F8CE.3080006@gmail.com> <50C60A45.9020807@gmail.com> <50C64BA9.1090500@oracle.com> <50C660DD.2000605@gmail.com> Message-ID: <50C69710.4070100@oracle.com> Hi Peter, On 12/10/2012 02:23 PM, Peter Levart wrote: > Hi David, Joe, > > I unpacked the src.zip of the first release of JDK 1.5.0. Here's the > relevant part: > > private transient Map annotations; > private transient Map declaredAnnotations; > > private synchronized void initAnnotationsIfNecessary() { > if (annotations != null) > return; > declaredAnnotations = AnnotationParser.parseAnnotations( > getRawAnnotations(), getConstantPool(), this); > Class superClass = getSuperclass(); > if (superClass == null) { > annotations = declaredAnnotations; > } else { > annotations = new HashMap(); > superClass.initAnnotationsIfNecessary(); > for (Map.Entry e : > superClass.annotations.entrySet()) { > Class annotationClass = e.getKey(); > if > (AnnotationType.getInstance(annotationClass).isInherited()) > annotations.put(annotationClass, e.getValue()); > } > annotations.putAll(declaredAnnotations); > } > } > > > ...there's no sign of invalidation logic here yet. Neither for > annotations nor for fields/methods/constructors. This appears to have > been added later, presumably to accommodate class redefinition > changing annotations. > > I would also like to see the source of AnnotationType to see if it > used the same logic and synchronization, but that's not part of > src.zip sources... In JDK 5 GA, the annotations feature did not attempt to support class file definition. From some quick bug archaeology, that omission was addressed circa 5.0u8 (and JDK 6) via bugs including: 5002251 potential bug with annotations and class file evolution http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5002251 6412391 fix for annotation cache and RedefineClasses() conflict needs HotSpot changes http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6412391 6422541 fix for {Constructor,Field,Method} annotation cache and RedefineClasses() conflict needs HS changes http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6422541 -Joe > > Regards, Peter > > > On 12/10/2012 09:52 PM, Joe Darcy wrote: >> Yes; the OpenJDK sources only go back to circa 2007, which was >> part-way into the JDK 7 release. The exact changesets of how >> annotations were added back in JDK 5 are not available publicly. >> However, the final results of that process may be mostly visible in >> the src.zip from JDK 5. >> >> HTH, >> >> -Joe >> >> On 12/10/2012 8:13 AM, Peter Levart wrote: >>> Hi David, >>> >>> It would be informative to look at how java.lang.Class evolved >>> during history. The oldest revision I can access is from 1st of Dec. >>> 2007, which already contains Java 1.5 code (annotations) and is more >>> or less unchanged until now. The most interesting changesets would >>> be those that introduced annotations. >>> >>> Regards, Peter >>> >>> >>> On 12/10/2012 03:59 PM, Peter Levart wrote: >>>> On 12/10/2012 07:18 AM, David Holmes wrote: >>>>> Hi Peter, >>>>> >>>>> Sorry for the delay on this. >>>> >>>> Thank you for taking it into consideration. I can only imagine how >>>> busy you are with other things. >>>> >>>>> >>>>> Generally your VolatileData and my ReflectionHelper are doing a >>>>> similar job. But I agree with your reasoning that all of the >>>>> cached SoftReferences are likely to be cleared at once, and so a >>>>> SoftReference to a helper object with direct references, is more >>>>> effective than a direct reference to a helper object with >>>>> SoftReferences. My initial stance with this was very conservative >>>>> as the more change that is introduced the more uncertainty there >>>>> is about the impact. >>>>> >>>>> I say the above primarily because I think, if I am to proceed with >>>>> this, I will need to separate out the general reflection caching >>>>> changes from the annotation changes. There are a number of reasons >>>>> for this: >>>>> >>>>> First, I'm not at all familiar with the implementation of >>>>> annotations at the VM or Java level, and the recent changes in >>>>> this area just exacerbate my ignorance of the mechanics. So I >>>>> don't feel qualified to evaluate that aspect. >>>>> >>>>> Second, the bulk of the reflection caching code is simplified by >>>>> the fact that due to current constraints on class redefinition the >>>>> caching is effectively idempotent for fields/methods/constructors. >>>>> But that is not the case for annotations. >>>> >>>> I think that on the Class-level these two aspects can be separated. >>>> But not on the Field/Method/Constructor level, because annotations >>>> are referenced by Field/Method/Constructor objects and there is no >>>> invalidation logic - like on the Class-level - that would just >>>> invalidate the sets of annotations on Field/Method/Constructor, >>>> leaving Field/Method/Constructor objects still valid. So these two >>>> aspects are connected - it may be - I haven't looked at history yet >>>> - that invalidation of Field/Method/Constructor was introduced just >>>> because of annotations. >>>> >>>> Also, the following bug (currently not accessible): >>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5002251 has >>>> references to docs that suggest that current class redefinition can >>>> introduce new methods, so If this is correct, then redefinition is >>>> not idempotent for basic reflection data. >>>> >>>>> >>>>> Finally, the use of synchronization with the annotations method is >>>>> perplexing me. I sent Joe a private email on this but I may as >>>>> well raise it here - and I think you have alluded to this in your >>>>> earlier emails as well: initAnnotationsIfNecessary() is a >>>>> synchronized instance method but I can not find any other code in >>>>> the VM that synchronizes on the Class object's monitor. So if this >>>>> synchronization is trying to establish consistency in the face of >>>>> class redefinition, I do not see where class redefinition is >>>>> participating in the synchronization! >>>> >>>> I think that the intent was merely synchronized access to / lazy >>>> initialization of cached 'annotations' and 'declaredAnnotations' >>>> Maps. Field[], Method[], Constructor[] arrays are published to >>>> other threads via volatile fields one field at a time, but >>>> initAnnotationsIfNecessary() was designed to publish two references >>>> ('annotations' and 'declaredAnnotations') atomically at the same >>>> time, so the author of the code choose to use synchronized block. I >>>> also have a feeling that this might have simply been the author's >>>> preferred style of synchronization, since the same approach is used >>>> also in Field/Method/Constructor/Executable although there's just >>>> one field of annotations that is published at a time. >>>> >>>> It is indicative that initAnnotationsIfNecessary() synchronized >>>> method also contains the call to clearCachesOnClassRedefinition(), >>>> so at first it seems that the synchronization is also meant to >>>> serialize access to invalidation logic which invalidates both >>>> Field/Method/Constructor and annotation fields, but that all >>>> falls-apart because clearCachesOnClassRedefinition() is also called >>>> from elsewhere, not guarded by the synchronization. >>>> >>>> So all in all the two aspects - annotations and basic reflection >>>> stuff - are quite intermingled in current code, unfortunately very >>>> inconsistently. I'm afraid that doing one thing and not touching >>>> the other is possible, but that would not solve the problems that >>>> this thread was starting to address (bottleneck by >>>> java.lang.Class.getAnnotations()) and evident dead-lock bugs. >>>> >>>> We can approach the problem so that we separate the aspects of >>>> caching Class-level annotations and Field/Method/Constructor arrays >>>> but using the same approach for both. And that would only make >>>> sense if there was a reason to separately cache Class-level >>>> annotations and Field/Method/Constructor arrays. I haven't yet been >>>> able to think of one such reason. So anyone with more insight (the >>>> author of annotations code?) is invited to participate in >>>> investigation. >>>> >>>> My approach of including the Class-level annotations together with >>>> Field/Method/Constructor arrays was guided by: >>>> - consistency - why should Class-level annotations be cached with >>>> hard references, while Field/Method/Constructor annotations are >>>> indirectly SoftReference(d)? Are they more important? >>>> - simplicity >>>> - space efficiency >>>> - correctness - unsynchronized calls to >>>> clearCachesOnClassRedefinition() followed by unsynchronized lazy >>>> initialization have - as I have shown - theoretical races that >>>> could result in caching the old versions of data instead of new. >>>> The approach I have chosen with the logic in getVolatileData() is a >>>> kind of MVCC rather than synchronization. >>>> >>>> But as said, the two aspects of caching can be separated. >>>> >>>> We can also leave the Class-level annotation aspect untouched by >>>> re-introducing the 'annotations' and 'declaredAnnotations' fields >>>> and also the 'lastRedefinedCount' field on the Class-level and >>>> re-introducing the synchronized initAnnotationsIfNecessary() method >>>> and a clearCachesOnClassRedefinition() which would just invalidate >>>> the two annotations fields. >>>> >>>> To recap. How to continue? >>>> a) as proposed; >>>> b) separate caching of annotations and Field/Method/Constructor >>>> arrays but with the same unblocking MVCC-like approach for both - >>>> with possible variation in that annotations be hardly referenced >>>> and Field/Method/Constructor arrays be softly; >>>> c) undo the annotations caching changes and only do MVCC for >>>> Field/Method/Constructor arrays. >>>> >>>> I can do b) but prepare two independent patches - one for >>>> VolatileData (rename it to MemberData?) and one for AnnotationData. >>>> So by applying only the first, we achieve c) and can later apply >>>> the second to upgrade to b). But it is unfortunately a) that is >>>> most efficient space-saving wise. >>>> >>>> What do you say about the trivial changes in >>>> Field/Method/Constructor/Executable to accommodate caching on the >>>> 'root' instance instead of on the copies? >>>> >>>> Regards, Peter >>>> >>>>> >>>>> So what I would like to do is take your basic VolatileData part of >>>>> the patch and run with it for JEP-149 purposes, while separating >>>>> the annotations issue so they can be dealt with by the experts in >>>>> that particular area. >>>>> >>>>> I'm sorry it has taken so long to arrive at a fairly negative >>>>> position, but I need someone else to take up the annotations >>>>> gauntlet and run with it. >>>>> >>>>> Thanks, >>>>> David >>>>> >>>>> On 3/12/2012 5:41 PM, Peter Levart wrote: >>>>>> Hi David, Alan, Alexander and others, >>>>>> >>>>>> In the meanwhile I have added another annotations space >>>>>> optimization to >>>>>> the patch. If a Class doesn't inherit any annotations from a >>>>>> superclass, >>>>>> which I think is a common case, it assigns the same Map instance to >>>>>> "annotations" as well as "declaredAnnotations" fields. Previously >>>>>> - and >>>>>> in the original code - this only happened for java.lang.Object and >>>>>> interfaces. >>>>>> >>>>>> Here's the updated webrev: >>>>>> >>>>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html >>>>>> >>>>>> >>>>>> I have also rewritten the performance micro-benchmarks. With the >>>>>> addition of repeating annotations, one performance aspect >>>>>> surfaces: when >>>>>> asking for a particular annotation type on a Class and that >>>>>> annotation >>>>>> is not present, the new repeating annotations support method >>>>>> AnnotationSupport.getOneAnnotation asks for @ContainedBy >>>>>> meta-annotation >>>>>> on the annotation type. This can result in an even more apparent >>>>>> synchronization hot-spot with original code that uses synchronized >>>>>> initAnnotationsIfNecessary(). This aspect is tested with the 3rd >>>>>> test. >>>>>> Other 2 tests test the same thing as before but are more stable now, >>>>>> since now they measure retrieval of 5 different annotation types >>>>>> from >>>>>> each AnnotatedElement, previously they only measured retrieval of 1 >>>>>> which was very sensitive to HashMap irregularities (it could >>>>>> happen that >>>>>> a particular key mapped to a bucket that was overloaded in one >>>>>> test-run >>>>>> and not in another)... >>>>>> >>>>>> Here're the new tests: >>>>>> >>>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java >>>>>> >>>>>> >>>>>> And the corresponding results when run on an i7 CPU on Linux: >>>>>> >>>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt >>>>>> >>>>>> >>>>>> >>>>>> Regards, Peter >>>>>> >>>>>> >>>>>> >>>>>> On 12/03/2012 02:15 AM, David Holmes wrote: >>>>>>> On 1/12/2012 4:54 AM, Alan Bateman wrote: >>>>>>>> On 30/11/2012 18:36, Peter Levart wrote: >>>>>>>>> : >>>>>>>>> >>>>>>>>> So, what do you think? What kind of tests should I prepare in >>>>>>>>> addidion >>>>>>>>> to those 3 so that the patch might get a consideration? >>>>>>>> I think this is good work and thanks for re-basing your patch. >>>>>>>> I know >>>>>>>> David plans to do a detail review. I think it will require >>>>>>>> extensive >>>>>>>> performance testing too, perhaps with some large applications. >>>>>>> >>>>>>> Indeed I do plan a detailed review and have initiated some initial >>>>>>> performance tests. >>>>>>> >>>>>>> I am also swamped but will try to get to the review this week - and >>>>>>> will also need to check the referenced annotations updates. >>>>>>> >>>>>>> David >>>>>>> >>>>>>>> -Alan >>>>>>>> >>>>>> >>>> >>> >> > From karen.kinnear at oracle.com Tue Dec 11 02:31:39 2012 From: karen.kinnear at oracle.com (Karen Kinnear) Date: Mon, 10 Dec 2012 21:31:39 -0500 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C56053.1060306@oracle.com> References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> <50C56053.1060306@oracle.com> Message-ID: David, I fully support the concept of a fully concurrent class loader, which allows parallel defineClass. I would agree that we deprecate registerAsParallelCapable - starting deprecation in JDK8. My memory is that customers asked us for the getClassLoadingLock API so that they could do their own internal concurrency controls using the same lock we created, so I think we need the blog etc. to explicitly ask for feedback on having this API return NULL or deprecating it. It does matter if our customers are using the results. "Fully concurrent" means custom class loaders that need to protect any per-class data do their own internal locking, not that no locks are needed. It means we allow concurrent defineClass, with the defineClassIfNotPresent semantics. Question on the source code: registerAsFullyConcurrent has confusing comment - do the super classes all need to be parallel capable? Or do the super classes all need to be FullyConcurrent? I assume the latter, so just fix the comments. thanks, Karen On Dec 9, 2012, at 11:08 PM, David Holmes wrote: > > Thanks for the comments Mandy. > > On 8/12/2012 9:46 AM, Mandy Chung wrote: >> On 12/5/12 3:59 AM, David Holmes wrote: >>> Java 7 introduced support for parallel classloading by adding to each >>> class loader a ConcurrentHashMap, referenced through a new field, >>> parallelLockMap. This contains a mapping from class names to Objects >>> to use as a classloading lock for that class name. This scheme has a >>> number of inefficiencies. To address this we propose for Java 8 the >>> notion of a fully concurrent classloader ... >>> >>> This is a fairly simple proposal that I've written up as a blog entry: >>> >>> https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent >>> >>> >> It's a good and simple proposal and also handles the backward >> compatibility nicely. >> >> I think having getClassLoadingLock() to return null for a fully >> concurrent loader is a good idea. In case if any code synchronizes on >> the returned value after migrating to fully concurrent class loader, it >> will catch such usage (it might be very rare)/ > > The only glitch with this is that a concurrent loader is-a parallel loader, so anyone trying work with an arbitrary parallel loader will encounter a problem with a concurrent loader if they don't make their code concurrent-loader aware. I am hopeful that the parallelLockMap is only being used internally by the classloaders themselves, and that there are no, or very few, external clients. > >> I agree with Alan's suggestion - we should consider deprecating >> registerAsParallelCapable. > > Definitely a consideration, though as I said perhaps for 9 rather than 8. > > Thanks, > David >> >> Mandy >> From luchsh at linux.vnet.ibm.com Tue Dec 11 02:42:58 2012 From: luchsh at linux.vnet.ibm.com (luchsh at linux.vnet.ibm.com) Date: Tue, 11 Dec 2012 02:42:58 +0000 Subject: hg: jdk8/tl/jdk: 6512101: Incorrect encoding in NetworkInterface.getDisplayName() Message-ID: <20121211024324.4C83147036@hg.openjdk.java.net> Changeset: 883feced1cdd Author: dingxmin Date: 2012-12-11 10:42 +0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/883feced1cdd 6512101: Incorrect encoding in NetworkInterface.getDisplayName() Reviewed-by: chegar, dsamersoff ! src/windows/native/java/net/NetworkInterface.c From david.holmes at oracle.com Tue Dec 11 02:55:24 2012 From: david.holmes at oracle.com (David Holmes) Date: Tue, 11 Dec 2012 12:55:24 +1000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> <50C56053.1060306@oracle.com> Message-ID: <50C6A09C.6000508@oracle.com> Hi Karen, Thanks for your feedback. On 11/12/2012 12:31 PM, Karen Kinnear wrote: > David, > > I fully support the concept of a fully concurrent class loader, which allows parallel defineClass. > > I would agree that we deprecate registerAsParallelCapable - starting deprecation in JDK8. Okay that seems to be the consensus. I'm obviously way too conservative :) > My memory is that customers asked us for the getClassLoadingLock API so that they could > do their own internal concurrency controls using the same lock we created, so I think we need > the blog etc. to explicitly ask for feedback on having this API return NULL or deprecating it. It does > matter if our customers are using the results. Okay it would be good to understand this better. Given each parallel classloader had a different lock per class this really only matters if they try to get the lock used by one of the existing system classloaders. Their own parallel loaders will continue to function as normal. > "Fully concurrent" means custom class loaders that need to protect any per-class data > do their own internal locking, not that no locks are needed. It means we allow > concurrent defineClass, with the defineClassIfNotPresent semantics. Is that a question or a statement? :) A fully concurrent loader needs no 'framework' support for synchronizing classloading. That could be because it uses its own locks, or that no locks are needed. > Question on the source code: registerAsFullyConcurrent has confusing comment - > do the super classes all need to be parallel capable? Or do the super classes all need > to be FullyConcurrent? I assume the latter, so just fix the comments. Actually it is the former. There's no reason to require that all superclasses be fully-concurrent. Of course a given loaders degree of concurrency may be constrained by what it's supertype allows, but there's no reason to actually force all the supertypes to be fully-concurrent: it is enough that they are at least all parallel capable. Thanks, David > thanks, > Karen > > On Dec 9, 2012, at 11:08 PM, David Holmes wrote: > >> >> Thanks for the comments Mandy. >> >> On 8/12/2012 9:46 AM, Mandy Chung wrote: >>> On 12/5/12 3:59 AM, David Holmes wrote: >>>> Java 7 introduced support for parallel classloading by adding to each >>>> class loader a ConcurrentHashMap, referenced through a new field, >>>> parallelLockMap. This contains a mapping from class names to Objects >>>> to use as a classloading lock for that class name. This scheme has a >>>> number of inefficiencies. To address this we propose for Java 8 the >>>> notion of a fully concurrent classloader ... >>>> >>>> This is a fairly simple proposal that I've written up as a blog entry: >>>> >>>> https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent >>>> >>>> >>> It's a good and simple proposal and also handles the backward >>> compatibility nicely. >>> >>> I think having getClassLoadingLock() to return null for a fully >>> concurrent loader is a good idea. In case if any code synchronizes on >>> the returned value after migrating to fully concurrent class loader, it >>> will catch such usage (it might be very rare)/ >> >> The only glitch with this is that a concurrent loader is-a parallel loader, so anyone trying work with an arbitrary parallel loader will encounter a problem with a concurrent loader if they don't make their code concurrent-loader aware. I am hopeful that the parallelLockMap is only being used internally by the classloaders themselves, and that there are no, or very few, external clients. >> >>> I agree with Alan's suggestion - we should consider deprecating >>> registerAsParallelCapable. >> >> Definitely a consideration, though as I said perhaps for 9 rather than 8. >> >> Thanks, >> David >>> >>> Mandy >>> > From david.lloyd at redhat.com Tue Dec 11 03:41:45 2012 From: david.lloyd at redhat.com (David M. Lloyd) Date: Mon, 10 Dec 2012 21:41:45 -0600 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C67FF4.6050506@oracle.com> References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com> <50C0B490.7050005@redhat.com> <50C55F11.6020801@oracle.com> <50C5E969.5040602@redhat.com> <50C67FF4.6050506@oracle.com> Message-ID: <50C6AB79.4010606@redhat.com> On 12/10/2012 06:36 PM, David Holmes wrote: > On 10/12/2012 11:53 PM, David M. Lloyd wrote: >> On 12/09/2012 10:03 PM, David Holmes wrote: >>> That sounds promising. Are you in a position to try out this proposal on >>> a testbed with your app server? >> >> Sure, I'd love to. What tree should I build? > > Please apply the patches from the webrevs here: > > http://cr.openjdk.java.net/~dholmes/concurrent-loaders/webrev.hotspot/ > http://cr.openjdk.java.net/~dholmes/concurrent-loaders/webrev.jdk/ > > They should apply to a jdk8 or tl forest. (And I hope I didn't mess > something up generating the webrev ;-) ) Well, I've just gotten everything working and done some cursory testing on a startup of an "empty" JBoss AS 7 instance, and then reviewing the metrics reported by our class loader. Our timing metrics are not really great for general-purpose benchmarking (for various uninteresting reasons), but I can at least get enough information to know everything is working more or less as expected: On JDK 6 with our "unsafe" lockless modification, we're typically loading 4707 classes, and I'm seeing anywhere from 0 to 5 define races that were automatically resolved. On JDK 7 using the standard registerAsParallelCapable() mechanism, we are loading 4711 classes and I'm seeing 35-50 define races that were automatically resolved - the overhead of locking starts to come to the fore I think. On JDK 8 with your patches, we are loading around 4750 classes and there are, as expected, 0 define races (I believe, however, that we're getting a false count though whenever defineClass() returns an already-defined class - it would be nice if there were *some* way to detect that this happened). On our class loader implementations, I'm initializing this way: static { try { ClassLoader.registerAsFullyConcurrent(); } catch (Throwable ignored) { try { ClassLoader.registerAsParallelCapable(); } catch (Throwable ignored2) { } } } The debugging message confirms that our class loaders are successfully registered as fully concurrent, and the fact that it doesn't hang or crash on JDK 7 indicates that they are still properly being registered as parallel-capable on that platform. -- - DML From david.holmes at oracle.com Tue Dec 11 05:10:04 2012 From: david.holmes at oracle.com (David Holmes) Date: Tue, 11 Dec 2012 15:10:04 +1000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50BF371A.1060604@oracle.com> References: <50BF371A.1060604@oracle.com> Message-ID: <50C6C02C.1060705@oracle.com> FYI I've made some small updates to the blog entry. Just to quantify the inefficiencies here is the instrumented output of a simple test that tries to load all classes in rt.jar and prints out the size of the lock maps: 18521 classes loaded. sun.misc.Launcher$AppClassLoader at f2f585 - lockMap size = 19050 sun.misc.Launcher$ExtClassLoader at d5163a - lockMap size = 19050 You may be wondering about the 500+ difference between the loaded classes and the map size? These represent classes in the list to load that were not actually present in rt.jar. So as you can see you not only get a lock object for every class successfully loaded, you get a lock object for every class that is attempted to be loaded! David ----- On 5/12/2012 9:59 PM, David Holmes wrote: > Java 7 introduced support for parallel classloading by adding to each > class loader a ConcurrentHashMap, referenced through a new field, > parallelLockMap. This contains a mapping from class names to Objects to > use as a classloading lock for that class name. This scheme has a number > of inefficiencies. To address this we propose for Java 8 the notion of a > fully concurrent classloader ... > > This is a fairly simple proposal that I've written up as a blog entry: > > https://blogs.oracle.com/dholmes/entry/parallel_classloading_revisited_fully_concurrent > > > Please discuss this proposal here. > > Thanks, > David Holmes > From weijun.wang at oracle.com Tue Dec 11 05:15:30 2012 From: weijun.wang at oracle.com (weijun.wang at oracle.com) Date: Tue, 11 Dec 2012 05:15:30 +0000 Subject: hg: jdk8/tl/jdk: 8004488: wrong permissions checked in krb5 Message-ID: <20121211051541.92D194703D@hg.openjdk.java.net> Changeset: d206e52bf8a6 Author: weijun Date: 2012-12-11 13:14 +0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d206e52bf8a6 8004488: wrong permissions checked in krb5 Reviewed-by: xuelei ! src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java ! src/share/classes/sun/security/jgss/krb5/Krb5Util.java + test/sun/security/krb5/auto/KeyPermissions.java ! test/sun/security/krb5/auto/KeyTabCompat.java From david.holmes at oracle.com Tue Dec 11 05:18:10 2012 From: david.holmes at oracle.com (David Holmes) Date: Tue, 11 Dec 2012 15:18:10 +1000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C6AB79.4010606@redhat.com> References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com> <50C0B490.7050005@redhat.com> <50C55F11.6020801@oracle.com> <50C5E969.5040602@redhat.com> <50C67FF4.6050506@oracle.com> <50C6AB79.4010606@redhat.com> Message-ID: <50C6C212.5090203@oracle.com> David, Many thanks for trialling this so promptly! Do you have any suggestions for what instrumentation you would like to see accompany this? David On 11/12/2012 1:41 PM, David M. Lloyd wrote: > On 12/10/2012 06:36 PM, David Holmes wrote: >> On 10/12/2012 11:53 PM, David M. Lloyd wrote: >>> On 12/09/2012 10:03 PM, David Holmes wrote: >>>> That sounds promising. Are you in a position to try out this >>>> proposal on >>>> a testbed with your app server? >>> >>> Sure, I'd love to. What tree should I build? >> >> Please apply the patches from the webrevs here: >> >> http://cr.openjdk.java.net/~dholmes/concurrent-loaders/webrev.hotspot/ >> http://cr.openjdk.java.net/~dholmes/concurrent-loaders/webrev.jdk/ >> >> They should apply to a jdk8 or tl forest. (And I hope I didn't mess >> something up generating the webrev ;-) ) > > Well, I've just gotten everything working and done some cursory testing > on a startup of an "empty" JBoss AS 7 instance, and then reviewing the > metrics reported by our class loader. Our timing metrics are not really > great for general-purpose benchmarking (for various uninteresting > reasons), but I can at least get enough information to know everything > is working more or less as expected: > > On JDK 6 with our "unsafe" lockless modification, we're typically > loading 4707 classes, and I'm seeing anywhere from 0 to 5 define races > that were automatically resolved. > > On JDK 7 using the standard registerAsParallelCapable() mechanism, we > are loading 4711 classes and I'm seeing 35-50 define races that were > automatically resolved - the overhead of locking starts to come to the > fore I think. > > On JDK 8 with your patches, we are loading around 4750 classes and there > are, as expected, 0 define races (I believe, however, that we're getting > a false count though whenever defineClass() returns an already-defined > class - it would be nice if there were *some* way to detect that this > happened). > > On our class loader implementations, I'm initializing this way: > > static { > try { > ClassLoader.registerAsFullyConcurrent(); > } catch (Throwable ignored) { > try { > ClassLoader.registerAsParallelCapable(); > } catch (Throwable ignored2) { > } > } > } > > The debugging message confirms that our class loaders are successfully > registered as fully concurrent, and the fact that it doesn't hang or > crash on JDK 7 indicates that they are still properly being registered > as parallel-capable on that platform. > From akhil.arora at oracle.com Tue Dec 11 05:31:08 2012 From: akhil.arora at oracle.com (Akhil Arora) Date: Mon, 10 Dec 2012 21:31:08 -0800 Subject: RFR: 8001647: In-place methods on Collection/List In-Reply-To: <50C658A9.30607@oracle.com> References: <50C34AAE.4498.1080E1A4@v.a.ammodytes.googlemail.com> <50C658A9.30607@oracle.com> Message-ID: <50C6C51C.8080903@oracle.com> http://cr.openjdk.java.net/~akhil/8001647.3/webrev/ - now with synchronized and unmodifiable wrappers in Collections.java for the default methods being added On 12/10/2012 01:48 PM, Akhil Arora wrote: > Updated with yours and Alan's comments - > > http://cr.openjdk.java.net/~akhil/8001647.2/webrev/ > > - removed null check for removeSet > - cache this.size in removeAll, replaceAll > (for ArrayList, Vector and CopyOnWriteArrayList) > - calculate removeCount instead of BitCount.cardinality() > - removed unnecessary @library from test support classes > > Catching IndexOOB and throwing CME in forEach/removeAll/replaceAll seems > unecessary... did you have a use-case in mind where an IndexOOB can > occur with these methods? > > Thanks > > On 12/08/2012 05:11 AM, Arne Siegel wrote: >> ArrayList.java, line 1171: >> final boolean anyToRemove = (removeSet != null) && !removeSet.isEmpty(); >> As removeSet will never be null, this line can be simplified. This is a left-over from the >> preceding implementation (see b67). >> >> ArrayList.java, method forEach optimizes the loop by reducing the number of heap accesses: >> final int size = this.size; >> for (int i=0; modCount == expectedModCount && i < size; i++) { >> ... >> This trick might also be introduced to methods removeAll and replaceAll. >> >> In the ListIterator implementation of ArrayList, there are various appearances of the idiom: >> try { >> ... >> } catch (IndexOutOfBoundsException ex) { >> throw new ConcurrentModificationException(); >> } >> This technique might also be used in forEach, removeAll, and replaceAll (though not likely to >> be of any importance). >> >> Regards >> Arne Siegel >> > > From peter.levart at gmail.com Tue Dec 11 08:12:24 2012 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 11 Dec 2012 09:12:24 +0100 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C6AB79.4010606@redhat.com> References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com> <50C0B490.7050005@redhat.com> <50C55F11.6020801@oracle.com> <50C5E969.5040602@redhat.com> <50C67FF4.6050506@oracle.com> <50C6AB79.4010606@redhat.com> Message-ID: <50C6EAE8.8000204@gmail.com> On 12/11/2012 04:41 AM, David M. Lloyd wrote: > On JDK 8 with your patches, we are loading around 4750 classes and > there are, as expected, 0 define races (I believe, however, that we're > getting a false count though whenever defineClass() returns an > already-defined class - it would be nice if there were *some* way to > detect that this happened). Hi David, You could, of course this would have a minor impact on the whole thing, in your custom ClassLoader, have an instance of: final ConcurrentMap, Boolean> foundClasses = new ConcurrentHashMap<>(); @Override protected Class findClass(String name) throws ClassNotFoundException { ... ... if (foundClasses.putIfAbsent(clazz, Boolean.TRUE) != null) races++; return clazz; } Regards, Peter From peter.levart at gmail.com Tue Dec 11 09:20:17 2012 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 11 Dec 2012 10:20:17 +0100 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C6A09C.6000508@oracle.com> References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> <50C56053.1060306@oracle.com> <50C6A09C.6000508@oracle.com> Message-ID: <50C6FAD1.40506@gmail.com> On 12/11/2012 03:55 AM, David Holmes wrote: >> Question on the source code: registerAsFullyConcurrent has confusing >> comment - >> do the super classes all need to be parallel capable? Or do the super >> classes all need >> to be FullyConcurrent? I assume the latter, so just fix the comments. > > Actually it is the former. There's no reason to require that all > superclasses be fully-concurrent. Of course a given loaders degree of > concurrency may be constrained by what it's supertype allows, but > there's no reason to actually force all the supertypes to be > fully-concurrent: it is enough that they are at least all parallel > capable. Hi David, There is one caveat: if ClassLoader X declares that it is fully-concurrent and it's superclass Y is only parallel-capable, then X will act as fully-concurrent (returning null from getClassLoadingLock()). superclass Y might or might not be coded to use the getClassLoadingLock(). X therefore has to know how Y is coded. To be defensive, X could ask for Y's registration and declare itself as only parallel-capable if Y declares the same so that when Y is upgraded to be fully-concurrent, X would become fully-concurrent automatically. To support situations where the same version of X would work in two environments where in one Y is only parallel-capable and in the other Y is fully-concurrent, there could be a static API to retrieve the registrations of superclasses. Or, to have less impact on future deprecation of old parallel-capable registration API, the fully-concurrent registration API: protected static boolean registerAsFullyConcurrent() might take a boolean parameter: protected static boolean registerAsFullyConcurrent(boolean downgradeToPrallelCapableIfAnySuperclassIsNotFullyConcurrent) and provide no accessible API to find out what the registration actually did (register as parallel-capable or fully-concurrent - return true in any case). Since all JDK provided ClassLoaders will be made fully concurrent, this might only be relevant if there is vendor A that currently provides only parallel-capable ClassLoader implementation and there is vendor B that subclasses A's loader and wants to upgrade and be backward compatible at the same time. Does this complicate things to much for no real benefit? Regards, Peter From peter.levart at gmail.com Tue Dec 11 09:28:34 2012 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 11 Dec 2012 10:28:34 +0100 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C6FAD1.40506@gmail.com> References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> <50C56053.1060306@oracle.com> <50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com> Message-ID: <50C6FCC2.8080001@gmail.com> Hi again, There might be a middle-ground variant. No registration API changes as described below. When ClassLoader X declares that it is fully-concurrent make it fully-concurrent. But if any superclass registered as only parallel-capable, provide getClassLoadingLock() locks nevertheless. Only if all the superclasses declare that they are fully-concurrent, make no lock map and make getClassLoadingLock() return null. Regards, Peter On 12/11/2012 10:20 AM, Peter Levart wrote: > On 12/11/2012 03:55 AM, David Holmes wrote: >>> Question on the source code: registerAsFullyConcurrent has confusing >>> comment - >>> do the super classes all need to be parallel capable? Or do the >>> super classes all need >>> to be FullyConcurrent? I assume the latter, so just fix the comments. >> >> Actually it is the former. There's no reason to require that all >> superclasses be fully-concurrent. Of course a given loaders degree of >> concurrency may be constrained by what it's supertype allows, but >> there's no reason to actually force all the supertypes to be >> fully-concurrent: it is enough that they are at least all parallel >> capable. > > Hi David, > > There is one caveat: if ClassLoader X declares that it is > fully-concurrent and it's superclass Y is only parallel-capable, then > X will act as fully-concurrent (returning null from > getClassLoadingLock()). superclass Y might or might not be coded to > use the getClassLoadingLock(). X therefore has to know how Y is coded. > To be defensive, X could ask for Y's registration and declare itself > as only parallel-capable if Y declares the same so that when Y is > upgraded to be fully-concurrent, X would become fully-concurrent > automatically. To support situations where the same version of X would > work in two environments where in one Y is only parallel-capable and > in the other Y is fully-concurrent, there could be a static API to > retrieve the registrations of superclasses. > > Or, to have less impact on future deprecation of old parallel-capable > registration API, the fully-concurrent registration API: > > protected static boolean registerAsFullyConcurrent() > > might take a boolean parameter: > > protected static boolean registerAsFullyConcurrent(boolean > downgradeToPrallelCapableIfAnySuperclassIsNotFullyConcurrent) > > > and provide no accessible API to find out what the registration > actually did (register as parallel-capable or fully-concurrent - > return true in any case). > > Since all JDK provided ClassLoaders will be made fully concurrent, > this might only be relevant if there is vendor A that currently > provides only parallel-capable ClassLoader implementation and there is > vendor B that subclasses A's loader and wants to upgrade and be > backward compatible at the same time. > > Does this complicate things to much for no real benefit? > > Regards, Peter > From david.holmes at oracle.com Tue Dec 11 09:29:02 2012 From: david.holmes at oracle.com (David Holmes) Date: Tue, 11 Dec 2012 19:29:02 +1000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C6FAD1.40506@gmail.com> References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> <50C56053.1060306@oracle.com> <50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com> Message-ID: <50C6FCDE.7070404@oracle.com> On 11/12/2012 7:20 PM, Peter Levart wrote: > On 12/11/2012 03:55 AM, David Holmes wrote: >>> Question on the source code: registerAsFullyConcurrent has confusing >>> comment - >>> do the super classes all need to be parallel capable? Or do the super >>> classes all need >>> to be FullyConcurrent? I assume the latter, so just fix the comments. >> >> Actually it is the former. There's no reason to require that all >> superclasses be fully-concurrent. Of course a given loaders degree of >> concurrency may be constrained by what it's supertype allows, but >> there's no reason to actually force all the supertypes to be >> fully-concurrent: it is enough that they are at least all parallel >> capable. > > Hi David, > > There is one caveat: if ClassLoader X declares that it is > fully-concurrent and it's superclass Y is only parallel-capable, then X > will act as fully-concurrent (returning null from > getClassLoadingLock()). superclass Y might or might not be coded to use > the getClassLoadingLock(). X therefore has to know how Y is coded. To be > defensive, X could ask for Y's registration and declare itself as only > parallel-capable if Y declares the same so that when Y is upgraded to be > fully-concurrent, X would become fully-concurrent automatically. To > support situations where the same version of X would work in two > environments where in one Y is only parallel-capable and in the other Y > is fully-concurrent, there could be a static API to retrieve the > registrations of superclasses. I don't quite follow this. What code in the superclass are you anticipating that the subclass will use which relies on the lock? Or is this just an abstract "what if" scenario? Thanks, David ----- > Or, to have less impact on future deprecation of old parallel-capable > registration API, the fully-concurrent registration API: > > protected static boolean registerAsFullyConcurrent() > > might take a boolean parameter: > > protected static boolean registerAsFullyConcurrent(boolean > downgradeToPrallelCapableIfAnySuperclassIsNotFullyConcurrent) > > > and provide no accessible API to find out what the registration actually > did (register as parallel-capable or fully-concurrent - return true in > any case). > > Since all JDK provided ClassLoaders will be made fully concurrent, this > might only be relevant if there is vendor A that currently provides only > parallel-capable ClassLoader implementation and there is vendor B that > subclasses A's loader and wants to upgrade and be backward compatible at > the same time. > > Does this complicate things to much for no real benefit? > > Regards, Peter > From peter.levart at gmail.com Tue Dec 11 09:44:39 2012 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 11 Dec 2012 10:44:39 +0100 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C6FCDE.7070404@oracle.com> References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> <50C56053.1060306@oracle.com> <50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com> <50C6FCDE.7070404@oracle.com> Message-ID: <50C70087.4030003@gmail.com> On 12/11/2012 10:29 AM, David Holmes wrote: > On 11/12/2012 7:20 PM, Peter Levart wrote: >> On 12/11/2012 03:55 AM, David Holmes wrote: >>>> Question on the source code: registerAsFullyConcurrent has confusing >>>> comment - >>>> do the super classes all need to be parallel capable? Or do the super >>>> classes all need >>>> to be FullyConcurrent? I assume the latter, so just fix the comments. >>> >>> Actually it is the former. There's no reason to require that all >>> superclasses be fully-concurrent. Of course a given loaders degree of >>> concurrency may be constrained by what it's supertype allows, but >>> there's no reason to actually force all the supertypes to be >>> fully-concurrent: it is enough that they are at least all parallel >>> capable. >> >> Hi David, >> >> There is one caveat: if ClassLoader X declares that it is >> fully-concurrent and it's superclass Y is only parallel-capable, then X >> will act as fully-concurrent (returning null from >> getClassLoadingLock()). superclass Y might or might not be coded to use >> the getClassLoadingLock(). X therefore has to know how Y is coded. To be >> defensive, X could ask for Y's registration and declare itself as only >> parallel-capable if Y declares the same so that when Y is upgraded to be >> fully-concurrent, X would become fully-concurrent automatically. To >> support situations where the same version of X would work in two >> environments where in one Y is only parallel-capable and in the other Y >> is fully-concurrent, there could be a static API to retrieve the >> registrations of superclasses. > > I don't quite follow this. What code in the superclass are you > anticipating that the subclass will use which relies on the lock? Or > is this just an abstract "what if" scenario? This is more or less "what if". There might be a subclass Y of say java.lang.ClassLoader that overrides loadClass or findClass, declares that it is parallel-capable and in the implementation of it's loadClass or findClass, uses getClassLoadingLock() to synchronize access to it's internal state. Now there comes class X extends Y that declares that it is fully-concurrent. Of course this will not work, X has to declare that it is parallel-capable, because Y uses getClassLoadingLock(). What I suggested in the next message is to not change the registration API but rather provide getClassLoadingLock() that returns non-null locks when any of the superclasses declare that they are only parallel-capable, not fully-concurrent. Regards, Peter > > Thanks, > David > ----- > >> Or, to have less impact on future deprecation of old parallel-capable >> registration API, the fully-concurrent registration API: >> >> protected static boolean registerAsFullyConcurrent() >> >> might take a boolean parameter: >> >> protected static boolean registerAsFullyConcurrent(boolean >> downgradeToPrallelCapableIfAnySuperclassIsNotFullyConcurrent) >> >> >> and provide no accessible API to find out what the registration actually >> did (register as parallel-capable or fully-concurrent - return true in >> any case). >> >> Since all JDK provided ClassLoaders will be made fully concurrent, this >> might only be relevant if there is vendor A that currently provides only >> parallel-capable ClassLoader implementation and there is vendor B that >> subclasses A's loader and wants to upgrade and be backward compatible at >> the same time. >> >> Does this complicate things to much for no real benefit? >> >> Regards, Peter >> From david.holmes at oracle.com Tue Dec 11 11:27:57 2012 From: david.holmes at oracle.com (David Holmes) Date: Tue, 11 Dec 2012 21:27:57 +1000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C70087.4030003@gmail.com> References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> <50C56053.1060306@oracle.com> <50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com> <50C6FCDE.7070404@oracle.com> <50C70087.4030003@gmail.com> Message-ID: <50C718BD.2010201@oracle.com> Peter, You are convincing me that all superclasses must be fully concurrent too. Otherwise we are just trying to second-guess a whole bunch of what-ifs. :) Thanks, David On 11/12/2012 7:44 PM, Peter Levart wrote: > On 12/11/2012 10:29 AM, David Holmes wrote: >> On 11/12/2012 7:20 PM, Peter Levart wrote: >>> On 12/11/2012 03:55 AM, David Holmes wrote: >>>>> Question on the source code: registerAsFullyConcurrent has confusing >>>>> comment - >>>>> do the super classes all need to be parallel capable? Or do the super >>>>> classes all need >>>>> to be FullyConcurrent? I assume the latter, so just fix the comments. >>>> >>>> Actually it is the former. There's no reason to require that all >>>> superclasses be fully-concurrent. Of course a given loaders degree of >>>> concurrency may be constrained by what it's supertype allows, but >>>> there's no reason to actually force all the supertypes to be >>>> fully-concurrent: it is enough that they are at least all parallel >>>> capable. >>> >>> Hi David, >>> >>> There is one caveat: if ClassLoader X declares that it is >>> fully-concurrent and it's superclass Y is only parallel-capable, then X >>> will act as fully-concurrent (returning null from >>> getClassLoadingLock()). superclass Y might or might not be coded to use >>> the getClassLoadingLock(). X therefore has to know how Y is coded. To be >>> defensive, X could ask for Y's registration and declare itself as only >>> parallel-capable if Y declares the same so that when Y is upgraded to be >>> fully-concurrent, X would become fully-concurrent automatically. To >>> support situations where the same version of X would work in two >>> environments where in one Y is only parallel-capable and in the other Y >>> is fully-concurrent, there could be a static API to retrieve the >>> registrations of superclasses. >> >> I don't quite follow this. What code in the superclass are you >> anticipating that the subclass will use which relies on the lock? Or >> is this just an abstract "what if" scenario? > > This is more or less "what if". There might be a subclass Y of say > java.lang.ClassLoader that overrides loadClass or findClass, declares > that it is parallel-capable and in the implementation of it's loadClass > or findClass, uses getClassLoadingLock() to synchronize access to it's > internal state. Now there comes class X extends Y that declares that it > is fully-concurrent. Of course this will not work, X has to declare that > it is parallel-capable, because Y uses getClassLoadingLock(). > > What I suggested in the next message is to not change the registration > API but rather provide getClassLoadingLock() that returns non-null locks > when any of the superclasses declare that they are only > parallel-capable, not fully-concurrent. > > Regards, Peter > >> >> Thanks, >> David >> ----- >> >>> Or, to have less impact on future deprecation of old parallel-capable >>> registration API, the fully-concurrent registration API: >>> >>> protected static boolean registerAsFullyConcurrent() >>> >>> might take a boolean parameter: >>> >>> protected static boolean registerAsFullyConcurrent(boolean >>> downgradeToPrallelCapableIfAnySuperclassIsNotFullyConcurrent) >>> >>> >>> and provide no accessible API to find out what the registration actually >>> did (register as parallel-capable or fully-concurrent - return true in >>> any case). >>> >>> Since all JDK provided ClassLoaders will be made fully concurrent, this >>> might only be relevant if there is vendor A that currently provides only >>> parallel-capable ClassLoader implementation and there is vendor B that >>> subclasses A's loader and wants to upgrade and be backward compatible at >>> the same time. >>> >>> Does this complicate things to much for no real benefit? >>> >>> Regards, Peter >>> > From david.holmes at oracle.com Tue Dec 11 11:41:00 2012 From: david.holmes at oracle.com (David Holmes) Date: Tue, 11 Dec 2012 21:41:00 +1000 Subject: RFR: 8001647: In-place methods on Collection/List In-Reply-To: <65E39782-6530-47CB-A1FC-741A5B9ED4E2@oracle.com> References: <50C29B04.5070508@oracle.com> <50C5E36B.2040005@oracle.com> <65E39782-6530-47CB-A1FC-741A5B9ED4E2@oracle.com> Message-ID: <50C71BCC.9060205@oracle.com> On 11/12/2012 7:59 AM, Mike Duigou wrote: > > On Dec 10 2012, at 05:28 , Alan Bateman wrote: > >> On 08/12/2012 01:42, Akhil Arora wrote: >>> As part of the Library Lambdafication, this patch adds the following >>> default methods to Collections - >>> >> This may be bikeshed territory but we usually don't use the "public" modifier on methods defined by interfaces as they are public anyway. > > Adding "public" was at my suggestion. > >> It seems inconsistent to me to have it on the default methods. Perhaps this has been discussed before, in which case ignore this. BTW: The only reason I'm bringing this up is because there are lots of default methods to come and it would be nice to establish a convention and consistency from the start. > > Agreed that we should be consistent. The suggestion to add "public" isn't related specifically to the default but anticipates, perhaps prematurely, future addition of "package" "module" and "protected" modifiers. When those modifiers are added it will make sense to be explicit about the access of a method. Additionally, some have complained about the difference in default access between interfaces and classes (public vs package) and prefer to explicit so that the intent is obvious and that method signature text in interfaces and classes look the same. > > So, worthwhile or not? I think not. No matter what modifiers come in the future the default will always have to remain "public". But if you are going to add it then add it to all the methods in the interfaces being updated. David ----- > Mike > From peter.levart at gmail.com Tue Dec 11 11:58:24 2012 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 11 Dec 2012 12:58:24 +0100 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C718BD.2010201@oracle.com> References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> <50C56053.1060306@oracle.com> <50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com> <50C6FCDE.7070404@oracle.com> <50C70087.4030003@gmail.com> <50C718BD.2010201@oracle.com> Message-ID: <50C71FE0.5020704@gmail.com> On 12/11/2012 12:27 PM, David Holmes wrote: > Peter, > > You are convincing me that all superclasses must be fully concurrent > too. Otherwise we are just trying to second-guess a whole bunch of > what-ifs. :) If you think some more, yes. The superclass might not use getClassLoadingLock() but rely on the fact that findClass() is allways called under a guard of per-class-name lock, for example. It's a matter of how far to go to prevent such miss-behaving fully-concurrent subclasses. So far to also prevent fully-concurrent subclasses that would otherwise be perfectly correct? Maybe not. Creating custom ClassLoaders is not an average programmer's job. Those that do this things will of course study the implementations of superclasses they extend and do the right thing. And it's reasonable to expect that they more or less will only extend JDK's ClassLoaders - but on the other hand if they only extend JDK's class loaders, they are not prevented to be fully-concurrent either way. Hm... Peter > > Thanks, > David > > On 11/12/2012 7:44 PM, Peter Levart wrote: >> On 12/11/2012 10:29 AM, David Holmes wrote: >>> On 11/12/2012 7:20 PM, Peter Levart wrote: >>>> On 12/11/2012 03:55 AM, David Holmes wrote: >>>>>> Question on the source code: registerAsFullyConcurrent has confusing >>>>>> comment - >>>>>> do the super classes all need to be parallel capable? Or do the >>>>>> super >>>>>> classes all need >>>>>> to be FullyConcurrent? I assume the latter, so just fix the >>>>>> comments. >>>>> >>>>> Actually it is the former. There's no reason to require that all >>>>> superclasses be fully-concurrent. Of course a given loaders degree of >>>>> concurrency may be constrained by what it's supertype allows, but >>>>> there's no reason to actually force all the supertypes to be >>>>> fully-concurrent: it is enough that they are at least all parallel >>>>> capable. >>>> >>>> Hi David, >>>> >>>> There is one caveat: if ClassLoader X declares that it is >>>> fully-concurrent and it's superclass Y is only parallel-capable, >>>> then X >>>> will act as fully-concurrent (returning null from >>>> getClassLoadingLock()). superclass Y might or might not be coded to >>>> use >>>> the getClassLoadingLock(). X therefore has to know how Y is coded. >>>> To be >>>> defensive, X could ask for Y's registration and declare itself as only >>>> parallel-capable if Y declares the same so that when Y is upgraded >>>> to be >>>> fully-concurrent, X would become fully-concurrent automatically. To >>>> support situations where the same version of X would work in two >>>> environments where in one Y is only parallel-capable and in the >>>> other Y >>>> is fully-concurrent, there could be a static API to retrieve the >>>> registrations of superclasses. >>> >>> I don't quite follow this. What code in the superclass are you >>> anticipating that the subclass will use which relies on the lock? Or >>> is this just an abstract "what if" scenario? >> >> This is more or less "what if". There might be a subclass Y of say >> java.lang.ClassLoader that overrides loadClass or findClass, declares >> that it is parallel-capable and in the implementation of it's loadClass >> or findClass, uses getClassLoadingLock() to synchronize access to it's >> internal state. Now there comes class X extends Y that declares that it >> is fully-concurrent. Of course this will not work, X has to declare that >> it is parallel-capable, because Y uses getClassLoadingLock(). >> >> What I suggested in the next message is to not change the registration >> API but rather provide getClassLoadingLock() that returns non-null locks >> when any of the superclasses declare that they are only >> parallel-capable, not fully-concurrent. >> >> Regards, Peter >> >>> >>> Thanks, >>> David >>> ----- >>> >>>> Or, to have less impact on future deprecation of old parallel-capable >>>> registration API, the fully-concurrent registration API: >>>> >>>> protected static boolean registerAsFullyConcurrent() >>>> >>>> might take a boolean parameter: >>>> >>>> protected static boolean registerAsFullyConcurrent(boolean >>>> downgradeToPrallelCapableIfAnySuperclassIsNotFullyConcurrent) >>>> >>>> >>>> and provide no accessible API to find out what the registration >>>> actually >>>> did (register as parallel-capable or fully-concurrent - return true in >>>> any case). >>>> >>>> Since all JDK provided ClassLoaders will be made fully concurrent, >>>> this >>>> might only be relevant if there is vendor A that currently provides >>>> only >>>> parallel-capable ClassLoader implementation and there is vendor B that >>>> subclasses A's loader and wants to upgrade and be backward >>>> compatible at >>>> the same time. >>>> >>>> Does this complicate things to much for no real benefit? >>>> >>>> Regards, Peter >>>> >> From Alan.Bateman at oracle.com Tue Dec 11 12:24:56 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 11 Dec 2012 12:24:56 +0000 Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present In-Reply-To: <50C61B4B.1080901@oracle.com> References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com> <50C27AC1.2050600@oracle.com> <50C27DBA.3050808@oracle.com> <50C61B4B.1080901@oracle.com> Message-ID: <50C72618.5000407@oracle.com> Joe sent me an update with changes to address issues discussed so far, I've put the webrev here: http://cr.openjdk.java.net/~alanb/8004371/webrev.02/ Joe - the classes you sent me were in different packages, also the formatting was a bit messed up in several classes, I've fixed up those issues so you may need to re-base from the patch file included in the webrev. -Alan. From Alan.Bateman at oracle.com Tue Dec 11 12:28:38 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 11 Dec 2012 12:28:38 +0000 Subject: RFR: 8001647: In-place methods on Collection/List In-Reply-To: <65E39782-6530-47CB-A1FC-741A5B9ED4E2@oracle.com> References: <50C29B04.5070508@oracle.com> <50C5E36B.2040005@oracle.com> <65E39782-6530-47CB-A1FC-741A5B9ED4E2@oracle.com> Message-ID: <50C726F6.8020203@oracle.com> On 10/12/2012 21:59, Mike Duigou wrote: > : > > Adding "public" was at my suggestion. > >> It seems inconsistent to me to have it on the default methods. Perhaps this has been discussed before, in which case ignore this. BTW: The only reason I'm bringing this up is because there are lots of default methods to come and it would be nice to establish a convention and consistency from the start. > Agreed that we should be consistent. The suggestion to add "public" isn't related specifically to the default but anticipates, perhaps prematurely, future addition of "package" "module" and "protected" modifiers. When those modifiers are added it will make sense to be explicit about the access of a method. Additionally, some have complained about the difference in default access between interfaces and classes (public vs package) and prefer to explicit so that the intent is obvious and that method signature text in interfaces and classes look the same. > > So, worthwhile or not? It's probably not worth spending time on now but if we going to be explicit with new methods then existing methods should be updated too. -Alan. From Alan.Bateman at oracle.com Tue Dec 11 13:01:02 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 11 Dec 2012 13:01:02 +0000 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C6181B.70005@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50C06DAC.5050500@oracle.com> <50C0D805.5030509@oracle.com> <50C1A31D.1090805@oracle.com> <50C1EB41.2010502@oracle.com> <50C207F9.5060307@oracle.com> <50C21A2C.8070503@oracle.com> <50C23755.5030503@oracle.com> <50C6181B.70005@oracle.com> Message-ID: <50C72E8E.3090400@oracle.com> On 10/12/2012 17:12, Daniel Fuchs wrote: > Hi, > > After further discussion with Joe & Alan, I changed the call > to ServiceLoader to simply return the first provider it finds, > or null. > > This is closer to what was present in JDK 7 - and looping is > not necessary in JDK 8 since the default implementation is > not returned as a service provider. > > So here is a new - and hopefully simpler webrev: > > > > > best regards, > > -- daniel This looks fine to me, just a stray

at L64. -Alan From daniel.fuchs at oracle.com Tue Dec 11 14:10:24 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 11 Dec 2012 15:10:24 +0100 Subject: CFR: javax.xml.parsers: Using ServiceLoader to load JAXP parser factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C72E8E.3090400@oracle.com> References: <50BCF7CD.1020308@oracle.com> <50BE007A.4090102@oracle.com> <50BF73B2.5000102@oracle.com> <50C06DAC.5050500@oracle.com> <50C0D805.5030509@oracle.com> <50C1A31D.1090805@oracle.com> <50C1EB41.2010502@oracle.com> <50C207F9.5060307@oracle.com> <50C21A2C.8070503@oracle.com> <50C23755.5030503@oracle.com> <50C6181B.70005@oracle.com> <50C72E8E.3090400@oracle.com> Message-ID: <50C73ED0.5010609@oracle.com> On 12/11/12 2:01 PM, Alan Bateman wrote: > On 10/12/2012 17:12, Daniel Fuchs wrote: [...] >> So here is a new - and hopefully simpler webrev: >> >> >> >> >> best regards, >> >> -- daniel > This looks fine to me, just a stray

at L64. Right - I originally did it on purpose because the doc was looking weird without it. But now I regenerated the doc and I don't think it looks better with it - so I will remove the stray

. I'll just refresh webrev.04 after that (I assume there's no need for a webrev.05 - but I'd like to keep a public copy of the 'final' patch). -- daniel > > -Alan From Lance.Andersen at oracle.com Tue Dec 11 14:38:42 2012 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Tue, 11 Dec 2012 09:38:42 -0500 Subject: Review request 8004357: Implement various methods in SerialBlob/Clob/Array and specify Thread Safety Message-ID: <02E63BEB-D873-4C60-AA77-828C60A7DB44@oracle.com> Need a reviewer for 8004357: Implement various methods in SerialBlob/Clob/Array and specify Thread Safety This defines thread safety adds missing methods to SerialBlob/Clob/Array The CCC request has been reviewed. The changes uncovered a couple of bugs in the JCK which the JCK team is going to address in the JCK and RowSet TCK. JDBC Unit tests and SQE tests all continue to pass. http://cr.openjdk.java.net/~lancea/8004357/webrev.00/ Best Lance Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From david.lloyd at redhat.com Tue Dec 11 15:10:29 2012 From: david.lloyd at redhat.com (David M. Lloyd) Date: Tue, 11 Dec 2012 09:10:29 -0600 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C6C212.5090203@oracle.com> References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com> <50C0B490.7050005@redhat.com> <50C55F11.6020801@oracle.com> <50C5E969.5040602@redhat.com> <50C67FF4.6050506@oracle.com> <50C6AB79.4010606@redhat.com> <50C6C212.5090203@oracle.com> Message-ID: <50C74CE5.3040803@redhat.com> No problem. What do you mean by "instrumentation"? On 12/10/2012 11:18 PM, David Holmes wrote: > David, > > Many thanks for trialling this so promptly! > > Do you have any suggestions for what instrumentation you would like to > see accompany this? > > David > > On 11/12/2012 1:41 PM, David M. Lloyd wrote: >> On 12/10/2012 06:36 PM, David Holmes wrote: >>> On 10/12/2012 11:53 PM, David M. Lloyd wrote: >>>> On 12/09/2012 10:03 PM, David Holmes wrote: >>>>> That sounds promising. Are you in a position to try out this >>>>> proposal on >>>>> a testbed with your app server? >>>> >>>> Sure, I'd love to. What tree should I build? >>> >>> Please apply the patches from the webrevs here: >>> >>> http://cr.openjdk.java.net/~dholmes/concurrent-loaders/webrev.hotspot/ >>> http://cr.openjdk.java.net/~dholmes/concurrent-loaders/webrev.jdk/ >>> >>> They should apply to a jdk8 or tl forest. (And I hope I didn't mess >>> something up generating the webrev ;-) ) >> >> Well, I've just gotten everything working and done some cursory testing >> on a startup of an "empty" JBoss AS 7 instance, and then reviewing the >> metrics reported by our class loader. Our timing metrics are not really >> great for general-purpose benchmarking (for various uninteresting >> reasons), but I can at least get enough information to know everything >> is working more or less as expected: >> >> On JDK 6 with our "unsafe" lockless modification, we're typically >> loading 4707 classes, and I'm seeing anywhere from 0 to 5 define races >> that were automatically resolved. >> >> On JDK 7 using the standard registerAsParallelCapable() mechanism, we >> are loading 4711 classes and I'm seeing 35-50 define races that were >> automatically resolved - the overhead of locking starts to come to the >> fore I think. >> >> On JDK 8 with your patches, we are loading around 4750 classes and there >> are, as expected, 0 define races (I believe, however, that we're getting >> a false count though whenever defineClass() returns an already-defined >> class - it would be nice if there were *some* way to detect that this >> happened). >> >> On our class loader implementations, I'm initializing this way: >> >> static { >> try { >> ClassLoader.registerAsFullyConcurrent(); >> } catch (Throwable ignored) { >> try { >> ClassLoader.registerAsParallelCapable(); >> } catch (Throwable ignored2) { >> } >> } >> } >> >> The debugging message confirms that our class loaders are successfully >> registered as fully concurrent, and the fact that it doesn't hang or >> crash on JDK 7 indicates that they are still properly being registered >> as parallel-capable on that platform. >> -- - DML From david.lloyd at redhat.com Tue Dec 11 15:18:20 2012 From: david.lloyd at redhat.com (David M. Lloyd) Date: Tue, 11 Dec 2012 09:18:20 -0600 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C6EAE8.8000204@gmail.com> References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com> <50C0B490.7050005@redhat.com> <50C55F11.6020801@oracle.com> <50C5E969.5040602@redhat.com> <50C67FF4.6050506@oracle.com> <50C6AB79.4010606@redhat.com> <50C6EAE8.8000204@gmail.com> Message-ID: <50C74EBC.10209@redhat.com> On 12/11/2012 02:12 AM, Peter Levart wrote: > On 12/11/2012 04:41 AM, David M. Lloyd wrote: >> On JDK 8 with your patches, we are loading around 4750 classes and >> there are, as expected, 0 define races (I believe, however, that we're >> getting a false count though whenever defineClass() returns an >> already-defined class - it would be nice if there were *some* way to >> detect that this happened). > > Hi David, > > You could, of course this would have a minor impact on the whole thing, > in your custom ClassLoader, have an instance of: > > final ConcurrentMap, Boolean> foundClasses = new > ConcurrentHashMap<>(); > > @Override > protected Class findClass(String name) throws ClassNotFoundException { > ... > ... > if (foundClasses.putIfAbsent(clazz, Boolean.TRUE) != null) > races++; > return clazz; > } Sure, but having this map puts me back in the same situation I was in before where we have another concurrent map with a key per class. -- - DML From jonathan.gibbons at oracle.com Tue Dec 11 16:28:33 2012 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Tue, 11 Dec 2012 16:28:33 +0000 Subject: hg: jdk8/tl/langtools: 8003967: detect and remove all mutable implicit static enum fields in langtools Message-ID: <20121211162835.DAC7347067@hg.openjdk.java.net> Changeset: fcf89720ae71 Author: vromero Date: 2012-12-10 16:21 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/fcf89720ae71 8003967: detect and remove all mutable implicit static enum fields in langtools Reviewed-by: jjg ! src/share/classes/com/sun/tools/classfile/Opcode.java ! src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFileFactory.java ! src/share/classes/com/sun/tools/javac/Server.java ! src/share/classes/com/sun/tools/javac/code/Flags.java ! src/share/classes/com/sun/tools/javac/code/Kinds.java ! src/share/classes/com/sun/tools/javac/code/Lint.java ! src/share/classes/com/sun/tools/javac/code/Source.java ! src/share/classes/com/sun/tools/javac/code/TargetType.java ! src/share/classes/com/sun/tools/javac/code/TypeTag.java ! src/share/classes/com/sun/tools/javac/code/Types.java ! src/share/classes/com/sun/tools/javac/comp/ConstFold.java ! src/share/classes/com/sun/tools/javac/comp/Flow.java ! src/share/classes/com/sun/tools/javac/comp/Resolve.java ! src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java ! src/share/classes/com/sun/tools/javac/jvm/Code.java ! src/share/classes/com/sun/tools/javac/jvm/Target.java ! src/share/classes/com/sun/tools/javac/main/JavaCompiler.java ! src/share/classes/com/sun/tools/javac/main/Option.java ! src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java ! src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java ! src/share/classes/com/sun/tools/javac/tree/JCTree.java ! src/share/classes/com/sun/tools/javac/util/BaseFileManager.java ! src/share/classes/com/sun/tools/javac/util/List.java ! src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java ! src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java ! src/share/classes/com/sun/tools/javah/JavahTask.java ! src/share/classes/com/sun/tools/javap/JavapTask.java ! src/share/classes/javax/lang/model/element/Modifier.java ! src/share/classes/javax/lang/model/util/ElementFilter.java ! src/share/classes/javax/tools/StandardLocation.java + test/tools/javac/T8003967/DetectMutableStaticFields.java From daniel.fuchs at oracle.com Tue Dec 11 17:47:18 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 11 Dec 2012 18:47:18 +0100 Subject: RFR: javax.xml.datatype: Using ServiceLoader to load JAXP datatype factories (7169894: JAXP Plugability Layer: using service loader) Message-ID: <50C771A6.7090807@oracle.com> Hi, Here is a new webrev in the series that addresses using ServiceLoader in JAXP for JDK 8. 7169894: JAXP Plugability Layer: using service loader This changeset addresses modification in the javax.xml.datatype package. It is similar to changes proposed for the javax.xml.parsers package [1], with a few differences due to the specificities of javax.xml.datatype. Namely: 1. The documentation that describes the loading mechanism is in the class header rather than in the method documentation - which leads to some wording changes. 2. The DatatypeFactory is specified to throw a DatatypeConfigurationException - which is a checked exception, instead of an Error - as was FactoryConfigurationError 3. DatatypeConfigurationException allows to wrap ServiceConfigurationError directly - so the additional layer of RuntimeException is not needed here. -- daniel [1] javax.xml.parsers: From chris.hegarty at oracle.com Tue Dec 11 18:10:01 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Tue, 11 Dec 2012 18:10:01 +0000 Subject: RFR: Trivial patch for javadoc warnings in Base64 Message-ID: <50C776F9.509@oracle.com> hg diff Base64.java diff -r d206e52bf8a6 src/share/classes/java/util/Base64.java --- a/src/share/classes/java/util/Base64.java Tue Dec 11 13:14:56 2012 +0800 +++ b/src/share/classes/java/util/Base64.java Tue Dec 11 18:05:30 2012 +0000 @@ -289,8 +289,8 @@ public class Base64 { * *

This method first encodes all input bytes into a base64 encoded * byte array and then constructs a new String by using the encoded byte - * array and the {@link java.nio.charset.StandardCharsets.ISO_8859_1 ISO-8859-1} - * charset. + * array and the {@link java.nio.charset.StandardCharsets#ISO_8859_1 + * ISO-8859-1} charset. * *

In other words, an invocation of this method has exactly the same * effect as invoking @@ -358,9 +358,9 @@ public class Base64 { * to encode any more input bytes. The encoding operation can be * continued, if there is more bytes in input buffer to be encoded, * by invoking this method again with an output buffer that has more - * {@linkplain Buffer#remaining remaining} bytes. This is typically - * done by draining any encoded bytes from the output buffer. The - * value returned from last invocation needs to be passed in as the + * {@linkplain java.nio.Buffer#remaining remaining} bytes. This is + * typically done by draining any encoded bytes from the output buffer. + * The value returned from last invocation needs to be passed in as the * third parameter {@code bytesOut} if it is to continue an unfinished * encoding, 0 otherwise. * @@ -806,9 +806,9 @@ public class Base64 { * buffer has insufficient space to decode any more input bytes. * The decoding operation can be continued, if there is more bytes * in input buffer to be decoded, by invoking this method again with - * an output buffer that has more {@linkplain Buffer#remaining remaining} - * bytes.This is typically done by draining any decoded bytes from the - * output buffer. + * an output buffer that has more {@linkplain java.nio.Buffer#remaining + * remaining} bytes. This is typically done by draining any decoded + * bytes from the output buffer. * *

Recommended Usage Example *



-Chris.


From joe.darcy at oracle.com  Tue Dec 11 18:21:19 2012
From: joe.darcy at oracle.com (Joe Darcy)
Date: Tue, 11 Dec 2012 10:21:19 -0800
Subject: RFR: Trivial patch for javadoc warnings in Base64
In-Reply-To: <50C776F9.509@oracle.com>
References: <50C776F9.509@oracle.com>
Message-ID: <50C7799F.9050109@oracle.com>

Looks good Chris -- approved!

Cheers,

-Joe

On 12/11/2012 10:10 AM, Chris Hegarty wrote:
>
> hg diff Base64.java
> diff -r d206e52bf8a6 src/share/classes/java/util/Base64.java
> --- a/src/share/classes/java/util/Base64.java   Tue Dec 11 13:14:56 
> 2012 +0800
> +++ b/src/share/classes/java/util/Base64.java   Tue Dec 11 18:05:30 
> 2012 +0000
> @@ -289,8 +289,8 @@ public class Base64 {
>           *
>           * 

This method first encodes all input bytes into a > base64 encoded > * byte array and then constructs a new String by using the > encoded byte > - * array and the {@link > java.nio.charset.StandardCharsets.ISO_8859_1 ISO-8859-1} > - * charset. > + * array and the {@link > java.nio.charset.StandardCharsets#ISO_8859_1 > + * ISO-8859-1} charset. > * > *

In other words, an invocation of this method has > exactly the same > * effect as invoking > @@ -358,9 +358,9 @@ public class Base64 { > * to encode any more input bytes. The encoding operation can be > * continued, if there is more bytes in input buffer to be > encoded, > * by invoking this method again with an output buffer that > has more > - * {@linkplain Buffer#remaining remaining} bytes. This is > typically > - * done by draining any encoded bytes from the output buffer. > The > - * value returned from last invocation needs to be passed in > as the > + * {@linkplain java.nio.Buffer#remaining remaining} bytes. > This is > + * typically done by draining any encoded bytes from the > output buffer. > + * The value returned from last invocation needs to be passed > in as the > * third parameter {@code bytesOut} if it is to continue an > unfinished > * encoding, 0 otherwise. > * > @@ -806,9 +806,9 @@ public class Base64 { > * buffer has insufficient space to decode any more input bytes. > * The decoding operation can be continued, if there is more > bytes > * in input buffer to be decoded, by invoking this method > again with > - * an output buffer that has more {@linkplain > Buffer#remaining remaining} > - * bytes.This is typically done by draining any decoded bytes > from the > - * output buffer. > + * an output buffer that has more {@linkplain > java.nio.Buffer#remaining > + * remaining} bytes. This is typically done by draining any > decoded > + * bytes from the output buffer. > * > *

Recommended Usage Example > *

>
>
> -Chris.



From akhil.arora at oracle.com  Tue Dec 11 19:54:00 2012
From: akhil.arora at oracle.com (Akhil Arora)
Date: Tue, 11 Dec 2012 11:54:00 -0800
Subject: Review Request: 8004201: add reducers to primitive type wrappers
In-Reply-To: <50C67417.2030205@oracle.com>
References: <50B8FE8A.2030403@oracle.com> <50BC0576.4070202@oracle.com>
	<50BFBC49.9020200@oracle.com> <50BFDC75.6000306@oracle.com>
	<50C67417.2030205@oracle.com>
Message-ID: <50C78F58.70705@oracle.com>

http://cr.openjdk.java.net/~akhil/8004201.3/webrev/

- removed these operators on Byte and Short
- javadoc improvements based on CCC review

On 12/10/2012 03:45 PM, Akhil Arora wrote:
> http://cr.openjdk.java.net/~akhil/8004201.2/webrev/
>
> - replaced "Suitable for conversion as a method reference to functional
> interfaces such as ..." with @see java.util.function.BinaryOperator
>
> - javadoc - replaced 'a  argument'/'another  argument' with
> 'the first operand'/'the second operand'
>
> - did not widen return types - widening the return type makes these
> methods unusable as reducers, since BinaryOperator is declared
>    T operate(T left, T right)
>
> Thanks
>
> On 12/05/2012 03:44 PM, Joseph Darcy wrote:
>> Akhil,
>>
>> In javadoc like this
>>
>> 298      * as {@code BinaryOperator<Boolean>}.
>>
>> you don't have to use "<" and the like inside {@code}; please
>> change to
>>
>> 298      * as {@code BinaryOperator}.
>>
>> As a general comment, if the operations for primitive type Foo are put
>> into java.lang.Foo, then the type of the operation needs to be
>> explicitly represented in the expression calling the method (unless
>> static imports are used, etc.).  Therefore, I suggest putting these sort
>> of static methods all into one class to allow overloading to do its
>> thing (java.lang.Operators?).  Also, for methods like sum, I think it is
>> worth considering returning a larger type than the operands to avoid
>> problems from integer or floating-point overflow. For example, sum on
>> byte and short would return int, sun on int would return long, etc.
>>
>> As an aside, to get a numerically robust result, the summation logic
>> over a set of doubles needs to be more than just a set of raw double
>> additions, but that can be tackled later.
>>
>> Cheers,
>>
>> -Joe
>>
>>
>> On 12/5/2012 1:27 PM, Akhil Arora wrote:
>>> Updated - http://cr.openjdk.java.net/~akhil/8004201.1/webrev/
>>>
>>> - delegate to Math.min/max for int/long/float/double
>>> - rename Boolean.and/or/xor to logicalAnd/logicalOr/logicalXor
>>> - removed Character variants of min/max/sum
>>>
>>> On 12/02/2012 05:50 PM, David Holmes wrote:
>>>> Hi Akhil,
>>>>
>>>> Is it really necessary/desirable to flag all of these as " Suitable for
>>>> conversion as a method reference to functional interfaces such as
>>>> ..." ?
>>> Not necessary, but it does provide a hint as to their intended use to a
>>> casual browser of these docs.
>>>
>>>> This style:
>>>>
>>>> +     * @param   a   a boolean argument.
>>>> +     * @param   b   another boolean argument.
>>>>
>>>> is at odds with the style used elsewhere for new Functional APIs, and
>>>> with the style of other methods in these classes. Can we just use
>>>> "first
>>>> operand" and "second operand" for all of these?
>>> It is consistent with Math.min/max, which use the a/b style. Since these
>>> methods are not in one of the functional package, is'nt it better to
>>> stick to the local style?
>>>
>>>> Character.sum does not make sense to me. Who adds together characters?
>>>> I'm not even sure min and max are worth supporting for Character.
>>> Good point - removed these methods for Character.
>>>
>>>> I disagree with other suggestions to use the Math functions for
>>>> float/double. I think all these methods should use the underlying
>>>> primitive operator regardless of type.
>>> Are you disagreeing only for float/double or for int/long also? Can you
>>> provide more information as to why you disagree?
>>>
>>> Thanks
>>>
>>>> Thanks,
>>>> David
>>>> -----
>>>>
>>>> On 1/12/2012 4:44 AM, Akhil Arora wrote:
>>>>> Hi
>>>>>
>>>>> Requesting review for some basic functionality related to lambdas -
>>>>>
>>>>> Add min, max, sum methods to the primitive wrapper classes - Byte,
>>>>> Short, Integer, Long, Float, Double and Character so as to be able to
>>>>> use them as reducers in lambda expressions. Add and, or, xor
>>>>> methods to
>>>>> Boolean.
>>>>>
>>>>> http://cr.openjdk.java.net/~akhil/8004201.0/webrev/
>>>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004201
>>>>>
>>>>> Thanks
>>>
>>
>



From Alan.Bateman at oracle.com  Tue Dec 11 19:55:57 2012
From: Alan.Bateman at oracle.com (Alan Bateman)
Date: Tue, 11 Dec 2012 19:55:57 +0000
Subject: 8004874: (profiles) Reduce dependency on java.beans to only
	add/removePropertyChangeListener
Message-ID: <50C78FCD.1090905@oracle.com>


Those tracking the work to get us to a modular JDK will know that the 
java.beans package is highly problematic.

For the "core" modules then  j.u.l.LogManager and j.u.jar.Pack200 have 
support for PropertyChangeListener and that means edges in the module 
graph that are highly undesirable. As I've mentioned in other mails 
here, the plan to address this is to deprecate the 
add/removePropertyChangeListener methods defined by these classes in JDK 
8 and remove them outright in JDK 9.

In the mean-time we have Compact Profiles coming in JDK 8 so we need a 
solution that allows the java.util.logging and java.util.jar packages be 
included in the profiles without java.beans. As we are only talking 
about 6 methods in non-mainstream areas then the proposal is that these 
methods are not present in the subset Profiles of Java SE. This may be a 
surprise but it avoids a long of list of complications that would 
otherwise arise if there are references to types that do not exist. In 
implementation terms they will be removed in the build of the profiles, 
that's a minor detail.

The changes proposed are just minor updates to LogManager and the 
Pack200.Packer and Pack200.Unpacker implementations so that the only 
dependencies on PropertyChangeListener and PropertyChangeEvent are in 
the addPropertyChangeListener and removePropertyChangeListener methods. 
Once they get to the profiles forest then we can put changes in to 
remove these methods (and maybe GC the constant pool too).

One other thing to point out is that Packer and Unpacker are interfaces 
and so removing methods means that implementations that compile against 
the subset will not compile when the add/removePropertyChangeListener 
methods are present.  As it should be very rare to implement Packer and 
Unpacker then it's probably not a big deal but we can use default 
methods to eliminate the concern so that implementations that compile 
against compact1 (for example) will also compile on the full platform.

The webrev with the changes is here. Note that only changes to 
LogManager and pack200's PropMap are proposed to be included for now, 
changing the methods to default methods will come later along with 
javadoc updates, perhaps via the profiles forest. One other thing is 
that the Beans supporting class is duplicated between the two, this is 
mostly to avoid it getting used more widely. It will of course be 
removed once these methods are removed from the full platform, as per 
the original plan.

http://cr.openjdk.java.net/~alanb/8004874/webrev/

Thanks,

Alan.


From kumar.x.srinivasan at oracle.com  Tue Dec 11 22:18:44 2012
From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan)
Date: Tue, 11 Dec 2012 14:18:44 -0800
Subject: 8004874: (profiles) Reduce dependency on java.beans to only
	add/removePropertyChangeListener
In-Reply-To: <50C78FCD.1090905@oracle.com>
References: <50C78FCD.1090905@oracle.com>
Message-ID: <50C7B144.3060100@oracle.com>

Alan,

PropMap.java, Nit: typo PropertyChangeListern's similarly in the other.

Nice test, but since it is specific to pack200 and all pack200 tests
are in jdk/test/tools/pack200,  perhaps move it there ?

Besides that I could not find anything else wrong, the
users of these ProperyChangeListeners are the deployment
technologies, though.

Kumar




>
> Those tracking the work to get us to a modular JDK will know that the 
> java.beans package is highly problematic.
>
> For the "core" modules then  j.u.l.LogManager and j.u.jar.Pack200 have 
> support for PropertyChangeListener and that means edges in the module 
> graph that are highly undesirable. As I've mentioned in other mails 
> here, the plan to address this is to deprecate the 
> add/removePropertyChangeListener methods defined by these classes in 
> JDK 8 and remove them outright in JDK 9.
>
> In the mean-time we have Compact Profiles coming in JDK 8 so we need a 
> solution that allows the java.util.logging and java.util.jar packages 
> be included in the profiles without java.beans. As we are only talking 
> about 6 methods in non-mainstream areas then the proposal is that 
> these methods are not present in the subset Profiles of Java SE. This 
> may be a surprise but it avoids a long of list of complications that 
> would otherwise arise if there are references to types that do not 
> exist. In implementation terms they will be removed in the build of 
> the profiles, that's a minor detail.
>
> The changes proposed are just minor updates to LogManager and the 
> Pack200.Packer and Pack200.Unpacker implementations so that the only 
> dependencies on PropertyChangeListener and PropertyChangeEvent are in 
> the addPropertyChangeListener and removePropertyChangeListener 
> methods. Once they get to the profiles forest then we can put changes 
> in to remove these methods (and maybe GC the constant pool too).
>
> One other thing to point out is that Packer and Unpacker are 
> interfaces and so removing methods means that implementations that 
> compile against the subset will not compile when the 
> add/removePropertyChangeListener methods are present.  As it should be 
> very rare to implement Packer and Unpacker then it's probably not a 
> big deal but we can use default methods to eliminate the concern so 
> that implementations that compile against compact1 (for example) will 
> also compile on the full platform.
>
> The webrev with the changes is here. Note that only changes to 
> LogManager and pack200's PropMap are proposed to be included for now, 
> changing the methods to default methods will come later along with 
> javadoc updates, perhaps via the profiles forest. One other thing is 
> that the Beans supporting class is duplicated between the two, this is 
> mostly to avoid it getting used more widely. It will of course be 
> removed once these methods are removed from the full platform, as per 
> the original plan.
>
> http://cr.openjdk.java.net/~alanb/8004874/webrev/
>
> Thanks,
>
> Alan.



From jim.gish at oracle.com  Tue Dec 11 23:04:58 2012
From: jim.gish at oracle.com (Jim Gish)
Date: Tue, 11 Dec 2012 18:04:58 -0500
Subject: RFR: 8004651 - TEST: java/util/logging/CheckLockLocationTest.java
	failed to delete file (win)
In-Reply-To: <50C68292.4030404@oracle.com>
References: <50C2410E.7040200@oracle.com> <50C68292.4030404@oracle.com>
Message-ID: <50C7BC1A.9010305@oracle.com>

A bit more cleanup as suggested:

http://cr.openjdk.java.net/~jgish/Bug8004651-CheckLockLocationTest-Windows-delete-file-fix/ 


Thanks,
     Jim

On 12/10/2012 07:47 PM, Stuart Marks wrote:
> Hi Jim,
>
> Catching IOException from delete() is a bit odd. The only thing in the 
> delete() method that throws an IOE is the explicit throw of 
> FileNotFoundException... so in that case we'd throw FNFE and then 
> catch the IOE at the caller and print a warning. Would it be better to 
> just print a warning from within the delete() method, and remove 
> "throws IOException" ? There's only one other caller to delete() and 
> it seems indifferent to this change.
>
> Now that we're no longer checking the message of FileSystemException, 
> it's possible to change the instanceof check into a separate 
> catch-clause of FileSystemException, which simply ignores that 
> exception. The catch clause for IOException can be simplified to 
> unconditionally wrap the IOE in a RuntimeException and rethrow it. 
> Actually it's not clear to me that's even necessary since runTests() 
> is declared to throw IOException, so we might not even need to catch 
> IOE here at all; we can just let it propagate to the caller.
>
> Looks like similar simplifications apply to tests 2 and 4 as well.
>
> s'marks
>
> On 12/7/12 11:18 AM, Jim Gish wrote:
>> Please review
>> http://cr.openjdk.java.net/~jgish/Bug8004651-CheckLockLocationTest-Windows-delete-file-fix/ 
>>
>>  
>>
>>
>>
>> Summary -- failure to delete a test log should be a warning instead of a
>> failure.  Also, while fixing this problem another one popped up -- 
>> not all
>> platforms generate the same message in the FileSystemException ("Not a
>> directory"), so removing the exception content check.
>>
>> Thanks,
>>     Jim
>>

-- 
Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304
Oracle Java Platform Group | Core Libraries Team
35 Network Drive
Burlington, MA 01803
jim.gish at oracle.com



From jonathan.gibbons at oracle.com  Tue Dec 11 23:05:56 2012
From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com)
Date: Tue, 11 Dec 2012 23:05:56 +0000
Subject: hg: jdk8/tl/langtools: 8004828: refactor init of *DocImpl classes
Message-ID: <20121211230601.6FED947097@hg.openjdk.java.net>

Changeset: cfde9737131e
Author:    jjg
Date:      2012-12-11 15:05 -0800
URL:       http://hg.openjdk.java.net/jdk8/tl/langtools/rev/cfde9737131e

8004828: refactor init of *DocImpl classes
Reviewed-by: darcy

! src/share/classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java
! src/share/classes/com/sun/tools/javadoc/AnnotationTypeElementDocImpl.java
! src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java
! src/share/classes/com/sun/tools/javadoc/ConstructorDocImpl.java
! src/share/classes/com/sun/tools/javadoc/DocEnv.java
! src/share/classes/com/sun/tools/javadoc/DocImpl.java
! src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java
! src/share/classes/com/sun/tools/javadoc/FieldDocImpl.java
! src/share/classes/com/sun/tools/javadoc/JavadocEnter.java
! src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java
! src/share/classes/com/sun/tools/javadoc/MemberDocImpl.java
! src/share/classes/com/sun/tools/javadoc/MethodDocImpl.java
! src/share/classes/com/sun/tools/javadoc/PackageDocImpl.java
! src/share/classes/com/sun/tools/javadoc/ProgramElementDocImpl.java
! src/share/classes/com/sun/tools/javadoc/RootDocImpl.java



From mandy.chung at oracle.com  Tue Dec 11 23:24:16 2012
From: mandy.chung at oracle.com (Mandy Chung)
Date: Tue, 11 Dec 2012 15:24:16 -0800
Subject: 8004874: (profiles) Reduce dependency on java.beans to only
	add/removePropertyChangeListener
In-Reply-To: <50C78FCD.1090905@oracle.com>
References: <50C78FCD.1090905@oracle.com>
Message-ID: <50C7C0A0.2010402@oracle.com>

Alan,

Looks good to me.  Duplicating the Beans supporting class is fine as 
they will be removed when the deprecated addPropertyChangeListener and 
removePropertyChangeListener methods are removed in a future release.

Mandy

On 12/11/12 11:55 AM, Alan Bateman wrote:
>
> Those tracking the work to get us to a modular JDK will know that the 
> java.beans package is highly problematic.
>
> For the "core" modules then  j.u.l.LogManager and j.u.jar.Pack200 have 
> support for PropertyChangeListener and that means edges in the module 
> graph that are highly undesirable. As I've mentioned in other mails 
> here, the plan to address this is to deprecate the 
> add/removePropertyChangeListener methods defined by these classes in 
> JDK 8 and remove them outright in JDK 9.
>
> In the mean-time we have Compact Profiles coming in JDK 8 so we need a 
> solution that allows the java.util.logging and java.util.jar packages 
> be included in the profiles without java.beans. As we are only talking 
> about 6 methods in non-mainstream areas then the proposal is that 
> these methods are not present in the subset Profiles of Java SE. This 
> may be a surprise but it avoids a long of list of complications that 
> would otherwise arise if there are references to types that do not 
> exist. In implementation terms they will be removed in the build of 
> the profiles, that's a minor detail.
>
> The changes proposed are just minor updates to LogManager and the 
> Pack200.Packer and Pack200.Unpacker implementations so that the only 
> dependencies on PropertyChangeListener and PropertyChangeEvent are in 
> the addPropertyChangeListener and removePropertyChangeListener 
> methods. Once they get to the profiles forest then we can put changes 
> in to remove these methods (and maybe GC the constant pool too).
>
> One other thing to point out is that Packer and Unpacker are 
> interfaces and so removing methods means that implementations that 
> compile against the subset will not compile when the 
> add/removePropertyChangeListener methods are present.  As it should be 
> very rare to implement Packer and Unpacker then it's probably not a 
> big deal but we can use default methods to eliminate the concern so 
> that implementations that compile against compact1 (for example) will 
> also compile on the full platform.
>
> The webrev with the changes is here. Note that only changes to 
> LogManager and pack200's PropMap are proposed to be included for now, 
> changing the methods to default methods will come later along with 
> javadoc updates, perhaps via the profiles forest. One other thing is 
> that the Beans supporting class is duplicated between the two, this is 
> mostly to avoid it getting used more widely. It will of course be 
> removed once these methods are removed from the full platform, as per 
> the original plan.
>
> http://cr.openjdk.java.net/~alanb/8004874/webrev/
>
> Thanks,
>
> Alan.



From mike.duigou at oracle.com  Tue Dec 11 23:49:54 2012
From: mike.duigou at oracle.com (mike.duigou at oracle.com)
Date: Tue, 11 Dec 2012 23:49:54 +0000
Subject: hg: jdk8/tl/jdk: 8003246: Add InitialValue Supplier to ThreadLocal
Message-ID: <20121211235017.14A764709A@hg.openjdk.java.net>

Changeset: c4bd81de2868
Author:    akhil
Date:      2012-12-11 15:33 -0800
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c4bd81de2868

8003246: Add InitialValue Supplier to ThreadLocal
Reviewed-by: mduigou, forax, dl, chegar, briangoetz

! src/share/classes/java/lang/ThreadLocal.java
+ test/java/lang/ThreadLocal/ThreadLocalSupplierTest.java



From stuart.marks at oracle.com  Tue Dec 11 23:53:29 2012
From: stuart.marks at oracle.com (Stuart Marks)
Date: Tue, 11 Dec 2012 15:53:29 -0800
Subject: RFR: 8004748: clean up @build tags in RMI tests
Message-ID: <50C7C779.4000106@oracle.com>

Hi all,

Please review the following gigantic webrev [1] to clean up @build tags in RMI 
tests. Details underlying this change are in the bug report [2].

Briefly, if test classes listed in @build tags are in the wrong order, this 
trips over a jtreg problem that in turn causes a cascade of subsequent tests to 
fail. It's sensitive to the order in which tests run. The problem currently 
occurs in the jdk7u repo. It doesn't happen in jdk8 right now, but as things 
shift around it might occur in the future.

Naturally, I intend to backport this to 7u once it's in 8.

Shifting the @build tags in the test is a workaround for the jtreg bug, but 
jtreg isn't going to be fixed soon. Besides, the @build tags in the RMI tests 
needed to be cleaned up anyway. In particular, consolidating multiple @build 
tags into a single tag speeds up the RMI test run by about 2.5%.

I've also taken the opportunity to do a couple of related cleanups in a few 
places, such as fixing typos, rearranging tags to be in a more consistent 
order, removing unnecessary classes from @build lines, adding necessary ones, 
and in one case renaming a file that was spelled differently from the class 
that it contained. (CheckUnmarshall.java -> CheckUnmarshal.java; there are no 
textual changes to this file.)

Needless to say, all tests pass. In addition, I've run each test individually 
(i.e., with a clean JTwork directory) to ensure that there were no occurrences 
of the library class ordering issue that triggers the jtreg bug.

Thanks,

s'marks


[1] http://cr.openjdk.java.net/~smarks/reviews/8004748/webrev.0/

[2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004748


From stuart.marks at oracle.com  Wed Dec 12 00:02:29 2012
From: stuart.marks at oracle.com (Stuart Marks)
Date: Tue, 11 Dec 2012 16:02:29 -0800
Subject: RFR: 8004651 - TEST: java/util/logging/CheckLockLocationTest.java
	failed to delete file (win)
In-Reply-To: <50C7BC1A.9010305@oracle.com>
References: <50C2410E.7040200@oracle.com> <50C68292.4030404@oracle.com>
	<50C7BC1A.9010305@oracle.com>
Message-ID: <50C7C995.5090408@oracle.com>

Looks good!

Do you need someone to push this for you?

s'marks

On 12/11/12 3:04 PM, Jim Gish wrote:
> A bit more cleanup as suggested:
>
> http://cr.openjdk.java.net/~jgish/Bug8004651-CheckLockLocationTest-Windows-delete-file-fix/
> 
>
> Thanks,
>      Jim
>
> On 12/10/2012 07:47 PM, Stuart Marks wrote:
>> Hi Jim,
>>
>> Catching IOException from delete() is a bit odd. The only thing in the
>> delete() method that throws an IOE is the explicit throw of
>> FileNotFoundException... so in that case we'd throw FNFE and then catch the
>> IOE at the caller and print a warning. Would it be better to just print a
>> warning from within the delete() method, and remove "throws IOException" ?
>> There's only one other caller to delete() and it seems indifferent to this
>> change.
>>
>> Now that we're no longer checking the message of FileSystemException, it's
>> possible to change the instanceof check into a separate catch-clause of
>> FileSystemException, which simply ignores that exception. The catch clause
>> for IOException can be simplified to unconditionally wrap the IOE in a
>> RuntimeException and rethrow it. Actually it's not clear to me that's even
>> necessary since runTests() is declared to throw IOException, so we might not
>> even need to catch IOE here at all; we can just let it propagate to the caller.
>>
>> Looks like similar simplifications apply to tests 2 and 4 as well.
>>
>> s'marks
>>
>> On 12/7/12 11:18 AM, Jim Gish wrote:
>>> Please review
>>> http://cr.openjdk.java.net/~jgish/Bug8004651-CheckLockLocationTest-Windows-delete-file-fix/
>>>
>>> 
>>>
>>>
>>>
>>> Summary -- failure to delete a test log should be a warning instead of a
>>> failure.  Also, while fixing this problem another one popped up -- not all
>>> platforms generate the same message in the FileSystemException ("Not a
>>> directory"), so removing the exception content check.
>>>
>>> Thanks,
>>>     Jim
>>>
>
> --
> Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304
> Oracle Java Platform Group | Core Libraries Team
> 35 Network Drive
> Burlington, MA 01803
> jim.gish at oracle.com
>


From joe.darcy at oracle.com  Wed Dec 12 01:27:11 2012
From: joe.darcy at oracle.com (Joe Darcy)
Date: Tue, 11 Dec 2012 17:27:11 -0800
Subject: RFR: 8004748: clean up @build tags in RMI tests
In-Reply-To: <50C7C779.4000106@oracle.com>
References: <50C7C779.4000106@oracle.com>
Message-ID: <50C7DD6F.4000203@oracle.com>

Looks fine; approved,

-Joe

On 12/11/2012 03:53 PM, Stuart Marks wrote:
> Hi all,
>
> Please review the following gigantic webrev [1] to clean up @build 
> tags in RMI tests. Details underlying this change are in the bug 
> report [2].
>
> Briefly, if test classes listed in @build tags are in the wrong order, 
> this trips over a jtreg problem that in turn causes a cascade of 
> subsequent tests to fail. It's sensitive to the order in which tests 
> run. The problem currently occurs in the jdk7u repo. It doesn't happen 
> in jdk8 right now, but as things shift around it might occur in the 
> future.
>
> Naturally, I intend to backport this to 7u once it's in 8.
>
> Shifting the @build tags in the test is a workaround for the jtreg 
> bug, but jtreg isn't going to be fixed soon. Besides, the @build tags 
> in the RMI tests needed to be cleaned up anyway. In particular, 
> consolidating multiple @build tags into a single tag speeds up the RMI 
> test run by about 2.5%.
>
> I've also taken the opportunity to do a couple of related cleanups in 
> a few places, such as fixing typos, rearranging tags to be in a more 
> consistent order, removing unnecessary classes from @build lines, 
> adding necessary ones, and in one case renaming a file that was 
> spelled differently from the class that it contained. 
> (CheckUnmarshall.java -> CheckUnmarshal.java; there are no textual 
> changes to this file.)
>
> Needless to say, all tests pass. In addition, I've run each test 
> individually (i.e., with a clean JTwork directory) to ensure that 
> there were no occurrences of the library class ordering issue that 
> triggers the jtreg bug.
>
> Thanks,
>
> s'marks
>
>
> [1] http://cr.openjdk.java.net/~smarks/reviews/8004748/webrev.0/
>
> [2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004748



From david.holmes at oracle.com  Wed Dec 12 01:32:51 2012
From: david.holmes at oracle.com (David Holmes)
Date: Wed, 12 Dec 2012 11:32:51 +1000
Subject: Proposal: Fully Concurrent ClassLoading
In-Reply-To: <50C74CE5.3040803@redhat.com>
References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com>
	<50C0B490.7050005@redhat.com> <50C55F11.6020801@oracle.com>
	<50C5E969.5040602@redhat.com> <50C67FF4.6050506@oracle.com>
	<50C6AB79.4010606@redhat.com> <50C6C212.5090203@oracle.com>
	<50C74CE5.3040803@redhat.com>
Message-ID: <50C7DEC3.2050503@oracle.com>

On 12/12/2012 1:10 AM, David M. Lloyd wrote:
> No problem. What do you mean by "instrumentation"?

Any means of "seeing" when parallel define class actually occurred:

-  -verbose:class logging ?
-  jvmstat counter ?
- -XX:+TraceParallelDefine ?
- ???

Thanks,
David

> On 12/10/2012 11:18 PM, David Holmes wrote:
>> David,
>>
>> Many thanks for trialling this so promptly!
>>
>> Do you have any suggestions for what instrumentation you would like to
>> see accompany this?
>>
>> David
>>
>> On 11/12/2012 1:41 PM, David M. Lloyd wrote:
>>> On 12/10/2012 06:36 PM, David Holmes wrote:
>>>> On 10/12/2012 11:53 PM, David M. Lloyd wrote:
>>>>> On 12/09/2012 10:03 PM, David Holmes wrote:
>>>>>> That sounds promising. Are you in a position to try out this
>>>>>> proposal on
>>>>>> a testbed with your app server?
>>>>>
>>>>> Sure, I'd love to. What tree should I build?
>>>>
>>>> Please apply the patches from the webrevs here:
>>>>
>>>> http://cr.openjdk.java.net/~dholmes/concurrent-loaders/webrev.hotspot/
>>>> http://cr.openjdk.java.net/~dholmes/concurrent-loaders/webrev.jdk/
>>>>
>>>> They should apply to a jdk8 or tl forest. (And I hope I didn't mess
>>>> something up generating the webrev ;-) )
>>>
>>> Well, I've just gotten everything working and done some cursory testing
>>> on a startup of an "empty" JBoss AS 7 instance, and then reviewing the
>>> metrics reported by our class loader. Our timing metrics are not really
>>> great for general-purpose benchmarking (for various uninteresting
>>> reasons), but I can at least get enough information to know everything
>>> is working more or less as expected:
>>>
>>> On JDK 6 with our "unsafe" lockless modification, we're typically
>>> loading 4707 classes, and I'm seeing anywhere from 0 to 5 define races
>>> that were automatically resolved.
>>>
>>> On JDK 7 using the standard registerAsParallelCapable() mechanism, we
>>> are loading 4711 classes and I'm seeing 35-50 define races that were
>>> automatically resolved - the overhead of locking starts to come to the
>>> fore I think.
>>>
>>> On JDK 8 with your patches, we are loading around 4750 classes and there
>>> are, as expected, 0 define races (I believe, however, that we're getting
>>> a false count though whenever defineClass() returns an already-defined
>>> class - it would be nice if there were *some* way to detect that this
>>> happened).
>>>
>>> On our class loader implementations, I'm initializing this way:
>>>
>>> static {
>>> try {
>>> ClassLoader.registerAsFullyConcurrent();
>>> } catch (Throwable ignored) {
>>> try {
>>> ClassLoader.registerAsParallelCapable();
>>> } catch (Throwable ignored2) {
>>> }
>>> }
>>> }
>>>
>>> The debugging message confirms that our class loaders are successfully
>>> registered as fully concurrent, and the fact that it doesn't hang or
>>> crash on JDK 7 indicates that they are still properly being registered
>>> as parallel-capable on that platform.
>>>
>
>


From david.holmes at oracle.com  Wed Dec 12 01:40:22 2012
From: david.holmes at oracle.com (David Holmes)
Date: Wed, 12 Dec 2012 11:40:22 +1000
Subject: Proposal: Fully Concurrent ClassLoading
In-Reply-To: <50C71FE0.5020704@gmail.com>
References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com>
	<50C56053.1060306@oracle.com>
	
	<50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com>
	<50C6FCDE.7070404@oracle.com> <50C70087.4030003@gmail.com>
	<50C718BD.2010201@oracle.com> <50C71FE0.5020704@gmail.com>
Message-ID: <50C7E086.6040805@oracle.com>

On 11/12/2012 9:58 PM, Peter Levart wrote:
> On 12/11/2012 12:27 PM, David Holmes wrote:
>> Peter,
>>
>> You are convincing me that all superclasses must be fully concurrent
>> too. Otherwise we are just trying to second-guess a whole bunch of
>> what-ifs. :)
>
> If you think some more, yes. The superclass might not use
> getClassLoadingLock() but rely on the fact that findClass() is allways
> called under a guard of per-class-name lock, for example. It's a matter
> of how far to go to prevent such miss-behaving fully-concurrent
> subclasses. So far to also prevent fully-concurrent subclasses that
> would otherwise be perfectly correct?
>
> Maybe not. Creating custom ClassLoaders is not an average programmer's
> job. Those that do this things will of course study the implementations
> of superclasses they extend and do the right thing. And it's reasonable
> to expect that they more or less will only extend JDK's ClassLoaders -
> but on the other hand if they only extend JDK's class loaders, they are
> not prevented to be fully-concurrent either way. Hm...

Again I think it is just too hard to try and second-guess how a 
parallel-loader might rely on the per-class locks (I actually don't see 
any reasonable use for them beyond flow-control), and then how a 
concurrent loader subclass might need to modify things.

If we simply disallow this then we can relax that constraint in the 
future if valid use-cases turn up for that capability. Of course if 
someone has a valid use-case during this discussion phase then of course 
that will influence the decision.

Thanks,
David

> Peter
>
>>
>> Thanks,
>> David
>>
>> On 11/12/2012 7:44 PM, Peter Levart wrote:
>>> On 12/11/2012 10:29 AM, David Holmes wrote:
>>>> On 11/12/2012 7:20 PM, Peter Levart wrote:
>>>>> On 12/11/2012 03:55 AM, David Holmes wrote:
>>>>>>> Question on the source code: registerAsFullyConcurrent has confusing
>>>>>>> comment -
>>>>>>> do the super classes all need to be parallel capable? Or do the
>>>>>>> super
>>>>>>> classes all need
>>>>>>> to be FullyConcurrent? I assume the latter, so just fix the
>>>>>>> comments.
>>>>>>
>>>>>> Actually it is the former. There's no reason to require that all
>>>>>> superclasses be fully-concurrent. Of course a given loaders degree of
>>>>>> concurrency may be constrained by what it's supertype allows, but
>>>>>> there's no reason to actually force all the supertypes to be
>>>>>> fully-concurrent: it is enough that they are at least all parallel
>>>>>> capable.
>>>>>
>>>>> Hi David,
>>>>>
>>>>> There is one caveat: if ClassLoader X declares that it is
>>>>> fully-concurrent and it's superclass Y is only parallel-capable,
>>>>> then X
>>>>> will act as fully-concurrent (returning null from
>>>>> getClassLoadingLock()). superclass Y might or might not be coded to
>>>>> use
>>>>> the getClassLoadingLock(). X therefore has to know how Y is coded.
>>>>> To be
>>>>> defensive, X could ask for Y's registration and declare itself as only
>>>>> parallel-capable if Y declares the same so that when Y is upgraded
>>>>> to be
>>>>> fully-concurrent, X would become fully-concurrent automatically. To
>>>>> support situations where the same version of X would work in two
>>>>> environments where in one Y is only parallel-capable and in the
>>>>> other Y
>>>>> is fully-concurrent, there could be a static API to retrieve the
>>>>> registrations of superclasses.
>>>>
>>>> I don't quite follow this. What code in the superclass are you
>>>> anticipating that the subclass will use which relies on the lock? Or
>>>> is this just an abstract "what if" scenario?
>>>
>>> This is more or less "what if". There might be a subclass Y of say
>>> java.lang.ClassLoader that overrides loadClass or findClass, declares
>>> that it is parallel-capable and in the implementation of it's loadClass
>>> or findClass, uses getClassLoadingLock() to synchronize access to it's
>>> internal state. Now there comes class X extends Y that declares that it
>>> is fully-concurrent. Of course this will not work, X has to declare that
>>> it is parallel-capable, because Y uses getClassLoadingLock().
>>>
>>> What I suggested in the next message is to not change the registration
>>> API but rather provide getClassLoadingLock() that returns non-null locks
>>> when any of the superclasses declare that they are only
>>> parallel-capable, not fully-concurrent.
>>>
>>> Regards, Peter
>>>
>>>>
>>>> Thanks,
>>>> David
>>>> -----
>>>>
>>>>> Or, to have less impact on future deprecation of old parallel-capable
>>>>> registration API, the fully-concurrent registration API:
>>>>>
>>>>> protected static boolean registerAsFullyConcurrent()
>>>>>
>>>>> might take a boolean parameter:
>>>>>
>>>>> protected static boolean registerAsFullyConcurrent(boolean
>>>>> downgradeToPrallelCapableIfAnySuperclassIsNotFullyConcurrent)
>>>>>
>>>>>
>>>>> and provide no accessible API to find out what the registration
>>>>> actually
>>>>> did (register as parallel-capable or fully-concurrent - return true in
>>>>> any case).
>>>>>
>>>>> Since all JDK provided ClassLoaders will be made fully concurrent,
>>>>> this
>>>>> might only be relevant if there is vendor A that currently provides
>>>>> only
>>>>> parallel-capable ClassLoader implementation and there is vendor B that
>>>>> subclasses A's loader and wants to upgrade and be backward
>>>>> compatible at
>>>>> the same time.
>>>>>
>>>>> Does this complicate things to much for no real benefit?
>>>>>
>>>>> Regards, Peter
>>>>>
>>>
>


From david.lloyd at redhat.com  Wed Dec 12 01:50:19 2012
From: david.lloyd at redhat.com (David M. Lloyd)
Date: Tue, 11 Dec 2012 19:50:19 -0600
Subject: Proposal: Fully Concurrent ClassLoading
In-Reply-To: <50C7DEC3.2050503@oracle.com>
References: <50BF371A.1060604@oracle.com> <50C08305.90907@oracle.com>
	<50C0B490.7050005@redhat.com> <50C55F11.6020801@oracle.com>
	<50C5E969.5040602@redhat.com> <50C67FF4.6050506@oracle.com>
	<50C6AB79.4010606@redhat.com> <50C6C212.5090203@oracle.com>
	<50C74CE5.3040803@redhat.com> <50C7DEC3.2050503@oracle.com>
Message-ID: <50C7E2DB.9060101@redhat.com>

Ah, well for our concurrent class loader we just keep simple counters 
for all that stuff.  If we can boost that up to the ClassLoader level 
that'd be nifty.  The stats we track that have been useful are:

- Number of defined classes
- Number of 'races' i.e. define when already existent
- Number of modules (== class loaders) created in the module loader
- CPU time spent defining classes (though this is currently hard to 
capture accurately)

The platform ClassLoadingMXBean has a couple useful stats already; I 
could see adding a counter for the number of duplicate defines, and 
maybe adding some basic timing information in there too.  One other 
metrics that could be useful: the number of failed class load attempts, 
number of failed due to being missing, and the number failed due to 
linkage problems.

On 12/11/2012 07:32 PM, David Holmes wrote:
> On 12/12/2012 1:10 AM, David M. Lloyd wrote:
>> No problem. What do you mean by "instrumentation"?
>
> Any means of "seeing" when parallel define class actually occurred:
>
> -  -verbose:class logging ?
> -  jvmstat counter ?
> - -XX:+TraceParallelDefine ?
> - ???
>
> Thanks,
> David
>
>> On 12/10/2012 11:18 PM, David Holmes wrote:
>>> David,
>>>
>>> Many thanks for trialling this so promptly!
>>>
>>> Do you have any suggestions for what instrumentation you would like to
>>> see accompany this?
>>>
>>> David
>>>
>>> On 11/12/2012 1:41 PM, David M. Lloyd wrote:
>>>> On 12/10/2012 06:36 PM, David Holmes wrote:
>>>>> On 10/12/2012 11:53 PM, David M. Lloyd wrote:
>>>>>> On 12/09/2012 10:03 PM, David Holmes wrote:
>>>>>>> That sounds promising. Are you in a position to try out this
>>>>>>> proposal on
>>>>>>> a testbed with your app server?
>>>>>>
>>>>>> Sure, I'd love to. What tree should I build?
>>>>>
>>>>> Please apply the patches from the webrevs here:
>>>>>
>>>>> http://cr.openjdk.java.net/~dholmes/concurrent-loaders/webrev.hotspot/
>>>>> http://cr.openjdk.java.net/~dholmes/concurrent-loaders/webrev.jdk/
>>>>>
>>>>> They should apply to a jdk8 or tl forest. (And I hope I didn't mess
>>>>> something up generating the webrev ;-) )
>>>>
>>>> Well, I've just gotten everything working and done some cursory testing
>>>> on a startup of an "empty" JBoss AS 7 instance, and then reviewing the
>>>> metrics reported by our class loader. Our timing metrics are not really
>>>> great for general-purpose benchmarking (for various uninteresting
>>>> reasons), but I can at least get enough information to know everything
>>>> is working more or less as expected:
>>>>
>>>> On JDK 6 with our "unsafe" lockless modification, we're typically
>>>> loading 4707 classes, and I'm seeing anywhere from 0 to 5 define races
>>>> that were automatically resolved.
>>>>
>>>> On JDK 7 using the standard registerAsParallelCapable() mechanism, we
>>>> are loading 4711 classes and I'm seeing 35-50 define races that were
>>>> automatically resolved - the overhead of locking starts to come to the
>>>> fore I think.
>>>>
>>>> On JDK 8 with your patches, we are loading around 4750 classes and
>>>> there
>>>> are, as expected, 0 define races (I believe, however, that we're
>>>> getting
>>>> a false count though whenever defineClass() returns an already-defined
>>>> class - it would be nice if there were *some* way to detect that this
>>>> happened).
>>>>
>>>> On our class loader implementations, I'm initializing this way:
>>>>
>>>> static {
>>>> try {
>>>> ClassLoader.registerAsFullyConcurrent();
>>>> } catch (Throwable ignored) {
>>>> try {
>>>> ClassLoader.registerAsParallelCapable();
>>>> } catch (Throwable ignored2) {
>>>> }
>>>> }
>>>> }
>>>>
>>>> The debugging message confirms that our class loaders are successfully
>>>> registered as fully concurrent, and the fact that it doesn't hang or
>>>> crash on JDK 7 indicates that they are still properly being registered
>>>> as parallel-capable on that platform.
>>>>
>>
>>


-- 
- DML


From mandy.chung at oracle.com  Wed Dec 12 02:24:12 2012
From: mandy.chung at oracle.com (Mandy Chung)
Date: Tue, 11 Dec 2012 18:24:12 -0800
Subject: RFR: 8004748: clean up @build tags in RMI tests
In-Reply-To: <50C7C779.4000106@oracle.com>
References: <50C7C779.4000106@oracle.com>
Message-ID: <50C7EACC.2090803@oracle.com>

Looks fine with me.

I notice that there are cases that still require @build the main class 
when it contains the source for other interfaces/classes that another 
class depends on - not a problem.

Mandy

On 12/11/2012 3:53 PM, Stuart Marks wrote:
> Hi all,
>
> Please review the following gigantic webrev [1] to clean up @build 
> tags in RMI tests. Details underlying this change are in the bug 
> report [2].
>
> Briefly, if test classes listed in @build tags are in the wrong order, 
> this trips over a jtreg problem that in turn causes a cascade of 
> subsequent tests to fail. It's sensitive to the order in which tests 
> run. The problem currently occurs in the jdk7u repo. It doesn't happen 
> in jdk8 right now, but as things shift around it might occur in the 
> future.
>
> Naturally, I intend to backport this to 7u once it's in 8.
>
> Shifting the @build tags in the test is a workaround for the jtreg 
> bug, but jtreg isn't going to be fixed soon. Besides, the @build tags 
> in the RMI tests needed to be cleaned up anyway. In particular, 
> consolidating multiple @build tags into a single tag speeds up the RMI 
> test run by about 2.5%.
>
> I've also taken the opportunity to do a couple of related cleanups in 
> a few places, such as fixing typos, rearranging tags to be in a more 
> consistent order, removing unnecessary classes from @build lines, 
> adding necessary ones, and in one case renaming a file that was 
> spelled differently from the class that it contained. 
> (CheckUnmarshall.java -> CheckUnmarshal.java; there are no textual 
> changes to this file.)
>
> Needless to say, all tests pass. In addition, I've run each test 
> individually (i.e., with a clean JTwork directory) to ensure that 
> there were no occurrences of the library class ordering issue that 
> triggers the jtreg bug.
>
> Thanks,
>
> s'marks
>
>
> [1] http://cr.openjdk.java.net/~smarks/reviews/8004748/webrev.0/
>
> [2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004748


From david.holmes at oracle.com  Wed Dec 12 04:27:24 2012
From: david.holmes at oracle.com (David Holmes)
Date: Wed, 12 Dec 2012 14:27:24 +1000
Subject: 8004874: (profiles) Reduce dependency on java.beans to only
	add/removePropertyChangeListener
In-Reply-To: <50C78FCD.1090905@oracle.com>
References: <50C78FCD.1090905@oracle.com>
Message-ID: <50C807AC.7060505@oracle.com>

Hi Alan,

This decoupling looks fine to me.

David

On 12/12/2012 5:55 AM, Alan Bateman wrote:
>
> Those tracking the work to get us to a modular JDK will know that the
> java.beans package is highly problematic.
>
> For the "core" modules then j.u.l.LogManager and j.u.jar.Pack200 have
> support for PropertyChangeListener and that means edges in the module
> graph that are highly undesirable. As I've mentioned in other mails
> here, the plan to address this is to deprecate the
> add/removePropertyChangeListener methods defined by these classes in JDK
> 8 and remove them outright in JDK 9.
>
> In the mean-time we have Compact Profiles coming in JDK 8 so we need a
> solution that allows the java.util.logging and java.util.jar packages be
> included in the profiles without java.beans. As we are only talking
> about 6 methods in non-mainstream areas then the proposal is that these
> methods are not present in the subset Profiles of Java SE. This may be a
> surprise but it avoids a long of list of complications that would
> otherwise arise if there are references to types that do not exist. In
> implementation terms they will be removed in the build of the profiles,
> that's a minor detail.
>
> The changes proposed are just minor updates to LogManager and the
> Pack200.Packer and Pack200.Unpacker implementations so that the only
> dependencies on PropertyChangeListener and PropertyChangeEvent are in
> the addPropertyChangeListener and removePropertyChangeListener methods.
> Once they get to the profiles forest then we can put changes in to
> remove these methods (and maybe GC the constant pool too).
>
> One other thing to point out is that Packer and Unpacker are interfaces
> and so removing methods means that implementations that compile against
> the subset will not compile when the add/removePropertyChangeListener
> methods are present. As it should be very rare to implement Packer and
> Unpacker then it's probably not a big deal but we can use default
> methods to eliminate the concern so that implementations that compile
> against compact1 (for example) will also compile on the full platform.
>
> The webrev with the changes is here. Note that only changes to
> LogManager and pack200's PropMap are proposed to be included for now,
> changing the methods to default methods will come later along with
> javadoc updates, perhaps via the profiles forest. One other thing is
> that the Beans supporting class is duplicated between the two, this is
> mostly to avoid it getting used more widely. It will of course be
> removed once these methods are removed from the full platform, as per
> the original plan.
>
> http://cr.openjdk.java.net/~alanb/8004874/webrev/
>
> Thanks,
>
> Alan.


From mike.duigou at oracle.com  Wed Dec 12 04:50:55 2012
From: mike.duigou at oracle.com (mike.duigou at oracle.com)
Date: Wed, 12 Dec 2012 04:50:55 +0000
Subject: hg: jdk8/tl/jdk: 8004905: Correct license of test to remove classpath
	exception
Message-ID: <20121212045118.9651C470AE@hg.openjdk.java.net>

Changeset: 6c795437f212
Author:    mduigou
Date:      2012-12-11 20:49 -0800
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6c795437f212

8004905: Correct license of test to remove classpath exception
Reviewed-by: akhil

! test/java/lang/ThreadLocal/ThreadLocalSupplierTest.java



From weijun.wang at oracle.com  Wed Dec 12 07:33:02 2012
From: weijun.wang at oracle.com (Weijun Wang)
Date: Wed, 12 Dec 2012 15:33:02 +0800
Subject: build failure on solaris-i586 in make/sun/cldr
Message-ID: <50C8332E.10009@oracle.com>

I haven't build on solaris-i586 for some time and see a failure today in 
make/sun/cldr. The Makefile [1] has these lines:

        75 	    for dir in $(GENSRCDIR); do \
        76 	        if [ -d $$dir ] ; then \
        77 	            ( $(CD) $$dir; \
        78 	                for sdir in $(CLDRGENSRCDIR); do \
        79 	                    if [ -d $$sdir ] ; then \
        80 	                        $(FIND) $$sdir \
        81 	                            -name '*.java' -print >> 
$(JAVA_SOURCE_LIST) ; \
        82 	                    fi ; \
        83 	                done \
        84 	            ); \
        85 	        fi; \
        86 	    done \

So it goes into $(GENSRCDIR) and then tries to look for files inside 
(one of) $(CLDRGENSRCDIR). The latter is defined as

        49 CLDRGENSRCDIR = $(GENSRCDIR)/sun/text/resources/cldr \
        50 			$(GENSRCDIR)/sun/util/cldr \
        51 			$(GENSRCDIR)/sun/util/resources/cldr

in the same file.

In my build, GENSRCDIR is something like 
../../../build/solaris-i586/gensrc. Since this is a relative directory, 
you cannot cd into it and use it again.

Maybe the first CD is just useless.

Is everyone using ALT_OUTPUTDIR?

Thanks
Max

[1] 
http://hg.openjdk.java.net/jdk8/tl/jdk/file/131a683a2ce0/make/sun/cldr/Makefile


From peter.levart at gmail.com  Wed Dec 12 09:07:26 2012
From: peter.levart at gmail.com (Peter Levart)
Date: Wed, 12 Dec 2012 10:07:26 +0100
Subject: IdentityHashMap.[keySet|values|entrySet].toArray speed-up
Message-ID: <50C8494E.5030402@gmail.com>

Hi all,

I propose a patch to java.util.IdentityHashMap to speed-up toArray 
methods of it's keySet, values and entrySet views:

http://dl.dropbox.com/u/101777488/jdk8-tl/IdentityHashMap/webrev.01/index.html

I toyed with the possibility to replace HashMap-s, that are used in 
java.lang.Class and java.lang.reflect.[Field|Method|Constructor] to hold 
cached annotations, with IdentityHashMap-s. They are a perfect 
replacement, since keys in these maps are java.lang.Class objects.

They are more compact then HashMap-s. This is the comparison of 
allocated heap bytes between HashMap and IdentityHashMap for various 
sizes and corresponding capacities which takes into account the size of 
the Map object, the size of allocated array and the size of Map.Entry-s 
in case of HM (IHM doesn't have them) and the size of associated values 
Collection view (allocated when dumping annotations to array). HM-s for 
annotations are currently allocated with default initial capacity (16). 
I propose to allocate IHM-s with initial capacity 8 that fits to hold 5 
entries which is enough for typical annotation use cases on one hand and 
still makes improvement for any case on the other:

32 bit JVM:

         |     HashMap     | IdentityHashMap |
     size|capacity    bytes|capacity    bytes|IHM.bytes-HM.bytes
--------+-----------------+-----------------+------------------
        0|      16      144|       8      136|      -8
        1|      16      168|       8      136|     -32
        2|      16      192|       8      136|     -56
        3|      16      216|       8      136|     -80
        4|      16      240|       8      136|    -104
        5|      16      264|       8      136|    -128
        6|      16      288|      16      200|     -88
        7|      16      312|      16      200|    -112
        8|      16      336|      16      200|    -136
        9|      16      360|      16      200|    -160
       10|      16      384|      16      200|    -184
       11|      16      408|      16      200|    -208
       12|      16      432|      32      328|    -104
       13|      32      520|      32      328|    -192
       14|      32      544|      32      328|    -216
       15|      32      568|      32      328|    -240
       16|      32      592|      32      328|    -264
       17|      32      616|      32      328|    -288
       18|      32      640|      32      328|    -312
       19|      32      664|      32      328|    -336
       20|      32      688|      32      328|    -360
       40|      64     1296|      64      584|    -712
       60|     128     2032|     128     1096|    -936
       80|     128     2512|     128     1096|   -1416
      100|     256     3504|     256     2120|   -1384
      120|     256     3984|     256     2120|   -1864
      140|     256     4464|     256     2120|   -2344
      160|     256     4944|     256     2120|   -2824
      180|     256     5424|     512     4168|   -1256

64 bit JVM:

         |     HashMap     | IdentityHashMap |
     size|capacity    bytes|capacity    bytes|IHM.bytes-HM.bytes
--------+-----------------+-----------------+------------------
        0|      16      248|       8      240|      -8
        1|      16      296|       8      240|     -56
        2|      16      344|       8      240|    -104
        3|      16      392|       8      240|    -152
        4|      16      440|       8      240|    -200
        5|      16      488|       8      240|    -248
        6|      16      536|      16      368|    -168
        7|      16      584|      16      368|    -216
        8|      16      632|      16      368|    -264
        9|      16      680|      16      368|    -312
       10|      16      728|      16      368|    -360
       11|      16      776|      16      368|    -408
       12|      16      824|      32      624|    -200
       13|      32     1000|      32      624|    -376
       14|      32     1048|      32      624|    -424
       15|      32     1096|      32      624|    -472
       16|      32     1144|      32      624|    -520
       17|      32     1192|      32      624|    -568
       18|      32     1240|      32      624|    -616
       19|      32     1288|      32      624|    -664
       20|      32     1336|      32      624|    -712
       40|      64     2552|      64     1136|   -1416
       60|     128     4024|     128     2160|   -1864
       80|     128     4984|     128     2160|   -2824
      100|     256     6968|     256     4208|   -2760
      120|     256     7928|     256     4208|   -3720
      140|     256     8888|     256     4208|   -4680
      160|     256     9848|     256     4208|   -5640
      180|     256    10808|     512     8304|   -2504

I hope I've got that tables right. This is the program to compute them:

https://raw.github.com/plevart/jdk8-tl/JEP-149.2/test/src/test/IHMvsHMsizes.java

IHM is also more performant when retrieving the values by keys. The only 
area in which it lags behind HashMap and is important for accessing 
annotations in bulk is the toArray method of the values view. In 
particular for small sizes. The above patch speeds-up those methods by 
using index iteration instead of Iterator.

Here are some speed-up comparisons:

https://raw.github.com/plevart/jdk8-tl/JEP-149.2/test/IHM_benchmark_results_i7-2600K.txt

They are obtained by running the following micro benchmark:

https://raw.github.com/plevart/jdk8-tl/JEP-149.2/test/src/test/IdentityHashMapTest.java

Even if IHM doesn't replace HM for holding annotations, a speed-up 
improvement is an improvement.


Regards, Peter



From paul.sandoz at oracle.com  Wed Dec 12 09:31:02 2012
From: paul.sandoz at oracle.com (Paul Sandoz)
Date: Wed, 12 Dec 2012 10:31:02 +0100
Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML
	parser as fallback when JAXP is not present
In-Reply-To: <50C72618.5000407@oracle.com>
References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com>
	<50C27AC1.2050600@oracle.com> <50C27DBA.3050808@oracle.com>
	<50C61B4B.1080901@oracle.com> <50C72618.5000407@oracle.com>
Message-ID: <7706A692-773E-4282-8B2C-9B2D85FD49A5@oracle.com>


On Dec 11, 2012, at 1:24 PM, Alan Bateman  wrote:

> 
> Joe sent me an update with changes to address issues discussed so far, I've put the webrev here:
> 
> http://cr.openjdk.java.net/~alanb/8004371/webrev.02/
> 
> Joe - the classes you sent me were in different packages, also the formatting was a bit messed up in several classes, I've fixed up those issues so you may need to re-base from the patch file included in the webrev.
> 

http://cr.openjdk.java.net/~alanb/8004371/webrev.02/src/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java.html

Why are the element qualified names compared ignoring case?

--

http://cr.openjdk.java.net/~alanb/8004371/webrev.02/src/share/classes/java/util/Properties.java.sdiff.html

What if there is a ServiceConfigurationError thrown in loadProviderAsService?

Need to be very careful of errors on static initialization of the Properties class.

--

We need tests with invalid documents. I did not check if there are already such tests present.

Paul.



From Alan.Bateman at oracle.com  Wed Dec 12 10:35:42 2012
From: Alan.Bateman at oracle.com (Alan Bateman)
Date: Wed, 12 Dec 2012 10:35:42 +0000
Subject: 8004371: (props) Properties.loadFromXML needs small footprint
	XML parser as fallback when JAXP is not present
In-Reply-To: <7706A692-773E-4282-8B2C-9B2D85FD49A5@oracle.com>
References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com>
	<50C27AC1.2050600@oracle.com> <50C27DBA.3050808@oracle.com>
	<50C61B4B.1080901@oracle.com> <50C72618.5000407@oracle.com>
	<7706A692-773E-4282-8B2C-9B2D85FD49A5@oracle.com>
Message-ID: <50C85DFE.5010300@oracle.com>

On 12/12/2012 09:31, Paul Sandoz wrote:
>
> http://cr.openjdk.java.net/~alanb/8004371/webrev.02/src/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java.html
>
> Why are the element qualified names compared ignoring case?
I'll leave this to Joe, but I agree that it doesn't look right.

>
> http://cr.openjdk.java.net/~alanb/8004371/webrev.02/src/share/classes/java/util/Properties.java.sdiff.html
>
> What if there is a ServiceConfigurationError thrown in loadProviderAsService?
>
> Need to be very careful of errors on static initialization of the Properties class.
This is a JDK-internal interface so if there is a SCE it probably means 
the JDK is broken. So the only change here is really just to hook in the 
fallback implementation. In the short term this will only be used for 
the smallest profile. Once we go to modules then we have a choice as to 
whether to put it into its own module or just keep it in the base module.


> :
>
>
> We need tests with invalid documents. I did not check if there are already such tests present.
>
Tests for properties in XML format are in short supply, at least in the 
jdk repository. There are tests in other test suites (JCK for example) 
but we may need to add additional tests to give this new code a good 
workout. The awkward thing is that this code will not be executed with 
by the regular JDK, hence the update to the LoadAndStoreXML.java test to 
at least ensure that it executed during normal test runs.

-Alan


From Alan.Bateman at oracle.com  Wed Dec 12 10:43:20 2012
From: Alan.Bateman at oracle.com (Alan Bateman)
Date: Wed, 12 Dec 2012 10:43:20 +0000
Subject: RFR: 8004748: clean up @build tags in RMI tests
In-Reply-To: <50C7C779.4000106@oracle.com>
References: <50C7C779.4000106@oracle.com>
Message-ID: <50C85FC8.3010102@oracle.com>

On 11/12/2012 23:53, Stuart Marks wrote:
> Hi all,
>
> Please review the following gigantic webrev [1] to clean up @build 
> tags in RMI tests. Details underlying this change are in the bug 
> report [2].
>
> Briefly, if test classes listed in @build tags are in the wrong order, 
> this trips over a jtreg problem that in turn causes a cascade of 
> subsequent tests to fail. It's sensitive to the order in which tests 
> run. The problem currently occurs in the jdk7u repo. It doesn't happen 
> in jdk8 right now, but as things shift around it might occur in the 
> future.
The changes looks okay to me. Also just to mention that I've seen this 
with jdk8 too, but only with -concurrency where the tests are running 
concurrently in different agent VMs to speed up the execution. It's very 
intermittent and hopefully the underlying issue in jtreg has be resolved 
soon.

-Alan.


From weijun.wang at oracle.com  Wed Dec 12 10:41:08 2012
From: weijun.wang at oracle.com (weijun.wang at oracle.com)
Date: Wed, 12 Dec 2012 10:41:08 +0000
Subject: hg: jdk8/tl/jdk: 8004904: Makefile for ntlm
Message-ID: <20121212104501.70F4F470BB@hg.openjdk.java.net>

Changeset: 12fba0974a9d
Author:    weijun
Date:      2012-12-12 18:39 +0800
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/12fba0974a9d

8004904: Makefile for ntlm
Reviewed-by: erikj, chegar

! make/com/sun/security/Makefile
+ make/com/sun/security/ntlm/Makefile



From Alan.Bateman at oracle.com  Wed Dec 12 10:47:21 2012
From: Alan.Bateman at oracle.com (Alan Bateman)
Date: Wed, 12 Dec 2012 10:47:21 +0000
Subject: 8004874: (profiles) Reduce dependency on java.beans to only
	add/removePropertyChangeListener
In-Reply-To: <50C7B144.3060100@oracle.com>
References: <50C78FCD.1090905@oracle.com> <50C7B144.3060100@oracle.com>
Message-ID: <50C860B9.7090805@oracle.com>

On 11/12/2012 22:18, Kumar Srinivasan wrote:
> Alan,
>
> PropMap.java, Nit: typo PropertyChangeListern's similarly in the other.
Thanks, I'll fix that typo in the comment before I push the changes.

>
> Nice test, but since it is specific to pack200 and all pack200 tests
> are in jdk/test/tools/pack200,  perhaps move it there ?
The reason I proposed it for java/util/jar/Pack200 is because it's an 
API test rather than a tool test. I don't mind moving it to 
tools/pack200 of course.  I should also say that I'm not planning to 
push this test with the change, instead this goes with the update to 
Pack200 that requires javadoc changes for profiles so I'll push it to 
the profiles forest first.


>
> Besides that I could not find anything else wrong, the
> users of these ProperyChangeListeners are the deployment
> technologies, though.
Thanks for reviewing (also thanks Mandy and David).

-Alan.


From joel.franck at oracle.com  Wed Dec 12 10:59:26 2012
From: joel.franck at oracle.com (=?iso-8859-1?Q?Joel_Borggr=E9n-Franck?=)
Date: Wed, 12 Dec 2012 11:59:26 +0100
Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch
In-Reply-To: <50C57EB0.1000202@oracle.com>
References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com>
	<23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com>
	<5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com>
	<5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com>
	<50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com>
	<509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com>
	<50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com>
	<50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com>
	<50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com>
Message-ID: 

Hi all,

First, thanks all of you that are involved in this!

I agree with David here, lets split this up (for now) and do reflective objects in the context of jep-149 and annotations separately.

As you may know there are even more annotation coming in with JSR 308 annotations on type (use), so I want to complete that work first and then do the effort of reducing contention and overhead for both type and regular annotations and also fixing up the behaviour for redefine/retransform class.

One other point to consider is that some of the fields in java/lang/reflect/ classes are known by the VM so not all changes in Java-land are actually doable. Glancing over your patches very quickly I don't think you have done anything to upset the VM, but then I am not an expert in this area.

Also, with the VM permgen changes we might have to rethink our assumptions in order to reduce total overhead. For example as I understand it previously we could just ship the same pointer into permgen for the annotations arrays, now that isn't possible so we create a new copy of the array for every Field/Method/Constructor instance. Perhaps there is some clever way of eliminating those copies.

So while I think your patches generally makes sense, I think it is prudent to delay this for annotations until all our new annotation features are in.

cheers
/Joel

On Dec 10, 2012, at 7:18 AM, David Holmes  wrote:

> Hi Peter,
> 
> Sorry for the delay on this.
> 
> Generally your VolatileData and my ReflectionHelper are doing a similar job. But I agree with your reasoning that all of the cached SoftReferences are likely to be cleared at once, and so a SoftReference to a helper object with direct references, is more effective than a direct reference to a helper object with SoftReferences. My initial stance with this was very conservative as the more change that is introduced the more uncertainty there is about the impact.
> 
> I say the above primarily because I think, if I am to proceed with this, I will need to separate out the general reflection caching changes from the annotation changes. There are a number of reasons for this:
> 
> First, I'm not at all familiar with the implementation of annotations at the VM or Java level, and the recent changes in this area just exacerbate my ignorance of the mechanics. So I don't feel qualified to evaluate that aspect.
> 
> Second, the bulk of the reflection caching code is simplified by the fact that due to current constraints on class redefinition the caching is effectively idempotent for fields/methods/constructors. But that is not the case for annotations.
> 
> Finally, the use of synchronization with the annotations method is perplexing me. I sent Joe a private email on this but I may as well raise it here - and I think you have alluded to this in your earlier emails as well: initAnnotationsIfNecessary() is a synchronized instance method but I can not find any other code in the VM that synchronizes on the Class object's monitor. So if this synchronization is trying to establish consistency in the face of class redefinition, I do not see where class redefinition is participating in the synchronization!
> 
> So what I would like to do is take your basic VolatileData part of the patch and run with it for JEP-149 purposes, while separating the annotations issue so they can be dealt with by the experts in that particular area.
> 
> I'm sorry it has taken so long to arrive at a fairly negative position, but I need someone else to take up the annotations gauntlet and run with it.
> 
> Thanks,
> David
> 
> On 3/12/2012 5:41 PM, Peter Levart wrote:
>> Hi David, Alan, Alexander and others,
>> 
>> In the meanwhile I have added another annotations space optimization to
>> the patch. If a Class doesn't inherit any annotations from a superclass,
>> which I think is a common case, it assigns the same Map instance to
>> "annotations" as well as "declaredAnnotations" fields. Previously - and
>> in the original code - this only happened for java.lang.Object and
>> interfaces.
>> 
>> Here's the updated webrev:
>> 
>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html
>> 
>> I have also rewritten the performance micro-benchmarks. With the
>> addition of repeating annotations, one performance aspect surfaces: when
>> asking for a particular annotation type on a Class and that annotation
>> is not present, the new repeating annotations support method
>> AnnotationSupport.getOneAnnotation asks for @ContainedBy meta-annotation
>> on the annotation type. This can result in an even more apparent
>> synchronization hot-spot with original code that uses synchronized
>> initAnnotationsIfNecessary(). This aspect is tested with the 3rd test.
>> Other 2 tests test the same thing as before but are more stable now,
>> since now they measure retrieval of 5 different annotation types from
>> each AnnotatedElement, previously they only measured retrieval of 1
>> which was very sensitive to HashMap irregularities (it could happen that
>> a particular key mapped to a bucket that was overloaded in one test-run
>> and not in another)...
>> 
>> Here're the new tests:
>> 
>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java
>> 
>> And the corresponding results when run on an i7 CPU on Linux:
>> 
>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt
>> 
>> 
>> Regards, Peter
>> 
>> 
>> 
>> On 12/03/2012 02:15 AM, David Holmes wrote:
>>> On 1/12/2012 4:54 AM, Alan Bateman wrote:
>>>> On 30/11/2012 18:36, Peter Levart wrote:
>>>>> :
>>>>> 
>>>>> So, what do you think? What kind of tests should I prepare in addidion
>>>>> to those 3 so that the patch might get a consideration?
>>>> I think this is good work and thanks for re-basing your patch. I know
>>>> David plans to do a detail review. I think it will require extensive
>>>> performance testing too, perhaps with some large applications.
>>> 
>>> Indeed I do plan a detailed review and have initiated some initial
>>> performance tests.
>>> 
>>> I am also swamped but will try to get to the review this week - and
>>> will also need to check the referenced annotations updates.
>>> 
>>> David
>>> 
>>>> -Alan
>>>> 
>> 



From chris.hegarty at oracle.com  Wed Dec 12 11:26:08 2012
From: chris.hegarty at oracle.com (Chris Hegarty)
Date: Wed, 12 Dec 2012 11:26:08 +0000
Subject: 8004874: (profiles) Reduce dependency on java.beans to only
	add/removePropertyChangeListener
In-Reply-To: <50C78FCD.1090905@oracle.com>
References: <50C78FCD.1090905@oracle.com>
Message-ID: <50C869D0.1030002@oracle.com>

Looks fine to me.

-Chris.

On 11/12/2012 19:55, Alan Bateman wrote:
>
> Those tracking the work to get us to a modular JDK will know that the
> java.beans package is highly problematic.
>
> For the "core" modules then j.u.l.LogManager and j.u.jar.Pack200 have
> support for PropertyChangeListener and that means edges in the module
> graph that are highly undesirable. As I've mentioned in other mails
> here, the plan to address this is to deprecate the
> add/removePropertyChangeListener methods defined by these classes in JDK
> 8 and remove them outright in JDK 9.
>
> In the mean-time we have Compact Profiles coming in JDK 8 so we need a
> solution that allows the java.util.logging and java.util.jar packages be
> included in the profiles without java.beans. As we are only talking
> about 6 methods in non-mainstream areas then the proposal is that these
> methods are not present in the subset Profiles of Java SE. This may be a
> surprise but it avoids a long of list of complications that would
> otherwise arise if there are references to types that do not exist. In
> implementation terms they will be removed in the build of the profiles,
> that's a minor detail.
>
> The changes proposed are just minor updates to LogManager and the
> Pack200.Packer and Pack200.Unpacker implementations so that the only
> dependencies on PropertyChangeListener and PropertyChangeEvent are in
> the addPropertyChangeListener and removePropertyChangeListener methods.
> Once they get to the profiles forest then we can put changes in to
> remove these methods (and maybe GC the constant pool too).
>
> One other thing to point out is that Packer and Unpacker are interfaces
> and so removing methods means that implementations that compile against
> the subset will not compile when the add/removePropertyChangeListener
> methods are present. As it should be very rare to implement Packer and
> Unpacker then it's probably not a big deal but we can use default
> methods to eliminate the concern so that implementations that compile
> against compact1 (for example) will also compile on the full platform.
>
> The webrev with the changes is here. Note that only changes to
> LogManager and pack200's PropMap are proposed to be included for now,
> changing the methods to default methods will come later along with
> javadoc updates, perhaps via the profiles forest. One other thing is
> that the Beans supporting class is duplicated between the two, this is
> mostly to avoid it getting used more widely. It will of course be
> removed once these methods are removed from the full platform, as per
> the original plan.
>
> http://cr.openjdk.java.net/~alanb/8004874/webrev/
>
> Thanks,
>
> Alan.


From joel.franck at oracle.com  Wed Dec 12 11:34:23 2012
From: joel.franck at oracle.com (=?iso-8859-1?Q?Joel_Borggr=E9n-Franck?=)
Date: Wed, 12 Dec 2012 12:34:23 +0100
Subject: AnnotationType & AnnotationSupport + repeating annotations
In-Reply-To: <50BDC0FE.9040004@gmail.com>
References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com>
	<23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com>
	<5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com>
	<5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com>
	<50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com>
	<509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com>
	<50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com>
	<50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com>
	<50BC57A0.8000108@gmail.com> <50BD1F24.40306@gmail.com>
	<50BDC0FE.9040004@gmail.com>
Message-ID: <446D8783-1D9F-47F6-8A37-73BF224AA6F4@oracle.com>

Hi,

I've filed a bug for this,

http://bugs.sun.com/view_bug.do?bug_id=8004919

should hopefully be visible shortly.

I won't get around to fixing this just yet, but thanks for both the investigation and the suggested fix!

cheers
/Joel

On Dec 4, 2012, at 10:23 AM, Peter Levart  wrote:

> Hi again,
> 
> Zhong Yu suggested to use plain TheadLocal> instead of ClassValue in the proposed patch. Here's the updated webrev that contains this change:
> 
> http://dl.dropbox.com/u/101777488/jdk8-tl/AnnotationTypeSupport/webrev.02/index.html
> 
> The improvement is twofold:
> - There is no ClassValue.ClassValueMap installed on the annotation Class instances
> - The mechanism for exposing an instance of AnnotationType for recursive calls in the same thread only uses the ThreadLocal entry for the in-flight recursive call and cleans-up and removes the entry when the call stack unwinds, so no unused retained objects are left behind.
> 
> The results of the benchmarks are not affected.
> 
> Regards, Peter
> 
> On 12/03/2012 10:52 PM, Peter Levart wrote:
>> Hi David and Alan,
>> 
>> The following is in part connected with the new code for repeating annotations, and in part with the proposed patch for resolving synchronization issues with annotations as well as improvements regarding space and multi-threaded contention.
>> 
>> Although connected, the patch proposed here can be taken entirely by itself. Let me try to explain what this patch does. This patch removes the "synchronized" keyword from the static method AnnotationType.getInstance(Class). By itself this synchronization does not present any big performance issue since the method is always called on slow-path (when parsing the annotations, when lazily constructing a Map of inherited annotations, when de-serializing annotations). The reason this method is synchronized on a single monitor is because it:
>> - lazily constructs an instance of AnnotationType and exposes it to other threads via a Class.annotationType field
>> - in the middle of the AnnotationType constructor it exposes a half-constructed instance via a Class.annotationType field to current thread so that recursive calls don't result in infinite recursion.
>> 
>> As current parsing/resolving logic is coded, other threads must not see the half-constructed AnnotationType instance and current thread must see it. This is achieved by single re-entrant lock because only single lock guarantees the absence of dead-locks (as can be seen from bugs this lock in combination with initAnnotationsIfNecessary() is a cause for dead-locks, but that's another story).
>> 
>> Now because there is a single lock, the method must not be called on heavily executed code paths or this will present a synchronization bottleneck. One such heavily executed code path is in the new sun.reflect.annotation.AnnotationSupport class that contains the logic for repeating annotations. In this class the AnnotationType for a particular annotation class is not obtained via this synchronized method, but incorrectly via direct unsynchronized read of Class.annotationType field. The code in AnnotationSupport can therefore dereference a half-constructed AnnotationType instance before it's constructor, executing in another thread, is finished and before final fields in object are frozen.
>> 
>> Class.[get,set]AnnotationType should only be called from within the synchronized AnnotationType.getInstance method, but that apparently is to contended to be practical.
>> 
>> I solved the problem by:
>> - making AnnotationType an immutable object (all fields final)
>> - exposing the instance to other threads via an unsynchronized write to Class.annotationType field only after constructor is finished and final fields are frozen
>> - exposing the instance to current thread for recursive calls in the middle of the constructor via a special:
>> 
>> private static final ClassValue> IN_CONSTRUCTION = ...
>> 
>> field.
>> 
>> It's true, this does present an overhead in storage, since every Class instance for annotation type will have a ClassValue.ClassValueMap installed, but it is hoped that the number of different annotation classes is not big compared to the number of all classes. A ThreadLocal referenced by ClassValue is only set for the in-flight recursive call and cleared afterwards.
>> 
>> Because with such non-blocking access to AnnotationType, AnnotationType.getInstance() can be used in AnnotationSupport properly to quickly access the AnnotationType instances. The access to AnnotationType with this patch is so quick that I added 2 fields to it (container, containee) where the container and/or containee for a particular annotation type are cached and used in AnnotationSupport to resolve repeating annotations. This is much faster than invoking Class.getDirectDeclaredAnnotation() which is a HashMap.get, followed by reflective invocation of the "value" method on that annotation.
>> 
>> The patch is here:
>> 
>> http://dl.dropbox.com/u/101777488/jdk8-tl/AnnotationTypeSupport/webrev.01/index.html 
>> 
>> The benchmarks that show improvement are the same benchmarks used in my related proposed patch (Class.getAnnotations() bottleneck):
>> 
>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java 
>> 
>> The results are combined results using plain JDK8 code with repeating annotation and then one patch applied at a time and finally both patches combined:
>> 
>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt 
>> 
>> 
>> Regards, Peter
>> 
>> P.S.
>> 
>> Maybe this is not the best approach. Another approach would be to construct a special non-recursive variant of annotation parsing logic that would be used only for select meta-annotations - just enough to construct an AnnotationType with all it's data.
>> 
>> The proposed patch is trying to keep the semantics of original logic, which is not entirely correct. The patch is not trying to solve the logic in-correctness. Here's a contrived example that exposes the in-correctness:
>> 
>> Let's have the following two annotations:
>> 
>> @Retention(RetentionPolicy.RUNTIME)
>> @RuntimeAnnotationB
>> public @interface RuntimeAnnotationA {}
>> 
>> @Retention(RetentionPolicy.RUNTIME)
>> @RuntimeAnnotationA
>> public @interface RuntimeAnnotationB {}
>> 
>> and the following test:
>> 
>> @RuntimeAnnotationA
>> public class AnnotationRetentionTest {
>>    public static void main(String[] args) {
>>        RuntimeAnnotationA ann1 = AnnotationRetentionTest.class.getDeclaredAnnotation(RuntimeAnnotationA.class);
>>        System.out.println(ann1 != null);
>>        RuntimeAnnotationA ann2 = RuntimeAnnotationB.class.getDeclaredAnnotation(RuntimeAnnotationA.class);
>>        System.out.println(ann2 != null);
>>    }
>> }
>> 
>> 
>> The test, when run, prints:
>> 
>> true
>> true
>> 
>> Now change the RuntimeAnnotationA's retention policy to:
>> 
>> @Retention(RetentionPolicy.CLASS)
>> @RuntimeAnnotationB
>> public @interface RuntimeAnnotationA {}
>> 
>> ...and only recompile the RuntimeAnnotationA.
>> When the test is run again with the recompiled RuntimeAnnotationA it prints:
>> 
>> false
>> true
>> 
>> 
>> Although the annotation data for RuntimeAnnotationA is present in both AnnotationRetentionTest and RuntimeAnnotationB class files, the order of initialization and recursion causes the RuntimeAnnotationA to be loaded as RUNTIME annotation into the RuntimeAnnotationB.class (WRONG) but not into the AnnotationRetentionTest.class (CORRECT).
>> 
> 



From chris.hegarty at oracle.com  Wed Dec 12 11:36:21 2012
From: chris.hegarty at oracle.com (chris.hegarty at oracle.com)
Date: Wed, 12 Dec 2012 11:36:21 +0000
Subject: hg: jdk8/tl/jdk: 8004921: Trivial javadoc warnings in Base64
Message-ID: <20121212113645.3471B470BD@hg.openjdk.java.net>

Changeset: 806cf26e5063
Author:    chegar
Date:      2012-12-12 11:35 +0000
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/806cf26e5063

8004921: Trivial javadoc warnings in Base64
Reviewed-by: darcy

! src/share/classes/java/util/Base64.java



From peter.levart at gmail.com  Wed Dec 12 12:31:59 2012
From: peter.levart at gmail.com (Peter Levart)
Date: Wed, 12 Dec 2012 13:31:59 +0100
Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch
In-Reply-To: 
References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com>
	<23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com>
	<5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com>
	<5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com>
	<50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com>
	<509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com>
	<50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com>
	<50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com>
	<50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com>
	
Message-ID: <50C8793F.1050205@gmail.com>

Hi all,

Ok, no problem. So here's a patch that summarizes what I did in the 
previous patch, but only for reflective fields (Field[], Method[], 
Constructor[]) not including annotations:

http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev/index.html

The annotations part is unchanged semantically, but I had to:

- modify private method clearCachesOnClassRedefinition to only include 
invalidation of annotations and declaredAnnotations fields. I also 
renamed it to clearAnnotationCachesOnClassRedefinition
- renamed lastRedefinedCountto lastAnnotationsRedefinedCountand, since 
this field is now only accessed while holding a lock (from synchronized 
initAnnotationsIfNecessary), I removed the volatile keyword.

That's it.

While looking at this unchanged part of code some more, I see other 
races as well. For example: two concurrent accesses to annotations 
combined with redefinition of a class can result in NPE. Here's a serial 
execution:

Thread 1:
     getAnnotation(annotationType);
         initAnnotationsIfNecessary();

VM:
     classRedefinedCount++;

Thread 2:
     getAnnotation(annotationType);
         initAnnotationsIfNecessary();
             clearAnnotationCachesOnClassRedefinition();
                 annotations = null;

Thread 1:
         return AnnotationSupport.getOneAnnotation(annotations, 
annotationClass);
         // 'annotations' field can be null


So this needs to be fixed sooner or later.

Joel!

Are your JSR 308 canges involving java.lang.Class too?

Regards, Peter


On 12/12/2012 11:59 AM, Joel Borggr?n-Franck wrote:
> Hi all,
>
> First, thanks all of you that are involved in this!
>
> I agree with David here, lets split this up (for now) and do reflective objects in the context of jep-149 and annotations separately.
>
> As you may know there are even more annotation coming in with JSR 308 annotations on type (use), so I want to complete that work first and then do the effort of reducing contention and overhead for both type and regular annotations and also fixing up the behaviour for redefine/retransform class.
>
> One other point to consider is that some of the fields in java/lang/reflect/ classes are known by the VM so not all changes in Java-land are actually doable. Glancing over your patches very quickly I don't think you have done anything to upset the VM, but then I am not an expert in this area.
>
> Also, with the VM permgen changes we might have to rethink our assumptions in order to reduce total overhead. For example as I understand it previously we could just ship the same pointer into permgen for the annotations arrays, now that isn't possible so we create a new copy of the array for every Field/Method/Constructor instance. Perhaps there is some clever way of eliminating those copies.
>
> So while I think your patches generally makes sense, I think it is prudent to delay this for annotations until all our new annotation features are in.
>
> cheers
> /Joel
>
> On Dec 10, 2012, at 7:18 AM, David Holmes  wrote:
>
>> Hi Peter,
>>
>> Sorry for the delay on this.
>>
>> Generally your VolatileData and my ReflectionHelper are doing a similar job. But I agree with your reasoning that all of the cached SoftReferences are likely to be cleared at once, and so a SoftReference to a helper object with direct references, is more effective than a direct reference to a helper object with SoftReferences. My initial stance with this was very conservative as the more change that is introduced the more uncertainty there is about the impact.
>>
>> I say the above primarily because I think, if I am to proceed with this, I will need to separate out the general reflection caching changes from the annotation changes. There are a number of reasons for this:
>>
>> First, I'm not at all familiar with the implementation of annotations at the VM or Java level, and the recent changes in this area just exacerbate my ignorance of the mechanics. So I don't feel qualified to evaluate that aspect.
>>
>> Second, the bulk of the reflection caching code is simplified by the fact that due to current constraints on class redefinition the caching is effectively idempotent for fields/methods/constructors. But that is not the case for annotations.
>>
>> Finally, the use of synchronization with the annotations method is perplexing me. I sent Joe a private email on this but I may as well raise it here - and I think you have alluded to this in your earlier emails as well: initAnnotationsIfNecessary() is a synchronized instance method but I can not find any other code in the VM that synchronizes on the Class object's monitor. So if this synchronization is trying to establish consistency in the face of class redefinition, I do not see where class redefinition is participating in the synchronization!
>>
>> So what I would like to do is take your basic VolatileData part of the patch and run with it for JEP-149 purposes, while separating the annotations issue so they can be dealt with by the experts in that particular area.
>>
>> I'm sorry it has taken so long to arrive at a fairly negative position, but I need someone else to take up the annotations gauntlet and run with it.
>>
>> Thanks,
>> David
>>
>> On 3/12/2012 5:41 PM, Peter Levart wrote:
>>> Hi David, Alan, Alexander and others,
>>>
>>> In the meanwhile I have added another annotations space optimization to
>>> the patch. If a Class doesn't inherit any annotations from a superclass,
>>> which I think is a common case, it assigns the same Map instance to
>>> "annotations" as well as "declaredAnnotations" fields. Previously - and
>>> in the original code - this only happened for java.lang.Object and
>>> interfaces.
>>>
>>> Here's the updated webrev:
>>>
>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html
>>>
>>> I have also rewritten the performance micro-benchmarks. With the
>>> addition of repeating annotations, one performance aspect surfaces: when
>>> asking for a particular annotation type on a Class and that annotation
>>> is not present, the new repeating annotations support method
>>> AnnotationSupport.getOneAnnotation asks for @ContainedBy meta-annotation
>>> on the annotation type. This can result in an even more apparent
>>> synchronization hot-spot with original code that uses synchronized
>>> initAnnotationsIfNecessary(). This aspect is tested with the 3rd test.
>>> Other 2 tests test the same thing as before but are more stable now,
>>> since now they measure retrieval of 5 different annotation types from
>>> each AnnotatedElement, previously they only measured retrieval of 1
>>> which was very sensitive to HashMap irregularities (it could happen that
>>> a particular key mapped to a bucket that was overloaded in one test-run
>>> and not in another)...
>>>
>>> Here're the new tests:
>>>
>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java
>>>
>>> And the corresponding results when run on an i7 CPU on Linux:
>>>
>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt
>>>
>>>
>>> Regards, Peter
>>>
>>>
>>>
>>> On 12/03/2012 02:15 AM, David Holmes wrote:
>>>> On 1/12/2012 4:54 AM, Alan Bateman wrote:
>>>>> On 30/11/2012 18:36, Peter Levart wrote:
>>>>>> :
>>>>>>
>>>>>> So, what do you think? What kind of tests should I prepare in addidion
>>>>>> to those 3 so that the patch might get a consideration?
>>>>> I think this is good work and thanks for re-basing your patch. I know
>>>>> David plans to do a detail review. I think it will require extensive
>>>>> performance testing too, perhaps with some large applications.
>>>> Indeed I do plan a detailed review and have initiated some initial
>>>> performance tests.
>>>>
>>>> I am also swamped but will try to get to the review this week - and
>>>> will also need to check the referenced annotations updates.
>>>>
>>>> David
>>>>
>>>>> -Alan
>>>>>



From alan.bateman at oracle.com  Wed Dec 12 13:06:39 2012
From: alan.bateman at oracle.com (alan.bateman at oracle.com)
Date: Wed, 12 Dec 2012 13:06:39 +0000
Subject: hg: jdk8/tl/jdk: 8004874: Reduce dependency on java.beans to only
	add/removePropertyChangeListener
Message-ID: <20121212130702.533D2470BE@hg.openjdk.java.net>

Changeset: 81640e75c7a7
Author:    alanb
Date:      2012-12-12 13:03 +0000
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/81640e75c7a7

8004874: Reduce dependency on java.beans to only add/removePropertyChangeListener
Reviewed-by: ksrini, mchung, dholmes

! src/share/classes/com/sun/java/util/jar/pack/PropMap.java
! src/share/classes/java/util/logging/LogManager.java



From daniel.fuchs at oracle.com  Wed Dec 12 13:08:40 2012
From: daniel.fuchs at oracle.com (Daniel Fuchs)
Date: Wed, 12 Dec 2012 14:08:40 +0100
Subject: RFR: javax.xml.datatype: Using ServiceLoader to load JAXP datatype
	factories (7169894: JAXP Plugability Layer: using service loader)
In-Reply-To: <50C771A6.7090807@oracle.com>
References: <50C771A6.7090807@oracle.com>
Message-ID: <50C881D8.1090909@oracle.com>

Hi,

Please find below a refreshed webrev which adds a bit of cleanup
suggested by Paul.

Instead of casting the result of newInstance() at several places,
we pass the expected base type to newInstance so that the cast
occurs only once.



-- daniel

Note: I have applied the same cleanup to the parsers package:
javax.xml.parsers:
 



On 12/11/12 6:47 PM, Daniel Fuchs wrote:
> Hi,
>
> Here is a new webrev in the series that addresses using ServiceLoader in
> JAXP for JDK 8.
>
> 7169894: JAXP Plugability Layer: using service loader
>
> This changeset addresses modification in the javax.xml.datatype
> package.
> It is similar to changes proposed for the javax.xml.parsers
> package [1], with a few differences due to the specificities of
> javax.xml.datatype.
>
> Namely:
>
> 1. The documentation that describes the loading mechanism is in the
>     class header rather than in the method documentation - which leads
>     to some wording changes.
>
> 2. The DatatypeFactory is specified to throw a
>     DatatypeConfigurationException - which is a checked exception,
>     instead of an Error - as was FactoryConfigurationError
>
> 3. DatatypeConfigurationException allows to wrap
>     ServiceConfigurationError directly - so the additional layer
>     of RuntimeException is not needed here.
>
> 
>
>
> -- daniel
>
> [1] javax.xml.parsers:
> 
>
>



From sean.mullan at oracle.com  Wed Dec 12 14:48:39 2012
From: sean.mullan at oracle.com (sean.mullan at oracle.com)
Date: Wed, 12 Dec 2012 14:48:39 +0000
Subject: hg: jdk8/tl/jdk: 2 new changesets
Message-ID: <20121212144946.95267470C0@hg.openjdk.java.net>

Changeset: 346c0af4af41
Author:    mullan
Date:      2012-12-12 09:25 -0500
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/346c0af4af41

8004064: Downgrade normative references to ${java.home}/lib/security/java.security
Reviewed-by: alanb, vinnie, xuelei

! src/share/classes/com/sun/net/ssl/KeyManagerFactory.java
! src/share/classes/com/sun/net/ssl/TrustManagerFactory.java
! src/share/classes/com/sun/security/auth/PolicyFile.java
! src/share/classes/com/sun/security/auth/login/ConfigFile.java
! src/share/classes/java/net/doc-files/net-properties.html
! src/share/classes/java/security/KeyStore.java
! src/share/classes/java/security/Policy.java
! src/share/classes/java/security/Security.java
! src/share/classes/java/security/cert/CertPathBuilder.java
! src/share/classes/java/security/cert/CertPathValidator.java
! src/share/classes/java/security/cert/CertStore.java
! src/share/classes/javax/net/ssl/KeyManagerFactory.java
! src/share/classes/javax/net/ssl/TrustManagerFactory.java
! src/share/classes/javax/security/auth/Policy.java
! src/share/classes/javax/security/auth/callback/CallbackHandler.java
! src/share/classes/javax/security/auth/login/Configuration.java
! src/share/classes/javax/security/auth/login/LoginContext.java
! src/share/classes/javax/security/cert/X509Certificate.java

Changeset: c7f86908d5fd
Author:    mullan
Date:      2012-12-12 09:27 -0500
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c7f86908d5fd

Merge

- src/share/lib/security/java.security



From Lance.Andersen at oracle.com  Wed Dec 12 15:13:41 2012
From: Lance.Andersen at oracle.com (Lance Andersen - Oracle)
Date: Wed, 12 Dec 2012 10:13:41 -0500
Subject: RFR: javax.xml.datatype: Using ServiceLoader to load JAXP
	datatype factories (7169894: JAXP Plugability Layer: using
	service loader)
In-Reply-To: <50C881D8.1090909@oracle.com>
References: <50C771A6.7090807@oracle.com> <50C881D8.1090909@oracle.com>
Message-ID: 

+1
On Dec 12, 2012, at 8:08 AM, Daniel Fuchs wrote:

> Hi,
> 
> Please find below a refreshed webrev which adds a bit of cleanup
> suggested by Paul.
> 
> Instead of casting the result of newInstance() at several places,
> we pass the expected base type to newInstance so that the cast
> occurs only once.
> 
> 
> 
> -- daniel
> 
> Note: I have applied the same cleanup to the parsers package:
> javax.xml.parsers:
>  
> 
> 
> On 12/11/12 6:47 PM, Daniel Fuchs wrote:
>> Hi,
>> 
>> Here is a new webrev in the series that addresses using ServiceLoader in
>> JAXP for JDK 8.
>> 
>> 7169894: JAXP Plugability Layer: using service loader
>> 
>> This changeset addresses modification in the javax.xml.datatype
>> package.
>> It is similar to changes proposed for the javax.xml.parsers
>> package [1], with a few differences due to the specificities of
>> javax.xml.datatype.
>> 
>> Namely:
>> 
>> 1. The documentation that describes the loading mechanism is in the
>>    class header rather than in the method documentation - which leads
>>    to some wording changes.
>> 
>> 2. The DatatypeFactory is specified to throw a
>>    DatatypeConfigurationException - which is a checked exception,
>>    instead of an Error - as was FactoryConfigurationError
>> 
>> 3. DatatypeConfigurationException allows to wrap
>>    ServiceConfigurationError directly - so the additional layer
>>    of RuntimeException is not needed here.
>> 
>> 
>> 
>> 
>> -- daniel
>> 
>> [1] javax.xml.parsers:
>> 
>> 
>> 
> 

-------------- next part --------------

Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com


From peter.levart at gmail.com  Wed Dec 12 15:34:16 2012
From: peter.levart at gmail.com (Peter Levart)
Date: Wed, 12 Dec 2012 16:34:16 +0100
Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch
In-Reply-To: 
References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com>
	<23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com>
	<5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com>
	<5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com>
	<50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com>
	<509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com>
	<50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com>
	<50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com>
	<50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com>
	
Message-ID: <50C8A3F8.6020700@gmail.com>

On 12/12/2012 11:59 AM, Joel Borggr?n-Franck wrote:
> Hi all,
>
> First, thanks all of you that are involved in this!
>
> I agree with David here, lets split this up (for now) and do reflective objects in the context of jep-149 and annotations separately.
>
> As you may know there are even more annotation coming in with JSR 308 annotations on type (use), so I want to complete that work first and then do the effort of reducing contention and overhead for both type and regular annotations and also fixing up the behaviour for redefine/retransform class.
>
> One other point to consider is that some of the fields in java/lang/reflect/ classes are known by the VM so not all changes in Java-land are actually doable. Glancing over your patches very quickly I don't think you have done anything to upset the VM, but then I am not an expert in this area.
>
> Also, with the VM permgen changes we might have to rethink our assumptions in order to reduce total overhead. For example as I understand it previously we could just ship the same pointer into permgen for the annotations arrays, now that isn't possible so we create a new copy of the array for every Field/Method/Constructor instance. Perhaps there is some clever way of eliminating those copies.
You mean the "byte[] annotations" arrays in the Field/Method/Constructor 
instances returned by the following java.lang.Class native methods:

     private native Field[]       getDeclaredFields0(boolean publicOnly);
     private native Method[]      getDeclaredMethods0(boolean publicOnly);
     private native Constructor[] getDeclaredConstructors0(boolean 
publicOnly);

If caching is effective (useCaches == true) then, in the absence of 
class redefinition, each of these methods is called at most two times 
(once for each value of publicOnly flag). If I understand the semantics 
of this flag correctly, it is used solely for the purpose of filtering 
the returned instances to include all or only public members.

The java part of caching could be modified to only call each of these 
methods once (with publicOnly==false) and derive the "publicOnly" 
variant of the array by doing the filtering in java. This way only a 
single instance of a particular Field/Method/Constructor will be 
retained by caches and there will be no duplication of annotation arrays.

Regards, Peter
>
> So while I think your patches generally makes sense, I think it is prudent to delay this for annotations until all our new annotation features are in.
>
> cheers
> /Joel
>
> On Dec 10, 2012, at 7:18 AM, David Holmes  wrote:
>
>> Hi Peter,
>>
>> Sorry for the delay on this.
>>
>> Generally your VolatileData and my ReflectionHelper are doing a similar job. But I agree with your reasoning that all of the cached SoftReferences are likely to be cleared at once, and so a SoftReference to a helper object with direct references, is more effective than a direct reference to a helper object with SoftReferences. My initial stance with this was very conservative as the more change that is introduced the more uncertainty there is about the impact.
>>
>> I say the above primarily because I think, if I am to proceed with this, I will need to separate out the general reflection caching changes from the annotation changes. There are a number of reasons for this:
>>
>> First, I'm not at all familiar with the implementation of annotations at the VM or Java level, and the recent changes in this area just exacerbate my ignorance of the mechanics. So I don't feel qualified to evaluate that aspect.
>>
>> Second, the bulk of the reflection caching code is simplified by the fact that due to current constraints on class redefinition the caching is effectively idempotent for fields/methods/constructors. But that is not the case for annotations.
>>
>> Finally, the use of synchronization with the annotations method is perplexing me. I sent Joe a private email on this but I may as well raise it here - and I think you have alluded to this in your earlier emails as well: initAnnotationsIfNecessary() is a synchronized instance method but I can not find any other code in the VM that synchronizes on the Class object's monitor. So if this synchronization is trying to establish consistency in the face of class redefinition, I do not see where class redefinition is participating in the synchronization!
>>
>> So what I would like to do is take your basic VolatileData part of the patch and run with it for JEP-149 purposes, while separating the annotations issue so they can be dealt with by the experts in that particular area.
>>
>> I'm sorry it has taken so long to arrive at a fairly negative position, but I need someone else to take up the annotations gauntlet and run with it.
>>
>> Thanks,
>> David
>>
>> On 3/12/2012 5:41 PM, Peter Levart wrote:
>>> Hi David, Alan, Alexander and others,
>>>
>>> In the meanwhile I have added another annotations space optimization to
>>> the patch. If a Class doesn't inherit any annotations from a superclass,
>>> which I think is a common case, it assigns the same Map instance to
>>> "annotations" as well as "declaredAnnotations" fields. Previously - and
>>> in the original code - this only happened for java.lang.Object and
>>> interfaces.
>>>
>>> Here's the updated webrev:
>>>
>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html
>>>
>>> I have also rewritten the performance micro-benchmarks. With the
>>> addition of repeating annotations, one performance aspect surfaces: when
>>> asking for a particular annotation type on a Class and that annotation
>>> is not present, the new repeating annotations support method
>>> AnnotationSupport.getOneAnnotation asks for @ContainedBy meta-annotation
>>> on the annotation type. This can result in an even more apparent
>>> synchronization hot-spot with original code that uses synchronized
>>> initAnnotationsIfNecessary(). This aspect is tested with the 3rd test.
>>> Other 2 tests test the same thing as before but are more stable now,
>>> since now they measure retrieval of 5 different annotation types from
>>> each AnnotatedElement, previously they only measured retrieval of 1
>>> which was very sensitive to HashMap irregularities (it could happen that
>>> a particular key mapped to a bucket that was overloaded in one test-run
>>> and not in another)...
>>>
>>> Here're the new tests:
>>>
>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java
>>>
>>> And the corresponding results when run on an i7 CPU on Linux:
>>>
>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt
>>>
>>>
>>> Regards, Peter
>>>
>>>
>>>
>>> On 12/03/2012 02:15 AM, David Holmes wrote:
>>>> On 1/12/2012 4:54 AM, Alan Bateman wrote:
>>>>> On 30/11/2012 18:36, Peter Levart wrote:
>>>>>> :
>>>>>>
>>>>>> So, what do you think? What kind of tests should I prepare in addidion
>>>>>> to those 3 so that the patch might get a consideration?
>>>>> I think this is good work and thanks for re-basing your patch. I know
>>>>> David plans to do a detail review. I think it will require extensive
>>>>> performance testing too, perhaps with some large applications.
>>>> Indeed I do plan a detailed review and have initiated some initial
>>>> performance tests.
>>>>
>>>> I am also swamped but will try to get to the review this week - and
>>>> will also need to check the referenced annotations updates.
>>>>
>>>> David
>>>>
>>>>> -Alan
>>>>>



From alexey.utkin at oracle.com  Wed Dec 12 15:41:56 2012
From: alexey.utkin at oracle.com (Alexey Utkin)
Date: Wed, 12 Dec 2012 19:41:56 +0400
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem.
Message-ID: <50C8A5C4.4030602@oracle.com>

Bug description:
     https://jbs.oracle.com/bugs/browse/JDK-8004928

Here is the suggested fix:
     http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8004928/webrev.01

Summary:
*test/java/io/Serializable/resolveProxyClass/NonPublicInterface.java*
*test/java/lang/reflect/Proxy/ClassRestrictions.java*
         The set of non-public interfaces was changed to avoid AWT 
dependencies.

*test/java/lang/management/CompilationMXBean/Basic.java*
         The ballast calls
             java.awt.Toolkit.getDefaultToolkit();
             javax.swing.UIManager.getInstalledLookAndFeels();
         were removed from compiled Java code. Compilation time still 
positive.

*test/java/lang/reflect/Generics/Probe.java*
         The dependence from the internal class 
"javax.swing.JComboBox$AccessibleJComboBox"
         was excepted from code. It has very small impact to test coverage.

*test/java/util/Collections/EmptyIterator.java*
         Swing-stored constants were changed to locally-defined.

*test/java/util/logging/LoggingDeadlock4.java*
         Test case was simplified to avoid AWT class loading. Negative 
test result was tested on early
         JDK7 build.

*test/sun/tools/jrunscript/common.sh*
         Useless mention of XToolkit  was removed from the script.

Regards,
-uta



From rob.mckenna at oracle.com  Wed Dec 12 15:43:38 2012
From: rob.mckenna at oracle.com (Rob McKenna)
Date: Wed, 12 Dec 2012 15:43:38 +0000
Subject: Request for review: 8000525: Java.net.httpcookie api does not
	support 2-digit year format
In-Reply-To: <50C614DE.6090208@oracle.com>
References: <50C10BE2.5070006@oracle.com> <50C614DE.6090208@oracle.com>
Message-ID: <50C8A62A.1090106@oracle.com>

Hi Chris,

I guess I figured if the parse failed the cal.set wouldn't happen. 
Still, no harm in moving the 1970 into the loop on the off chance 
something else goes wrong.

I've updated the test too. Thanks for spotting that.

     -Rob

On 10/12/12 16:59, Chris Hegarty wrote:
> Shouldn't 'cal.set(1970, 0, 1, 0, 0, 0)' be inside the for loop?
>
> The test can simply throw Exception, rather can catching.
>
> Otherwise, looks fine to me.
>
> -Crhis.
>
> On 06/12/2012 21:19, Rob McKenna wrote:
>> Hi folks,
>>
>> According to HttpCookie.java:
>>
>> """
>> There are 3 http cookie specifications:
>>
>> Netscape draft
>> RFC 2109 -/http://www.ietf.org/rfc/rfc2109.txt/
>> RFC 2965 -/http://www.ietf.org/rfc/rfc2965.txt/
>>
>> HttpCookie class can accept all these 3 forms of syntax.
>> """
>>
>> According to http://www.ietf.org/rfc/rfc2109.txt section 10.1.2:
>>
>> """
>> Netscape's original proposal defined an Expires header that took a date
>> value in a fixed-length variant format in place of Max-Age: Wdy,
>> DD-Mon-YY HH:MM:SS GMT
>> """
>>
>> Thats in the "Historical" section provided to allow for compatibility
>> with Netscape's implementation, which we also support: (as per
>> http://docs.oracle.com/javase/6/docs/api/java/net/HttpCookie.html )
>>
>> While we don't support the rfc explicitly, this change follows the
>> format specified in section 5.1.1 of rfc 6265:
>>
>> """
>> 3. If the year-value is greater than or equal to 70 and less than or
>> equal to 99, increment the year-value by 1900.
>> 4. If the year-value is greater than or equal to 0 and less than or
>> equal to 69, increment the year-value by 2000.
>> 1. NOTE: Some existing user agents interpret two-digit years 
>> differently.
>> """
>>
>> The webrev is at:
>>
>> http://cr.openjdk.java.net/~robm/8000525/webrev.01/
>> 
>>
>> Note: The addition of setLenient(false) has required changes to two
>> existing testcases.
>>
>> -Rob



From rob.mckenna at oracle.com  Wed Dec 12 15:44:14 2012
From: rob.mckenna at oracle.com (Rob McKenna)
Date: Wed, 12 Dec 2012 15:44:14 +0000
Subject: Request for review: 8000525: Java.net.httpcookie api does not
	support 2-digit year format
In-Reply-To: <50C8A62A.1090106@oracle.com>
References: <50C10BE2.5070006@oracle.com> <50C614DE.6090208@oracle.com>
	<50C8A62A.1090106@oracle.com>
Message-ID: <50C8A64E.6090404@oracle.com>

..the url would be helpful:
http://cr.openjdk.java.net/~robm/8000525/webrev.02/

     -Rob
On 12/12/12 15:43, Rob McKenna wrote:
> Hi Chris,
>
> I guess I figured if the parse failed the cal.set wouldn't happen. 
> Still, no harm in moving the 1970 into the loop on the off chance 
> something else goes wrong.
>
> I've updated the test too. Thanks for spotting that.
>
>     -Rob
>
> On 10/12/12 16:59, Chris Hegarty wrote:
>> Shouldn't 'cal.set(1970, 0, 1, 0, 0, 0)' be inside the for loop?
>>
>> The test can simply throw Exception, rather can catching.
>>
>> Otherwise, looks fine to me.
>>
>> -Crhis.
>>
>> On 06/12/2012 21:19, Rob McKenna wrote:
>>> Hi folks,
>>>
>>> According to HttpCookie.java:
>>>
>>> """
>>> There are 3 http cookie specifications:
>>>
>>> Netscape draft
>>> RFC 2109 -/http://www.ietf.org/rfc/rfc2109.txt/
>>> RFC 2965 -/http://www.ietf.org/rfc/rfc2965.txt/
>>>
>>> HttpCookie class can accept all these 3 forms of syntax.
>>> """
>>>
>>> According to http://www.ietf.org/rfc/rfc2109.txt section 10.1.2:
>>>
>>> """
>>> Netscape's original proposal defined an Expires header that took a date
>>> value in a fixed-length variant format in place of Max-Age: Wdy,
>>> DD-Mon-YY HH:MM:SS GMT
>>> """
>>>
>>> Thats in the "Historical" section provided to allow for compatibility
>>> with Netscape's implementation, which we also support: (as per
>>> http://docs.oracle.com/javase/6/docs/api/java/net/HttpCookie.html )
>>>
>>> While we don't support the rfc explicitly, this change follows the
>>> format specified in section 5.1.1 of rfc 6265:
>>>
>>> """
>>> 3. If the year-value is greater than or equal to 70 and less than or
>>> equal to 99, increment the year-value by 1900.
>>> 4. If the year-value is greater than or equal to 0 and less than or
>>> equal to 69, increment the year-value by 2000.
>>> 1. NOTE: Some existing user agents interpret two-digit years 
>>> differently.
>>> """
>>>
>>> The webrev is at:
>>>
>>> http://cr.openjdk.java.net/~robm/8000525/webrev.01/
>>> 
>>>
>>> Note: The addition of setLenient(false) has required changes to two
>>> existing testcases.
>>>
>>> -Rob
>



From peter.levart at gmail.com  Wed Dec 12 15:49:57 2012
From: peter.levart at gmail.com (Peter Levart)
Date: Wed, 12 Dec 2012 16:49:57 +0100
Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch
In-Reply-To: <50C8A3F8.6020700@gmail.com>
References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com>
	<23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com>
	<5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com>
	<5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com>
	<50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com>
	<509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com>
	<50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com>
	<50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com>
	<50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com>
	
	<50C8A3F8.6020700@gmail.com>
Message-ID: <50C8A7A5.7060100@gmail.com>

On 12/12/2012 04:34 PM, Peter Levart wrote:
> On 12/12/2012 11:59 AM, Joel Borggr?n-Franck wrote:
>> Hi all,
>>
>> First, thanks all of you that are involved in this!
>>
>> I agree with David here, lets split this up (for now) and do 
>> reflective objects in the context of jep-149 and annotations separately.
>>
>> As you may know there are even more annotation coming in with JSR 308 
>> annotations on type (use), so I want to complete that work first and 
>> then do the effort of reducing contention and overhead for both type 
>> and regular annotations and also fixing up the behaviour for 
>> redefine/retransform class.
>>
>> One other point to consider is that some of the fields in 
>> java/lang/reflect/ classes are known by the VM so not all changes in 
>> Java-land are actually doable. Glancing over your patches very 
>> quickly I don't think you have done anything to upset the VM, but 
>> then I am not an expert in this area.
>>
>> Also, with the VM permgen changes we might have to rethink our 
>> assumptions in order to reduce total overhead. For example as I 
>> understand it previously we could just ship the same pointer into 
>> permgen for the annotations arrays, now that isn't possible so we 
>> create a new copy of the array for every Field/Method/Constructor 
>> instance. Perhaps there is some clever way of eliminating those copies.
> You mean the "byte[] annotations" arrays in the 
> Field/Method/Constructor instances returned by the following 
> java.lang.Class native methods:
>
>     private native Field[]       getDeclaredFields0(boolean publicOnly);
>     private native Method[]      getDeclaredMethods0(boolean publicOnly);
>     private native Constructor[] getDeclaredConstructors0(boolean 
> publicOnly);
>
> If caching is effective (useCaches == true) then, in the absence of 
> class redefinition, each of these methods is called at most two times 
> (once for each value of publicOnly flag). If I understand the 
> semantics of this flag correctly, it is used solely for the purpose of 
> filtering the returned instances to include all or only public members.
>
> The java part of caching could be modified to only call each of these 
> methods once (with publicOnly==false) and derive the "publicOnly" 
> variant of the array by doing the filtering in java. This way only a 
> single instance of a particular Field/Method/Constructor will be 
> retained by caches and there will be no duplication of annotation arrays.

Even more, when raw annotations are parsed in the 'root' instance and 
turned into a Map, the raw annotations array can be 
released since it's not needed any more. And on the copies (those that 
are passed to the outside world), there's no need to hold a reference to 
it in the first place (if delegating requests to root), so it can be 
left as null from the beginning.

Regards, Peter

>
> Regards, Peter
>>
>> So while I think your patches generally makes sense, I think it is 
>> prudent to delay this for annotations until all our new annotation 
>> features are in.
>>
>> cheers
>> /Joel
>>
>> On Dec 10, 2012, at 7:18 AM, David Holmes  
>> wrote:
>>
>>> Hi Peter,
>>>
>>> Sorry for the delay on this.
>>>
>>> Generally your VolatileData and my ReflectionHelper are doing a 
>>> similar job. But I agree with your reasoning that all of the cached 
>>> SoftReferences are likely to be cleared at once, and so a 
>>> SoftReference to a helper object with direct references, is more 
>>> effective than a direct reference to a helper object with 
>>> SoftReferences. My initial stance with this was very conservative as 
>>> the more change that is introduced the more uncertainty there is 
>>> about the impact.
>>>
>>> I say the above primarily because I think, if I am to proceed with 
>>> this, I will need to separate out the general reflection caching 
>>> changes from the annotation changes. There are a number of reasons 
>>> for this:
>>>
>>> First, I'm not at all familiar with the implementation of 
>>> annotations at the VM or Java level, and the recent changes in this 
>>> area just exacerbate my ignorance of the mechanics. So I don't feel 
>>> qualified to evaluate that aspect.
>>>
>>> Second, the bulk of the reflection caching code is simplified by the 
>>> fact that due to current constraints on class redefinition the 
>>> caching is effectively idempotent for fields/methods/constructors. 
>>> But that is not the case for annotations.
>>>
>>> Finally, the use of synchronization with the annotations method is 
>>> perplexing me. I sent Joe a private email on this but I may as well 
>>> raise it here - and I think you have alluded to this in your earlier 
>>> emails as well: initAnnotationsIfNecessary() is a synchronized 
>>> instance method but I can not find any other code in the VM that 
>>> synchronizes on the Class object's monitor. So if this 
>>> synchronization is trying to establish consistency in the face of 
>>> class redefinition, I do not see where class redefinition is 
>>> participating in the synchronization!
>>>
>>> So what I would like to do is take your basic VolatileData part of 
>>> the patch and run with it for JEP-149 purposes, while separating the 
>>> annotations issue so they can be dealt with by the experts in that 
>>> particular area.
>>>
>>> I'm sorry it has taken so long to arrive at a fairly negative 
>>> position, but I need someone else to take up the annotations 
>>> gauntlet and run with it.
>>>
>>> Thanks,
>>> David
>>>
>>> On 3/12/2012 5:41 PM, Peter Levart wrote:
>>>> Hi David, Alan, Alexander and others,
>>>>
>>>> In the meanwhile I have added another annotations space 
>>>> optimization to
>>>> the patch. If a Class doesn't inherit any annotations from a 
>>>> superclass,
>>>> which I think is a common case, it assigns the same Map instance to
>>>> "annotations" as well as "declaredAnnotations" fields. Previously - 
>>>> and
>>>> in the original code - this only happened for java.lang.Object and
>>>> interfaces.
>>>>
>>>> Here's the updated webrev:
>>>>
>>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html
>>>>
>>>> I have also rewritten the performance micro-benchmarks. With the
>>>> addition of repeating annotations, one performance aspect surfaces: 
>>>> when
>>>> asking for a particular annotation type on a Class and that annotation
>>>> is not present, the new repeating annotations support method
>>>> AnnotationSupport.getOneAnnotation asks for @ContainedBy 
>>>> meta-annotation
>>>> on the annotation type. This can result in an even more apparent
>>>> synchronization hot-spot with original code that uses synchronized
>>>> initAnnotationsIfNecessary(). This aspect is tested with the 3rd test.
>>>> Other 2 tests test the same thing as before but are more stable now,
>>>> since now they measure retrieval of 5 different annotation types from
>>>> each AnnotatedElement, previously they only measured retrieval of 1
>>>> which was very sensitive to HashMap irregularities (it could happen 
>>>> that
>>>> a particular key mapped to a bucket that was overloaded in one 
>>>> test-run
>>>> and not in another)...
>>>>
>>>> Here're the new tests:
>>>>
>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java 
>>>>
>>>>
>>>> And the corresponding results when run on an i7 CPU on Linux:
>>>>
>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt 
>>>>
>>>>
>>>>
>>>> Regards, Peter
>>>>
>>>>
>>>>
>>>> On 12/03/2012 02:15 AM, David Holmes wrote:
>>>>> On 1/12/2012 4:54 AM, Alan Bateman wrote:
>>>>>> On 30/11/2012 18:36, Peter Levart wrote:
>>>>>>> :
>>>>>>>
>>>>>>> So, what do you think? What kind of tests should I prepare in 
>>>>>>> addidion
>>>>>>> to those 3 so that the patch might get a consideration?
>>>>>> I think this is good work and thanks for re-basing your patch. I 
>>>>>> know
>>>>>> David plans to do a detail review. I think it will require extensive
>>>>>> performance testing too, perhaps with some large applications.
>>>>> Indeed I do plan a detailed review and have initiated some initial
>>>>> performance tests.
>>>>>
>>>>> I am also swamped but will try to get to the review this week - and
>>>>> will also need to check the referenced annotations updates.
>>>>>
>>>>> David
>>>>>
>>>>>> -Alan
>>>>>>
>



From zhong.j.yu at gmail.com  Wed Dec 12 15:51:03 2012
From: zhong.j.yu at gmail.com (Zhong Yu)
Date: Wed, 12 Dec 2012 09:51:03 -0600
Subject: Proposal: Fully Concurrent ClassLoading
In-Reply-To: <50C7E086.6040805@oracle.com>
References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com>
	<50C56053.1060306@oracle.com>
	
	<50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com>
	<50C6FCDE.7070404@oracle.com> <50C70087.4030003@gmail.com>
	<50C718BD.2010201@oracle.com> <50C71FE0.5020704@gmail.com>
	<50C7E086.6040805@oracle.com>
Message-ID: 

If a class loader is declared fully concurrent, yet
getClassLoadingLock() is invoked, what's the harm of returning a
dedicated lock anyway, exactly like what's done before?

On Tue, Dec 11, 2012 at 7:40 PM, David Holmes  wrote:
> On 11/12/2012 9:58 PM, Peter Levart wrote:
>>
>> On 12/11/2012 12:27 PM, David Holmes wrote:
>>>
>>> Peter,
>>>
>>> You are convincing me that all superclasses must be fully concurrent
>>> too. Otherwise we are just trying to second-guess a whole bunch of
>>> what-ifs. :)
>>
>>
>> If you think some more, yes. The superclass might not use
>> getClassLoadingLock() but rely on the fact that findClass() is allways
>> called under a guard of per-class-name lock, for example. It's a matter
>> of how far to go to prevent such miss-behaving fully-concurrent
>> subclasses. So far to also prevent fully-concurrent subclasses that
>> would otherwise be perfectly correct?
>>
>> Maybe not. Creating custom ClassLoaders is not an average programmer's
>> job. Those that do this things will of course study the implementations
>> of superclasses they extend and do the right thing. And it's reasonable
>> to expect that they more or less will only extend JDK's ClassLoaders -
>> but on the other hand if they only extend JDK's class loaders, they are
>> not prevented to be fully-concurrent either way. Hm...
>
>
> Again I think it is just too hard to try and second-guess how a
> parallel-loader might rely on the per-class locks (I actually don't see any
> reasonable use for them beyond flow-control), and then how a concurrent
> loader subclass might need to modify things.
>
> If we simply disallow this then we can relax that constraint in the future
> if valid use-cases turn up for that capability. Of course if someone has a
> valid use-case during this discussion phase then of course that will
> influence the decision.
>
> Thanks,
> David
>
>> Peter
>>
>>>
>>> Thanks,
>>> David
>>>
>>> On 11/12/2012 7:44 PM, Peter Levart wrote:
>>>>
>>>> On 12/11/2012 10:29 AM, David Holmes wrote:
>>>>>
>>>>> On 11/12/2012 7:20 PM, Peter Levart wrote:
>>>>>>
>>>>>> On 12/11/2012 03:55 AM, David Holmes wrote:
>>>>>>>>
>>>>>>>> Question on the source code: registerAsFullyConcurrent has confusing
>>>>>>>> comment -
>>>>>>>> do the super classes all need to be parallel capable? Or do the
>>>>>>>> super
>>>>>>>> classes all need
>>>>>>>> to be FullyConcurrent? I assume the latter, so just fix the
>>>>>>>> comments.
>>>>>>>
>>>>>>>
>>>>>>> Actually it is the former. There's no reason to require that all
>>>>>>> superclasses be fully-concurrent. Of course a given loaders degree of
>>>>>>> concurrency may be constrained by what it's supertype allows, but
>>>>>>> there's no reason to actually force all the supertypes to be
>>>>>>> fully-concurrent: it is enough that they are at least all parallel
>>>>>>> capable.
>>>>>>
>>>>>>
>>>>>> Hi David,
>>>>>>
>>>>>> There is one caveat: if ClassLoader X declares that it is
>>>>>> fully-concurrent and it's superclass Y is only parallel-capable,
>>>>>> then X
>>>>>> will act as fully-concurrent (returning null from
>>>>>> getClassLoadingLock()). superclass Y might or might not be coded to
>>>>>> use
>>>>>> the getClassLoadingLock(). X therefore has to know how Y is coded.
>>>>>> To be
>>>>>> defensive, X could ask for Y's registration and declare itself as only
>>>>>> parallel-capable if Y declares the same so that when Y is upgraded
>>>>>> to be
>>>>>> fully-concurrent, X would become fully-concurrent automatically. To
>>>>>> support situations where the same version of X would work in two
>>>>>> environments where in one Y is only parallel-capable and in the
>>>>>> other Y
>>>>>> is fully-concurrent, there could be a static API to retrieve the
>>>>>> registrations of superclasses.
>>>>>
>>>>>
>>>>> I don't quite follow this. What code in the superclass are you
>>>>> anticipating that the subclass will use which relies on the lock? Or
>>>>> is this just an abstract "what if" scenario?
>>>>
>>>>
>>>> This is more or less "what if". There might be a subclass Y of say
>>>> java.lang.ClassLoader that overrides loadClass or findClass, declares
>>>> that it is parallel-capable and in the implementation of it's loadClass
>>>> or findClass, uses getClassLoadingLock() to synchronize access to it's
>>>> internal state. Now there comes class X extends Y that declares that it
>>>> is fully-concurrent. Of course this will not work, X has to declare that
>>>> it is parallel-capable, because Y uses getClassLoadingLock().
>>>>
>>>> What I suggested in the next message is to not change the registration
>>>> API but rather provide getClassLoadingLock() that returns non-null locks
>>>> when any of the superclasses declare that they are only
>>>> parallel-capable, not fully-concurrent.
>>>>
>>>> Regards, Peter
>>>>
>>>>>
>>>>> Thanks,
>>>>> David
>>>>> -----
>>>>>
>>>>>> Or, to have less impact on future deprecation of old parallel-capable
>>>>>> registration API, the fully-concurrent registration API:
>>>>>>
>>>>>> protected static boolean registerAsFullyConcurrent()
>>>>>>
>>>>>> might take a boolean parameter:
>>>>>>
>>>>>> protected static boolean registerAsFullyConcurrent(boolean
>>>>>> downgradeToPrallelCapableIfAnySuperclassIsNotFullyConcurrent)
>>>>>>
>>>>>>
>>>>>> and provide no accessible API to find out what the registration
>>>>>> actually
>>>>>> did (register as parallel-capable or fully-concurrent - return true in
>>>>>> any case).
>>>>>>
>>>>>> Since all JDK provided ClassLoaders will be made fully concurrent,
>>>>>> this
>>>>>> might only be relevant if there is vendor A that currently provides
>>>>>> only
>>>>>> parallel-capable ClassLoader implementation and there is vendor B that
>>>>>> subclasses A's loader and wants to upgrade and be backward
>>>>>> compatible at
>>>>>> the same time.
>>>>>>
>>>>>> Does this complicate things to much for no real benefit?
>>>>>>
>>>>>> Regards, Peter
>>>>>>
>>>>
>>
>


From rob.mckenna at oracle.com  Wed Dec 12 15:53:52 2012
From: rob.mckenna at oracle.com (rob.mckenna at oracle.com)
Date: Wed, 12 Dec 2012 15:53:52 +0000
Subject: hg: jdk8/tl/jdk: 8004337: java/sql tests aren't run in test/Makefile
Message-ID: <20121212155414.29B01470C5@hg.openjdk.java.net>

Changeset: 68374c6e65c1
Author:    robm
Date:      2012-12-12 15:57 +0000
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/68374c6e65c1

8004337: java/sql tests aren't run in test/Makefile
Reviewed-by: lancea, alanb

! test/Makefile



From peter.levart at gmail.com  Wed Dec 12 16:05:15 2012
From: peter.levart at gmail.com (Peter Levart)
Date: Wed, 12 Dec 2012 17:05:15 +0100
Subject: Proposal: Fully Concurrent ClassLoading
In-Reply-To: 
References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com>
	<50C56053.1060306@oracle.com>
	
	<50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com>
	<50C6FCDE.7070404@oracle.com> <50C70087.4030003@gmail.com>
	<50C718BD.2010201@oracle.com> <50C71FE0.5020704@gmail.com>
	<50C7E086.6040805@oracle.com>
	
Message-ID: <50C8AB3B.9050708@gmail.com>

On 12/12/2012 04:51 PM, Zhong Yu wrote:
> If a class loader is declared fully concurrent, yet
> getClassLoadingLock() is invoked, what's the harm of returning a
> dedicated lock anyway, exactly like what's done before?
To encourage people to not use locking in the first place ;-)

No, seriously, to be able to remove the deprecated feature in the 
future, perhaps.

Peter
>
> On Tue, Dec 11, 2012 at 7:40 PM, David Holmes  wrote:
>> On 11/12/2012 9:58 PM, Peter Levart wrote:
>>> On 12/11/2012 12:27 PM, David Holmes wrote:
>>>> Peter,
>>>>
>>>> You are convincing me that all superclasses must be fully concurrent
>>>> too. Otherwise we are just trying to second-guess a whole bunch of
>>>> what-ifs. :)
>>>
>>> If you think some more, yes. The superclass might not use
>>> getClassLoadingLock() but rely on the fact that findClass() is allways
>>> called under a guard of per-class-name lock, for example. It's a matter
>>> of how far to go to prevent such miss-behaving fully-concurrent
>>> subclasses. So far to also prevent fully-concurrent subclasses that
>>> would otherwise be perfectly correct?
>>>
>>> Maybe not. Creating custom ClassLoaders is not an average programmer's
>>> job. Those that do this things will of course study the implementations
>>> of superclasses they extend and do the right thing. And it's reasonable
>>> to expect that they more or less will only extend JDK's ClassLoaders -
>>> but on the other hand if they only extend JDK's class loaders, they are
>>> not prevented to be fully-concurrent either way. Hm...
>>
>> Again I think it is just too hard to try and second-guess how a
>> parallel-loader might rely on the per-class locks (I actually don't see any
>> reasonable use for them beyond flow-control), and then how a concurrent
>> loader subclass might need to modify things.
>>
>> If we simply disallow this then we can relax that constraint in the future
>> if valid use-cases turn up for that capability. Of course if someone has a
>> valid use-case during this discussion phase then of course that will
>> influence the decision.
>>
>> Thanks,
>> David
>>
>>> Peter
>>>
>>>> Thanks,
>>>> David
>>>>
>>>> On 11/12/2012 7:44 PM, Peter Levart wrote:
>>>>> On 12/11/2012 10:29 AM, David Holmes wrote:
>>>>>> On 11/12/2012 7:20 PM, Peter Levart wrote:
>>>>>>> On 12/11/2012 03:55 AM, David Holmes wrote:
>>>>>>>>> Question on the source code: registerAsFullyConcurrent has confusing
>>>>>>>>> comment -
>>>>>>>>> do the super classes all need to be parallel capable? Or do the
>>>>>>>>> super
>>>>>>>>> classes all need
>>>>>>>>> to be FullyConcurrent? I assume the latter, so just fix the
>>>>>>>>> comments.
>>>>>>>>
>>>>>>>> Actually it is the former. There's no reason to require that all
>>>>>>>> superclasses be fully-concurrent. Of course a given loaders degree of
>>>>>>>> concurrency may be constrained by what it's supertype allows, but
>>>>>>>> there's no reason to actually force all the supertypes to be
>>>>>>>> fully-concurrent: it is enough that they are at least all parallel
>>>>>>>> capable.
>>>>>>>
>>>>>>> Hi David,
>>>>>>>
>>>>>>> There is one caveat: if ClassLoader X declares that it is
>>>>>>> fully-concurrent and it's superclass Y is only parallel-capable,
>>>>>>> then X
>>>>>>> will act as fully-concurrent (returning null from
>>>>>>> getClassLoadingLock()). superclass Y might or might not be coded to
>>>>>>> use
>>>>>>> the getClassLoadingLock(). X therefore has to know how Y is coded.
>>>>>>> To be
>>>>>>> defensive, X could ask for Y's registration and declare itself as only
>>>>>>> parallel-capable if Y declares the same so that when Y is upgraded
>>>>>>> to be
>>>>>>> fully-concurrent, X would become fully-concurrent automatically. To
>>>>>>> support situations where the same version of X would work in two
>>>>>>> environments where in one Y is only parallel-capable and in the
>>>>>>> other Y
>>>>>>> is fully-concurrent, there could be a static API to retrieve the
>>>>>>> registrations of superclasses.
>>>>>>
>>>>>> I don't quite follow this. What code in the superclass are you
>>>>>> anticipating that the subclass will use which relies on the lock? Or
>>>>>> is this just an abstract "what if" scenario?
>>>>>
>>>>> This is more or less "what if". There might be a subclass Y of say
>>>>> java.lang.ClassLoader that overrides loadClass or findClass, declares
>>>>> that it is parallel-capable and in the implementation of it's loadClass
>>>>> or findClass, uses getClassLoadingLock() to synchronize access to it's
>>>>> internal state. Now there comes class X extends Y that declares that it
>>>>> is fully-concurrent. Of course this will not work, X has to declare that
>>>>> it is parallel-capable, because Y uses getClassLoadingLock().
>>>>>
>>>>> What I suggested in the next message is to not change the registration
>>>>> API but rather provide getClassLoadingLock() that returns non-null locks
>>>>> when any of the superclasses declare that they are only
>>>>> parallel-capable, not fully-concurrent.
>>>>>
>>>>> Regards, Peter
>>>>>
>>>>>> Thanks,
>>>>>> David
>>>>>> -----
>>>>>>
>>>>>>> Or, to have less impact on future deprecation of old parallel-capable
>>>>>>> registration API, the fully-concurrent registration API:
>>>>>>>
>>>>>>> protected static boolean registerAsFullyConcurrent()
>>>>>>>
>>>>>>> might take a boolean parameter:
>>>>>>>
>>>>>>> protected static boolean registerAsFullyConcurrent(boolean
>>>>>>> downgradeToPrallelCapableIfAnySuperclassIsNotFullyConcurrent)
>>>>>>>
>>>>>>>
>>>>>>> and provide no accessible API to find out what the registration
>>>>>>> actually
>>>>>>> did (register as parallel-capable or fully-concurrent - return true in
>>>>>>> any case).
>>>>>>>
>>>>>>> Since all JDK provided ClassLoaders will be made fully concurrent,
>>>>>>> this
>>>>>>> might only be relevant if there is vendor A that currently provides
>>>>>>> only
>>>>>>> parallel-capable ClassLoader implementation and there is vendor B that
>>>>>>> subclasses A's loader and wants to upgrade and be backward
>>>>>>> compatible at
>>>>>>> the same time.
>>>>>>>
>>>>>>> Does this complicate things to much for no real benefit?
>>>>>>>
>>>>>>> Regards, Peter
>>>>>>>



From jim.gish at oracle.com  Wed Dec 12 16:13:33 2012
From: jim.gish at oracle.com (Jim Gish)
Date: Wed, 12 Dec 2012 11:13:33 -0500
Subject: RFR: 8004651 - TEST: java/util/logging/CheckLockLocationTest.java
	failed to delete file (win)
In-Reply-To: <50C7C995.5090408@oracle.com>
References: <50C2410E.7040200@oracle.com> <50C68292.4030404@oracle.com>
	<50C7BC1A.9010305@oracle.com> <50C7C995.5090408@oracle.com>
Message-ID: <50C8AD2D.7070800@oracle.com>

Yes, please.

Thanks,
    Jim

On 12/11/2012 07:02 PM, Stuart Marks wrote:
> Looks good!
>
> Do you need someone to push this for you?
>
> s'marks
>
> On 12/11/12 3:04 PM, Jim Gish wrote:
>> A bit more cleanup as suggested:
>>
>> http://cr.openjdk.java.net/~jgish/Bug8004651-CheckLockLocationTest-Windows-delete-file-fix/ 
>>
>>  
>>
>>
>> Thanks,
>>      Jim
>>
>> On 12/10/2012 07:47 PM, Stuart Marks wrote:
>>> Hi Jim,
>>>
>>> Catching IOException from delete() is a bit odd. The only thing in the
>>> delete() method that throws an IOE is the explicit throw of
>>> FileNotFoundException... so in that case we'd throw FNFE and then 
>>> catch the
>>> IOE at the caller and print a warning. Would it be better to just 
>>> print a
>>> warning from within the delete() method, and remove "throws 
>>> IOException" ?
>>> There's only one other caller to delete() and it seems indifferent 
>>> to this
>>> change.
>>>
>>> Now that we're no longer checking the message of 
>>> FileSystemException, it's
>>> possible to change the instanceof check into a separate catch-clause of
>>> FileSystemException, which simply ignores that exception. The catch 
>>> clause
>>> for IOException can be simplified to unconditionally wrap the IOE in a
>>> RuntimeException and rethrow it. Actually it's not clear to me 
>>> that's even
>>> necessary since runTests() is declared to throw IOException, so we 
>>> might not
>>> even need to catch IOE here at all; we can just let it propagate to 
>>> the caller.
>>>
>>> Looks like similar simplifications apply to tests 2 and 4 as well.
>>>
>>> s'marks
>>>
>>> On 12/7/12 11:18 AM, Jim Gish wrote:
>>>> Please review
>>>> http://cr.openjdk.java.net/~jgish/Bug8004651-CheckLockLocationTest-Windows-delete-file-fix/ 
>>>>
>>>>
>>>>  
>>>>
>>>>
>>>>
>>>>
>>>> Summary -- failure to delete a test log should be a warning instead 
>>>> of a
>>>> failure.  Also, while fixing this problem another one popped up -- 
>>>> not all
>>>> platforms generate the same message in the FileSystemException ("Not a
>>>> directory"), so removing the exception content check.
>>>>
>>>> Thanks,
>>>>     Jim
>>>>
>>
>> -- 
>> Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304
>> Oracle Java Platform Group | Core Libraries Team
>> 35 Network Drive
>> Burlington, MA 01803
>> jim.gish at oracle.com
>>

-- 
Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304
Oracle Java Platform Group | Core Libraries Team
35 Network Drive
Burlington, MA 01803
jim.gish at oracle.com



From chris.hegarty at oracle.com  Wed Dec 12 16:17:59 2012
From: chris.hegarty at oracle.com (Chris Hegarty)
Date: Wed, 12 Dec 2012 16:17:59 +0000
Subject: Request for review: 8000525: Java.net.httpcookie api does not
	support 2-digit year format
In-Reply-To: <50C8A64E.6090404@oracle.com>
References: <50C10BE2.5070006@oracle.com> <50C614DE.6090208@oracle.com>
	<50C8A62A.1090106@oracle.com> <50C8A64E.6090404@oracle.com>
Message-ID: <50C8AE37.1060808@oracle.com>

Thank you Rob, I'm ok with this change.

-Chris.

On 12/12/2012 15:44, Rob McKenna wrote:
> ...the url would be helpful:
> http://cr.openjdk.java.net/~robm/8000525/webrev.02/
>
> -Rob
> On 12/12/12 15:43, Rob McKenna wrote:
>> Hi Chris,
>>
>> I guess I figured if the parse failed the cal.set wouldn't happen.
>> Still, no harm in moving the 1970 into the loop on the off chance
>> something else goes wrong.
>>
>> I've updated the test too. Thanks for spotting that.
>>
>> -Rob
>>
>> On 10/12/12 16:59, Chris Hegarty wrote:
>>> Shouldn't 'cal.set(1970, 0, 1, 0, 0, 0)' be inside the for loop?
>>>
>>> The test can simply throw Exception, rather can catching.
>>>
>>> Otherwise, looks fine to me.
>>>
>>> -Crhis.
>>>
>>> On 06/12/2012 21:19, Rob McKenna wrote:
>>>> Hi folks,
>>>>
>>>> According to HttpCookie.java:
>>>>
>>>> """
>>>> There are 3 http cookie specifications:
>>>>
>>>> Netscape draft
>>>> RFC 2109 -/http://www.ietf.org/rfc/rfc2109.txt/
>>>> RFC 2965 -/http://www.ietf.org/rfc/rfc2965.txt/
>>>>
>>>> HttpCookie class can accept all these 3 forms of syntax.
>>>> """
>>>>
>>>> According to http://www.ietf.org/rfc/rfc2109.txt section 10.1.2:
>>>>
>>>> """
>>>> Netscape's original proposal defined an Expires header that took a date
>>>> value in a fixed-length variant format in place of Max-Age: Wdy,
>>>> DD-Mon-YY HH:MM:SS GMT
>>>> """
>>>>
>>>> Thats in the "Historical" section provided to allow for compatibility
>>>> with Netscape's implementation, which we also support: (as per
>>>> http://docs.oracle.com/javase/6/docs/api/java/net/HttpCookie.html )
>>>>
>>>> While we don't support the rfc explicitly, this change follows the
>>>> format specified in section 5.1.1 of rfc 6265:
>>>>
>>>> """
>>>> 3. If the year-value is greater than or equal to 70 and less than or
>>>> equal to 99, increment the year-value by 1900.
>>>> 4. If the year-value is greater than or equal to 0 and less than or
>>>> equal to 69, increment the year-value by 2000.
>>>> 1. NOTE: Some existing user agents interpret two-digit years
>>>> differently.
>>>> """
>>>>
>>>> The webrev is at:
>>>>
>>>> http://cr.openjdk.java.net/~robm/8000525/webrev.01/
>>>> 
>>>>
>>>> Note: The addition of setLenient(false) has required changes to two
>>>> existing testcases.
>>>>
>>>> -Rob
>>
>


From zhong.j.yu at gmail.com  Wed Dec 12 16:24:05 2012
From: zhong.j.yu at gmail.com (Zhong Yu)
Date: Wed, 12 Dec 2012 10:24:05 -0600
Subject: Proposal: Fully Concurrent ClassLoading
In-Reply-To: <50C8AB3B.9050708@gmail.com>
References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com>
	<50C56053.1060306@oracle.com>
	
	<50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com>
	<50C6FCDE.7070404@oracle.com> <50C70087.4030003@gmail.com>
	<50C718BD.2010201@oracle.com> <50C71FE0.5020704@gmail.com>
	<50C7E086.6040805@oracle.com>
	
	<50C8AB3B.9050708@gmail.com>
Message-ID: 

On Wed, Dec 12, 2012 at 10:05 AM, Peter Levart  wrote:
> On 12/12/2012 04:51 PM, Zhong Yu wrote:
>>
>> If a class loader is declared fully concurrent, yet
>> getClassLoadingLock() is invoked, what's the harm of returning a
>> dedicated lock anyway, exactly like what's done before?
>
> To encourage people to not use locking in the first place ;-)

In that case throwing an exception is probably better than returning a null.

> No, seriously, to be able to remove the deprecated feature in the future,
> perhaps.

> Peter
>
>>
>> On Tue, Dec 11, 2012 at 7:40 PM, David Holmes 
>> wrote:
>>>
>>> On 11/12/2012 9:58 PM, Peter Levart wrote:
>>>>
>>>> On 12/11/2012 12:27 PM, David Holmes wrote:
>>>>>
>>>>> Peter,
>>>>>
>>>>> You are convincing me that all superclasses must be fully concurrent
>>>>> too. Otherwise we are just trying to second-guess a whole bunch of
>>>>> what-ifs. :)
>>>>
>>>>
>>>> If you think some more, yes. The superclass might not use
>>>> getClassLoadingLock() but rely on the fact that findClass() is allways
>>>> called under a guard of per-class-name lock, for example. It's a matter
>>>> of how far to go to prevent such miss-behaving fully-concurrent
>>>> subclasses. So far to also prevent fully-concurrent subclasses that
>>>> would otherwise be perfectly correct?
>>>>
>>>> Maybe not. Creating custom ClassLoaders is not an average programmer's
>>>> job. Those that do this things will of course study the implementations
>>>> of superclasses they extend and do the right thing. And it's reasonable
>>>> to expect that they more or less will only extend JDK's ClassLoaders -
>>>> but on the other hand if they only extend JDK's class loaders, they are
>>>> not prevented to be fully-concurrent either way. Hm...
>>>
>>>
>>> Again I think it is just too hard to try and second-guess how a
>>> parallel-loader might rely on the per-class locks (I actually don't see
>>> any
>>> reasonable use for them beyond flow-control), and then how a concurrent
>>> loader subclass might need to modify things.
>>>
>>> If we simply disallow this then we can relax that constraint in the
>>> future
>>> if valid use-cases turn up for that capability. Of course if someone has
>>> a
>>> valid use-case during this discussion phase then of course that will
>>> influence the decision.
>>>
>>> Thanks,
>>> David
>>>
>>>> Peter
>>>>
>>>>> Thanks,
>>>>> David
>>>>>
>>>>> On 11/12/2012 7:44 PM, Peter Levart wrote:
>>>>>>
>>>>>> On 12/11/2012 10:29 AM, David Holmes wrote:
>>>>>>>
>>>>>>> On 11/12/2012 7:20 PM, Peter Levart wrote:
>>>>>>>>
>>>>>>>> On 12/11/2012 03:55 AM, David Holmes wrote:
>>>>>>>>>>
>>>>>>>>>> Question on the source code: registerAsFullyConcurrent has
>>>>>>>>>> confusing
>>>>>>>>>> comment -
>>>>>>>>>> do the super classes all need to be parallel capable? Or do the
>>>>>>>>>> super
>>>>>>>>>> classes all need
>>>>>>>>>> to be FullyConcurrent? I assume the latter, so just fix the
>>>>>>>>>> comments.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Actually it is the former. There's no reason to require that all
>>>>>>>>> superclasses be fully-concurrent. Of course a given loaders degree
>>>>>>>>> of
>>>>>>>>> concurrency may be constrained by what it's supertype allows, but
>>>>>>>>> there's no reason to actually force all the supertypes to be
>>>>>>>>> fully-concurrent: it is enough that they are at least all parallel
>>>>>>>>> capable.
>>>>>>>>
>>>>>>>>
>>>>>>>> Hi David,
>>>>>>>>
>>>>>>>> There is one caveat: if ClassLoader X declares that it is
>>>>>>>> fully-concurrent and it's superclass Y is only parallel-capable,
>>>>>>>> then X
>>>>>>>> will act as fully-concurrent (returning null from
>>>>>>>> getClassLoadingLock()). superclass Y might or might not be coded to
>>>>>>>> use
>>>>>>>> the getClassLoadingLock(). X therefore has to know how Y is coded.
>>>>>>>> To be
>>>>>>>> defensive, X could ask for Y's registration and declare itself as
>>>>>>>> only
>>>>>>>> parallel-capable if Y declares the same so that when Y is upgraded
>>>>>>>> to be
>>>>>>>> fully-concurrent, X would become fully-concurrent automatically. To
>>>>>>>> support situations where the same version of X would work in two
>>>>>>>> environments where in one Y is only parallel-capable and in the
>>>>>>>> other Y
>>>>>>>> is fully-concurrent, there could be a static API to retrieve the
>>>>>>>> registrations of superclasses.
>>>>>>>
>>>>>>>
>>>>>>> I don't quite follow this. What code in the superclass are you
>>>>>>> anticipating that the subclass will use which relies on the lock? Or
>>>>>>> is this just an abstract "what if" scenario?
>>>>>>
>>>>>>
>>>>>> This is more or less "what if". There might be a subclass Y of say
>>>>>> java.lang.ClassLoader that overrides loadClass or findClass, declares
>>>>>> that it is parallel-capable and in the implementation of it's
>>>>>> loadClass
>>>>>> or findClass, uses getClassLoadingLock() to synchronize access to it's
>>>>>> internal state. Now there comes class X extends Y that declares that
>>>>>> it
>>>>>> is fully-concurrent. Of course this will not work, X has to declare
>>>>>> that
>>>>>> it is parallel-capable, because Y uses getClassLoadingLock().
>>>>>>
>>>>>> What I suggested in the next message is to not change the registration
>>>>>> API but rather provide getClassLoadingLock() that returns non-null
>>>>>> locks
>>>>>> when any of the superclasses declare that they are only
>>>>>> parallel-capable, not fully-concurrent.
>>>>>>
>>>>>> Regards, Peter
>>>>>>
>>>>>>> Thanks,
>>>>>>> David
>>>>>>> -----
>>>>>>>
>>>>>>>> Or, to have less impact on future deprecation of old
>>>>>>>> parallel-capable
>>>>>>>> registration API, the fully-concurrent registration API:
>>>>>>>>
>>>>>>>> protected static boolean registerAsFullyConcurrent()
>>>>>>>>
>>>>>>>> might take a boolean parameter:
>>>>>>>>
>>>>>>>> protected static boolean registerAsFullyConcurrent(boolean
>>>>>>>> downgradeToPrallelCapableIfAnySuperclassIsNotFullyConcurrent)
>>>>>>>>
>>>>>>>>
>>>>>>>> and provide no accessible API to find out what the registration
>>>>>>>> actually
>>>>>>>> did (register as parallel-capable or fully-concurrent - return true
>>>>>>>> in
>>>>>>>> any case).
>>>>>>>>
>>>>>>>> Since all JDK provided ClassLoaders will be made fully concurrent,
>>>>>>>> this
>>>>>>>> might only be relevant if there is vendor A that currently provides
>>>>>>>> only
>>>>>>>> parallel-capable ClassLoader implementation and there is vendor B
>>>>>>>> that
>>>>>>>> subclasses A's loader and wants to upgrade and be backward
>>>>>>>> compatible at
>>>>>>>> the same time.
>>>>>>>>
>>>>>>>> Does this complicate things to much for no real benefit?
>>>>>>>>
>>>>>>>> Regards, Peter
>>>>>>>>
>


From daniel.daugherty at oracle.com  Wed Dec 12 16:36:25 2012
From: daniel.daugherty at oracle.com (Daniel D. Daugherty)
Date: Wed, 12 Dec 2012 09:36:25 -0700
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem.
In-Reply-To: <50C8A5C4.4030602@oracle.com>
References: <50C8A5C4.4030602@oracle.com>
Message-ID: <50C8B289.8070906@oracle.com>

For this item:

 >     test/java/util/logging/LoggingDeadlock4.java
 >         Test case was simplified to avoid AWT class loading. Negative 
test
 >         result was tested on early JDK7 build.

if I remember correctly, the whole point of that test was to
check for a logging deadlock relative to AWT's usage of logging.
If you avoid loading AWT classes, doesn't that make the test
rather useless?

Dan


On 12/12/12 8:41 AM, Alexey Utkin wrote:
> Bug description:
> https://jbs.oracle.com/bugs/browse/JDK-8004928
>
> Here is the suggested fix:
> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8004928/webrev.01
>
> Summary:
> *test/java/io/Serializable/resolveProxyClass/NonPublicInterface.java*
> *test/java/lang/reflect/Proxy/ClassRestrictions.java*
>         The set of non-public interfaces was changed to avoid AWT 
> dependencies.
>
> *test/java/lang/management/CompilationMXBean/Basic.java*
>         The ballast calls
>             java.awt.Toolkit.getDefaultToolkit();
>             javax.swing.UIManager.getInstalledLookAndFeels();
>         were removed from compiled Java code. Compilation time still 
> positive.
>
> *test/java/lang/reflect/Generics/Probe.java*
>         The dependence from the internal class 
> "javax.swing.JComboBox$AccessibleJComboBox"
>         was excepted from code. It has very small impact to test coverage.
>
> *test/java/util/Collections/EmptyIterator.java*
>         Swing-stored constants were changed to locally-defined.
>
> *test/java/util/logging/LoggingDeadlock4.java*
>         Test case was simplified to avoid AWT class loading. Negative 
> test result was tested on early
>         JDK7 build.
>
> *test/sun/tools/jrunscript/common.sh*
>         Useless mention of XToolkit  was removed from the script.
>
> Regards,
> -uta
>



From Alan.Bateman at oracle.com  Wed Dec 12 16:47:10 2012
From: Alan.Bateman at oracle.com (Alan Bateman)
Date: Wed, 12 Dec 2012 16:47:10 +0000
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem.
In-Reply-To: <50C8B289.8070906@oracle.com>
References: <50C8A5C4.4030602@oracle.com> <50C8B289.8070906@oracle.com>
Message-ID: <50C8B50E.90807@oracle.com>

On 12/12/2012 16:36, Daniel D. Daugherty wrote:
> For this item:
>
> >     test/java/util/logging/LoggingDeadlock4.java
> >         Test case was simplified to avoid AWT class loading. 
> Negative test
> >         result was tested on early JDK7 build.
>
> if I remember correctly, the whole point of that test was to
> check for a logging deadlock relative to AWT's usage of logging.
> If you avoid loading AWT classes, doesn't that make the test
> rather useless?
>
> Dan
java.awt.Container:

     private static final PlatformLogger log = 
PlatformLogger.getLogger("java.awt.Container");
     private static final PlatformLogger eventLog = 
PlatformLogger.getLogger("java.awt.event.Container");

and the updated test is just using PlatformLogger directly, I hope it 
demonstrates the same issue with a JDK that doesn't have the fix.

(BTW: Just as background, with compact profiles coming then we need to 
beat our tests into shape so that the tests for the APIs supported in 
each profile can be run. Alexey is addressing some of the low-hanging 
fruit, clearly it won't be possible to remove the dependency from all 
tests. Also care is required to ensure that the test continues to test 
what it was created to test. Expect efforts like this ^10 once modules 
comes).

-Alan



From daniel.daugherty at oracle.com  Wed Dec 12 16:52:31 2012
From: daniel.daugherty at oracle.com (Daniel D. Daugherty)
Date: Wed, 12 Dec 2012 09:52:31 -0700
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem.
In-Reply-To: <50C8B50E.90807@oracle.com>
References: <50C8A5C4.4030602@oracle.com> <50C8B289.8070906@oracle.com>
	<50C8B50E.90807@oracle.com>
Message-ID: <50C8B64F.3020204@oracle.com>

On 12/12/12 9:47 AM, Alan Bateman wrote:
> On 12/12/2012 16:36, Daniel D. Daugherty wrote:
>> For this item:
>>
>> >     test/java/util/logging/LoggingDeadlock4.java
>> >         Test case was simplified to avoid AWT class loading. 
>> Negative test
>> >         result was tested on early JDK7 build.
>>
>> if I remember correctly, the whole point of that test was to
>> check for a logging deadlock relative to AWT's usage of logging.
>> If you avoid loading AWT classes, doesn't that make the test
>> rather useless?
>>
>> Dan
> java.awt.Container:
>
>     private static final PlatformLogger log = 
> PlatformLogger.getLogger("java.awt.Container");
>     private static final PlatformLogger eventLog = 
> PlatformLogger.getLogger("java.awt.event.Container");
>
> and the updated test is just using PlatformLogger directly,

I thought the deadlock had to do with locks grabbed on the way
to getting into the underlying PlatformLogger, but my memory is
hazy and I don't have the cycles to research this.


> I hope it demonstrates the same issue with a JDK that doesn't have the 
> fix.

That would be the right way to see if the test still "works".


> (BTW: Just as background, with compact profiles coming then we need to 
> beat our tests into shape so that the tests for the APIs supported in 
> each profile can be run. Alexey is addressing some of the low-hanging 
> fruit, clearly it won't be possible to remove the dependency from all 
> tests. Also care is required to ensure that the test continues to test 
> what it was created to test. Expect efforts like this ^10 once modules 
> comes).

Thanks for the background.

Dan



From stuart.marks at oracle.com  Wed Dec 12 17:47:29 2012
From: stuart.marks at oracle.com (Stuart Marks)
Date: Wed, 12 Dec 2012 09:47:29 -0800
Subject: RFR: 8004748: clean up @build tags in RMI tests
In-Reply-To: <50C7EACC.2090803@oracle.com>
References: <50C7C779.4000106@oracle.com> <50C7EACC.2090803@oracle.com>
Message-ID: <50C8C331.7020607@oracle.com>

On 12/11/12 6:24 PM, Mandy Chung wrote:
> Looks fine with me.
>
> I notice that there are cases that still require @build the main class when it
> contains the source for other interfaces/classes that another class depends on
> - not a problem.

Right, that's exactly what's going on. To decompress this for other readers :-) 
for some test class X it's usually not necessary to list X on an @build line. 
If there is a helper class Y then something like the following usually works:

     @build Y
     @run main X

But sometimes the source file X.java includes an interface N that Y depends on. 
(Personally, I would never program this way.) :-)

In this case the above doesn't work, and one must do this:

     @build X Y
     @run main X

In the fullness of time it might be nice to split out interfaces like N into 
their own top-level source files, but I wanted to keep this separate from the 
cleanup pass of @build tags.

Thanks,

s'marks

>
> Mandy
>
> On 12/11/2012 3:53 PM, Stuart Marks wrote:
>> Hi all,
>>
>> Please review the following gigantic webrev [1] to clean up @build tags in
>> RMI tests. Details underlying this change are in the bug report [2].
>>
>> Briefly, if test classes listed in @build tags are in the wrong order, this
>> trips over a jtreg problem that in turn causes a cascade of subsequent tests
>> to fail. It's sensitive to the order in which tests run. The problem
>> currently occurs in the jdk7u repo. It doesn't happen in jdk8 right now, but
>> as things shift around it might occur in the future.
>>
>> Naturally, I intend to backport this to 7u once it's in 8.
>>
>> Shifting the @build tags in the test is a workaround for the jtreg bug, but
>> jtreg isn't going to be fixed soon. Besides, the @build tags in the RMI tests
>> needed to be cleaned up anyway. In particular, consolidating multiple @build
>> tags into a single tag speeds up the RMI test run by about 2.5%.
>>
>> I've also taken the opportunity to do a couple of related cleanups in a few
>> places, such as fixing typos, rearranging tags to be in a more consistent
>> order, removing unnecessary classes from @build lines, adding necessary ones,
>> and in one case renaming a file that was spelled differently from the class
>> that it contained. (CheckUnmarshall.java -> CheckUnmarshal.java; there are no
>> textual changes to this file.)
>>
>> Needless to say, all tests pass. In addition, I've run each test individually
>> (i.e., with a clean JTwork directory) to ensure that there were no
>> occurrences of the library class ordering issue that triggers the jtreg bug.
>>
>> Thanks,
>>
>> s'marks
>>
>>
>> [1] http://cr.openjdk.java.net/~smarks/reviews/8004748/webrev.0/
>>
>> [2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004748


From stuart.marks at oracle.com  Wed Dec 12 17:51:28 2012
From: stuart.marks at oracle.com (Stuart Marks)
Date: Wed, 12 Dec 2012 09:51:28 -0800
Subject: RFR: 8004748: clean up @build tags in RMI tests
In-Reply-To: <50C85FC8.3010102@oracle.com>
References: <50C7C779.4000106@oracle.com> <50C85FC8.3010102@oracle.com>
Message-ID: <50C8C420.6040207@oracle.com>

On 12/12/12 2:43 AM, Alan Bateman wrote:
> On 11/12/2012 23:53, Stuart Marks wrote:
>> Please review the following gigantic webrev [1] to clean up @build tags in
>> RMI tests. Details underlying this change are in the bug report [2].
>>
>> Briefly, if test classes listed in @build tags are in the wrong order, this
>> trips over a jtreg problem that in turn causes a cascade of subsequent tests
>> to fail. It's sensitive to the order in which tests run. The problem
>> currently occurs in the jdk7u repo. It doesn't happen in jdk8 right now, but
>> as things shift around it might occur in the future.
> The changes looks okay to me. Also just to mention that I've seen this with
> jdk8 too, but only with -concurrency where the tests are running concurrently
> in different agent VMs to speed up the execution. It's very intermittent and
> hopefully the underlying issue in jtreg has be resolved soon.

The problem occurs when a test with the "wrong" class order for @build gets run 
first, after which it spoils a bunch of subsequent tests. If a "good" test is 
run first the rest of the run is fine. When run without -concurrency the first 
test in jdk8 is good, so we don't see the problem. But with -concurrency I can 
easily see that a "bad" test runs first -- but only sometimes -- which then 
causes the problem.

s'marks


From stuart.marks at oracle.com  Wed Dec 12 18:16:18 2012
From: stuart.marks at oracle.com (stuart.marks at oracle.com)
Date: Wed, 12 Dec 2012 18:16:18 +0000
Subject: hg: jdk8/tl/jdk: 8004748: clean up @build tags in RMI tests
Message-ID: <20121212181630.EDE2E470CD@hg.openjdk.java.net>

Changeset: bd84d0927a2e
Author:    smarks
Date:      2012-12-12 09:53 -0800
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/bd84d0927a2e

8004748: clean up @build tags in RMI tests
Reviewed-by: alanb, darcy, mchung

! test/java/rmi/MarshalledObject/compare/Compare.java
! test/java/rmi/MarshalledObject/compare/HashCode.java
! test/java/rmi/MarshalledObject/compare/NullReference.java
! test/java/rmi/Naming/DefaultRegistryPort.java
! test/java/rmi/Naming/LookupIPv6.java
! test/java/rmi/Naming/RmiIsNoScheme.java
! test/java/rmi/Naming/UnderscoreHost.java
! test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java
! test/java/rmi/RMISecurityManager/checkPackageAccess/CheckPackageAccess.java
! test/java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java
! test/java/rmi/activation/Activatable/checkAnnotations/CheckAnnotations.java
! test/java/rmi/activation/Activatable/checkImplClassLoader/CheckImplClassLoader.java
! test/java/rmi/activation/Activatable/checkRegisterInLog/CheckRegisterInLog.java
! test/java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java
! test/java/rmi/activation/Activatable/downloadParameterClass/DownloadParameterClass.java
! test/java/rmi/activation/Activatable/elucidateNoSuchMethod/ElucidateNoSuchMethod.java
! test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh
! test/java/rmi/activation/Activatable/forceLogSnapshot/ForceLogSnapshot.java
! test/java/rmi/activation/Activatable/inactiveGroup/InactiveGroup.java
! test/java/rmi/activation/Activatable/lookupActivationSystem/LookupActivationSystem.java
! test/java/rmi/activation/Activatable/nestedActivate/NestedActivate.java
! test/java/rmi/activation/Activatable/nonExistentActivatable/NonExistentActivatable.java
! test/java/rmi/activation/Activatable/restartCrashedService/RestartCrashedService.java
! test/java/rmi/activation/Activatable/restartLatecomer/RestartLatecomer.java
! test/java/rmi/activation/Activatable/restartService/RestartService.java
! test/java/rmi/activation/Activatable/shutdownGracefully/ShutdownGracefully.java
! test/java/rmi/activation/Activatable/unregisterInactive/UnregisterInactive.java
! test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java
! test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java
! test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java
! test/java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java
! test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java
! test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java
! test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java
! test/java/rmi/activation/CommandEnvironment/NullOptions.java
! test/java/rmi/activation/CommandEnvironment/SetChildEnv.java
! test/java/rmi/activation/checkusage/CheckUsage.java
! test/java/rmi/activation/log/LogTest.java
! test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java
! test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java
! test/java/rmi/dgc/VMID/CheckVMID.java
! test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java
! test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation.java
! test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls.java
! test/java/rmi/invalidName/InvalidName.java
! test/java/rmi/registry/altSecurityManager/AltSecurityManager.java
! test/java/rmi/registry/checkusage/CheckUsage.java
! test/java/rmi/registry/classPathCodebase/ClassPathCodebase.java
! test/java/rmi/registry/interfaceHash/InterfaceHash.java
! test/java/rmi/registry/multipleRegistries/MultipleRegistries.java
! test/java/rmi/registry/readTest/readTest.sh
! test/java/rmi/registry/reexport/Reexport.java
! test/java/rmi/reliability/benchmark/runRmiBench.sh
! test/java/rmi/reliability/benchmark/runSerialBench.sh
! test/java/rmi/reliability/juicer/AppleUserImpl.java
! test/java/rmi/server/ObjID/randomIDs/RandomIDs.java
! test/java/rmi/server/RMIClassLoader/delegateBeforePermissionCheck/DelegateBeforePermissionCheck.java
! test/java/rmi/server/RMIClassLoader/delegateToContextLoader/DelegateToContextLoader.java
! test/java/rmi/server/RMIClassLoader/downloadArrayClass/DownloadArrayClass.java
! test/java/rmi/server/RMIClassLoader/getClassAnnotation/NullClass.java
! test/java/rmi/server/RMIClassLoader/getClassLoader/GetClassLoader.java
! test/java/rmi/server/RMIClassLoader/loadProxyClasses/LoadProxyClasses.java
! test/java/rmi/server/RMIClassLoader/noSecurityManager/NoSecurityManager.java
! test/java/rmi/server/RMIClassLoader/spi/ContextInsulation.java
! test/java/rmi/server/RMIClassLoader/spi/DefaultProperty.java
! test/java/rmi/server/RMIClassLoader/spi/Installed.java
! test/java/rmi/server/RMIClassLoader/spi/InvalidProperty.java
! test/java/rmi/server/RMIClassLoader/spi/Property.java
! test/java/rmi/server/RMIClassLoader/useCodebaseOnly/UseCodebaseOnly.java
! test/java/rmi/server/RMIClassLoader/useGetURLs/UseGetURLs.java
! test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java
! test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java
! test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java
! test/java/rmi/server/RemoteObject/notExtending/NotExtending.java
! test/java/rmi/server/RemoteObject/verifyRemoteEquals/VerifyRemoteEquals.java
! test/java/rmi/server/RemoteServer/AddrInUse.java
! test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName.java
! test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java
! test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java
! test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport.java
! test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2.java
! test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java
! test/java/rmi/server/Unmarshal/PrimitiveClasses.java
+ test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshal.java
! test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread.java
- test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshall.java
! test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java
! test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java
! test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet.java
! test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java
! test/java/rmi/server/clientStackTrace/ClientStackTrace.java
! test/java/rmi/server/getRemoteClass/GetRemoteClass.java
! test/java/rmi/server/serverStackTrace/ServerStackTrace.java
! test/java/rmi/server/serverStackTrace/SuppressStackTraces.java
! test/java/rmi/server/useCustomRef/UseCustomRef.java
! test/java/rmi/transport/acceptLoop/CloseServerSocketOnTermination.java
! test/java/rmi/transport/checkFQDN/CheckFQDN.java
! test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java
! test/java/rmi/transport/closeServerSocket/CloseServerSocket.java
! test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java
! test/java/rmi/transport/handshakeFailure/HandshakeFailure.java
! test/java/rmi/transport/handshakeTimeout/HandshakeTimeout.java
! test/java/rmi/transport/httpSocket/HttpSocketTest.java
! test/java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java
! test/java/rmi/transport/readTimeout/ReadTimeoutTest.java
! test/java/rmi/transport/reuseDefaultPort/ReuseDefaultPort.java
! test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java
! test/javax/rmi/ssl/SocketFactoryTest.java
! test/sun/rmi/log/ReliableLog/LogAlignmentTest.java
! test/sun/rmi/log/ReliableLog/SnapshotSize.java
! test/sun/rmi/rmic/RMIGenerator/RmicDefault.java
! test/sun/rmi/rmic/newrmic/equivalence/run.sh
! test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java
! test/sun/rmi/runtime/Log/checkLogging/CheckLogStreams.java
! test/sun/rmi/runtime/Log/checkLogging/CheckLogging.java
! test/sun/rmi/server/MarshalOutputStream/marshalForeignStub/MarshalForeignStub.java
! test/sun/rmi/transport/proxy/EagerHttpFallback.java
! test/sun/rmi/transport/tcp/DeadCachedConnection.java
! test/sun/rmi/transport/tcp/blockAccept/BlockAcceptTest.java
! test/sun/rmi/transport/tcp/disableMultiplexing/DisableMultiplexing.java



From Alan.Bateman at oracle.com  Wed Dec 12 18:40:57 2012
From: Alan.Bateman at oracle.com (Alan Bateman)
Date: Wed, 12 Dec 2012 18:40:57 +0000
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem.
In-Reply-To: <50C8A5C4.4030602@oracle.com>
References: <50C8A5C4.4030602@oracle.com>
Message-ID: <50C8CFB9.3010608@oracle.com>

On 12/12/2012 15:41, Alexey Utkin wrote:
> Bug description:
> https://jbs.oracle.com/bugs/browse/JDK-8004928
>
> Here is the suggested fix:
> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8004928/webrev.01
This mostly looks good to me, just a few comments:

For java/io/Serializable/resolveProxyClass/NonPublicInterface.java and 
java/lang/reflect/Proxy/ClassRestrictions.java then it would be nice if 
the types used were in compact1 [1], that would avoid needing to exclude 
those tests. I also see the test uses sun.tools.agent.StepConstants 
which I don't think exists but perhaps that is intentional.

test/java/util/Collections/EmptyIterator.java, minor nit but I think we 
prefer "public static" over "static public". It doesn't of course need 
to be public anyway.

You probably saw Dan's comment about changing 
test/java/util/logging/LoggingDeadlock4.java, I trust you'll double 
check this test with an older version of the JDK that doesn't have the 
fix. My only comment is that line 46 is too wide.

-Alan.

[1] http://openjdk.java.net/jeps/161


From mandy.chung at oracle.com  Wed Dec 12 18:59:37 2012
From: mandy.chung at oracle.com (Mandy Chung)
Date: Wed, 12 Dec 2012 10:59:37 -0800
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem.
In-Reply-To: <50C8A5C4.4030602@oracle.com>
References: <50C8A5C4.4030602@oracle.com>
Message-ID: <50C8D419.8000608@oracle.com>

On 12/12/12 7:41 AM, Alexey Utkin wrote:
> Bug description:
>     https://jbs.oracle.com/bugs/browse/JDK-8004928
>
> Here is the suggested fix:
>     http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8004928/webrev.01
>

Looks good in general with some minor comments below.

> Summary:
> *test/java/io/Serializable/resolveProxyClass/NonPublicInterface.java*
> *test/java/lang/reflect/Proxy/ClassRestrictions.java*
>         The set of non-public interfaces was changed to avoid AWT 
> dependencies.
>

These 2 tests look for the first non-public system interface.  Instead 
of keeping the nonPublicInterfaces list, it may be good to simplify this 
to use "java.util.zip.ZipConstants" which seems to be a stable one that 
will unlikely be removed.  I would suggest to add a check that the class 
is non-public (Modifier.isPublic) to catch any future change to this class.

> *test/java/lang/management/CompilationMXBean/Basic.java*
>         The ballast calls
>             java.awt.Toolkit.getDefaultToolkit();
>             javax.swing.UIManager.getInstalledLookAndFeels();
>         were removed from compiled Java code. Compilation time still 
> positive.
>

OK.

> *test/java/lang/reflect/Generics/Probe.java*
>         The dependence from the internal class 
> "javax.swing.JComboBox$AccessibleJComboBox"
>         was excepted from code. It has very small impact to test 
> coverage.
>

OK.

> *test/java/util/Collections/EmptyIterator.java*
>         Swing-stored constants were changed to locally-defined.
>

I believe your change captures what it's intended to test (typed 
enumeration and rawtype enumeration).  Minor comment - it might be 
better to move the new static variables as local variable before calling 
testEmptyEnumeration to be consistent with convention used in this 
test.  There is no need to keep them static anyway.   I would also take 
out the comment about the substitution since this test doesn't seem to 
have any relationship with javax.swing.

> *test/java/util/logging/LoggingDeadlock4.java*
>         Test case was simplified to avoid AWT class loading. Negative 
> test result was tested on early
>         JDK7 build.
>

Looks good.  Nit: L46 - good to break it into 2 lines.  It's good that 
you have verified with and without the fix.

> *test/sun/tools/jrunscript/common.sh*
>         Useless mention of XToolkit  was removed from the script.
>

OK

Thanks
Mandy


From huizhe.wang at oracle.com  Wed Dec 12 19:14:00 2012
From: huizhe.wang at oracle.com (Joe Wang)
Date: Wed, 12 Dec 2012 11:14:00 -0800
Subject: code review request : 8003147 port fix for BCEL bug 39695
In-Reply-To: <50C58072.4060802@oracle.com>
References: <50C58072.4060802@oracle.com>
Message-ID: <50C8D778.20506@oracle.com>

Hi David,

You didn't apply the original Apache completely. Was the omission of the 
change in toString() method intentional?

I see that you've sent your test to Patrick. Have you run regression 
test for this patch?

Thanks,
Joe

On 12/9/2012 10:25 PM, David Buck wrote:
> Hi!
>
> I would like to request a code review of my JDK8 fix for the following 
> issue:
>
> [ 8003147 : port fix for BCEL bug 39695 to our copy bundled as part of 
> jaxp ]
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8003147
>
> In addition to the fix that the BCEL project had for this issue, I 
> needed to "port" some of their support for LocalVariableTypeTable:s to 
> our copy of BCEL as well. Implementing support for LVTT is very 
> straightforward and does not add much to the complexity or risk of 
> this change (especially considering the limited scope of jaxp's use of 
> BCEL).
>
> Here is the webrev for my fix:
>
> [ Code Review for jaxp ]
> http://cr.openjdk.java.net/~dbuck/8003147/webrev.00/
>
> My understanding is that the test cases for our copy of the jaxp code 
> are handled in a separate repository / test suite. I have been in 
> contact with Patrick Zhang (Oracle QA) and Joe Wang and have provided 
> a junit test for this issue as requested. Please see bug report for a 
> simpler (non-junit) test-case. If for some reason anyone wants to see 
> the junit-based test, please let me know and I can provide a copy of 
> that as well.
>
> Best Regards,
> -Buck


From naoto.sato at oracle.com  Wed Dec 12 19:49:34 2012
From: naoto.sato at oracle.com (Naoto Sato)
Date: Wed, 12 Dec 2012 11:49:34 -0800
Subject: build failure on solaris-i586 in make/sun/cldr
In-Reply-To: <50C8332E.10009@oracle.com>
References: <50C8332E.10009@oracle.com>
Message-ID: <50C8DFCE.2050608@oracle.com>

Hi Max,

Looks like the "$(CD) $$dir;" is unnecessary here. Thanks for the catch. 
Just wondering why it is failing on solaris-i586 only. I don't use 
ALT_OUTPUTDIR, but never seen this failure on my environment.

Can you please file a bug for this?

Naoto

On 12/11/12 11:33 PM, Weijun Wang wrote:
> I haven't build on solaris-i586 for some time and see a failure today in
> make/sun/cldr. The Makefile [1] has these lines:
>
>         75         for dir in $(GENSRCDIR); do \
>         76             if [ -d $$dir ] ; then \
>         77                 ( $(CD) $$dir; \
>         78                     for sdir in $(CLDRGENSRCDIR); do \
>         79                         if [ -d $$sdir ] ; then \
>         80                             $(FIND) $$sdir \
>         81                                 -name '*.java' -print >>
> $(JAVA_SOURCE_LIST) ; \
>         82                         fi ; \
>         83                     done \
>         84                 ); \
>         85             fi; \
>         86         done \
>
> So it goes into $(GENSRCDIR) and then tries to look for files inside
> (one of) $(CLDRGENSRCDIR). The latter is defined as
>
>         49 CLDRGENSRCDIR = $(GENSRCDIR)/sun/text/resources/cldr \
>         50             $(GENSRCDIR)/sun/util/cldr \
>         51             $(GENSRCDIR)/sun/util/resources/cldr
>
> in the same file.
>
> In my build, GENSRCDIR is something like
> ../../../build/solaris-i586/gensrc. Since this is a relative directory,
> you cannot cd into it and use it again.
>
> Maybe the first CD is just useless.
>
> Is everyone using ALT_OUTPUTDIR?
>
> Thanks
> Max
>
> [1]
> http://hg.openjdk.java.net/jdk8/tl/jdk/file/131a683a2ce0/make/sun/cldr/Makefile
>



From Alan.Bateman at oracle.com  Wed Dec 12 20:12:06 2012
From: Alan.Bateman at oracle.com (Alan Bateman)
Date: Wed, 12 Dec 2012 20:12:06 +0000
Subject: Result: New core-libs Group Member: Mandy Chung
Message-ID: <50C8E516.90504@oracle.com>

The vote for Mandy Chung [1] is now closed.

Yes: 6
Veto: 0
Abstain: 0

According to the Bylaws definition of Lazy Consensus, this is sufficient 
to approve the nomination.

-Alan

[1] 
http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012494.html


From Alan.Bateman at oracle.com  Wed Dec 12 20:12:13 2012
From: Alan.Bateman at oracle.com (Alan Bateman)
Date: Wed, 12 Dec 2012 20:12:13 +0000
Subject: Result: New core-libs Group Member: Mike Duigou
Message-ID: <50C8E51D.6080803@oracle.com>

The vote for Mike Duigou [1] is now closed.

Yes: 6
Veto: 0
Abstain: 0

According to the Bylaws definition of Lazy Consensus, this is sufficient 
to approve the nomination.

-Alan

[1] 
http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012491.html 



From Alan.Bateman at oracle.com  Wed Dec 12 20:12:18 2012
From: Alan.Bateman at oracle.com (Alan Bateman)
Date: Wed, 12 Dec 2012 20:12:18 +0000
Subject: Result: New core-libs Group Member: Stuart Marks
Message-ID: <50C8E522.1050502@oracle.com>

The vote for Stuart Marks [1] is now closed.

Yes: 6
Veto: 0
Abstain: 0

According to the Bylaws definition of Lazy Consensus, this is sufficient 
to approve the nomination.

-Alan

[1] 
http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012492.html


From jonathan.gibbons at oracle.com  Wed Dec 12 22:42:06 2012
From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com)
Date: Wed, 12 Dec 2012 22:42:06 +0000
Subject: hg: jdk8/tl/langtools: 8004504: ListBuffer could reuse List.nil() as
	the sentinel element
Message-ID: <20121212224208.B5808470ED@hg.openjdk.java.net>

Changeset: 170e486632d9
Author:    jlahoda
Date:      2012-12-12 20:26 +0100
URL:       http://hg.openjdk.java.net/jdk8/tl/langtools/rev/170e486632d9

8004504: ListBuffer could reuse List.nil() as the sentinel element
Summary: ListBuffer.last now points to the last elements with client data, or null if none.
Reviewed-by: jjg, mcimadamore

! src/share/classes/com/sun/tools/javac/jvm/Code.java
! src/share/classes/com/sun/tools/javac/parser/JavacParser.java
! src/share/classes/com/sun/tools/javac/util/ListBuffer.java
+ test/tools/javac/util/list/ListBufferTest.java



From mandy.chung at oracle.com  Wed Dec 12 22:59:01 2012
From: mandy.chung at oracle.com (Mandy Chung)
Date: Wed, 12 Dec 2012 14:59:01 -0800
Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch
In-Reply-To: <50C8793F.1050205@gmail.com>
References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com>
	<23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com>
	<5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com>
	<5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com>
	<50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com>
	<509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com>
	<50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com>
	<50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com>
	<50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com>
	
	<50C8793F.1050205@gmail.com>
Message-ID: <50C90C35.7020000@oracle.com>

Hi Peter,

On 12/12/12 4:31 AM, Peter Levart wrote:
> Hi all,
>
> Ok, no problem. So here's a patch that summarizes what I did in the 
> previous patch, but only for reflective fields (Field[], Method[], 
> Constructor[]) not including annotations:
>
> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev/index.html
>

Finally able to make time to review this patch.  It's good work.  While 
it's good to see the synchronization issue with annotations be fixed, 
separating the cache for reflection and annotation helps.  As David 
replied, he will take your patch and run with it for JEP-149.

The change looks good.  Nit: there are several long lines 
L2235,2244,2245,2249,2269 etc that should be broken into separate 
lines.  The remaining open question is the performance difference in the 
reflectionData() method and how well it will be jit'ed.  In the common 
case, there is no class redefinition where 
classCachesOnClassRedefinition() is essentially like an nop.  I believe 
David will look at the footprint and performance numbers as he has 
initiated the performance testing (need to do it with this new patch).

Thanks
Mandy

> The annotations part is unchanged semantically, but I had to:
>
> - modify private method clearCachesOnClassRedefinition to only include 
> invalidation of annotations and declaredAnnotations fields. I also 
> renamed it to clearAnnotationCachesOnClassRedefinition
> - renamed lastRedefinedCount to lastAnnotationsRedefinedCount and, 
> since this field is now only accessed while holding a lock (from 
> synchronized initAnnotationsIfNecessary), I removed the volatile keyword.
>
> That's it.
>
> While looking at this unchanged part of code some more, I see other 
> races as well. For example: two concurrent accesses to annotations 
> combined with redefinition of a class can result in NPE. Here's a 
> serial execution:
>
> Thread 1:
>     getAnnotation(annotationType);
>         initAnnotationsIfNecessary();
>
> VM:
>     classRedefinedCount++;
>
> Thread 2:
>     getAnnotation(annotationType);
>         initAnnotationsIfNecessary();
>             clearAnnotationCachesOnClassRedefinition();
>                 annotations = null;
>
> Thread 1:
>         return AnnotationSupport.getOneAnnotation(annotations, 
> annotationClass);
>         // 'annotations' field can be null
>
>
> So this needs to be fixed sooner or later.
>
> Joel!
>
> Are your JSR 308 canges involving java.lang.Class too?
>
> Regards, Peter
>
>
> On 12/12/2012 11:59 AM, Joel Borggr?n-Franck wrote:
>> Hi all,
>>
>> First, thanks all of you that are involved in this!
>>
>> I agree with David here, lets split this up (for now) and do 
>> reflective objects in the context of jep-149 and annotations separately.
>>
>> As you may know there are even more annotation coming in with JSR 308 
>> annotations on type (use), so I want to complete that work first and 
>> then do the effort of reducing contention and overhead for both type 
>> and regular annotations and also fixing up the behaviour for 
>> redefine/retransform class.
>>
>> One other point to consider is that some of the fields in 
>> java/lang/reflect/ classes are known by the VM so not all changes in 
>> Java-land are actually doable. Glancing over your patches very 
>> quickly I don't think you have done anything to upset the VM, but 
>> then I am not an expert in this area.
>>
>> Also, with the VM permgen changes we might have to rethink our 
>> assumptions in order to reduce total overhead. For example as I 
>> understand it previously we could just ship the same pointer into 
>> permgen for the annotations arrays, now that isn't possible so we 
>> create a new copy of the array for every Field/Method/Constructor 
>> instance. Perhaps there is some clever way of eliminating those copies.
>>
>> So while I think your patches generally makes sense, I think it is 
>> prudent to delay this for annotations until all our new annotation 
>> features are in.
>>
>> cheers
>> /Joel
>>
>> On Dec 10, 2012, at 7:18 AM, David Holmes  
>> wrote:
>>
>>> Hi Peter,
>>>
>>> Sorry for the delay on this.
>>>
>>> Generally your VolatileData and my ReflectionHelper are doing a 
>>> similar job. But I agree with your reasoning that all of the cached 
>>> SoftReferences are likely to be cleared at once, and so a 
>>> SoftReference to a helper object with direct references, is more 
>>> effective than a direct reference to a helper object with 
>>> SoftReferences. My initial stance with this was very conservative as 
>>> the more change that is introduced the more uncertainty there is 
>>> about the impact.
>>>
>>> I say the above primarily because I think, if I am to proceed with 
>>> this, I will need to separate out the general reflection caching 
>>> changes from the annotation changes. There are a number of reasons 
>>> for this:
>>>
>>> First, I'm not at all familiar with the implementation of 
>>> annotations at the VM or Java level, and the recent changes in this 
>>> area just exacerbate my ignorance of the mechanics. So I don't feel 
>>> qualified to evaluate that aspect.
>>>
>>> Second, the bulk of the reflection caching code is simplified by the 
>>> fact that due to current constraints on class redefinition the 
>>> caching is effectively idempotent for fields/methods/constructors. 
>>> But that is not the case for annotations.
>>>
>>> Finally, the use of synchronization with the annotations method is 
>>> perplexing me. I sent Joe a private email on this but I may as well 
>>> raise it here - and I think you have alluded to this in your earlier 
>>> emails as well: initAnnotationsIfNecessary() is a synchronized 
>>> instance method but I can not find any other code in the VM that 
>>> synchronizes on the Class object's monitor. So if this 
>>> synchronization is trying to establish consistency in the face of 
>>> class redefinition, I do not see where class redefinition is 
>>> participating in the synchronization!
>>>
>>> So what I would like to do is take your basic VolatileData part of 
>>> the patch and run with it for JEP-149 purposes, while separating the 
>>> annotations issue so they can be dealt with by the experts in that 
>>> particular area.
>>>
>>> I'm sorry it has taken so long to arrive at a fairly negative 
>>> position, but I need someone else to take up the annotations 
>>> gauntlet and run with it.
>>>
>>> Thanks,
>>> David
>>>
>>> On 3/12/2012 5:41 PM, Peter Levart wrote:
>>>> Hi David, Alan, Alexander and others,
>>>>
>>>> In the meanwhile I have added another annotations space 
>>>> optimization to
>>>> the patch. If a Class doesn't inherit any annotations from a 
>>>> superclass,
>>>> which I think is a common case, it assigns the same Map instance to
>>>> "annotations" as well as "declaredAnnotations" fields. Previously - 
>>>> and
>>>> in the original code - this only happened for java.lang.Object and
>>>> interfaces.
>>>>
>>>> Here's the updated webrev:
>>>>
>>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html
>>>>
>>>> I have also rewritten the performance micro-benchmarks. With the
>>>> addition of repeating annotations, one performance aspect surfaces: 
>>>> when
>>>> asking for a particular annotation type on a Class and that annotation
>>>> is not present, the new repeating annotations support method
>>>> AnnotationSupport.getOneAnnotation asks for @ContainedBy 
>>>> meta-annotation
>>>> on the annotation type. This can result in an even more apparent
>>>> synchronization hot-spot with original code that uses synchronized
>>>> initAnnotationsIfNecessary(). This aspect is tested with the 3rd test.
>>>> Other 2 tests test the same thing as before but are more stable now,
>>>> since now they measure retrieval of 5 different annotation types from
>>>> each AnnotatedElement, previously they only measured retrieval of 1
>>>> which was very sensitive to HashMap irregularities (it could happen 
>>>> that
>>>> a particular key mapped to a bucket that was overloaded in one 
>>>> test-run
>>>> and not in another)...
>>>>
>>>> Here're the new tests:
>>>>
>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java 
>>>>
>>>>
>>>> And the corresponding results when run on an i7 CPU on Linux:
>>>>
>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt 
>>>>
>>>>
>>>>
>>>> Regards, Peter
>>>>
>>>>
>>>>
>>>> On 12/03/2012 02:15 AM, David Holmes wrote:
>>>>> On 1/12/2012 4:54 AM, Alan Bateman wrote:
>>>>>> On 30/11/2012 18:36, Peter Levart wrote:
>>>>>>> :
>>>>>>>
>>>>>>> So, what do you think? What kind of tests should I prepare in 
>>>>>>> addidion
>>>>>>> to those 3 so that the patch might get a consideration?
>>>>>> I think this is good work and thanks for re-basing your patch. I 
>>>>>> know
>>>>>> David plans to do a detail review. I think it will require extensive
>>>>>> performance testing too, perhaps with some large applications.
>>>>> Indeed I do plan a detailed review and have initiated some initial
>>>>> performance tests.
>>>>>
>>>>> I am also swamped but will try to get to the review this week - and
>>>>> will also need to check the referenced annotations updates.
>>>>>
>>>>> David
>>>>>
>>>>>> -Alan
>>>>>>
>



From stuart.marks at oracle.com  Wed Dec 12 23:36:13 2012
From: stuart.marks at oracle.com (stuart.marks at oracle.com)
Date: Wed, 12 Dec 2012 23:36:13 +0000
Subject: hg: jdk8/tl/jdk: 8004651: TEST:
	java/util/logging/CheckLockLocationTest.java failed to delete
	file (win)
Message-ID: <20121212233633.B1748470F0@hg.openjdk.java.net>

Changeset: 56fd5479a98f
Author:    jgish
Date:      2012-12-12 15:37 -0800
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/56fd5479a98f

8004651: TEST: java/util/logging/CheckLockLocationTest.java failed to delete file (win)
Summary: Failure to delete test log file should be a warning instead of test failure
Reviewed-by: mduigou, smarks

! test/java/util/logging/CheckLockLocationTest.java



From david.holmes at oracle.com  Wed Dec 12 23:48:46 2012
From: david.holmes at oracle.com (David Holmes)
Date: Thu, 13 Dec 2012 09:48:46 +1000
Subject: Proposal: Fully Concurrent ClassLoading
In-Reply-To: 
References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com>
	<50C56053.1060306@oracle.com>
	
	<50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com>
	<50C6FCDE.7070404@oracle.com> <50C70087.4030003@gmail.com>
	<50C718BD.2010201@oracle.com> <50C71FE0.5020704@gmail.com>
	<50C7E086.6040805@oracle.com>
	
Message-ID: <50C917DE.6010200@oracle.com>

On 13/12/2012 1:51 AM, Zhong Yu wrote:
> If a class loader is declared fully concurrent, yet
> getClassLoadingLock() is invoked, what's the harm of returning a
> dedicated lock anyway, exactly like what's done before?

The whole point is to get rid of the lockMap and these lock objects.

I could return a sentinel Object in all cases rather than null but that 
just seems to encourage continued use of something that shouldn't be 
used with a fully concurrent loader.

Returning null versus throwing an exception is mostly a matter of style. 
I'd want to hear from anyone who invokes getClassLoadingLock() on any of 
the system classloaders to see which is preferable.

Thanks for the comments.

David

> On Tue, Dec 11, 2012 at 7:40 PM, David Holmes  wrote:
>> On 11/12/2012 9:58 PM, Peter Levart wrote:
>>>
>>> On 12/11/2012 12:27 PM, David Holmes wrote:
>>>>
>>>> Peter,
>>>>
>>>> You are convincing me that all superclasses must be fully concurrent
>>>> too. Otherwise we are just trying to second-guess a whole bunch of
>>>> what-ifs. :)
>>>
>>>
>>> If you think some more, yes. The superclass might not use
>>> getClassLoadingLock() but rely on the fact that findClass() is allways
>>> called under a guard of per-class-name lock, for example. It's a matter
>>> of how far to go to prevent such miss-behaving fully-concurrent
>>> subclasses. So far to also prevent fully-concurrent subclasses that
>>> would otherwise be perfectly correct?
>>>
>>> Maybe not. Creating custom ClassLoaders is not an average programmer's
>>> job. Those that do this things will of course study the implementations
>>> of superclasses they extend and do the right thing. And it's reasonable
>>> to expect that they more or less will only extend JDK's ClassLoaders -
>>> but on the other hand if they only extend JDK's class loaders, they are
>>> not prevented to be fully-concurrent either way. Hm...
>>
>>
>> Again I think it is just too hard to try and second-guess how a
>> parallel-loader might rely on the per-class locks (I actually don't see any
>> reasonable use for them beyond flow-control), and then how a concurrent
>> loader subclass might need to modify things.
>>
>> If we simply disallow this then we can relax that constraint in the future
>> if valid use-cases turn up for that capability. Of course if someone has a
>> valid use-case during this discussion phase then of course that will
>> influence the decision.
>>
>> Thanks,
>> David
>>
>>> Peter
>>>
>>>>
>>>> Thanks,
>>>> David
>>>>
>>>> On 11/12/2012 7:44 PM, Peter Levart wrote:
>>>>>
>>>>> On 12/11/2012 10:29 AM, David Holmes wrote:
>>>>>>
>>>>>> On 11/12/2012 7:20 PM, Peter Levart wrote:
>>>>>>>
>>>>>>> On 12/11/2012 03:55 AM, David Holmes wrote:
>>>>>>>>>
>>>>>>>>> Question on the source code: registerAsFullyConcurrent has confusing
>>>>>>>>> comment -
>>>>>>>>> do the super classes all need to be parallel capable? Or do the
>>>>>>>>> super
>>>>>>>>> classes all need
>>>>>>>>> to be FullyConcurrent? I assume the latter, so just fix the
>>>>>>>>> comments.
>>>>>>>>
>>>>>>>>
>>>>>>>> Actually it is the former. There's no reason to require that all
>>>>>>>> superclasses be fully-concurrent. Of course a given loaders degree of
>>>>>>>> concurrency may be constrained by what it's supertype allows, but
>>>>>>>> there's no reason to actually force all the supertypes to be
>>>>>>>> fully-concurrent: it is enough that they are at least all parallel
>>>>>>>> capable.
>>>>>>>
>>>>>>>
>>>>>>> Hi David,
>>>>>>>
>>>>>>> There is one caveat: if ClassLoader X declares that it is
>>>>>>> fully-concurrent and it's superclass Y is only parallel-capable,
>>>>>>> then X
>>>>>>> will act as fully-concurrent (returning null from
>>>>>>> getClassLoadingLock()). superclass Y might or might not be coded to
>>>>>>> use
>>>>>>> the getClassLoadingLock(). X therefore has to know how Y is coded.
>>>>>>> To be
>>>>>>> defensive, X could ask for Y's registration and declare itself as only
>>>>>>> parallel-capable if Y declares the same so that when Y is upgraded
>>>>>>> to be
>>>>>>> fully-concurrent, X would become fully-concurrent automatically. To
>>>>>>> support situations where the same version of X would work in two
>>>>>>> environments where in one Y is only parallel-capable and in the
>>>>>>> other Y
>>>>>>> is fully-concurrent, there could be a static API to retrieve the
>>>>>>> registrations of superclasses.
>>>>>>
>>>>>>
>>>>>> I don't quite follow this. What code in the superclass are you
>>>>>> anticipating that the subclass will use which relies on the lock? Or
>>>>>> is this just an abstract "what if" scenario?
>>>>>
>>>>>
>>>>> This is more or less "what if". There might be a subclass Y of say
>>>>> java.lang.ClassLoader that overrides loadClass or findClass, declares
>>>>> that it is parallel-capable and in the implementation of it's loadClass
>>>>> or findClass, uses getClassLoadingLock() to synchronize access to it's
>>>>> internal state. Now there comes class X extends Y that declares that it
>>>>> is fully-concurrent. Of course this will not work, X has to declare that
>>>>> it is parallel-capable, because Y uses getClassLoadingLock().
>>>>>
>>>>> What I suggested in the next message is to not change the registration
>>>>> API but rather provide getClassLoadingLock() that returns non-null locks
>>>>> when any of the superclasses declare that they are only
>>>>> parallel-capable, not fully-concurrent.
>>>>>
>>>>> Regards, Peter
>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> David
>>>>>> -----
>>>>>>
>>>>>>> Or, to have less impact on future deprecation of old parallel-capable
>>>>>>> registration API, the fully-concurrent registration API:
>>>>>>>
>>>>>>> protected static boolean registerAsFullyConcurrent()
>>>>>>>
>>>>>>> might take a boolean parameter:
>>>>>>>
>>>>>>> protected static boolean registerAsFullyConcurrent(boolean
>>>>>>> downgradeToPrallelCapableIfAnySuperclassIsNotFullyConcurrent)
>>>>>>>
>>>>>>>
>>>>>>> and provide no accessible API to find out what the registration
>>>>>>> actually
>>>>>>> did (register as parallel-capable or fully-concurrent - return true in
>>>>>>> any case).
>>>>>>>
>>>>>>> Since all JDK provided ClassLoaders will be made fully concurrent,
>>>>>>> this
>>>>>>> might only be relevant if there is vendor A that currently provides
>>>>>>> only
>>>>>>> parallel-capable ClassLoader implementation and there is vendor B that
>>>>>>> subclasses A's loader and wants to upgrade and be backward
>>>>>>> compatible at
>>>>>>> the same time.
>>>>>>>
>>>>>>> Does this complicate things to much for no real benefit?
>>>>>>>
>>>>>>> Regards, Peter
>>>>>>>
>>>>>
>>>
>>


From weijun.wang at oracle.com  Wed Dec 12 23:54:25 2012
From: weijun.wang at oracle.com (Weijun Wang)
Date: Thu, 13 Dec 2012 07:54:25 +0800
Subject: build failure on solaris-i586 in make/sun/cldr
In-Reply-To: <50C8DFCE.2050608@oracle.com>
References: <50C8332E.10009@oracle.com> <50C8DFCE.2050608@oracle.com>
Message-ID: <50C91931.6030400@oracle.com>



On 12/13/2012 03:49 AM, Naoto Sato wrote:
> Hi Max,
>
> Looks like the "$(CD) $$dir;" is unnecessary here. Thanks for the catch.
> Just wondering why it is failing on solaris-i586 only. I don't use
> ALT_OUTPUTDIR, but never seen this failure on my environment.

I've filed the bug [1] but then noticed it's also my problem.

In fact,  ../../../build/solaris-i586/gensrc goes up 3 levels and go 
down another 3, so it's back to the current directory. Cool.

But here, my build/solaris-i586 is a symlink to a fast local drive, and 
it's messed up.

I just lowered the priority and add a comment.

Thanks
Max

[1] https://jbs.oracle.com/bugs/browse/JDK-8004981

>
> Can you please file a bug for this?
>
> Naoto
>
> On 12/11/12 11:33 PM, Weijun Wang wrote:
>> I haven't build on solaris-i586 for some time and see a failure today in
>> make/sun/cldr. The Makefile [1] has these lines:
>>
>>         75         for dir in $(GENSRCDIR); do \
>>         76             if [ -d $$dir ] ; then \
>>         77                 ( $(CD) $$dir; \
>>         78                     for sdir in $(CLDRGENSRCDIR); do \
>>         79                         if [ -d $$sdir ] ; then \
>>         80                             $(FIND) $$sdir \
>>         81                                 -name '*.java' -print >>
>> $(JAVA_SOURCE_LIST) ; \
>>         82                         fi ; \
>>         83                     done \
>>         84                 ); \
>>         85             fi; \
>>         86         done \
>>
>> So it goes into $(GENSRCDIR) and then tries to look for files inside
>> (one of) $(CLDRGENSRCDIR). The latter is defined as
>>
>>         49 CLDRGENSRCDIR = $(GENSRCDIR)/sun/text/resources/cldr \
>>         50             $(GENSRCDIR)/sun/util/cldr \
>>         51             $(GENSRCDIR)/sun/util/resources/cldr
>>
>> in the same file.
>>
>> In my build, GENSRCDIR is something like
>> ../../../build/solaris-i586/gensrc. Since this is a relative directory,
>> you cannot cd into it and use it again.
>>
>> Maybe the first CD is just useless.
>>
>> Is everyone using ALT_OUTPUTDIR?
>>
>> Thanks
>> Max
>>
>> [1]
>> http://hg.openjdk.java.net/jdk8/tl/jdk/file/131a683a2ce0/make/sun/cldr/Makefile
>>
>>
>


From weijun.wang at oracle.com  Thu Dec 13 00:12:35 2012
From: weijun.wang at oracle.com (weijun.wang at oracle.com)
Date: Thu, 13 Dec 2012 00:12:35 +0000
Subject: hg: jdk8/tl/jdk: 8004235: Disable native JGSS provider on Mac
Message-ID: <20121213001247.26992470F2@hg.openjdk.java.net>

Changeset: 5a2ab2c3f106
Author:    weijun
Date:      2012-12-13 08:11 +0800
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5a2ab2c3f106

8004235: Disable native JGSS provider on Mac
Reviewed-by: erikj, valeriep

! make/sun/security/Makefile
! makefiles/CompileNativeLibraries.gmk
! src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java



From lance.andersen at oracle.com  Thu Dec 13 01:59:14 2012
From: lance.andersen at oracle.com (lance.andersen at oracle.com)
Date: Thu, 13 Dec 2012 01:59:14 +0000
Subject: hg: jdk8/tl/jdk: 8004357: Implement various methods in
	SerialBlob/Clob/Array and specify Thread Safety
Message-ID: <20121213015927.3E708470F5@hg.openjdk.java.net>

Changeset: 7a8978a5bb6e
Author:    lancea
Date:      2012-12-12 20:57 -0500
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7a8978a5bb6e

8004357: Implement various methods in SerialBlob/Clob/Array and specify Thread Safety
Reviewed-by: naoto

! src/share/classes/javax/sql/rowset/serial/SerialArray.java
! src/share/classes/javax/sql/rowset/serial/SerialBlob.java
! src/share/classes/javax/sql/rowset/serial/SerialClob.java
! src/share/classes/javax/sql/rowset/serial/SerialDatalink.java
! src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java
! src/share/classes/javax/sql/rowset/serial/SerialRef.java
! src/share/classes/javax/sql/rowset/serial/SerialStruct.java



From david.buck at oracle.com  Thu Dec 13 04:37:41 2012
From: david.buck at oracle.com (David Buck)
Date: Thu, 13 Dec 2012 13:37:41 +0900
Subject: code review request : 8003147 port fix for BCEL bug 39695
In-Reply-To: <50C8D778.20506@oracle.com>
References: <50C58072.4060802@oracle.com> <50C8D778.20506@oracle.com>
Message-ID: <50C95B95.9050204@oracle.com>

Hi Joe!

Thank you for looking at this.

 > You didn't apply the original Apache completely. Was the omission of the
 > change in toString() method intentional?

Yes, the improvement in toString() was not related to the issue and 
seems to have been included in the apache version of this fix on a whim. 
I did not feel it was appropriate to include it in the port as it is 
clearly outside of the scope of BCEL bug 39695.

 > I see that you've sent your test to Patrick. Have you run regression
 > test for this patch?

I have only tested the different versions of my own testcase. I do not 
know anything about the test cases that Patrick is maintaining. If you 
or Patrick can walk me through how to get and run the test cases SQE 
uses, I will be more than happy to do that. Or if Patrick or you prefer, 
I can send you my build if it would be easier for one of you to run the 
tests yourself.

Cheers,
-Buck

On 2012/12/13 4:14, Joe Wang wrote:
> Hi David,
>
> You didn't apply the original Apache completely. Was the omission of the
> change in toString() method intentional?
>
> I see that you've sent your test to Patrick. Have you run regression
> test for this patch?
>
> Thanks,
> Joe
>
> On 12/9/2012 10:25 PM, David Buck wrote:
>> Hi!
>>
>> I would like to request a code review of my JDK8 fix for the following
>> issue:
>>
>> [ 8003147 : port fix for BCEL bug 39695 to our copy bundled as part of
>> jaxp ]
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8003147
>>
>> In addition to the fix that the BCEL project had for this issue, I
>> needed to "port" some of their support for LocalVariableTypeTable:s to
>> our copy of BCEL as well. Implementing support for LVTT is very
>> straightforward and does not add much to the complexity or risk of
>> this change (especially considering the limited scope of jaxp's use of
>> BCEL).
>>
>> Here is the webrev for my fix:
>>
>> [ Code Review for jaxp ]
>> http://cr.openjdk.java.net/~dbuck/8003147/webrev.00/
>>
>> My understanding is that the test cases for our copy of the jaxp code
>> are handled in a separate repository / test suite. I have been in
>> contact with Patrick Zhang (Oracle QA) and Joe Wang and have provided
>> a junit test for this issue as requested. Please see bug report for a
>> simpler (non-junit) test-case. If for some reason anyone wants to see
>> the junit-based test, please let me know and I can provide a copy of
>> that as well.
>>
>> Best Regards,
>> -Buck


From david.holmes at oracle.com  Thu Dec 13 05:54:11 2012
From: david.holmes at oracle.com (David Holmes)
Date: Thu, 13 Dec 2012 15:54:11 +1000
Subject: bottleneck by java.lang.Class.getAnnotations() - rebased patch
In-Reply-To: <50C8793F.1050205@gmail.com>
References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com>
	<23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com>
	<5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com>
	<5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com>
	<50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com>
	<509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com>
	<50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com>
	<50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com>
	<50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com>
	
	<50C8793F.1050205@gmail.com>
Message-ID: <50C96D83.5010708@oracle.com>

Peter,

Many thanks for preparing that patch. As we're leaving annotations 
behind lets continue any further discussion of this patch in a new email 
thread specific to JEP-149.

I'll run this patch through some basic testing and performance benchmarks.

The JEP will also need updating so I'll be in touch to confirm details 
about size savings etc for the write up.

Thanks again,
David

On 12/12/2012 10:31 PM, Peter Levart wrote:
> Hi all,
>
> Ok, no problem. So here's a patch that summarizes what I did in the
> previous patch, but only for reflective fields (Field[], Method[],
> Constructor[]) not including annotations:
>
> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev/index.html
>
> The annotations part is unchanged semantically, but I had to:
>
> - modify private method clearCachesOnClassRedefinition to only include
> invalidation of annotations and declaredAnnotations fields. I also
> renamed it to clearAnnotationCachesOnClassRedefinition
> - renamed lastRedefinedCountto lastAnnotationsRedefinedCountand, since
> this field is now only accessed while holding a lock (from synchronized
> initAnnotationsIfNecessary), I removed the volatile keyword.
>
> That's it.
>
> While looking at this unchanged part of code some more, I see other
> races as well. For example: two concurrent accesses to annotations
> combined with redefinition of a class can result in NPE. Here's a serial
> execution:
>
> Thread 1:
> getAnnotation(annotationType);
> initAnnotationsIfNecessary();
>
> VM:
> classRedefinedCount++;
>
> Thread 2:
> getAnnotation(annotationType);
> initAnnotationsIfNecessary();
> clearAnnotationCachesOnClassRedefinition();
> annotations = null;
>
> Thread 1:
> return AnnotationSupport.getOneAnnotation(annotations, annotationClass);
> // 'annotations' field can be null
>
>
> So this needs to be fixed sooner or later.
>
> Joel!
>
> Are your JSR 308 canges involving java.lang.Class too?
>
> Regards, Peter
>
>
> On 12/12/2012 11:59 AM, Joel Borggr?n-Franck wrote:
>> Hi all,
>>
>> First, thanks all of you that are involved in this!
>>
>> I agree with David here, lets split this up (for now) and do
>> reflective objects in the context of jep-149 and annotations separately.
>>
>> As you may know there are even more annotation coming in with JSR 308
>> annotations on type (use), so I want to complete that work first and
>> then do the effort of reducing contention and overhead for both type
>> and regular annotations and also fixing up the behaviour for
>> redefine/retransform class.
>>
>> One other point to consider is that some of the fields in
>> java/lang/reflect/ classes are known by the VM so not all changes in
>> Java-land are actually doable. Glancing over your patches very quickly
>> I don't think you have done anything to upset the VM, but then I am
>> not an expert in this area.
>>
>> Also, with the VM permgen changes we might have to rethink our
>> assumptions in order to reduce total overhead. For example as I
>> understand it previously we could just ship the same pointer into
>> permgen for the annotations arrays, now that isn't possible so we
>> create a new copy of the array for every Field/Method/Constructor
>> instance. Perhaps there is some clever way of eliminating those copies.
>>
>> So while I think your patches generally makes sense, I think it is
>> prudent to delay this for annotations until all our new annotation
>> features are in.
>>
>> cheers
>> /Joel
>>
>> On Dec 10, 2012, at 7:18 AM, David Holmes 
>> wrote:
>>
>>> Hi Peter,
>>>
>>> Sorry for the delay on this.
>>>
>>> Generally your VolatileData and my ReflectionHelper are doing a
>>> similar job. But I agree with your reasoning that all of the cached
>>> SoftReferences are likely to be cleared at once, and so a
>>> SoftReference to a helper object with direct references, is more
>>> effective than a direct reference to a helper object with
>>> SoftReferences. My initial stance with this was very conservative as
>>> the more change that is introduced the more uncertainty there is
>>> about the impact.
>>>
>>> I say the above primarily because I think, if I am to proceed with
>>> this, I will need to separate out the general reflection caching
>>> changes from the annotation changes. There are a number of reasons
>>> for this:
>>>
>>> First, I'm not at all familiar with the implementation of annotations
>>> at the VM or Java level, and the recent changes in this area just
>>> exacerbate my ignorance of the mechanics. So I don't feel qualified
>>> to evaluate that aspect.
>>>
>>> Second, the bulk of the reflection caching code is simplified by the
>>> fact that due to current constraints on class redefinition the
>>> caching is effectively idempotent for fields/methods/constructors.
>>> But that is not the case for annotations.
>>>
>>> Finally, the use of synchronization with the annotations method is
>>> perplexing me. I sent Joe a private email on this but I may as well
>>> raise it here - and I think you have alluded to this in your earlier
>>> emails as well: initAnnotationsIfNecessary() is a synchronized
>>> instance method but I can not find any other code in the VM that
>>> synchronizes on the Class object's monitor. So if this
>>> synchronization is trying to establish consistency in the face of
>>> class redefinition, I do not see where class redefinition is
>>> participating in the synchronization!
>>>
>>> So what I would like to do is take your basic VolatileData part of
>>> the patch and run with it for JEP-149 purposes, while separating the
>>> annotations issue so they can be dealt with by the experts in that
>>> particular area.
>>>
>>> I'm sorry it has taken so long to arrive at a fairly negative
>>> position, but I need someone else to take up the annotations gauntlet
>>> and run with it.
>>>
>>> Thanks,
>>> David
>>>
>>> On 3/12/2012 5:41 PM, Peter Levart wrote:
>>>> Hi David, Alan, Alexander and others,
>>>>
>>>> In the meanwhile I have added another annotations space optimization to
>>>> the patch. If a Class doesn't inherit any annotations from a
>>>> superclass,
>>>> which I think is a common case, it assigns the same Map instance to
>>>> "annotations" as well as "declaredAnnotations" fields. Previously - and
>>>> in the original code - this only happened for java.lang.Object and
>>>> interfaces.
>>>>
>>>> Here's the updated webrev:
>>>>
>>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149/webrev.02/index.html
>>>>
>>>> I have also rewritten the performance micro-benchmarks. With the
>>>> addition of repeating annotations, one performance aspect surfaces:
>>>> when
>>>> asking for a particular annotation type on a Class and that annotation
>>>> is not present, the new repeating annotations support method
>>>> AnnotationSupport.getOneAnnotation asks for @ContainedBy
>>>> meta-annotation
>>>> on the annotation type. This can result in an even more apparent
>>>> synchronization hot-spot with original code that uses synchronized
>>>> initAnnotationsIfNecessary(). This aspect is tested with the 3rd test.
>>>> Other 2 tests test the same thing as before but are more stable now,
>>>> since now they measure retrieval of 5 different annotation types from
>>>> each AnnotatedElement, previously they only measured retrieval of 1
>>>> which was very sensitive to HashMap irregularities (it could happen
>>>> that
>>>> a particular key mapped to a bucket that was overloaded in one test-run
>>>> and not in another)...
>>>>
>>>> Here're the new tests:
>>>>
>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/src/test/ReflectionTest.java
>>>>
>>>>
>>>> And the corresponding results when run on an i7 CPU on Linux:
>>>>
>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149/test/benchmark_results_i7-2600K.txt
>>>>
>>>>
>>>>
>>>> Regards, Peter
>>>>
>>>>
>>>>
>>>> On 12/03/2012 02:15 AM, David Holmes wrote:
>>>>> On 1/12/2012 4:54 AM, Alan Bateman wrote:
>>>>>> On 30/11/2012 18:36, Peter Levart wrote:
>>>>>>> :
>>>>>>>
>>>>>>> So, what do you think? What kind of tests should I prepare in
>>>>>>> addidion
>>>>>>> to those 3 so that the patch might get a consideration?
>>>>>> I think this is good work and thanks for re-basing your patch. I know
>>>>>> David plans to do a detail review. I think it will require extensive
>>>>>> performance testing too, perhaps with some large applications.
>>>>> Indeed I do plan a detailed review and have initiated some initial
>>>>> performance tests.
>>>>>
>>>>> I am also swamped but will try to get to the review this week - and
>>>>> will also need to check the referenced annotations updates.
>>>>>
>>>>> David
>>>>>
>>>>>> -Alan
>>>>>>
>


From alexey.utkin at oracle.com  Thu Dec 13 09:35:34 2012
From: alexey.utkin at oracle.com (Alexey Utkin)
Date: Thu, 13 Dec 2012 13:35:34 +0400
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem.
In-Reply-To: <50C8B64F.3020204@oracle.com>
References: <50C8A5C4.4030602@oracle.com> <50C8B289.8070906@oracle.com>
	<50C8B50E.90807@oracle.com> <50C8B64F.3020204@oracle.com>
Message-ID: <50C9A166.3060803@oracle.com>

On 12.12.2012 20:52, Daniel D. Daugherty wrote:
> On 12/12/12 9:47 AM, Alan Bateman wrote:
>> On 12/12/2012 16:36, Daniel D. Daugherty wrote:
>>> For this item:
>>>
>>> >     test/java/util/logging/LoggingDeadlock4.java
>>> >         Test case was simplified to avoid AWT class loading. 
>>> Negative test
>>> >         result was tested on early JDK7 build.
>>>
>>> if I remember correctly, the whole point of that test was to
>>> check for a logging deadlock relative to AWT's usage of logging.
>>> If you avoid loading AWT classes, doesn't that make the test
>>> rather useless?
>>>
>>> Dan
>> java.awt.Container:
>>
>>     private static final PlatformLogger log = 
>> PlatformLogger.getLogger("java.awt.Container");
>>     private static final PlatformLogger eventLog = 
>> PlatformLogger.getLogger("java.awt.event.Container");
>>
>> and the updated test is just using PlatformLogger directly,
>
Exactly.
> I thought the deadlock had to do with locks grabbed on the way
> to getting into the underlying PlatformLogger, but my memory is
> hazy and I don't have the cycles to research this.
>
>
>> I hope it demonstrates the same issue with a JDK that doesn't have 
>> the fix.
>
> That would be the right way to see if the test still "works".
>
Yes, it works!*
test result: Error. Program `C:\Program Files\Java\jdk1.7.0\bin\java' 
interrupted! (timed out?)*

Regards,
-uta


From chris.hegarty at oracle.com  Thu Dec 13 09:57:15 2012
From: chris.hegarty at oracle.com (chris.hegarty at oracle.com)
Date: Thu, 13 Dec 2012 09:57:15 +0000
Subject: hg: jdk8/tl/jdk: 8004925: java/net/Socks/SocksV4Test.java failing on
	all platforms
Message-ID: <20121213095811.50B2E470FE@hg.openjdk.java.net>

Changeset: 775b0050144a
Author:    chegar
Date:      2012-12-13 09:55 +0000
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/775b0050144a

8004925: java/net/Socks/SocksV4Test.java failing on all platforms
Reviewed-by: alanb, dsamersoff

! test/java/net/Socks/SocksV4Test.java



From peter.levart at gmail.com  Thu Dec 13 10:13:26 2012
From: peter.levart at gmail.com (Peter Levart)
Date: Thu, 13 Dec 2012 11:13:26 +0100
Subject: ReflectionData space optimization in java.lang.Class (JEP-149)
In-Reply-To: <50C90C35.7020000@oracle.com>
References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com>
	<23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com>
	<5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com>
	<5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com>
	<50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com>
	<509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com>
	<50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com>
	<50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com>
	<50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com>
	
	<50C8793F.1050205@gmail.com> <50C90C35.7020000@oracle.com>
Message-ID: <50C9AA46.5030401@gmail.com>

Hi Mandy, David and others,

Here's the updated version of the patch for ReflectionData:

http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev.02/index.html

I split long lines as proposed by Mandy. I also split reflectionData() 
method in two methods, so the fast-path method is smaller and might get 
better chances of being in-lined.

I also found code-paths that evaluated reflectionData() method more than 
once for each external call. It's the methods:

private Field[] privateGetDeclaredFields(boolean publicOnly)

and

private Method[] privateGetDeclaredMethods(boolean publicOnly)

which are called from:

private Field[] privateGetPublicFields(Set> traversedInterfaces)

and

private Method[] privateGetPublicMethods()

respectively. I therefore introduced overloaded variants of the former 
methods taking a ReflectionData parameter like the following:

     private Field[] privateGetDeclaredFields(boolean publicOnly) {
         return privateGetDeclaredFields(publicOnly, reflectionData());
     }
     // A variant called from methods that already obtained 
ReflectionData instance
     private Field[] privateGetDeclaredFields(boolean publicOnly, 
ReflectionData rd) {
     ...

the same for privateGetDeclaredMethods. This is not for performance 
reasons (though it might help) but for correctness. Each external call 
should be a separate "transaction" and should work on the same 
ReflectionData instance. The "transaction" is only guaranteed on the 
level of a particular java.lang.Class instance though. Some methods also 
invoke other Class instances (to gather inherited public methods / 
fields) and those invocations might be separate transactions in the face 
of concurrent class re-definitions. But we are not going to implement a 
database here, are we?

I prepared some micro benchmarks for individual public methods. Here're 
the results:

https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/reflection_data_benchmark_results_i7-2600K.txt

they indicate no noticeable performance decreases. Some methods are in 
fact faster (more in-linable?):

- getFields - 4x
- getDeclaredConstructor - 4x ... 10x
- getDeclaredMethod - 3x

Here's the code for micro-benchmarks:

https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/src/test/ReflectionDataTest.java


Regards, Peter


On 12/12/2012 11:59 PM, Mandy Chung wrote:
> Hi Peter,
>
> On 12/12/12 4:31 AM, Peter Levart wrote:
>> Hi all,
>>
>> Ok, no problem. So here's a patch that summarizes what I did in the 
>> previous patch, but only for reflective fields (Field[], Method[], 
>> Constructor[]) not including annotations:
>>
>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev/index.html
>>
>
> Finally able to make time to review this patch.  It's good work. While 
> it's good to see the synchronization issue with annotations be fixed, 
> separating the cache for reflection and annotation helps.  As David 
> replied, he will take your patch and run with it for JEP-149.
>
> The change looks good.  Nit: there are several long lines 
> L2235,2244,2245,2249,2269 etc that should be broken into separate 
> lines.  The remaining open question is the performance difference in 
> the reflectionData() method and how well it will be jit'ed.  In the 
> common case, there is no class redefinition where 
> classCachesOnClassRedefinition() is essentially like an nop.  I 
> believe David will look at the footprint and performance numbers as he 
> has initiated the performance testing (need to do it with this new 
> patch).
>
> Thanks
> Mandy
>
>> The annotations part is unchanged semantically, but I had to:
>>
>> - modify private method clearCachesOnClassRedefinition to only 
>> include invalidation of annotations and declaredAnnotations fields. I 
>> also renamed it to clearAnnotationCachesOnClassRedefinition
>> - renamed lastRedefinedCount to lastAnnotationsRedefinedCount and, 
>> since this field is now only accessed while holding a lock (from 
>> synchronized initAnnotationsIfNecessary), I removed the volatile 
>> keyword.
>>
>> That's it.
>>
>> While looking at this unchanged part of code some more, I see other 
>> races as well. For example: two concurrent accesses to annotations 
>> combined with redefinition of a class can result in NPE. Here's a 
>> serial execution:
>>
>> Thread 1:
>>     getAnnotation(annotationType);
>>         initAnnotationsIfNecessary();
>>
>> VM:
>>     classRedefinedCount++;
>>
>> Thread 2:
>>     getAnnotation(annotationType);
>>         initAnnotationsIfNecessary();
>>             clearAnnotationCachesOnClassRedefinition();
>>                 annotations = null;
>>
>> Thread 1:
>>         return AnnotationSupport.getOneAnnotation(annotations, 
>> annotationClass);
>>         // 'annotations' field can be null
>>
>>
>> So this needs to be fixed sooner or later.
>>
>> Joel!
>>
>> Are your JSR 308 canges involving java.lang.Class too?
>>
>> Regards, Peter
>>
>>
>> On 12/12/2012 11:59 AM, Joel Borggr?n-Franck wrote:
>>> Hi all,
>>>
>>> First, thanks all of you that are involved in this!
>>>
>>> I agree with David here, lets split this up (for now) and do 
>>> reflective objects in the context of jep-149 and annotations 
>>> separately.
>>>
>>> As you may know there are even more annotation coming in with JSR 
>>> 308 annotations on type (use), so I want to complete that work first 
>>> and then do the effort of reducing contention and overhead for both 
>>> type and regular annotations and also fixing up the behaviour for 
>>> redefine/retransform class.
>>>
>>> One other point to consider is that some of the fields in 
>>> java/lang/reflect/ classes are known by the VM so not all changes in 
>>> Java-land are actually doable. Glancing over your patches very 
>>> quickly I don't think you have done anything to upset the VM, but 
>>> then I am not an expert in this area.
>>>
>>> Also, with the VM permgen changes we might have to rethink our 
>>> assumptions in order to reduce total overhead. For example as I 
>>> understand it previously we could just ship the same pointer into 
>>> permgen for the annotations arrays, now that isn't possible so we 
>>> create a new copy of the array for every Field/Method/Constructor 
>>> instance. Perhaps there is some clever way of eliminating those copies.
>>>
>>> So while I think your patches generally makes sense, I think it is 
>>> prudent to delay this for annotations until all our new annotation 
>>> features are in.
>>>
>>> cheers
>>> /Joel
>>>
>>> On Dec 10, 2012, at 7:18 AM, David Holmes  
>>> wrote:
>>>
>>>> Hi Peter,
>>>>
>>>> Sorry for the delay on this.
>>>>
>>>> Generally your VolatileData and my ReflectionHelper are doing a 
>>>> similar job. But I agree with your reasoning that all of the cached 
>>>> SoftReferences are likely to be cleared at once, and so a 
>>>> SoftReference to a helper object with direct references, is more 
>>>> effective than a direct reference to a helper object with 
>>>> SoftReferences. My initial stance with this was very conservative 
>>>> as the more change that is introduced the more uncertainty there is 
>>>> about the impact.
>>>>
>>>> I say the above primarily because I think, if I am to proceed with 
>>>> this, I will need to separate out the general reflection caching 
>>>> changes from the annotation changes. There are a number of reasons 
>>>> for this:
>>>>
>>>> First, I'm not at all familiar with the implementation of 
>>>> annotations at the VM or Java level, and the recent changes in this 
>>>> area just exacerbate my ignorance of the mechanics. So I don't feel 
>>>> qualified to evaluate that aspect.
>>>>
>>>> Second, the bulk of the reflection caching code is simplified by 
>>>> the fact that due to current constraints on class redefinition the 
>>>> caching is effectively idempotent for fields/methods/constructors. 
>>>> But that is not the case for annotations.
>>>>
>>>> Finally, the use of synchronization with the annotations method is 
>>>> perplexing me. I sent Joe a private email on this but I may as well 
>>>> raise it here - and I think you have alluded to this in your 
>>>> earlier emails as well: initAnnotationsIfNecessary() is a 
>>>> synchronized instance method but I can not find any other code in 
>>>> the VM that synchronizes on the Class object's monitor. So if this 
>>>> synchronization is trying to establish consistency in the face of 
>>>> class redefinition, I do not see where class redefinition is 
>>>> participating in the synchronization!
>>>>
>>>> So what I would like to do is take your basic VolatileData part of 
>>>> the patch and run with it for JEP-149 purposes, while separating 
>>>> the annotations issue so they can be dealt with by the experts in 
>>>> that particular area.
>>>>
>>>> I'm sorry it has taken so long to arrive at a fairly negative 
>>>> position, but I need someone else to take up the annotations 
>>>> gauntlet and run with it.
>>>>
>>>> Thanks,
>>>> David
>>>>



From david.holmes at oracle.com  Thu Dec 13 10:46:08 2012
From: david.holmes at oracle.com (David Holmes)
Date: Thu, 13 Dec 2012 20:46:08 +1000
Subject: ReflectionData space optimization in java.lang.Class (JEP-149)
In-Reply-To: <50C9AA46.5030401@gmail.com>
References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com>
	<23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com>
	<5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com>
	<5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com>
	<50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com>
	<509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com>
	<50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com>
	<50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com>
	<50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com>
	
	<50C8793F.1050205@gmail.com> <50C90C35.7020000@oracle.com>
	<50C9AA46.5030401@gmail.com>
Message-ID: <50C9B1F0.5080808@oracle.com>

Hi Peter,

I dropped Joel from the direct cc as this isn't annotation related.

On 13/12/2012 8:13 PM, Peter Levart wrote:
> Hi Mandy, David and others,
>
> Here's the updated version of the patch for ReflectionData:
>
> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev.02/index.html
>
> I split long lines as proposed by Mandy. I also split reflectionData()
> method in two methods, so the fast-path method is smaller and might get
> better chances of being in-lined.

Okay - though I just submitted the previous version to get some 
performance data :(

> I also found code-paths that evaluated reflectionData() method more than
> once for each external call. It's the methods:
>
> private Field[] privateGetDeclaredFields(boolean publicOnly)
>
> and
>
> private Method[] privateGetDeclaredMethods(boolean publicOnly)
>
> which are called from:
>
> private Field[] privateGetPublicFields(Set> traversedInterfaces)
>
> and
>
> private Method[] privateGetPublicMethods()
>
> respectively. I therefore introduced overloaded variants of the former
> methods taking a ReflectionData parameter like the following:
>
> private Field[] privateGetDeclaredFields(boolean publicOnly) {
> return privateGetDeclaredFields(publicOnly, reflectionData());
> }
> // A variant called from methods that already obtained ReflectionData
> instance
> private Field[] privateGetDeclaredFields(boolean publicOnly,
> ReflectionData rd) {
> ...
>
> the same for privateGetDeclaredMethods. This is not for performance
> reasons (though it might help) but for correctness. Each external call
> should be a separate "transaction" and should work on the same
> ReflectionData instance. The "transaction" is only guaranteed on the
> level of a particular java.lang.Class instance though. Some methods also
> invoke other Class instances (to gather inherited public methods /
> fields) and those invocations might be separate transactions in the face
> of concurrent class re-definitions. But we are not going to implement a
> database here, are we?

Sorry I don't understand the problem you are seeing here. If we find a 
cached public fields, for example, we will return it. Else we start the 
process of calculating anew. If someone else manages to fill in the 
cache then we will get it when we call privateGetDeclaredFields. The 
results are expected to be idempotent so I don't see what the problem is.

Thanks,
David
------

> I prepared some micro benchmarks for individual public methods. Here're
> the results:
>
> https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/reflection_data_benchmark_results_i7-2600K.txt
>
> they indicate no noticeable performance decreases. Some methods are in
> fact faster (more in-linable?):
>
> - getFields - 4x
> - getDeclaredConstructor - 4x ... 10x
> - getDeclaredMethod - 3x
>
> Here's the code for micro-benchmarks:
>
> https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/src/test/ReflectionDataTest.java
>
>
> Regards, Peter
>
>
> On 12/12/2012 11:59 PM, Mandy Chung wrote:
>> Hi Peter,
>>
>> On 12/12/12 4:31 AM, Peter Levart wrote:
>>> Hi all,
>>>
>>> Ok, no problem. So here's a patch that summarizes what I did in the
>>> previous patch, but only for reflective fields (Field[], Method[],
>>> Constructor[]) not including annotations:
>>>
>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev/index.html
>>>
>>
>> Finally able to make time to review this patch. It's good work. While
>> it's good to see the synchronization issue with annotations be fixed,
>> separating the cache for reflection and annotation helps. As David
>> replied, he will take your patch and run with it for JEP-149.
>>
>> The change looks good. Nit: there are several long lines
>> L2235,2244,2245,2249,2269 etc that should be broken into separate
>> lines. The remaining open question is the performance difference in
>> the reflectionData() method and how well it will be jit'ed. In the
>> common case, there is no class redefinition where
>> classCachesOnClassRedefinition() is essentially like an nop. I believe
>> David will look at the footprint and performance numbers as he has
>> initiated the performance testing (need to do it with this new patch).
>>
>> Thanks
>> Mandy
>>
>>> The annotations part is unchanged semantically, but I had to:
>>>
>>> - modify private method clearCachesOnClassRedefinition to only
>>> include invalidation of annotations and declaredAnnotations fields. I
>>> also renamed it to clearAnnotationCachesOnClassRedefinition
>>> - renamed lastRedefinedCount to lastAnnotationsRedefinedCount and,
>>> since this field is now only accessed while holding a lock (from
>>> synchronized initAnnotationsIfNecessary), I removed the volatile
>>> keyword.
>>>
>>> That's it.
>>>
>>> While looking at this unchanged part of code some more, I see other
>>> races as well. For example: two concurrent accesses to annotations
>>> combined with redefinition of a class can result in NPE. Here's a
>>> serial execution:
>>>
>>> Thread 1:
>>> getAnnotation(annotationType);
>>> initAnnotationsIfNecessary();
>>>
>>> VM:
>>> classRedefinedCount++;
>>>
>>> Thread 2:
>>> getAnnotation(annotationType);
>>> initAnnotationsIfNecessary();
>>> clearAnnotationCachesOnClassRedefinition();
>>> annotations = null;
>>>
>>> Thread 1:
>>> return AnnotationSupport.getOneAnnotation(annotations, annotationClass);
>>> // 'annotations' field can be null
>>>
>>>
>>> So this needs to be fixed sooner or later.
>>>
>>> Joel!
>>>
>>> Are your JSR 308 canges involving java.lang.Class too?
>>>
>>> Regards, Peter
>>>
>>>
>>> On 12/12/2012 11:59 AM, Joel Borggr?n-Franck wrote:
>>>> Hi all,
>>>>
>>>> First, thanks all of you that are involved in this!
>>>>
>>>> I agree with David here, lets split this up (for now) and do
>>>> reflective objects in the context of jep-149 and annotations
>>>> separately.
>>>>
>>>> As you may know there are even more annotation coming in with JSR
>>>> 308 annotations on type (use), so I want to complete that work first
>>>> and then do the effort of reducing contention and overhead for both
>>>> type and regular annotations and also fixing up the behaviour for
>>>> redefine/retransform class.
>>>>
>>>> One other point to consider is that some of the fields in
>>>> java/lang/reflect/ classes are known by the VM so not all changes in
>>>> Java-land are actually doable. Glancing over your patches very
>>>> quickly I don't think you have done anything to upset the VM, but
>>>> then I am not an expert in this area.
>>>>
>>>> Also, with the VM permgen changes we might have to rethink our
>>>> assumptions in order to reduce total overhead. For example as I
>>>> understand it previously we could just ship the same pointer into
>>>> permgen for the annotations arrays, now that isn't possible so we
>>>> create a new copy of the array for every Field/Method/Constructor
>>>> instance. Perhaps there is some clever way of eliminating those copies.
>>>>
>>>> So while I think your patches generally makes sense, I think it is
>>>> prudent to delay this for annotations until all our new annotation
>>>> features are in.
>>>>
>>>> cheers
>>>> /Joel
>>>>
>>>> On Dec 10, 2012, at 7:18 AM, David Holmes 
>>>> wrote:
>>>>
>>>>> Hi Peter,
>>>>>
>>>>> Sorry for the delay on this.
>>>>>
>>>>> Generally your VolatileData and my ReflectionHelper are doing a
>>>>> similar job. But I agree with your reasoning that all of the cached
>>>>> SoftReferences are likely to be cleared at once, and so a
>>>>> SoftReference to a helper object with direct references, is more
>>>>> effective than a direct reference to a helper object with
>>>>> SoftReferences. My initial stance with this was very conservative
>>>>> as the more change that is introduced the more uncertainty there is
>>>>> about the impact.
>>>>>
>>>>> I say the above primarily because I think, if I am to proceed with
>>>>> this, I will need to separate out the general reflection caching
>>>>> changes from the annotation changes. There are a number of reasons
>>>>> for this:
>>>>>
>>>>> First, I'm not at all familiar with the implementation of
>>>>> annotations at the VM or Java level, and the recent changes in this
>>>>> area just exacerbate my ignorance of the mechanics. So I don't feel
>>>>> qualified to evaluate that aspect.
>>>>>
>>>>> Second, the bulk of the reflection caching code is simplified by
>>>>> the fact that due to current constraints on class redefinition the
>>>>> caching is effectively idempotent for fields/methods/constructors.
>>>>> But that is not the case for annotations.
>>>>>
>>>>> Finally, the use of synchronization with the annotations method is
>>>>> perplexing me. I sent Joe a private email on this but I may as well
>>>>> raise it here - and I think you have alluded to this in your
>>>>> earlier emails as well: initAnnotationsIfNecessary() is a
>>>>> synchronized instance method but I can not find any other code in
>>>>> the VM that synchronizes on the Class object's monitor. So if this
>>>>> synchronization is trying to establish consistency in the face of
>>>>> class redefinition, I do not see where class redefinition is
>>>>> participating in the synchronization!
>>>>>
>>>>> So what I would like to do is take your basic VolatileData part of
>>>>> the patch and run with it for JEP-149 purposes, while separating
>>>>> the annotations issue so they can be dealt with by the experts in
>>>>> that particular area.
>>>>>
>>>>> I'm sorry it has taken so long to arrive at a fairly negative
>>>>> position, but I need someone else to take up the annotations
>>>>> gauntlet and run with it.
>>>>>
>>>>> Thanks,
>>>>> David
>>>>>
>


From david.holmes at oracle.com  Thu Dec 13 11:23:26 2012
From: david.holmes at oracle.com (David Holmes)
Date: Thu, 13 Dec 2012 21:23:26 +1000
Subject: Profiles update to jdk8-b67
In-Reply-To: <50BEDADE.40301@oracle.com>
References: <50BC0678.1040300@oracle.com> <50BEDADE.40301@oracle.com>
Message-ID: <50C9BAAE.5030309@oracle.com>

Just FYI the Profiles forest has been updated to the jdk8-b67 level.

This version includes the initial set of java.util.function APIs from 
lambda.

It also restricts profiles builds to linux.

David


From alexey.utkin at oracle.com  Thu Dec 13 11:48:47 2012
From: alexey.utkin at oracle.com (Alexey Utkin)
Date: Thu, 13 Dec 2012 15:48:47 +0400
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem (ver. 2)
In-Reply-To: <50C8D419.8000608@oracle.com>
References: <50C8A5C4.4030602@oracle.com> <50C8D419.8000608@oracle.com>
Message-ID: <50C9C09F.1030005@oracle.com>

Here is new version fix:
     http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8004928/webrev.02

On 12.12.2012 22:59, Mandy Chung wrote:
> On 12/12/12 7:41 AM, Alexey Utkin wrote:
>> Bug description:
>>     https://jbs.oracle.com/bugs/browse/JDK-8004928
>>
>
>> Summary:
>> *test/java/io/Serializable/resolveProxyClass/NonPublicInterface.java*
>> *test/java/lang/reflect/Proxy/ClassRestrictions.java*
>>         The set of non-public interfaces was changed to avoid AWT 
>> dependencies.
>>
> These 2 tests look for the first non-public system interface.  Instead 
> of keeping the nonPublicInterfaces list, it may be good to simplify 
> this to use "java.util.zip.ZipConstants" which seems to be a stable 
> one that will unlikely be removed.  I would suggest to add a check 
> that the class is non-public (Modifier.isPublic) to catch any future 
> change to this class.
Done.

>>         Swing-stored constants were changed to locally-defined.
>>
> *test/java/util/Collections/EmptyIterator.java*
>
> I believe your change captures what it's intended to test (typed 
> enumeration and rawtype enumeration).  Minor comment - it might be 
> better to move the new static variables as local variable before 
> calling testEmptyEnumeration to be consistent with convention used in 
> this test.  There is no need to keep them static anyway.   I would 
> also take out the comment about the substitution since this test 
> doesn't seem to have any relationship with javax.swing.
>
Done.

>> *test/java/util/logging/LoggingDeadlock4.java*
>>         Test case was simplified to avoid AWT class loading. Negative 
>> test result was tested on early
>>         JDK7 build.
>>
>
> Looks good.  Nit: L46 - good to break it into 2 lines.  It's good that 
> you have verified with and without the fix.
Done.

On 12.12.2012 22:40, Alan Bateman wrote:
> For java/io/Serializable/resolveProxyClass/NonPublicInterface.java and 
> java/lang/reflect/Proxy/ClassRestrictions.java then it would be nice 
> if the types used were in compact1 [1], that would avoid needing to 
> exclude those tests. I also see the test uses 
> sun.tools.agent.StepConstants which I don't think exists but perhaps 
> that is intentional.
The list was reduces to "java.util.zip.ZipConstants" (from compact1 
profile) with "non-public" status verification.

> test/java/util/Collections/EmptyIterator.java, minor nit but I think 
> we prefer "public static" over "static public". It doesn't of course 
> need to be public anyway.
>
The variables were made local-final in accordance with Mandy's 
recommendation.

> You probably saw Dan's comment about changing 
> test/java/util/logging/LoggingDeadlock4.java, I trust you'll double 
> check this test with an older version of the JDK that doesn't have the 
> fix. My only comment is that line 46 is too wide.
>
Done.

Thanks for review!
-uta



From Alan.Bateman at oracle.com  Thu Dec 13 11:56:04 2012
From: Alan.Bateman at oracle.com (Alan Bateman)
Date: Thu, 13 Dec 2012 11:56:04 +0000
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem (ver. 2)
In-Reply-To: <50C9C09F.1030005@oracle.com>
References: <50C8A5C4.4030602@oracle.com> <50C8D419.8000608@oracle.com>
	<50C9C09F.1030005@oracle.com>
Message-ID: <50C9C254.2010307@oracle.com>

On 13/12/2012 11:48, Alexey Utkin wrote:
> Here is new version fix:
>     http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8004928/webrev.02
This looks good to me and thanks for the confirmation that 
LoggingDeadlock4 continues to test what it was meant to test.

Minor comment on ClassRestrictions.java is that you've changed the test 
to throw Error rather than RuntimeException. Either will cause the test 
to fail so it doesn't matter of course.

-Alan


From alexey.utkin at oracle.com  Thu Dec 13 11:59:50 2012
From: alexey.utkin at oracle.com (Alexey Utkin)
Date: Thu, 13 Dec 2012 15:59:50 +0400
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem (ver. 2)
In-Reply-To: <50C9C254.2010307@oracle.com>
References: <50C8A5C4.4030602@oracle.com> <50C8D419.8000608@oracle.com>
	<50C9C09F.1030005@oracle.com> <50C9C254.2010307@oracle.com>
Message-ID: <50C9C336.7020104@oracle.com>

On 13.12.2012 15:56, Alan Bateman wrote:
> On 13/12/2012 11:48, Alexey Utkin wrote:
>> Here is new version fix:
>>     
>> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8004928/webrev.02
> This looks good to me and thanks for the confirmation that 
> LoggingDeadlock4 continues to test what it was meant to test.
>
> Minor comment on ClassRestrictions.java is that you've changed the 
> test to throw Error rather than RuntimeException. Either will cause 
> the test to fail so it doesn't matter of course.
I did it just for code unification between
     test/java/io/Serializable/resolveProxyClass/NonPublicInterface.java
     test/java/lang/reflect/Proxy/ClassRestrictions.java
tests. Yes, that need to be mentioned in summary. Sorry.

-uta



From peter.levart at gmail.com  Thu Dec 13 12:27:03 2012
From: peter.levart at gmail.com (Peter Levart)
Date: Thu, 13 Dec 2012 13:27:03 +0100
Subject: ReflectionData space optimization in java.lang.Class (JEP-149)
In-Reply-To: <50C9B1F0.5080808@oracle.com>
References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com>
	<23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com>
	<5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com>
	<5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com>
	<50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com>
	<509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com>
	<50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com>
	<50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com>
	<50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com>
	
	<50C8793F.1050205@gmail.com> <50C90C35.7020000@oracle.com>
	<50C9AA46.5030401@gmail.com> <50C9B1F0.5080808@oracle.com>
Message-ID: <50C9C997.10900@gmail.com>

On 12/13/2012 11:46 AM, David Holmes wrote:
> Hi Peter,
>
> I dropped Joel from the direct cc as this isn't annotation related.
>
> On 13/12/2012 8:13 PM, Peter Levart wrote:
>> Hi Mandy, David and others,
>>
>> Here's the updated version of the patch for ReflectionData:
>>
>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev.02/index.html
>>
>> I split long lines as proposed by Mandy. I also split reflectionData()
>> method in two methods, so the fast-path method is smaller and might get
>> better chances of being in-lined.
>
> Okay - though I just submitted the previous version to get some 
> performance data :(

Never mind, it's not a big difference, see below...

>
>> I also found code-paths that evaluated reflectionData() method more than
>> once for each external call. It's the methods:
>>
>> private Field[] privateGetDeclaredFields(boolean publicOnly)
>>
>> and
>>
>> private Method[] privateGetDeclaredMethods(boolean publicOnly)
>>
>> which are called from:
>>
>> private Field[] privateGetPublicFields(Set> 
>> traversedInterfaces)
>>
>> and
>>
>> private Method[] privateGetPublicMethods()
>>
>> respectively. I therefore introduced overloaded variants of the former
>> methods taking a ReflectionData parameter like the following:
>>
>> private Field[] privateGetDeclaredFields(boolean publicOnly) {
>> return privateGetDeclaredFields(publicOnly, reflectionData());
>> }
>> // A variant called from methods that already obtained ReflectionData
>> instance
>> private Field[] privateGetDeclaredFields(boolean publicOnly,
>> ReflectionData rd) {
>> ...
>>
>> the same for privateGetDeclaredMethods. This is not for performance
>> reasons (though it might help) but for correctness. Each external call
>> should be a separate "transaction" and should work on the same
>> ReflectionData instance. The "transaction" is only guaranteed on the
>> level of a particular java.lang.Class instance though. Some methods also
>> invoke other Class instances (to gather inherited public methods /
>> fields) and those invocations might be separate transactions in the face
>> of concurrent class re-definitions. But we are not going to implement a
>> database here, are we?
>
> Sorry I don't understand the problem you are seeing here. If we find a 
> cached public fields, for example, we will return it. Else we start 
> the process of calculating anew. If someone else manages to fill in 
> the cache then we will get it when we call privateGetDeclaredFields. 
> The results are expected to be idempotent so I don't see what the 
> problem is.
>
It's true, yes. For the outside caller there is no observable 
difference. It can only happen that we retrieve declaredFields from a 
newer snapshot (say v.2) of ReflectionData and then compute publicFields 
and install them into an older ReflectionData instance v.1 which is 
already obsolete. But for the outside observer there's no difference.
 From performance standpoint, the additional call to reflectionData() 
that we save is on the slow-path so it's not worth it.

The split of reflectionData() into two methods does have an impact 
though. FWIW my micro-benchmark shows that without the split, only the 
following public method is observed to be faster then in the original 
JDK8 code:

- getFields - 4x

With the split of reflectionData() but without these unneeded overloaded 
privateGetDeclaredFields methods, the following methods are faster:

- getMethods - 1.7x (1, 2 threads) ... 1x (4...32 threads)
- getFields - 4x
- getDeclaredConstructor - 6x ... 11x
- getDeclaredMethod - 3x

But for performance tests that you already initiated, it is important to 
note that original patch is good enough since it appears that no public 
method is any slower than in the original JDK8 code.

Speaking of that, I don't know much about the constraints of the JIT 
compiler, but it seems from the results above, that it can in-line 
multiple levels of method calls and that the total size of the methods 
matter. If this is true then it might be possible to split several 
private methods in java.lang.Class into pairs of short fast-path and 
longer slow-path. Is this worth the maintenance cost?

Regards, Peter

> Thanks,
> David
> ------
>
>> I prepared some micro benchmarks for individual public methods. Here're
>> the results:
>>
>> https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/reflection_data_benchmark_results_i7-2600K.txt 
>>
>>
>> they indicate no noticeable performance decreases. Some methods are in
>> fact faster (more in-linable?):
>>
>> - getFields - 4x
>> - getDeclaredConstructor - 4x ... 10x
>> - getDeclaredMethod - 3x
>>
>> Here's the code for micro-benchmarks:
>>
>> https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/src/test/ReflectionDataTest.java 
>>
>>
>>
>> Regards, Peter
>>
>>
>> On 12/12/2012 11:59 PM, Mandy Chung wrote:
>>> Hi Peter,
>>>
>>> On 12/12/12 4:31 AM, Peter Levart wrote:
>>>> Hi all,
>>>>
>>>> Ok, no problem. So here's a patch that summarizes what I did in the
>>>> previous patch, but only for reflective fields (Field[], Method[],
>>>> Constructor[]) not including annotations:
>>>>
>>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev/index.html
>>>>
>>>
>>> Finally able to make time to review this patch. It's good work. While
>>> it's good to see the synchronization issue with annotations be fixed,
>>> separating the cache for reflection and annotation helps. As David
>>> replied, he will take your patch and run with it for JEP-149.
>>>
>>> The change looks good. Nit: there are several long lines
>>> L2235,2244,2245,2249,2269 etc that should be broken into separate
>>> lines. The remaining open question is the performance difference in
>>> the reflectionData() method and how well it will be jit'ed. In the
>>> common case, there is no class redefinition where
>>> classCachesOnClassRedefinition() is essentially like an nop. I believe
>>> David will look at the footprint and performance numbers as he has
>>> initiated the performance testing (need to do it with this new patch).
>>>
>>> Thanks
>>> Mandy
>>>
>>>> The annotations part is unchanged semantically, but I had to:
>>>>
>>>> - modify private method clearCachesOnClassRedefinition to only
>>>> include invalidation of annotations and declaredAnnotations fields. I
>>>> also renamed it to clearAnnotationCachesOnClassRedefinition
>>>> - renamed lastRedefinedCount to lastAnnotationsRedefinedCount and,
>>>> since this field is now only accessed while holding a lock (from
>>>> synchronized initAnnotationsIfNecessary), I removed the volatile
>>>> keyword.
>>>>
>>>> That's it.
>>>>
>>>> While looking at this unchanged part of code some more, I see other
>>>> races as well. For example: two concurrent accesses to annotations
>>>> combined with redefinition of a class can result in NPE. Here's a
>>>> serial execution:
>>>>
>>>> Thread 1:
>>>> getAnnotation(annotationType);
>>>> initAnnotationsIfNecessary();
>>>>
>>>> VM:
>>>> classRedefinedCount++;
>>>>
>>>> Thread 2:
>>>> getAnnotation(annotationType);
>>>> initAnnotationsIfNecessary();
>>>> clearAnnotationCachesOnClassRedefinition();
>>>> annotations = null;
>>>>
>>>> Thread 1:
>>>> return AnnotationSupport.getOneAnnotation(annotations, 
>>>> annotationClass);
>>>> // 'annotations' field can be null
>>>>
>>>>
>>>> So this needs to be fixed sooner or later.
>>>>
>>>> Joel!
>>>>
>>>> Are your JSR 308 canges involving java.lang.Class too?
>>>>
>>>> Regards, Peter
>>>>
>>>>
>>>> On 12/12/2012 11:59 AM, Joel Borggr?n-Franck wrote:
>>>>> Hi all,
>>>>>
>>>>> First, thanks all of you that are involved in this!
>>>>>
>>>>> I agree with David here, lets split this up (for now) and do
>>>>> reflective objects in the context of jep-149 and annotations
>>>>> separately.
>>>>>
>>>>> As you may know there are even more annotation coming in with JSR
>>>>> 308 annotations on type (use), so I want to complete that work first
>>>>> and then do the effort of reducing contention and overhead for both
>>>>> type and regular annotations and also fixing up the behaviour for
>>>>> redefine/retransform class.
>>>>>
>>>>> One other point to consider is that some of the fields in
>>>>> java/lang/reflect/ classes are known by the VM so not all changes in
>>>>> Java-land are actually doable. Glancing over your patches very
>>>>> quickly I don't think you have done anything to upset the VM, but
>>>>> then I am not an expert in this area.
>>>>>
>>>>> Also, with the VM permgen changes we might have to rethink our
>>>>> assumptions in order to reduce total overhead. For example as I
>>>>> understand it previously we could just ship the same pointer into
>>>>> permgen for the annotations arrays, now that isn't possible so we
>>>>> create a new copy of the array for every Field/Method/Constructor
>>>>> instance. Perhaps there is some clever way of eliminating those 
>>>>> copies.
>>>>>
>>>>> So while I think your patches generally makes sense, I think it is
>>>>> prudent to delay this for annotations until all our new annotation
>>>>> features are in.
>>>>>
>>>>> cheers
>>>>> /Joel
>>>>>
>>>>> On Dec 10, 2012, at 7:18 AM, David Holmes 
>>>>> wrote:
>>>>>
>>>>>> Hi Peter,
>>>>>>
>>>>>> Sorry for the delay on this.
>>>>>>
>>>>>> Generally your VolatileData and my ReflectionHelper are doing a
>>>>>> similar job. But I agree with your reasoning that all of the cached
>>>>>> SoftReferences are likely to be cleared at once, and so a
>>>>>> SoftReference to a helper object with direct references, is more
>>>>>> effective than a direct reference to a helper object with
>>>>>> SoftReferences. My initial stance with this was very conservative
>>>>>> as the more change that is introduced the more uncertainty there is
>>>>>> about the impact.
>>>>>>
>>>>>> I say the above primarily because I think, if I am to proceed with
>>>>>> this, I will need to separate out the general reflection caching
>>>>>> changes from the annotation changes. There are a number of reasons
>>>>>> for this:
>>>>>>
>>>>>> First, I'm not at all familiar with the implementation of
>>>>>> annotations at the VM or Java level, and the recent changes in this
>>>>>> area just exacerbate my ignorance of the mechanics. So I don't feel
>>>>>> qualified to evaluate that aspect.
>>>>>>
>>>>>> Second, the bulk of the reflection caching code is simplified by
>>>>>> the fact that due to current constraints on class redefinition the
>>>>>> caching is effectively idempotent for fields/methods/constructors.
>>>>>> But that is not the case for annotations.
>>>>>>
>>>>>> Finally, the use of synchronization with the annotations method is
>>>>>> perplexing me. I sent Joe a private email on this but I may as well
>>>>>> raise it here - and I think you have alluded to this in your
>>>>>> earlier emails as well: initAnnotationsIfNecessary() is a
>>>>>> synchronized instance method but I can not find any other code in
>>>>>> the VM that synchronizes on the Class object's monitor. So if this
>>>>>> synchronization is trying to establish consistency in the face of
>>>>>> class redefinition, I do not see where class redefinition is
>>>>>> participating in the synchronization!
>>>>>>
>>>>>> So what I would like to do is take your basic VolatileData part of
>>>>>> the patch and run with it for JEP-149 purposes, while separating
>>>>>> the annotations issue so they can be dealt with by the experts in
>>>>>> that particular area.
>>>>>>
>>>>>> I'm sorry it has taken so long to arrive at a fairly negative
>>>>>> position, but I need someone else to take up the annotations
>>>>>> gauntlet and run with it.
>>>>>>
>>>>>> Thanks,
>>>>>> David
>>>>>>
>>



From chris.hegarty at oracle.com  Thu Dec 13 14:34:33 2012
From: chris.hegarty at oracle.com (chris.hegarty at oracle.com)
Date: Thu, 13 Dec 2012 14:34:33 +0000
Subject: hg: jdk8/tl/jdk: 8004675: Inet6Address.getHostAddress should use
	string scope identifier where available
Message-ID: <20121213143445.2B5D047108@hg.openjdk.java.net>

Changeset: 682d2d3ccff5
Author:    chegar
Date:      2012-12-13 14:33 +0000
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/682d2d3ccff5

8004675: Inet6Address.getHostAddress should use string scope identifier where available
Summary: ...and some minor stylistic cleanup
Reviewed-by: khazra, dsamersoff, michaelm

! src/share/classes/java/net/Inet6Address.java
! src/share/native/java/net/Inet6Address.c
+ test/java/net/Inet6Address/StringScope.java



From sean.mullan at oracle.com  Thu Dec 13 14:37:41 2012
From: sean.mullan at oracle.com (sean.mullan at oracle.com)
Date: Thu, 13 Dec 2012 14:37:41 +0000
Subject: hg: jdk8/tl/jdk: 2 new changesets
Message-ID: <20121213143805.4F23147109@hg.openjdk.java.net>

Changeset: c97618a3c8c2
Author:    juh
Date:      2012-12-13 09:35 -0500
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c97618a3c8c2

7193792: sun/security/pkcs11/ec/TestECDSA.java failing intermittently
Reviewed-by: vinnie, wetmore

! test/ProblemList.txt
! test/sun/security/pkcs11/ec/TestECDSA.java

Changeset: 7b697da6626a
Author:    mullan
Date:      2012-12-13 09:37 -0500
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7b697da6626a

Merge




From chris.hegarty at oracle.com  Thu Dec 13 14:48:45 2012
From: chris.hegarty at oracle.com (chris.hegarty at oracle.com)
Date: Thu, 13 Dec 2012 14:48:45 +0000
Subject: hg: jdk8/tl/jdk: 8003890: corelibs test scripts should pass TESTVMOPTS
Message-ID: <20121213144857.1B39D4710A@hg.openjdk.java.net>

Changeset: ae5d04dbacd6
Author:    chegar
Date:      2012-12-13 14:47 +0000
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ae5d04dbacd6

8003890: corelibs test scripts should pass TESTVMOPTS
Reviewed-by: chegar, alanb
Contributed-by: Mark Sheppard 

! test/com/oracle/net/sanity.sh
! test/com/sun/corba/cachedSocket/7056731.sh
! test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh
! test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
! test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
! test/com/sun/tools/attach/ApplicationSetup.sh
! test/com/sun/tools/attach/BasicTests.sh
! test/com/sun/tools/attach/PermissionTests.sh
! test/com/sun/tools/attach/ProviderTests.sh
! test/com/sun/tools/extcheck/TestExtcheckArgs.sh
! test/demo/zipfs/basic.sh
! test/java/io/File/GetXSpace.sh
! test/java/io/File/MacPathTest.sh
! test/java/io/File/basic.sh
! test/java/io/FileOutputStream/FileOpen.sh
! test/java/io/Serializable/class/run.sh
! test/java/io/Serializable/evolution/AddedExternField/run.sh
! test/java/io/Serializable/evolution/RenamePackage/run.sh
! test/java/io/Serializable/maskSyntheticModifier/run.sh
! test/java/io/Serializable/packageAccess/run.sh
! test/java/io/Serializable/resolveClass/consTest/run.sh
! test/java/io/Serializable/resolveClass/deserializeButton/run.sh
! test/java/io/Serializable/subclass/run.sh
! test/java/io/Serializable/superclassDataLoss/run.sh
! test/java/io/Serializable/unnamedPackageSwitch/run.sh
! test/java/lang/Class/forName/NonJavaNames.sh
! test/java/lang/ClassLoader/Assert.sh
! test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh
! test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh
! test/java/lang/ClassLoader/getdotresource.sh
! test/java/lang/Runtime/exec/setcwd.sh
! test/java/lang/StringCoding/CheckEncodings.sh
! test/java/lang/System/finalization/FinExit.sh
! test/java/lang/annotation/loaderLeak/LoaderLeak.sh
! test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh
! test/java/net/Authenticator/B4933582.sh
! test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh
! test/java/net/InetAddress/ptr/lookup.sh
! test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.sh
! test/java/net/Socket/OldSocketImpl.sh
! test/java/net/URL/B5086147.sh
! test/java/net/URL/runconstructor.sh
! test/java/net/URLClassLoader/B5077773.sh
! test/java/net/URLClassLoader/getresourceasstream/test.sh
! test/java/net/URLClassLoader/sealing/checksealed.sh
! test/java/net/URLConnection/6212146/test.sh
! test/java/net/URLConnection/UNCTest.sh
! test/java/nio/Buffer/LimitDirectMemory.sh
! test/java/nio/channels/AsynchronousChannelGroup/run_any_task.sh
! test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh
! test/java/nio/charset/Charset/default.sh
! test/java/nio/charset/coders/CheckSJISMappingProp.sh
! test/java/nio/charset/spi/basic.sh
! test/java/nio/file/Files/delete_on_close.sh
! test/java/nio/file/Files/walkFileTree/walk_file_tree.sh
! test/java/nio/file/Path/MacPathTest.sh
! test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh
! test/java/rmi/registry/readTest/readTest.sh
! test/java/rmi/reliability/benchmark/runSerialBench.sh
! test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh
! test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh
! test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh
! test/java/security/Security/signedfirst/Dyn.sh
! test/java/security/Security/signedfirst/Static.sh
! test/java/security/cert/CertificateFactory/slowstream.sh
! test/java/util/Currency/PropertiesTest.sh
! test/java/util/Locale/LocaleCategory.sh
! test/java/util/Locale/LocaleProviders.sh
! test/java/util/PluggableLocale/ExecTest.sh
! test/java/util/ResourceBundle/Bug6299235Test.sh
! test/java/util/ResourceBundle/Control/MissingResourceCauseTest.sh
! test/java/util/ServiceLoader/basic.sh
! test/java/util/TimeZone/OldIDMappingTest.sh
! test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh
! test/java/util/prefs/CheckUserPrefsStorage.sh
! test/java/util/prefs/PrefsSpi.sh
! test/java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.sh
! test/java/util/zip/3GBZipFiles.sh
! test/java/util/zip/ZipFile/deletetempjar.sh
! test/javax/crypto/SecretKeyFactory/FailOverTest.sh
! test/javax/print/applet/AppletPrintLookup.sh
! test/javax/script/ProviderTest.sh
! test/javax/security/auth/Subject/doAs/Test.sh
! test/lib/security/java.policy/Ext_AllPolicy.sh
! test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh
! test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh
! test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh
! test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh
! test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh
! test/sun/management/jmxremote/startstop/JMXStartStopTest.sh
! test/sun/misc/Cleaner/exitOnThrow.sh
! test/sun/net/InetAddress/nameservice/dns/cname.sh
! test/sun/net/sdp/sanity.sh
! test/sun/net/www/MarkResetTest.sh
! test/sun/net/www/http/HttpClient/RetryPost.sh
! test/sun/net/www/protocol/file/DirPermissionDenied.sh
! test/sun/net/www/protocol/jar/B5105410.sh
! test/sun/net/www/protocol/jar/getcontenttype.sh
! test/sun/net/www/protocol/jar/jarbug/run.sh
! test/sun/rmi/rmic/manifestClassPath/run.sh
! test/sun/rmi/rmic/minimizeWrapperInstances/run.sh
! test/sun/rmi/rmic/oldjavacRemoved/sunToolsJavacMain.sh
! test/sun/security/krb5/runNameEquals.sh
! test/sun/security/krb5/tools/ktcheck.sh
! test/sun/security/mscapi/AccessKeyStore.sh
! test/sun/security/mscapi/IsSunMSCAPIAvailable.sh
! test/sun/security/mscapi/KeyStoreCompatibilityMode.sh
! test/sun/security/mscapi/PublicKeyInterop.sh
! test/sun/security/mscapi/RSAEncryptDecrypt.sh
! test/sun/security/mscapi/ShortRSAKey1024.sh
! test/sun/security/mscapi/SignUsingNONEwithRSA.sh
! test/sun/security/mscapi/SignUsingSHA2withRSA.sh
! test/sun/security/pkcs11/KeyStore/Basic.sh
! test/sun/security/pkcs11/KeyStore/ClientAuth.sh
! test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh
! test/sun/security/pkcs11/KeyStore/Solaris.sh
! test/sun/security/pkcs11/Provider/ConfigQuotedString.sh
! test/sun/security/pkcs11/Provider/Login.sh
! test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh
! test/sun/security/provider/PolicyFile/getinstance/getinstance.sh
! test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh
! test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh
! test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh
! test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh
! test/sun/security/tools/jarsigner/emptymanifest.sh
! test/sun/security/tools/jarsigner/ts.sh
! test/sun/security/tools/keytool/printssl.sh
! test/sun/security/tools/keytool/standard.sh
! test/sun/security/validator/certreplace.sh
! test/sun/security/validator/samedn.sh
! test/tools/launcher/6842838/Test6842838.sh
! test/tools/launcher/MultipleJRE.sh



From daniel.daugherty at oracle.com  Thu Dec 13 14:58:04 2012
From: daniel.daugherty at oracle.com (Daniel D. Daugherty)
Date: Thu, 13 Dec 2012 07:58:04 -0700
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem.
In-Reply-To: <50C9A166.3060803@oracle.com>
References: <50C8A5C4.4030602@oracle.com> <50C8B289.8070906@oracle.com>
	<50C8B50E.90807@oracle.com> <50C8B64F.3020204@oracle.com>
	<50C9A166.3060803@oracle.com>
Message-ID: <50C9ECFC.1030305@oracle.com>

On 12/13/12 2:35 AM, Alexey Utkin wrote:
> On 12.12.2012 20:52, Daniel D. Daugherty wrote:
>> On 12/12/12 9:47 AM, Alan Bateman wrote:
>>> On 12/12/2012 16:36, Daniel D. Daugherty wrote:
>>>> For this item:
>>>>
>>>> >     test/java/util/logging/LoggingDeadlock4.java
>>>> >         Test case was simplified to avoid AWT class loading. 
>>>> Negative test
>>>> >         result was tested on early JDK7 build.
>>>>
>>>> if I remember correctly, the whole point of that test was to
>>>> check for a logging deadlock relative to AWT's usage of logging.
>>>> If you avoid loading AWT classes, doesn't that make the test
>>>> rather useless?
>>>>
>>>> Dan
>>> java.awt.Container:
>>>
>>>     private static final PlatformLogger log = 
>>> PlatformLogger.getLogger("java.awt.Container");
>>>     private static final PlatformLogger eventLog = 
>>> PlatformLogger.getLogger("java.awt.event.Container");
>>>
>>> and the updated test is just using PlatformLogger directly,
>>
> Exactly.
>> I thought the deadlock had to do with locks grabbed on the way
>> to getting into the underlying PlatformLogger, but my memory is
>> hazy and I don't have the cycles to research this.
>>
>>
>>> I hope it demonstrates the same issue with a JDK that doesn't have 
>>> the fix.
>>
>> That would be the right way to see if the test still "works".
>>
> Yes, it works!*
> test result: Error. Program `C:\Program Files\Java\jdk1.7.0\bin\java' 
> interrupted! (timed out?)*
>
> Regards,
> -uta

Thanks for letting me know.

Dan



From rob.mckenna at oracle.com  Thu Dec 13 15:24:20 2012
From: rob.mckenna at oracle.com (rob.mckenna at oracle.com)
Date: Thu, 13 Dec 2012 15:24:20 +0000
Subject: hg: jdk8/tl/jdk: 8000525: Java.net.httpcookie api does not support
	2-digit year format
Message-ID: <20121213152432.0C2154710D@hg.openjdk.java.net>

Changeset: 087425441a48
Author:    robm
Date:      2012-12-13 15:28 +0000
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/087425441a48

8000525: Java.net.httpcookie api does not support 2-digit year format
Reviewed-by: chegar

! src/share/classes/java/net/HttpCookie.java
! test/java/net/CookieHandler/B6791927.java
! test/java/net/CookieHandler/CookieManagerTest.java
+ test/java/net/HttpCookie/ExpiredCookieTest.java



From mandy.chung at oracle.com  Thu Dec 13 15:49:38 2012
From: mandy.chung at oracle.com (Mandy Chung)
Date: Thu, 13 Dec 2012 07:49:38 -0800
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem (ver. 2)
In-Reply-To: <50C9C09F.1030005@oracle.com>
References: <50C8A5C4.4030602@oracle.com> <50C8D419.8000608@oracle.com>
	<50C9C09F.1030005@oracle.com>
Message-ID: <50C9F912.3020200@oracle.com>

On 12/13/2012 3:48 AM, Alexey Utkin wrote:
> Here is new version fix:
> http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8004928/webrev.02

Looks good.  Thanks for the update.

Mandy


From chris.hegarty at oracle.com  Thu Dec 13 16:53:08 2012
From: chris.hegarty at oracle.com (Chris Hegarty)
Date: Thu, 13 Dec 2012 16:53:08 +0000
Subject: RRFR 8002356: Add ForkJoin common pool and CountedCompleted
Message-ID: <50CA07F4.4000908@oracle.com>


I would like to re-start [1] review discussion of the changes to 
ForkJoinXXX ( add a default common pool, task tags, and implementation 
updates ), and the addition of CountedCompleter, as part of part of JEP 
155 [2].

These changes are of course coming form Doug and the JSR 166 EG members. 
I have done a quick sanity review, and the changes reflect what is in 
Doug's CVS. I need to spend more time reviewing myself, others on the 
list have more experience with these new API already and may have 
valuable feedback.

specdiff:
 
http://cr.openjdk.java.net/~chegar/8002356/ver.00/specdiff/java/util/concurrent/package-summary.html

webrev:
   http://cr.openjdk.java.net/~chegar/8002356/ver.00/webrev/webrev/

-Chris.

[1] http://openjdk.java.net/jeps/155
[2] 
http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012153.html


From mike.duigou at oracle.com  Thu Dec 13 20:16:08 2012
From: mike.duigou at oracle.com (Mike Duigou)
Date: Thu, 13 Dec 2012 12:16:08 -0800
Subject: RRFR 8002356: Add ForkJoin common pool and CountedCompleted
In-Reply-To: <50CA07F4.4000908@oracle.com>
References: <50CA07F4.4000908@oracle.com>
Message-ID: <8694E88A-40A5-4AC3-8C25-55FA3574D933@oracle.com>

Some notes:

- The Object padding (pad10 - pad1d) in WorkQueue and ForkJoinPool is sensitive to reference size and compressed OOPS. I was surprised to see Object used rather than long or int.

- how is getCommonPoolParallelism() different from commonPool().getParallelism() ? Seems redundant.

- I would document the effects of shutdown, shutdownNow, awaitTermination, isTerminating specific to the common pool on getCommonPool() rather than on the individual methods. The discussion seems out of place on the individual methods. Everything about the common pool should be consolidated (or replicated) on getCommonPool() for one-stop-shopping to understand the characteristics of the common pool.

- ForkJoinTask - "If the current thread is operating in a ForkJoinPool," and similar phrases. It doesn't say what happens if it isn't.

- ForkJoinTask - removing "This method may be invoked only from within ForkJoinPool computations (as may be determined using method inForkJoinPool()). Attempts to invoke in other contexts result in exceptions or errors, possibly including ClassCastException." etc. would seem to open up a lot of ambiguity about what happens when methods are called out of context.

- CountedCompleter : "Asuuming" -> "Assuming"

I didn't see anything that rang warning bells.

Mike

On Dec 13 2012, at 08:53 , Chris Hegarty wrote:

> 
> I would like to re-start [1] review discussion of the changes to ForkJoinXXX ( add a default common pool, task tags, and implementation updates ), and the addition of CountedCompleter, as part of part of JEP 155 [2].
> 
> These changes are of course coming form Doug and the JSR 166 EG members. I have done a quick sanity review, and the changes reflect what is in Doug's CVS. I need to spend more time reviewing myself, others on the list have more experience with these new API already and may have valuable feedback.
> 
> specdiff:
> http://cr.openjdk.java.net/~chegar/8002356/ver.00/specdiff/java/util/concurrent/package-summary.html
> 
> webrev:
>  http://cr.openjdk.java.net/~chegar/8002356/ver.00/webrev/webrev/
> 
> -Chris.
> 
> [1] http://openjdk.java.net/jeps/155
> [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012153.html



From huizhe.wang at oracle.com  Thu Dec 13 20:24:52 2012
From: huizhe.wang at oracle.com (Joe Wang)
Date: Thu, 13 Dec 2012 12:24:52 -0800
Subject: RFR: javax.xml.datatype: Using ServiceLoader to load JAXP datatype
	factories (7169894: JAXP Plugability Layer: using service loader)
In-Reply-To: <50C881D8.1090909@oracle.com>
References: <50C771A6.7090807@oracle.com> <50C881D8.1090909@oracle.com>
Message-ID: <50CA3994.303@oracle.com>

Hi Daniel,

This looks good.  We had some discussion over if there's a difference in 
classloading between the original sequence and that of ServiceLoader. I 
understand you have the full regression testsuite from SQE. Just would 
like to make sure they pass just fine.

Thanks,
Joe

On 12/12/2012 5:08 AM, Daniel Fuchs wrote:
> Hi,
>
> Please find below a refreshed webrev which adds a bit of cleanup
> suggested by Paul.
>
> Instead of casting the result of newInstance() at several places,
> we pass the expected base type to newInstance so that the cast
> occurs only once.
>
>  
>
>
> -- daniel
>
> Note: I have applied the same cleanup to the parsers package:
> javax.xml.parsers:
>  
>
>
>
> On 12/11/12 6:47 PM, Daniel Fuchs wrote:
>> Hi,
>>
>> Here is a new webrev in the series that addresses using ServiceLoader in
>> JAXP for JDK 8.
>>
>> 7169894: JAXP Plugability Layer: using service loader
>>
>> This changeset addresses modification in the javax.xml.datatype
>> package.
>> It is similar to changes proposed for the javax.xml.parsers
>> package [1], with a few differences due to the specificities of
>> javax.xml.datatype.
>>
>> Namely:
>>
>> 1. The documentation that describes the loading mechanism is in the
>>     class header rather than in the method documentation - which leads
>>     to some wording changes.
>>
>> 2. The DatatypeFactory is specified to throw a
>>     DatatypeConfigurationException - which is a checked exception,
>>     instead of an Error - as was FactoryConfigurationError
>>
>> 3. DatatypeConfigurationException allows to wrap
>>     ServiceConfigurationError directly - so the additional layer
>>     of RuntimeException is not needed here.
>>
>>  
>>
>>
>>
>> -- daniel
>>
>> [1] javax.xml.parsers:
>>  
>>
>>
>>
>


From gary.collins at oracle.com  Wed Dec  5 17:46:38 2012
From: gary.collins at oracle.com (Gary Collins)
Date: Wed, 5 Dec 2012 09:46:38 -0800
Subject: Profiles update to jdk8-b66
In-Reply-To: <50BEDADE.40301@oracle.com>
References: <50BC0678.1040300@oracle.com> <50BEDADE.40301@oracle.com>
Message-ID: 

Awesome job!

Thanks David!

Gary
On Dec 4, 2012, at 9:25 PM, David Holmes wrote:

> Just FYI the Profiles forest has been updated to the jdk8-b66 level.
> 
> Aside from that, recent changes include:
> 
> - javac support for -profile flag
> - keytool is now part of profile compact1
> - Fix for FDS to ensure configure settings make their way through to hotspot
> 
> David



From leonid.arbouzov at oracle.com  Thu Dec 13 19:24:08 2012
From: leonid.arbouzov at oracle.com (Leonid Arbouzov)
Date: Thu, 13 Dec 2012 11:24:08 -0800
Subject: signatures that are recorded for default methods
In-Reply-To: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com>
References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com>
Message-ID: <50CA2B58.5030103@oracle.com>

Hello Lance,

My understanding would be that the signature test
should check that interface method is marked as default method
but do not track the code in its default body
(assuming that the body is not a part of a spec - API javadoc).

(I've confirmed that with the signature test developer)

Thanks,
-leonid

On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote:
> Folks,
>
> Will the signatures for interfaces that are recorded by the TCKs for interfaces record the fact that a method includes a default method? or will it just record the method definition?
>
> I am assuming it will, but I know there has been discussion that a implementor could choose a different default implementation on one of the recent threads that was up for review.
>
> I am still trying to understand what our guidelines are, if any for documenting the behavior of the supplied default methods given the javadocs are part of the specification for many APIs (and in some case the only spec).
>
> Best
> Lance
>
> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
> Oracle Java Engineering
> 1 Network Drive
> Burlington, MA 01803
> Lance.Andersen at oracle.com
>
>



From joe.darcy at oracle.com  Thu Dec 13 21:05:36 2012
From: joe.darcy at oracle.com (Joe Darcy)
Date: Thu, 13 Dec 2012 13:05:36 -0800
Subject: signatures that are recorded for default methods
In-Reply-To: <50CA2B58.5030103@oracle.com>
References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com>
	<50CA2B58.5030103@oracle.com>
Message-ID: <50CA4320.40408@oracle.com>

Hello,

As with concrete methods on abstract classes, I would expect the 
specifications of the default methods to often contain text akin to 
"This default implementation does x, y, and z" since if the method is to 
be called by subtypes, the self-use patterns in the default method need 
to be known.

Cheers,

-Joe

On 12/13/2012 11:24 AM, Leonid Arbouzov wrote:
> Hello Lance,
>
> My understanding would be that the signature test
> should check that interface method is marked as default method
> but do not track the code in its default body
> (assuming that the body is not a part of a spec - API javadoc).
>
> (I've confirmed that with the signature test developer)
>
> Thanks,
> -leonid
>
> On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote:
>> Folks,
>>
>> Will the signatures for interfaces that are recorded by the TCKs for interfaces record the fact that a method includes a default method? or will it just record the method definition?
>>
>> I am assuming it will, but I know there has been discussion that a implementor could choose a different default implementation on one of the recent threads that was up for review.
>>
>> I am still trying to understand what our guidelines are, if any for documenting the behavior of the supplied default methods given the javadocs are part of the specification for many APIs (and in some case the only spec).
>>
>> Best
>> Lance
>>
>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>> Oracle Java Engineering
>> 1 Network Drive
>> Burlington, MA 01803
>> Lance.Andersen at oracle.com
>>
>>
>



From Lance.Andersen at oracle.com  Thu Dec 13 21:17:39 2012
From: Lance.Andersen at oracle.com (Lance Andersen - Oracle)
Date: Thu, 13 Dec 2012 16:17:39 -0500
Subject: signatures that are recorded for default methods
In-Reply-To: <50CA4320.40408@oracle.com>
References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com>
	<50CA2B58.5030103@oracle.com> <50CA4320.40408@oracle.com>
Message-ID: <2120CD2B-1918-4527-91F0-F37FFA38C247@oracle.com>

Hi Joe,

I would agree but if the default implementation is not considered part of the spec, should it be defined in the javadoc and if so, IMHO a javadoc tag would be very useful so that we are consistent in at least presentation.


Leonid, thank you for the confirmation.

Best
Lance
On Dec 13, 2012, at 4:05 PM, Joe Darcy wrote:

> Hello,
> 
> As with concrete methods on abstract classes, I would expect the specifications of the default methods to often contain text akin to "This default implementation does x, y, and z" since if the method is to be called by subtypes, the self-use patterns in the default method need to be known.
> 
> Cheers,
> 
> -Joe
> 
> On 12/13/2012 11:24 AM, Leonid Arbouzov wrote:
>> Hello Lance,
>> 
>> My understanding would be that the signature test
>> should check that interface method is marked as default method
>> but do not track the code in its default body
>> (assuming that the body is not a part of a spec - API javadoc).
>> 
>> (I've confirmed that with the signature test developer)
>> 
>> Thanks,
>> -leonid
>> 
>> On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote:
>>> Folks,
>>> 
>>> Will the signatures for interfaces that are recorded by the TCKs for interfaces record the fact that a method includes a default method? or will it just record the method definition?
>>> 
>>> I am assuming it will, but I know there has been discussion that a implementor could choose a different default implementation on one of the recent threads that was up for review.
>>> 
>>> I am still trying to understand what our guidelines are, if any for documenting the behavior of the supplied default methods given the javadocs are part of the specification for many APIs (and in some case the only spec).
>>> 
>>> Best
>>> Lance
>>> 
>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>>> Oracle Java Engineering
>>> 1 Network Drive
>>> Burlington, MA 01803
>>> Lance.Andersen at oracle.com
>>> 
>>> 
>> 
> 

-------------- next part --------------

Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com


From huizhe.wang at oracle.com  Thu Dec 13 21:46:05 2012
From: huizhe.wang at oracle.com (Joe Wang)
Date: Thu, 13 Dec 2012 13:46:05 -0800
Subject: 8004371: (props) Properties.loadFromXML needs small footprint
	XML parser as fallback when JAXP is not present
In-Reply-To: <50C85DFE.5010300@oracle.com>
References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com>
	<50C27AC1.2050600@oracle.com> <50C27DBA.3050808@oracle.com>
	<50C61B4B.1080901@oracle.com> <50C72618.5000407@oracle.com>
	<7706A692-773E-4282-8B2C-9B2D85FD49A5@oracle.com>
	<50C85DFE.5010300@oracle.com>
Message-ID: <50CA4C9D.50101@oracle.com>



On 12/12/2012 2:35 AM, Alan Bateman wrote:
> On 12/12/2012 09:31, Paul Sandoz wrote:
>>
>> http://cr.openjdk.java.net/~alanb/8004371/webrev.02/src/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java.html 
>>
>>
>> Why are the element qualified names compared ignoring case?
> I'll leave this to Joe, but I agree that it doesn't look right.

What I was thinking?!  I had the property dtd in mind that requires the 
elements all be in lower cases, so therefore I should ignore case and 
allow it -- any better logic than that? :-)

Fixed now. And also added a couple of test cases.  Elements with wrong 
case would still have been rejected, but the error messages would be 
different.

>
>>
>> We need tests with invalid documents. I did not check if there are 
>> already such tests present.

I added some test cases to test validation, compatibility and etc.  Alan 
thinks we'll use the ones currently in the JDK repository for now.

Thanks,
Joe
>>
> Tests for properties in XML format are in short supply, at least in 
> the jdk repository. There are tests in other test suites (JCK for 
> example) but we may need to add additional tests to give this new code 
> a good workout. The awkward thing is that this code will not be 
> executed with by the regular JDK, hence the update to the 
> LoadAndStoreXML.java test to at least ensure that it executed during 
> normal test runs.
>
> -Alan


From leonid.arbouzov at oracle.com  Thu Dec 13 23:16:42 2012
From: leonid.arbouzov at oracle.com (Leonid Arbuzov)
Date: Thu, 13 Dec 2012 15:16:42 -0800
Subject: signatures that are recorded for default methods
In-Reply-To: <50CA4320.40408@oracle.com>
References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com>
	<50CA2B58.5030103@oracle.com> <50CA4320.40408@oracle.com>
Message-ID: <50CA61DA.7050205@oracle.com>

Good point, Joe.
Those extra assertions for default methods can be checked
by regular API tests separately from signature tests.

Thanks,
-leonid

On 12/13/2012 1:05 PM, Joe Darcy wrote:
> Hello,
>
> As with concrete methods on abstract classes, I would expect the 
> specifications of the default methods to often contain text akin to 
> "This default implementation does x, y, and z" since if the method is 
> to be called by subtypes, the self-use patterns in the default method 
> need to be known.
>
> Cheers,
>
> -Joe
>
> On 12/13/2012 11:24 AM, Leonid Arbouzov wrote:
>> Hello Lance,
>>
>> My understanding would be that the signature test
>> should check that interface method is marked as default method
>> but do not track the code in its default body
>> (assuming that the body is not a part of a spec - API javadoc).
>>
>> (I've confirmed that with the signature test developer)
>>
>> Thanks,
>> -leonid
>>
>> On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote:
>>> Folks,
>>>
>>> Will the signatures for interfaces that are recorded by the TCKs for 
>>> interfaces record the fact that a method includes a default method? 
>>> or will it just record the method definition?
>>>
>>> I am assuming it will, but I know there has been discussion that a 
>>> implementor could choose a different default implementation on one 
>>> of the recent threads that was up for review.
>>>
>>> I am still trying to understand what our guidelines are, if any for 
>>> documenting the behavior of the supplied default methods given the 
>>> javadocs are part of the specification for many APIs (and in some 
>>> case the only spec).
>>>
>>> Best
>>> Lance
>>>
>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>>> Oracle Java Engineering
>>> 1 Network Drive
>>> Burlington, MA 01803
>>> Lance.Andersen at oracle.com
>>>
>>>
>>
>


From david.holmes at oracle.com  Thu Dec 13 23:30:11 2012
From: david.holmes at oracle.com (David Holmes)
Date: Fri, 14 Dec 2012 09:30:11 +1000
Subject: RFR (trivial): 8003632 HPROF class file version
	java.lang.RuntimeException errors
Message-ID: <50CA6503.8050104@oracle.com>

Trivial update of max classfile version to 52.

http://cr.openjdk.java.net/~dholmes/8003632/webrev/

Pushing through tl/jdk

Thanks,
David


From Lance.Andersen at oracle.com  Thu Dec 13 23:30:32 2012
From: Lance.Andersen at oracle.com (Lance Andersen - Oracle)
Date: Thu, 13 Dec 2012 18:30:32 -0500
Subject: signatures that are recorded for default methods
In-Reply-To: <50CA61DA.7050205@oracle.com>
References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com>
	<50CA2B58.5030103@oracle.com> <50CA4320.40408@oracle.com>
	<50CA61DA.7050205@oracle.com>
Message-ID: <46D348C4-E38A-418E-A1D4-C789B038F078@oracle.com>


On Dec 13, 2012, at 6:16 PM, Leonid Arbuzov wrote:

> Good point, Joe.
> Those extra assertions for default methods can be checked
> by regular API tests separately from signature tests.

I am not clear on this.  See the message attached from David which ask a similar question (from the attached email):
-------------------
2. It is not obvious to me that the JDK's choice for a default implementation has to be _the_ only possible implementation choice. In many/most cases there will be a very obvious choice, but that doesn't mean that all suppliers of OpenJDK classes have to be locked in to that choice.
-------------------


If everyone needs to implement the same default implementation then great the JCK/TCK can test it and IMHO we should have a javadoc tag for this.

If everyone is free to choose what the default behavior is, then we cannot test it.

So has there been a decision WRT the requirements for default methods?


Best
Lance
> Thanks,
> -leonid
> 
> On 12/13/2012 1:05 PM, Joe Darcy wrote:
>> Hello,
>> 
>> As with concrete methods on abstract classes, I would expect the specifications of the default methods to often contain text akin to "This default implementation does x, y, and z" since if the method is to be called by subtypes, the self-use patterns in the default method need to be known.
>> 
>> Cheers,
>> 
>> -Joe
>> 
>> On 12/13/2012 11:24 AM, Leonid Arbouzov wrote:
>>> Hello Lance,
>>> 
>>> My understanding would be that the signature test
>>> should check that interface method is marked as default method
>>> but do not track the code in its default body
>>> (assuming that the body is not a part of a spec - API javadoc).
>>> 
>>> (I've confirmed that with the signature test developer)
>>> 
>>> Thanks,
>>> -leonid
>>> 
>>> On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote:
>>>> Folks,
>>>> 
>>>> Will the signatures for interfaces that are recorded by the TCKs for interfaces record the fact that a method includes a default method? or will it just record the method definition?
>>>> 
>>>> I am assuming it will, but I know there has been discussion that a implementor could choose a different default implementation on one of the recent threads that was up for review.
>>>> 
>>>> I am still trying to understand what our guidelines are, if any for documenting the behavior of the supplied default methods given the javadocs are part of the specification for many APIs (and in some case the only spec).
>>>> 
>>>> Best
>>>> Lance
>>>> 
>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>>>> Oracle Java Engineering
>>>> 1 Network Drive
>>>> Burlington, MA 01803
>>>> Lance.Andersen at oracle.com
>>>> 
>>>> 
>>> 
>> 

-------------- next part --------------

Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com
-------------- next part --------------
An embedded message was scrubbed...
From: David Holmes 
Subject: Re: Request for Review : CR#8004015 : Add interface extends and	defaults for basic functional interfaces
Date: Thu, 29 Nov 2012 15:50:57 +1000
Size: 8211
URL: 

From lowasser at google.com  Thu Dec 13 23:36:41 2012
From: lowasser at google.com (Louis Wasserman)
Date: Thu, 13 Dec 2012 15:36:41 -0800
Subject: [PATCH] Sunbug 7131192: Optimize BigInteger.doubleValue(),
	floatValue()
In-Reply-To: 
References: 
	<4FFE758E.1000003@redhat.com>
	
	<4FFEA51B.4030107@redhat.com> <5000C965.7070101@oracle.com>
	
	
Message-ID: 

Hi,

I'm working at Google now, but I'd like to revive this patch as a
contribution from Google.  At the moment, what's mainly needed is review
for http://bugs.sun.com/view_bug.do?bug_id=7192954, the fix to
Float.parseFloat's rounding behavior, before we can go anywhere with the
patch to optimize BigInteger.floatValue() and doubleValue().

> Would anyone be able to review that patch so these can start moving
forward?

Thanks,

> Louis Wasserman
Java Core Libraries Team @ Google
guava-libraries.googlecode.com

---------- Forwarded message ----------
> From: Louis Wasserman 
> Date: Sat, Jul 14, 2012 at 5:32 AM
> Subject: Re: [PATCH] Sunbug 7131192: Optimize BigInteger.doubleValue(),
> floatValue()
> To: Joseph Darcy 
> Cc: Andrew Haley , core-libs-dev at openjdk.java.net
>
>
> Understood.  FYI, testing for this change revealed a bug in
> Float.parseFloat, a patch for which has been separately sent to this
> mailing list under the subject line "[PATCH] Sunbug 6358355: Rounding error
> in Float.parseFloat".  (As a result, the BigInteger patch may fail some of
> the provided tests at the moment, but that is truly because the reference
> implementation it's being tested against is faulty.)
>
> Louis Wasserman
> wasserman.louis at gmail.com
> http://profiles.google.com/wasserman.louis
>
>
> On Sat, Jul 14, 2012 at 2:20 AM, Joseph Darcy wrote:
>
>> Hello,
>>
>> Thanks for the patch Louis.
>>
>>
>> On 7/12/2012 3:21 AM, Andrew Haley wrote:
>>
>>> On 07/12/2012 10:32 AM, Louis Wasserman wrote:
>>>
>>>> It was attached to the previous message?  I don't know if this list
>>>> works
>>>> with attachments.  Alternately, the patch was attached here:
>>>> https://bugs.openjdk.java.net/**show_bug.cgi?id=100222
>>>>
>>>> I'm not sure what you mean by double-rounding bugs, though.  It's
>>>> not difficult to actually implement the HALF_EVEN rounding behavior
>>>> with bit twiddling.
>>>>
>>> Sure, as long as you've thought about it and done it carefully.  The
>>> bit twiddling is easy to do, and easy to get wrong.
>>>
>>> > From the supplied patch it looks like you've done a good job, but
>>> there was no way to tell without it.  I presume the listserv dropped
>>> it on the floor.
>>>
>>> Andrew.
>>>
>>
>> I've taken a quick look at the patch.  The concept for the change is
>> good; the current path of converting to float/double through a string is a
>> simple but very roundabout way to accomplish this task.
>>
>> Unfortunately, I'm saturated with the JDK bug migration [1] and will
>> continue to be saturated for at least several more weeks so I won't be able
>> to take a more detailed look at the patch for a while.  I suspect some more
>> directly test cases will be needed to test tricky rounding situations.
>>
>> Thanks,
>>
>> -Joe
>>
>> [1] https://blogs.oracle.com/**darcy/entry/moving_monarchs_**dragons
>>
>
>
>


-- 
Louis Wasserman


From leonid.arbouzov at oracle.com  Thu Dec 13 23:41:24 2012
From: leonid.arbouzov at oracle.com (Leonid Arbuzov)
Date: Thu, 13 Dec 2012 15:41:24 -0800
Subject: signatures that are recorded for default methods
In-Reply-To: <46D348C4-E38A-418E-A1D4-C789B038F078@oracle.com>
References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com>
	<50CA2B58.5030103@oracle.com> <50CA4320.40408@oracle.com>
	<50CA61DA.7050205@oracle.com>
	<46D348C4-E38A-418E-A1D4-C789B038F078@oracle.com>
Message-ID: <50CA67A4.2040608@oracle.com>


If those extra statements are normative they can be checked by 
conformance tests,
if not normative, those can be checked by implementation-specific unit 
tests.
Specification should be clear what is normative and what is not.
Tagging normative requirements in API specs (and in other specs too!)
would be certainly helpful.

Thanks,
-leonid


On 12/13/2012 3:30 PM, Lance Andersen - Oracle wrote:
> On Dec 13, 2012, at 6:16 PM, Leonid Arbuzov wrote:
>
>> Good point, Joe.
>> Those extra assertions for default methods can be checked
>> by regular API tests separately from signature tests.
> I am not clear on this.  See the message attached from David which ask a similar question (from the attached email):
> -------------------
> 2. It is not obvious to me that the JDK's choice for a default implementation has to be _the_ only possible implementation choice. In many/most cases there will be a very obvious choice, but that doesn't mean that all suppliers of OpenJDK classes have to be locked in to that choice.
> -------------------
>
>
> If everyone needs to implement the same default implementation then great the JCK/TCK can test it and IMHO we should have a javadoc tag for this.
>
> If everyone is free to choose what the default behavior is, then we cannot test it.
>
> So has there been a decision WRT the requirements for default methods?
>
>
> Best
> Lance
>> Thanks,
>> -leonid
>>
>> On 12/13/2012 1:05 PM, Joe Darcy wrote:
>>> Hello,
>>>
>>> As with concrete methods on abstract classes, I would expect the specifications of the default methods to often contain text akin to "This default implementation does x, y, and z" since if the method is to be called by subtypes, the self-use patterns in the default method need to be known.
>>>
>>> Cheers,
>>>
>>> -Joe
>>>
>>> On 12/13/2012 11:24 AM, Leonid Arbouzov wrote:
>>>> Hello Lance,
>>>>
>>>> My understanding would be that the signature test
>>>> should check that interface method is marked as default method
>>>> but do not track the code in its default body
>>>> (assuming that the body is not a part of a spec - API javadoc).
>>>>
>>>> (I've confirmed that with the signature test developer)
>>>>
>>>> Thanks,
>>>> -leonid
>>>>
>>>> On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote:
>>>>> Folks,
>>>>>
>>>>> Will the signatures for interfaces that are recorded by the TCKs for interfaces record the fact that a method includes a default method? or will it just record the method definition?
>>>>>
>>>>> I am assuming it will, but I know there has been discussion that a implementor could choose a different default implementation on one of the recent threads that was up for review.
>>>>>
>>>>> I am still trying to understand what our guidelines are, if any for documenting the behavior of the supplied default methods given the javadocs are part of the specification for many APIs (and in some case the only spec).
>>>>>
>>>>> Best
>>>>> Lance
>>>>>
>>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>>>>> Oracle Java Engineering
>>>>> 1 Network Drive
>>>>> Burlington, MA 01803
>>>>> Lance.Andersen at oracle.com
>>>>>
>>>>>
>
>
> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
> Oracle Java Engineering
> 1 Network Drive
> Burlington, MA 01803
> Lance.Andersen at oracle.com


From Lance.Andersen at oracle.com  Thu Dec 13 23:54:52 2012
From: Lance.Andersen at oracle.com (Lance Andersen)
Date: Thu, 13 Dec 2012 18:54:52 -0500
Subject: RFR (trivial): 8003632 HPROF class file version
	java.lang.RuntimeException errors
In-Reply-To: <50CA6503.8050104@oracle.com>
References: <50CA6503.8050104@oracle.com>
Message-ID: <3F6E15BA-BB9C-4CFD-8BE4-E29EC942FC0C@oracle.com>

+1

--

Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com

Sent from my iPhone

On Dec 13, 2012, at 6:30 PM, David Holmes  wrote:

> Trivial update of max classfile version to 52.
> 
> http://cr.openjdk.java.net/~dholmes/8003632/webrev/
> 
> Pushing through tl/jdk
> 
> Thanks,
> David


From jonathan.gibbons at oracle.com  Fri Dec 14 00:06:57 2012
From: jonathan.gibbons at oracle.com (Jonathan Gibbons)
Date: Thu, 13 Dec 2012 16:06:57 -0800
Subject: Review request: 8003562: Provide a command-line tool to find
	static dependencies
In-Reply-To: <50C5B9B2.2050705@oracle.com>
References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com>
	<50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com>
Message-ID: <50CA6DA1.1070004@oracle.com>

Mandy,

Mostly good -- and nice to see Dependencies getting the full tool treatment.

-- Jon


Archive.java:128
non-localized text: "not found"

ClassFileReader.java:74, ditto similar code in JarFileReader
Will not work for inner classes.

ClassFileReader.java:various
Langtools is (for a while longer) still using -source 6. This is to 
allow NetBeans to build and use langtools. I guess the code here is OK 
as long as NB don't try and build all of langtools.

JDepsTask:111
Did you mean --summary?
If you're wanting to emulate the GNU-style --options, these options 
normally use =, as in --name=value, so you might want to update 
handleOption.

PlatformClassPath
The API you are looking for is now available in the profiles forest, in 
langtools/src/classes/com/sun/tools/javac/sym

-- Jon

On 12/10/2012 02:30 AM, Erik Joelsson wrote:
> Looks good.
>
> /Erik
>
> On 2012-12-07 22:55, Mandy Chung wrote:
>> This is the updated webrev. It includes Erik's makefile changes and
>> small change - be consistent with javap, jdeps can take classnames as
>> the input argument or wildcard "*" to analyze all class files that
>> replaces the "-all" option.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.03/
>>
>> Mandy
>>
>> On 12/5/12 5:36 PM, Mandy Chung wrote:
>>> This review request (add a new jdeps tool in the JDK) include 
>>> changes in
>>> langtools and the jdk build.  I would need reviewers from the langtools
>>> and the build-infra team.
>>>
>>> Webrev for review:
>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/langtools-webrev.02/
>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/jdk-webrev.02/
>>>
>>> The jdeps source is in the langtools repo.  The change in the jdk 
>>> repo is
>>> to add the new jdeps executable.  I made change in the old and new 
>>> build
>>> for the addition of this new jdeps tool.  I discussed with Jon 
>>> whether I
>>> should modify langtools/make/build.xml to add a new jdeps target. Since
>>> the old build will be replaced by the new build soon, I simply add
>>> com/sun/tools/jdeps as part of javap.includes.
>>>
>>> Alan,
>>>
>>> The -d option is kept as a hidden option and use as implementation. We
>>> can remove it when it's determined not useful in the future. I also
>>> rename -v:summary to -summary.
>>>
>>> Thanks
>>> Mandy
>>>
>>> ----------------------------
>>>
>>> $ jdep -h
>>> Usage: jdeps  
>>> where possible options include:
>>>   -version                 Version information
>>>   -classpath         Specify where to find class files
>>>   -summary                 Print dependency summary only
>>>   -v:class                 Print class-level dependencies
>>>   -v:package               Print package-level dependencies
>>>   -p         Restrict analysis to classes in this package
>>>                            (may be given multiple times)
>>>   -e                Restrict analysis to packages matching 
>>> pattern
>>>                            (-p and -e are exclusive)
>>>   -P  --profile            Show profile or the file containing a 
>>> package
>>>   -R  --recursive          Traverse all dependencies recursively
>>>   -all                     Process all classes specified in -classpath
>>>
>>> $ jdep Notepad.jar Ensemble.jar
>>> Notepad.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar
>>>  (Notepad.jar)
>>>       -> java.awt
>>>       -> java.awt.event
>>>       -> java.beans
>>>       -> java.io
>>>       -> java.lang
>>>       -> java.net
>>>       -> java.util
>>>       -> java.util.logging
>>>       -> javax.swing
>>>       -> javax.swing.border
>>>       -> javax.swing.event
>>>       -> javax.swing.text
>>>       -> javax.swing.tree
>>>       -> javax.swing.undo
>>>
>>> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\jfxrt.jar
>>> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar
>>>    com.javafx.main (Ensemble.jar)
>>>       -> java.applet
>>>       -> java.awt
>>>       -> java.awt.event
>>>       -> java.io
>>>       -> java.lang
>>>       -> java.lang.reflect
>>>       -> java.net
>>>       -> java.security
>>>       -> java.util
>>>       -> java.util.jar
>>>       -> javax.swing
>>>       -> sun.misc                                 JDK internal API 
>>> (rt.jar)
>>



From akhil.arora at oracle.com  Fri Dec 14 01:24:35 2012
From: akhil.arora at oracle.com (Akhil Arora)
Date: Thu, 13 Dec 2012 17:24:35 -0800
Subject: RFR: 8005051: default methods for Iterator
Message-ID: <50CA7FD3.5020701@oracle.com>

As part of the library lambdafication, this patch adds a forEach default 
method to Iterator, and converts remove() into a default method so that 
implementations of Iterator no longer have to override remove if they 
desire the default behavior, which is to throw an 
UnsupportedOperationException.

http://cr.openjdk.java.net/~akhil/8005051.0/webrev/

The above patch requires a small patch to an internal class which 
happens to implement both Iterable and Iterator. Now both Iterable and 
Iterator supply a default forEach method, so the compiler balks. One 
minimally intrusive solution is for this class to override both defaults 
and provide its own version of forEach.

http://cr.openjdk.java.net/~akhil/8005053.0/webrev/

Please review
Thanks


From jonathan.gibbons at oracle.com  Fri Dec 14 01:50:14 2012
From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com)
Date: Fri, 14 Dec 2012 01:50:14 +0000
Subject: hg: jdk8/tl/langtools: 8001114: Container annotation is not checked
	for semantic correctness
Message-ID: <20121214015018.AA5C947136@hg.openjdk.java.net>

Changeset: 376d6c1b49e5
Author:    jfranck
Date:      2012-12-03 11:16 +0100
URL:       http://hg.openjdk.java.net/jdk8/tl/langtools/rev/376d6c1b49e5

8001114: Container annotation is not checked for semantic correctness
Reviewed-by: jjg

! src/share/classes/com/sun/tools/javac/code/Annotations.java
! src/share/classes/com/sun/tools/javac/comp/Annotate.java
! src/share/classes/com/sun/tools/javac/comp/Check.java
! src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
! src/share/classes/com/sun/tools/javac/resources/compiler.properties
! test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.java
! test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.out
! test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.java
! test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.out
! test/tools/javac/annotations/repeatingAnnotations/NoRepeatableAnno.out
+ test/tools/javac/annotations/repeatingAnnotations/RepeatingTargetNotAllowed.java
+ test/tools/javac/annotations/repeatingAnnotations/RepeatingTargetNotAllowed.out
! test/tools/javac/diags/examples/ContainedByNonDefault.java
+ test/tools/javac/diags/examples/InvalidDuplicateAnnotation.java



From mandy.chung at oracle.com  Fri Dec 14 02:03:59 2012
From: mandy.chung at oracle.com (Mandy Chung)
Date: Thu, 13 Dec 2012 18:03:59 -0800
Subject: RFR (trivial): 8003632 HPROF class file version
	java.lang.RuntimeException errors
In-Reply-To: <50CA6503.8050104@oracle.com>
References: <50CA6503.8050104@oracle.com>
Message-ID: <50CA890F.7080101@oracle.com>

Looks good to me.

I didn't know about this file and so I was interested in finding out 
more.   This file classfile_constants.h doesn't look like a header file 
exported from the hotspot repo (I couldn't find it).  It's used by hprof 
and the old verifier (jdk/src/share/native/common/check_code.h).   This 
is probably a good candidate for future clean up so that we don't need 
to remember to fix this header file when we bump the classfile version 
number every time if feasible.  Anyway, David - your fix is good to go.

Mandy

On 12/13/2012 3:30 PM, David Holmes wrote:
> Trivial update of max classfile version to 52.
>
> http://cr.openjdk.java.net/~dholmes/8003632/webrev/
>
> Pushing through tl/jdk
>
> Thanks,
> David


From mandy.chung at oracle.com  Fri Dec 14 02:15:13 2012
From: mandy.chung at oracle.com (Mandy Chung)
Date: Thu, 13 Dec 2012 18:15:13 -0800
Subject: Review request: 8003562: Provide a command-line tool to find
	static dependencies
In-Reply-To: <50CA6DA1.1070004@oracle.com>
References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com>
	<50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com>
	<50CA6DA1.1070004@oracle.com>
Message-ID: <50CA8BB1.1030502@oracle.com>

On 12/13/2012 4:06 PM, Jonathan Gibbons wrote:
> Mandy,
>
> Mostly good -- and nice to see Dependencies getting the full tool 
> treatment.
>

Thanks for the review, Jon.

> -- Jon
>
>
> Archive.java:128
> non-localized text: "not found"
>

Oh I missed that - will fix it.

> ClassFileReader.java:74, ditto similar code in JarFileReader
> Will not work for inner classes.
>

That's right.  What's the best way handling inner classes besides retrying?

> ClassFileReader.java:various
> Langtools is (for a while longer) still using -source 6. This is to 
> allow NetBeans to build and use langtools. I guess the code here is OK 
> as long as NB don't try and build all of langtools.
>

We talked about this and I hope that some part of langtools could be 
built with -source 7 as they are not needed in the bootstrap phase.  I 
will fix it since it's close to integration.   That'll help when you use 
NB to open langtools repo; otherwise, NB will indicate the files with 
syntax error which is kind of annoying.


> JDepsTask:111
> Did you mean --summary?

Yes will fix it.

> If you're wanting to emulate the GNU-style --options, these options 
> normally use =, as in --name=value, so you might want to update 
> handleOption.
>

That's right - will fix it.

> PlatformClassPath
> The API you are looking for is now available in the profiles forest, 
> in langtools/src/classes/com/sun/tools/javac/sym

Good - I'll check that out and send out a new webrev.

Thanks
Mandy

>
> -- Jon
>
> On 12/10/2012 02:30 AM, Erik Joelsson wrote:
>> Looks good.
>>
>> /Erik
>>
>> On 2012-12-07 22:55, Mandy Chung wrote:
>>> This is the updated webrev. It includes Erik's makefile changes and
>>> small change - be consistent with javap, jdeps can take classnames as
>>> the input argument or wildcard "*" to analyze all class files that
>>> replaces the "-all" option.
>>>
>>> Webrev:
>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.03/
>>>
>>> Mandy
>>>
>>> On 12/5/12 5:36 PM, Mandy Chung wrote:
>>>> This review request (add a new jdeps tool in the JDK) include 
>>>> changes in
>>>> langtools and the jdk build.  I would need reviewers from the 
>>>> langtools
>>>> and the build-infra team.
>>>>
>>>> Webrev for review:
>>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/langtools-webrev.02/ 
>>>>
>>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/jdk-webrev.02/
>>>>
>>>> The jdeps source is in the langtools repo.  The change in the jdk 
>>>> repo is
>>>> to add the new jdeps executable.  I made change in the old and new 
>>>> build
>>>> for the addition of this new jdeps tool.  I discussed with Jon 
>>>> whether I
>>>> should modify langtools/make/build.xml to add a new jdeps target. 
>>>> Since
>>>> the old build will be replaced by the new build soon, I simply add
>>>> com/sun/tools/jdeps as part of javap.includes.
>>>>
>>>> Alan,
>>>>
>>>> The -d option is kept as a hidden option and use as implementation. We
>>>> can remove it when it's determined not useful in the future. I also
>>>> rename -v:summary to -summary.
>>>>
>>>> Thanks
>>>> Mandy
>>>>
>>>> ----------------------------
>>>>
>>>> $ jdep -h
>>>> Usage: jdeps  
>>>> where possible options include:
>>>>   -version                 Version information
>>>>   -classpath         Specify where to find class files
>>>>   -summary                 Print dependency summary only
>>>>   -v:class                 Print class-level dependencies
>>>>   -v:package               Print package-level dependencies
>>>>   -p         Restrict analysis to classes in this 
>>>> package
>>>>                            (may be given multiple times)
>>>>   -e                Restrict analysis to packages matching 
>>>> pattern
>>>>                            (-p and -e are exclusive)
>>>>   -P  --profile            Show profile or the file containing a 
>>>> package
>>>>   -R  --recursive          Traverse all dependencies recursively
>>>>   -all                     Process all classes specified in -classpath
>>>>
>>>> $ jdep Notepad.jar Ensemble.jar
>>>> Notepad.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar
>>>>  (Notepad.jar)
>>>>       -> java.awt
>>>>       -> java.awt.event
>>>>       -> java.beans
>>>>       -> java.io
>>>>       -> java.lang
>>>>       -> java.net
>>>>       -> java.util
>>>>       -> java.util.logging
>>>>       -> javax.swing
>>>>       -> javax.swing.border
>>>>       -> javax.swing.event
>>>>       -> javax.swing.text
>>>>       -> javax.swing.tree
>>>>       -> javax.swing.undo
>>>>
>>>> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\jfxrt.jar
>>>> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar
>>>>    com.javafx.main (Ensemble.jar)
>>>>       -> java.applet
>>>>       -> java.awt
>>>>       -> java.awt.event
>>>>       -> java.io
>>>>       -> java.lang
>>>>       -> java.lang.reflect
>>>>       -> java.net
>>>>       -> java.security
>>>>       -> java.util
>>>>       -> java.util.jar
>>>>       -> javax.swing
>>>>       -> sun.misc                                 JDK internal API 
>>>> (rt.jar)
>>>
>


From david.holmes at oracle.com  Fri Dec 14 02:19:03 2012
From: david.holmes at oracle.com (david.holmes at oracle.com)
Date: Fri, 14 Dec 2012 02:19:03 +0000
Subject: hg: jdk8/tl/jdk: 8003632: HPROF class file version
	java.lang.RuntimeException errors
Message-ID: <20121214021924.3C81647137@hg.openjdk.java.net>

Changeset: 8d7323a9d8ed
Author:    dholmes
Date:      2012-12-13 21:18 -0500
URL:       http://hg.openjdk.java.net/jdk8/tl/jdk/rev/8d7323a9d8ed

8003632: HPROF class file version java.lang.RuntimeException errors
Reviewed-by: mchung, lancea

! src/share/javavm/export/classfile_constants.h



From david.holmes at oracle.com  Fri Dec 14 02:27:47 2012
From: david.holmes at oracle.com (David Holmes)
Date: Fri, 14 Dec 2012 12:27:47 +1000
Subject: RFR (trivial): 8003632 HPROF class file version
	java.lang.RuntimeException errors
In-Reply-To: <50CA890F.7080101@oracle.com>
References: <50CA6503.8050104@oracle.com> <50CA890F.7080101@oracle.com>
Message-ID: <50CA8EA3.5@oracle.com>

On 14/12/2012 12:03 PM, Mandy Chung wrote:
> Looks good to me.

Thanks Mandy.

FYI tested with nsk/hprof suite

> I didn't know about this file and so I was interested in finding out
> more. This file classfile_constants.h doesn't look like a header file
> exported from the hotspot repo (I couldn't find it). It's used by hprof
> and the old verifier (jdk/src/share/native/common/check_code.h). This is
> probably a good candidate for future clean up so that we don't need to
> remember to fix this header file when we bump the classfile version
> number every time if feasible. Anyway, David - your fix is good to go.

Yes definitely a candidate for clean up.

FYI this was added here under:

  6855180: Fix classfile version check in java_crw_demo

Previously the version number was hard-wired into

jdk/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c

Cheers,
David

> Mandy
>
> On 12/13/2012 3:30 PM, David Holmes wrote:
>> Trivial update of max classfile version to 52.
>>
>> http://cr.openjdk.java.net/~dholmes/8003632/webrev/
>>
>> Pushing through tl/jdk
>>
>> Thanks,
>> David


From kelly.ohair at oracle.com  Fri Dec 14 02:54:53 2012
From: kelly.ohair at oracle.com (Kelly O'Hair)
Date: Thu, 13 Dec 2012 18:54:53 -0800
Subject: RFR (trivial): 8003632 HPROF class file version
	java.lang.RuntimeException errors
In-Reply-To: <50CA8EA3.5@oracle.com>
References: <50CA6503.8050104@oracle.com> <50CA890F.7080101@oracle.com>
	<50CA8EA3.5@oracle.com>
Message-ID: <65FB0317-453B-429D-9659-A81B0FB790C0@oracle.com>

This file was added by me, to the jdk repo, mostly for reading class files.
But as I recall (it was a while ago) the idea was that this file would describe the classfile format for the jdk being released.

As I recall, the hotspot sources never exported anything like this, certainly not something that could be used in C code.

-kto

On Dec 13, 2012, at 6:27 PM, David Holmes wrote:

> On 14/12/2012 12:03 PM, Mandy Chung wrote:
>> Looks good to me.
> 
> Thanks Mandy.
> 
> FYI tested with nsk/hprof suite
> 
>> I didn't know about this file and so I was interested in finding out
>> more. This file classfile_constants.h doesn't look like a header file
>> exported from the hotspot repo (I couldn't find it). It's used by hprof
>> and the old verifier (jdk/src/share/native/common/check_code.h). This is
>> probably a good candidate for future clean up so that we don't need to
>> remember to fix this header file when we bump the classfile version
>> number every time if feasible. Anyway, David - your fix is good to go.
> 
> Yes definitely a candidate for clean up.
> 
> FYI this was added here under:
> 
> 6855180: Fix classfile version check in java_crw_demo
> 
> Previously the version number was hard-wired into
> 
> jdk/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c
> 
> Cheers,
> David
> 
>> Mandy
>> 
>> On 12/13/2012 3:30 PM, David Holmes wrote:
>>> Trivial update of max classfile version to 52.
>>> 
>>> http://cr.openjdk.java.net/~dholmes/8003632/webrev/
>>> 
>>> Pushing through tl/jdk
>>> 
>>> Thanks,
>>> David



From david.holmes at oracle.com  Fri Dec 14 04:59:49 2012
From: david.holmes at oracle.com (David Holmes)
Date: Fri, 14 Dec 2012 14:59:49 +1000
Subject: ReflectionData space optimization in java.lang.Class (JEP-149)
In-Reply-To: <50C9C997.10900@gmail.com>
References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com>
	<23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com>
	<5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com>
	<5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com>
	<50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com>
	<509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com>
	<50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com>
	<50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com>
	<50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com>
	
	<50C8793F.1050205@gmail.com> <50C90C35.7020000@oracle.com>
	<50C9AA46.5030401@gmail.com> <50C9B1F0.5080808@oracle.com>
	<50C9C997.10900@gmail.com>
Message-ID: <50CAB245.6010004@oracle.com>

Hi Peter,

On 13/12/2012 10:27 PM, Peter Levart wrote:
> On 12/13/2012 11:46 AM, David Holmes wrote:



>>> I also found code-paths that evaluated reflectionData() method more than
>>> once for each external call. It's the methods:
>>>
>>> private Field[] privateGetDeclaredFields(boolean publicOnly)
>>>
>>> and
>>>
>>> private Method[] privateGetDeclaredMethods(boolean publicOnly)
>>>
>>> which are called from:
>>>
>>> private Field[] privateGetPublicFields(Set>
>>> traversedInterfaces)
>>>
>>> and
>>>
>>> private Method[] privateGetPublicMethods()
>>>
>>> respectively. I therefore introduced overloaded variants of the former
>>> methods taking a ReflectionData parameter like the following:
>>>
>>> private Field[] privateGetDeclaredFields(boolean publicOnly) {
>>> return privateGetDeclaredFields(publicOnly, reflectionData());
>>> }
>>> // A variant called from methods that already obtained ReflectionData
>>> instance
>>> private Field[] privateGetDeclaredFields(boolean publicOnly,
>>> ReflectionData rd) {
>>> ...
>>>
>>> the same for privateGetDeclaredMethods. This is not for performance
>>> reasons (though it might help) but for correctness. Each external call
>>> should be a separate "transaction" and should work on the same
>>> ReflectionData instance. The "transaction" is only guaranteed on the
>>> level of a particular java.lang.Class instance though. Some methods also
>>> invoke other Class instances (to gather inherited public methods /
>>> fields) and those invocations might be separate transactions in the face
>>> of concurrent class re-definitions. But we are not going to implement a
>>> database here, are we?
>>
>> Sorry I don't understand the problem you are seeing here. If we find a
>> cached public fields, for example, we will return it. Else we start
>> the process of calculating anew. If someone else manages to fill in
>> the cache then we will get it when we call privateGetDeclaredFields.
>> The results are expected to be idempotent so I don't see what the
>> problem is.
>>
> It's true, yes. For the outside caller there is no observable
> difference. It can only happen that we retrieve declaredFields from a
> newer snapshot (say v.2) of ReflectionData and then compute publicFields
> and install them into an older ReflectionData instance v.1 which is
> already obsolete. But for the outside observer there's no difference.
>  From performance standpoint, the additional call to reflectionData()
> that we save is on the slow-path so it's not worth it.

Okay - so I'll ignore this :)

> The split of reflectionData() into two methods does have an impact
> though. FWIW my micro-benchmark shows that without the split, only the
> following public method is observed to be faster then in the original
> JDK8 code:
>
> - getFields - 4x
>
> With the split of reflectionData() but without these unneeded overloaded
> privateGetDeclaredFields methods, the following methods are faster:
>
> - getMethods - 1.7x (1, 2 threads) ... 1x (4...32 threads)
> - getFields - 4x
> - getDeclaredConstructor - 6x ... 11x
> - getDeclaredMethod - 3x
>
> But for performance tests that you already initiated, it is important to
> note that original patch is good enough since it appears that no public
> method is any slower than in the original JDK8 code.
>
> Speaking of that, I don't know much about the constraints of the JIT
> compiler, but it seems from the results above, that it can in-line
> multiple levels of method calls and that the total size of the methods
> matter. If this is true then it might be possible to split several
> private methods in java.lang.Class into pairs of short fast-path and
> longer slow-path. Is this worth the maintenance cost?

Method size certainly does affect inlining. Generally however we would 
only refactor this way if we find a bottleneck that needs to be broken - 
splitting methods adds additional meta-data overhead etc.

As you've already done the investigation here I think the split is a 
reasonable one to make. But I wonder in general applications how often 
we'll even end up compiling this method.

Thanks,
David

> Regards, Peter
>
>> Thanks,
>> David
>> ------
>>
>>> I prepared some micro benchmarks for individual public methods. Here're
>>> the results:
>>>
>>> https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/reflection_data_benchmark_results_i7-2600K.txt
>>>
>>>
>>> they indicate no noticeable performance decreases. Some methods are in
>>> fact faster (more in-linable?):
>>>
>>> - getFields - 4x
>>> - getDeclaredConstructor - 4x ... 10x
>>> - getDeclaredMethod - 3x
>>>
>>> Here's the code for micro-benchmarks:
>>>
>>> https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/src/test/ReflectionDataTest.java
>>>
>>>
>>>
>>> Regards, Peter
>>>
>>>
>>> On 12/12/2012 11:59 PM, Mandy Chung wrote:
>>>> Hi Peter,
>>>>
>>>> On 12/12/12 4:31 AM, Peter Levart wrote:
>>>>> Hi all,
>>>>>
>>>>> Ok, no problem. So here's a patch that summarizes what I did in the
>>>>> previous patch, but only for reflective fields (Field[], Method[],
>>>>> Constructor[]) not including annotations:
>>>>>
>>>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev/index.html
>>>>>
>>>>
>>>> Finally able to make time to review this patch. It's good work. While
>>>> it's good to see the synchronization issue with annotations be fixed,
>>>> separating the cache for reflection and annotation helps. As David
>>>> replied, he will take your patch and run with it for JEP-149.
>>>>
>>>> The change looks good. Nit: there are several long lines
>>>> L2235,2244,2245,2249,2269 etc that should be broken into separate
>>>> lines. The remaining open question is the performance difference in
>>>> the reflectionData() method and how well it will be jit'ed. In the
>>>> common case, there is no class redefinition where
>>>> classCachesOnClassRedefinition() is essentially like an nop. I believe
>>>> David will look at the footprint and performance numbers as he has
>>>> initiated the performance testing (need to do it with this new patch).
>>>>
>>>> Thanks
>>>> Mandy
>>>>
>>>>> The annotations part is unchanged semantically, but I had to:
>>>>>
>>>>> - modify private method clearCachesOnClassRedefinition to only
>>>>> include invalidation of annotations and declaredAnnotations fields. I
>>>>> also renamed it to clearAnnotationCachesOnClassRedefinition
>>>>> - renamed lastRedefinedCount to lastAnnotationsRedefinedCount and,
>>>>> since this field is now only accessed while holding a lock (from
>>>>> synchronized initAnnotationsIfNecessary), I removed the volatile
>>>>> keyword.
>>>>>
>>>>> That's it.
>>>>>
>>>>> While looking at this unchanged part of code some more, I see other
>>>>> races as well. For example: two concurrent accesses to annotations
>>>>> combined with redefinition of a class can result in NPE. Here's a
>>>>> serial execution:
>>>>>
>>>>> Thread 1:
>>>>> getAnnotation(annotationType);
>>>>> initAnnotationsIfNecessary();
>>>>>
>>>>> VM:
>>>>> classRedefinedCount++;
>>>>>
>>>>> Thread 2:
>>>>> getAnnotation(annotationType);
>>>>> initAnnotationsIfNecessary();
>>>>> clearAnnotationCachesOnClassRedefinition();
>>>>> annotations = null;
>>>>>
>>>>> Thread 1:
>>>>> return AnnotationSupport.getOneAnnotation(annotations,
>>>>> annotationClass);
>>>>> // 'annotations' field can be null
>>>>>
>>>>>
>>>>> So this needs to be fixed sooner or later.
>>>>>
>>>>> Joel!
>>>>>
>>>>> Are your JSR 308 canges involving java.lang.Class too?
>>>>>
>>>>> Regards, Peter
>>>>>
>>>>>
>>>>> On 12/12/2012 11:59 AM, Joel Borggr?n-Franck wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> First, thanks all of you that are involved in this!
>>>>>>
>>>>>> I agree with David here, lets split this up (for now) and do
>>>>>> reflective objects in the context of jep-149 and annotations
>>>>>> separately.
>>>>>>
>>>>>> As you may know there are even more annotation coming in with JSR
>>>>>> 308 annotations on type (use), so I want to complete that work first
>>>>>> and then do the effort of reducing contention and overhead for both
>>>>>> type and regular annotations and also fixing up the behaviour for
>>>>>> redefine/retransform class.
>>>>>>
>>>>>> One other point to consider is that some of the fields in
>>>>>> java/lang/reflect/ classes are known by the VM so not all changes in
>>>>>> Java-land are actually doable. Glancing over your patches very
>>>>>> quickly I don't think you have done anything to upset the VM, but
>>>>>> then I am not an expert in this area.
>>>>>>
>>>>>> Also, with the VM permgen changes we might have to rethink our
>>>>>> assumptions in order to reduce total overhead. For example as I
>>>>>> understand it previously we could just ship the same pointer into
>>>>>> permgen for the annotations arrays, now that isn't possible so we
>>>>>> create a new copy of the array for every Field/Method/Constructor
>>>>>> instance. Perhaps there is some clever way of eliminating those
>>>>>> copies.
>>>>>>
>>>>>> So while I think your patches generally makes sense, I think it is
>>>>>> prudent to delay this for annotations until all our new annotation
>>>>>> features are in.
>>>>>>
>>>>>> cheers
>>>>>> /Joel
>>>>>>
>>>>>> On Dec 10, 2012, at 7:18 AM, David Holmes 
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Peter,
>>>>>>>
>>>>>>> Sorry for the delay on this.
>>>>>>>
>>>>>>> Generally your VolatileData and my ReflectionHelper are doing a
>>>>>>> similar job. But I agree with your reasoning that all of the cached
>>>>>>> SoftReferences are likely to be cleared at once, and so a
>>>>>>> SoftReference to a helper object with direct references, is more
>>>>>>> effective than a direct reference to a helper object with
>>>>>>> SoftReferences. My initial stance with this was very conservative
>>>>>>> as the more change that is introduced the more uncertainty there is
>>>>>>> about the impact.
>>>>>>>
>>>>>>> I say the above primarily because I think, if I am to proceed with
>>>>>>> this, I will need to separate out the general reflection caching
>>>>>>> changes from the annotation changes. There are a number of reasons
>>>>>>> for this:
>>>>>>>
>>>>>>> First, I'm not at all familiar with the implementation of
>>>>>>> annotations at the VM or Java level, and the recent changes in this
>>>>>>> area just exacerbate my ignorance of the mechanics. So I don't feel
>>>>>>> qualified to evaluate that aspect.
>>>>>>>
>>>>>>> Second, the bulk of the reflection caching code is simplified by
>>>>>>> the fact that due to current constraints on class redefinition the
>>>>>>> caching is effectively idempotent for fields/methods/constructors.
>>>>>>> But that is not the case for annotations.
>>>>>>>
>>>>>>> Finally, the use of synchronization with the annotations method is
>>>>>>> perplexing me. I sent Joe a private email on this but I may as well
>>>>>>> raise it here - and I think you have alluded to this in your
>>>>>>> earlier emails as well: initAnnotationsIfNecessary() is a
>>>>>>> synchronized instance method but I can not find any other code in
>>>>>>> the VM that synchronizes on the Class object's monitor. So if this
>>>>>>> synchronization is trying to establish consistency in the face of
>>>>>>> class redefinition, I do not see where class redefinition is
>>>>>>> participating in the synchronization!
>>>>>>>
>>>>>>> So what I would like to do is take your basic VolatileData part of
>>>>>>> the patch and run with it for JEP-149 purposes, while separating
>>>>>>> the annotations issue so they can be dealt with by the experts in
>>>>>>> that particular area.
>>>>>>>
>>>>>>> I'm sorry it has taken so long to arrive at a fairly negative
>>>>>>> position, but I need someone else to take up the annotations
>>>>>>> gauntlet and run with it.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> David
>>>>>>>
>>>
>


From mike.duigou at oracle.com  Fri Dec 14 05:24:30 2012
From: mike.duigou at oracle.com (Mike Duigou)
Date: Thu, 13 Dec 2012 21:24:30 -0800
Subject: RFR : CR8004015 : Add parent interfaces and default methods to basic
	functional interfaces
Message-ID: <99DC2763-ED44-42CA-90F3-04AD07B2846D@oracle.com>

Hello all;

I have updated the webrev again for hopefully the last time:

http://cr.openjdk.java.net/~mduigou/8004015/3/webrev/
http://cr.openjdk.java.net/~mduigou/8004015/3/specdiff/overview-summary.html

The implementation now uses Primitive.primitiveValue() ie. Integer.integerValue() rather than a cast. Same bytecode but using the intrinsic function makes it more clear that result is either primitive or NPE and that CCE is not possible.

I have added @throws NPE for a number of the default methods. We won't be including @throws NPE in all cases where null is disallowed because when the @throws NPE is declared the API is required to throw NPE in that circumstance. So for cases where the NPE is "naturally" thrown or that aren't performance sensitive we will likely add @throws NPE declarations but for performance sensitive methods we won't be adding explicit null checks to match a @throws NPE specification. There's a tradeoff here in some cases. Please feel free to quibble about specific cases as they occur. :-)

Mike

From david.holmes at oracle.com  Fri Dec 14 06:18:06 2012
From: david.holmes at oracle.com (David Holmes)
Date: Fri, 14 Dec 2012 16:18:06 +1000
Subject: signatures that are recorded for default methods
In-Reply-To: <46D348C4-E38A-418E-A1D4-C789B038F078@oracle.com>
References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com>
	<50CA2B58.5030103@oracle.com> <50CA4320.40408@oracle.com>
	<50CA61DA.7050205@oracle.com>
	<46D348C4-E38A-418E-A1D4-C789B038F078@oracle.com>
Message-ID: <50CAC49E.2010904@oracle.com>

As a case in point Akhil just asked for this to be reviewed:

http://cr.openjdk.java.net/~akhil/8005051.0/webrev/src/share/classes/java/util/Iterator.java.frames.html

and there is no mention that the remove() implementation actually throws 
the exception, nor how forEach does its work.

David

On 14/12/2012 9:30 AM, Lance Andersen - Oracle wrote:
>
> On Dec 13, 2012, at 6:16 PM, Leonid Arbuzov wrote:
>
>> Good point, Joe.
>> Those extra assertions for default methods can be checked
>> by regular API tests separately from signature tests.
>
> I am not clear on this.  See the message attached from David which ask a similar question (from the attached email):
> -------------------
> 2. It is not obvious to me that the JDK's choice for a default implementation has to be _the_ only possible implementation choice. In many/most cases there will be a very obvious choice, but that doesn't mean that all suppliers of OpenJDK classes have to be locked in to that choice.
> -------------------
>
>
> If everyone needs to implement the same default implementation then great the JCK/TCK can test it and IMHO we should have a javadoc tag for this.
>
> If everyone is free to choose what the default behavior is, then we cannot test it.
>
> So has there been a decision WRT the requirements for default methods?
>
>
> Best
> Lance
>> Thanks,
>> -leonid
>>
>> On 12/13/2012 1:05 PM, Joe Darcy wrote:
>>> Hello,
>>>
>>> As with concrete methods on abstract classes, I would expect the specifications of the default methods to often contain text akin to "This default implementation does x, y, and z" since if the method is to be called by subtypes, the self-use patterns in the default method need to be known.
>>>
>>> Cheers,
>>>
>>> -Joe
>>>
>>> On 12/13/2012 11:24 AM, Leonid Arbouzov wrote:
>>>> Hello Lance,
>>>>
>>>> My understanding would be that the signature test
>>>> should check that interface method is marked as default method
>>>> but do not track the code in its default body
>>>> (assuming that the body is not a part of a spec - API javadoc).
>>>>
>>>> (I've confirmed that with the signature test developer)
>>>>
>>>> Thanks,
>>>> -leonid
>>>>
>>>> On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote:
>>>>> Folks,
>>>>>
>>>>> Will the signatures for interfaces that are recorded by the TCKs for interfaces record the fact that a method includes a default method? or will it just record the method definition?
>>>>>
>>>>> I am assuming it will, but I know there has been discussion that a implementor could choose a different default implementation on one of the recent threads that was up for review.
>>>>>
>>>>> I am still trying to understand what our guidelines are, if any for documenting the behavior of the supplied default methods given the javadocs are part of the specification for many APIs (and in some case the only spec).
>>>>>
>>>>> Best
>>>>> Lance
>>>>>
>>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>>>>> Oracle Java Engineering
>>>>> 1 Network Drive
>>>>> Burlington, MA 01803
>>>>> Lance.Andersen at oracle.com
>>>>>
>>>>>
>>>>
>>>
>
>
>
>
> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
> Oracle Java Engineering
> 1 Network Drive
> Burlington, MA 01803
> Lance.Andersen at oracle.com
>
>
>
>


From david.holmes at oracle.com  Fri Dec 14 06:21:14 2012
From: david.holmes at oracle.com (David Holmes)
Date: Fri, 14 Dec 2012 16:21:14 +1000
Subject: signatures that are recorded for default methods
In-Reply-To: 
References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com>
	<50CA2B58.5030103@oracle.com> <50CA4320.40408@oracle.com>
	<50CA61DA.7050205@oracle.com>
	<46D348C4-E38A-418E-A1D4-C789B038F078@oracle.com>
	
Message-ID: <50CAC55A.3010602@oracle.com>

Paul,

On 14/12/2012 9:46 AM, Paul Benedict wrote:
> Lance,
>
> Good questions. Someone with authority will surely answer, but here's
> my armchair opinion...
>
> If the Javadoc is to specify how the default method executes, than
> that would naturally infer all default implementations must have a
> stated contract. You can't document the default execution behavior in
> the public API and then let a provider switch the behavior. The two go
> hand-in-hand, imo.

I couldn't really make sense of that. :) The method has a contract. The 
"default implementation" has to honor that contract. The question is 
whether how the "default implementation" honors the method contract is 
required to be part of a second contract.

I hope that made sense :)

David
-----


> Paul
>
> On Thu, Dec 13, 2012 at 5:30 PM, Lance Andersen - Oracle
>   wrote:
>>
>> On Dec 13, 2012, at 6:16 PM, Leonid Arbuzov wrote:
>>
>>> Good point, Joe.
>>> Those extra assertions for default methods can be checked
>>> by regular API tests separately from signature tests.
>>
>> I am not clear on this.  See the message attached from David which ask a similar question (from the attached email):
>> -------------------
>> 2. It is not obvious to me that the JDK's choice for a default implementation has to be _the_ only possible implementation choice. In many/most cases there will be a very obvious choice, but that doesn't mean that all suppliers of OpenJDK classes have to be locked in to that choice.
>> -------------------
>>
>>
>> If everyone needs to implement the same default implementation then great the JCK/TCK can test it and IMHO we should have a javadoc tag for this.
>>
>> If everyone is free to choose what the default behavior is, then we cannot test it.
>>
>> So has there been a decision WRT the requirements for default methods?
>>
>>
>> Best
>> Lance
>>> Thanks,
>>> -leonid
>>>
>>> On 12/13/2012 1:05 PM, Joe Darcy wrote:
>>>> Hello,
>>>>
>>>> As with concrete methods on abstract classes, I would expect the specifications of the default methods to often contain text akin to "This default implementation does x, y, and z" since if the method is to be called by subtypes, the self-use patterns in the default method need to be known.
>>>>
>>>> Cheers,
>>>>
>>>> -Joe
>>>>
>>>> On 12/13/2012 11:24 AM, Leonid Arbouzov wrote:
>>>>> Hello Lance,
>>>>>
>>>>> My understanding would be that the signature test
>>>>> should check that interface method is marked as default method
>>>>> but do not track the code in its default body
>>>>> (assuming that the body is not a part of a spec - API javadoc).
>>>>>
>>>>> (I've confirmed that with the signature test developer)
>>>>>
>>>>> Thanks,
>>>>> -leonid
>>>>>
>>>>> On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote:
>>>>>> Folks,
>>>>>>
>>>>>> Will the signatures for interfaces that are recorded by the TCKs for interfaces record the fact that a method includes a default method? or will it just record the method definition?
>>>>>>
>>>>>> I am assuming it will, but I know there has been discussion that a implementor could choose a different default implementation on one of the recent threads that was up for review.
>>>>>>
>>>>>> I am still trying to understand what our guidelines are, if any for documenting the behavior of the supplied default methods given the javadocs are part of the specification for many APIs (and in some case the only spec).
>>>>>>
>>>>>> Best
>>>>>> Lance
>>>>>>
>>>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>>>>>> Oracle Java Engineering
>>>>>> 1 Network Drive
>>>>>> Burlington, MA 01803
>>>>>> Lance.Andersen at oracle.com
>>>>>>
>>>>>>
>>>>>
>>>>
>>
>>
>>
>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>> Oracle Java Engineering
>> 1 Network Drive
>> Burlington, MA 01803
>> Lance.Andersen at oracle.com
>>
>>
>>
>


From david.holmes at oracle.com  Fri Dec 14 06:28:41 2012
From: david.holmes at oracle.com (David Holmes)
Date: Fri, 14 Dec 2012 16:28:41 +1000
Subject: RFR : CR8004015 : Add parent interfaces and default methods to
	basic functional interfaces
In-Reply-To: <99DC2763-ED44-42CA-90F3-04AD07B2846D@oracle.com>
References: <99DC2763-ED44-42CA-90F3-04AD07B2846D@oracle.com>
Message-ID: <50CAC719.7090308@oracle.com>

HI Mike,

On 14/12/2012 3:24 PM, Mike Duigou wrote:
> Hello all;
>
> I have updated the webrev again for hopefully the last time:
>
> http://cr.openjdk.java.net/~mduigou/8004015/3/webrev/
> http://cr.openjdk.java.net/~mduigou/8004015/3/specdiff/overview-summary.html
>
> The implementation now uses Primitive.primitiveValue() ie. Integer.integerValue() rather than a cast. Same bytecode but using the intrinsic function makes it more clear that result is either primitive or NPE and that CCE is not possible.
>
> I have added @throws NPE for a number of the default methods. We won't be including @throws NPE in all cases where null is disallowed because when the @throws NPE is declared the API is required to throw NPE in that circumstance. So for cases where the NPE is "naturally" thrown or that aren't performance sensitive we will likely add @throws NPE declarations but for performance sensitive methods we won't be adding explicit null checks to match a @throws NPE specification. There's a tradeoff here in some cases. Please feel free to quibble about specific cases as they occur. :-)

That doesn't make sense to me. The throwing of the NPE is intended to be 
part of the specification not an implementation choice. Further @param 
foo non-null, is just as binding on implementations as @throws NPE if 
foo is null. ???

I think defining the NPE via the @param and @throws is a lose-lose 
situation:

!      * @param left {@inheritDoc}, must be non-null
!      * @param right {@inheritDoc}, must be non-null
!      * @return {@inheritDoc}, always non-null
!      * @throws NullPointerException if {@code left} or {@code right} 
is null

You only need one convention.

David
-----


> Mike


From mandy.chung at oracle.com  Fri Dec 14 07:22:11 2012
From: mandy.chung at oracle.com (Mandy Chung)
Date: Thu, 13 Dec 2012 23:22:11 -0800
Subject: Review request: 8003562: Provide a command-line tool to find
	static dependencies
In-Reply-To: <50CA8BB1.1030502@oracle.com>
References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com>
	<50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com>
	<50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com>
Message-ID: <50CAD3A3.5040300@oracle.com>

Updated webrev:
    http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.04/

The binary name of an inner class has a '$' and so 
ClassFileReader.java:74 should do it.  Once the jdeps change is pulled 
down to the profiles forest, I may make the change there to use the API 
as javac uses.

thanks
Mandy

On 12/13/2012 6:15 PM, Mandy Chung wrote:
> On 12/13/2012 4:06 PM, Jonathan Gibbons wrote:
>> Mandy,
>>
>> Mostly good -- and nice to see Dependencies getting the full tool 
>> treatment.
>>
>
> Thanks for the review, Jon.
>
>> -- Jon
>>
>>
>> Archive.java:128
>> non-localized text: "not found"
>>
>
> Oh I missed that - will fix it.
>
>> ClassFileReader.java:74, ditto similar code in JarFileReader
>> Will not work for inner classes.
>>
>
> That's right.  What's the best way handling inner classes besides 
> retrying?
>
>> ClassFileReader.java:various
>> Langtools is (for a while longer) still using -source 6. This is to 
>> allow NetBeans to build and use langtools. I guess the code here is 
>> OK as long as NB don't try and build all of langtools.
>>
>
> We talked about this and I hope that some part of langtools could be 
> built with -source 7 as they are not needed in the bootstrap phase.  I 
> will fix it since it's close to integration.   That'll help when you 
> use NB to open langtools repo; otherwise, NB will indicate the files 
> with syntax error which is kind of annoying.
>
>
>> JDepsTask:111
>> Did you mean --summary?
>
> Yes will fix it.
>
>> If you're wanting to emulate the GNU-style --options, these options 
>> normally use =, as in --name=value, so you might want to update 
>> handleOption.
>>
>
> That's right - will fix it.
>
>> PlatformClassPath
>> The API you are looking for is now available in the profiles forest, 
>> in langtools/src/classes/com/sun/tools/javac/sym
>
> Good - I'll check that out and send out a new webrev.
>
> Thanks
> Mandy
>
>>
>> -- Jon
>>
>> On 12/10/2012 02:30 AM, Erik Joelsson wrote:
>>> Looks good.
>>>
>>> /Erik
>>>
>>> On 2012-12-07 22:55, Mandy Chung wrote:
>>>> This is the updated webrev. It includes Erik's makefile changes and
>>>> small change - be consistent with javap, jdeps can take classnames as
>>>> the input argument or wildcard "*" to analyze all class files that
>>>> replaces the "-all" option.
>>>>
>>>> Webrev:
>>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.03/
>>>>
>>>> Mandy
>>>>
>>>> On 12/5/12 5:36 PM, Mandy Chung wrote:
>>>>> This review request (add a new jdeps tool in the JDK) include 
>>>>> changes in
>>>>> langtools and the jdk build.  I would need reviewers from the 
>>>>> langtools
>>>>> and the build-infra team.
>>>>>
>>>>> Webrev for review:
>>>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/langtools-webrev.02/ 
>>>>>
>>>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/jdk-webrev.02/
>>>>>
>>>>> The jdeps source is in the langtools repo.  The change in the jdk 
>>>>> repo is
>>>>> to add the new jdeps executable.  I made change in the old and new 
>>>>> build
>>>>> for the addition of this new jdeps tool.  I discussed with Jon 
>>>>> whether I
>>>>> should modify langtools/make/build.xml to add a new jdeps target. 
>>>>> Since
>>>>> the old build will be replaced by the new build soon, I simply add
>>>>> com/sun/tools/jdeps as part of javap.includes.
>>>>>
>>>>> Alan,
>>>>>
>>>>> The -d option is kept as a hidden option and use as 
>>>>> implementation. We
>>>>> can remove it when it's determined not useful in the future. I also
>>>>> rename -v:summary to -summary.
>>>>>
>>>>> Thanks
>>>>> Mandy
>>>>>
>>>>> ----------------------------
>>>>>
>>>>> $ jdep -h
>>>>> Usage: jdeps  
>>>>> where possible options include:
>>>>>   -version                 Version information
>>>>>   -classpath         Specify where to find class files
>>>>>   -summary                 Print dependency summary only
>>>>>   -v:class                 Print class-level dependencies
>>>>>   -v:package               Print package-level dependencies
>>>>>   -p         Restrict analysis to classes in this 
>>>>> package
>>>>>                            (may be given multiple times)
>>>>>   -e                Restrict analysis to packages matching 
>>>>> pattern
>>>>>                            (-p and -e are exclusive)
>>>>>   -P  --profile            Show profile or the file containing a 
>>>>> package
>>>>>   -R  --recursive          Traverse all dependencies recursively
>>>>>   -all                     Process all classes specified in 
>>>>> -classpath
>>>>>
>>>>> $ jdep Notepad.jar Ensemble.jar
>>>>> Notepad.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar
>>>>>  (Notepad.jar)
>>>>>       -> java.awt
>>>>>       -> java.awt.event
>>>>>       -> java.beans
>>>>>       -> java.io
>>>>>       -> java.lang
>>>>>       -> java.net
>>>>>       -> java.util
>>>>>       -> java.util.logging
>>>>>       -> javax.swing
>>>>>       -> javax.swing.border
>>>>>       -> javax.swing.event
>>>>>       -> javax.swing.text
>>>>>       -> javax.swing.tree
>>>>>       -> javax.swing.undo
>>>>>
>>>>> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\jfxrt.jar
>>>>> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar
>>>>>    com.javafx.main (Ensemble.jar)
>>>>>       -> java.applet
>>>>>       -> java.awt
>>>>>       -> java.awt.event
>>>>>       -> java.io
>>>>>       -> java.lang
>>>>>       -> java.lang.reflect
>>>>>       -> java.net
>>>>>       -> java.security
>>>>>       -> java.util
>>>>>       -> java.util.jar
>>>>>       -> javax.swing
>>>>>       -> sun.misc                                 JDK internal API 
>>>>> (rt.jar)
>>>>
>>


From peter.levart at gmail.com  Fri Dec 14 09:06:58 2012
From: peter.levart at gmail.com (Peter Levart)
Date: Fri, 14 Dec 2012 10:06:58 +0100
Subject: signatures that are recorded for default methods
In-Reply-To: <50CAC55A.3010602@oracle.com>
References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com>
	<50CA2B58.5030103@oracle.com> <50CA4320.40408@oracle.com>
	<50CA61DA.7050205@oracle.com>
	<46D348C4-E38A-418E-A1D4-C789B038F078@oracle.com>
	
	<50CAC55A.3010602@oracle.com>
Message-ID: <50CAEC32.6060802@gmail.com>

On 12/14/2012 07:21 AM, David Holmes wrote:
> Paul,
>
> On 14/12/2012 9:46 AM, Paul Benedict wrote:
>> Lance,
>>
>> Good questions. Someone with authority will surely answer, but here's
>> my armchair opinion...
>>
>> If the Javadoc is to specify how the default method executes, than
>> that would naturally infer all default implementations must have a
>> stated contract. You can't document the default execution behavior in
>> the public API and then let a provider switch the behavior. The two go
>> hand-in-hand, imo.
>
> I couldn't really make sense of that. :) The method has a contract. 
> The "default implementation" has to honor that contract. The question 
> is whether how the "default implementation" honors the method contract 
> is required to be part of a second contract.
>
> I hope that made sense :)
I think that the answer is obvious. A default method provider has only 
as much freedom in choosing the implementation of the default method 
that particular implementation differences among various providers are 
not observable by the "sane" usage of the API. The only soft aspect 
might be performance. Any other behavioural difference should not be 
allowed. Otherwise there will be in-compatibilities among platform 
providers.

For example, the default Iterator.remove() is implemented in Oracle's 
JDK as always throwing UnsupportedOperationException. The TCK should 
test for that and the Javadoc should specify that.

As Joe said, default interface methods are no different than any other 
overridable methods. They have a contract and behaviour. The behaviour 
can be changed (overriden) within constraints defined by contract, but 
the behaviour itself should also be specified and followed by different 
providers.

Just my 2 cents.

Regards, Peter

>
> David
> -----
>
>
>> Paul
>>
>> On Thu, Dec 13, 2012 at 5:30 PM, Lance Andersen - Oracle
>>   wrote:
>>>
>>> On Dec 13, 2012, at 6:16 PM, Leonid Arbuzov wrote:
>>>
>>>> Good point, Joe.
>>>> Those extra assertions for default methods can be checked
>>>> by regular API tests separately from signature tests.
>>>
>>> I am not clear on this.  See the message attached from David which 
>>> ask a similar question (from the attached email):
>>> -------------------
>>> 2. It is not obvious to me that the JDK's choice for a default 
>>> implementation has to be _the_ only possible implementation choice. 
>>> In many/most cases there will be a very obvious choice, but that 
>>> doesn't mean that all suppliers of OpenJDK classes have to be locked 
>>> in to that choice.
>>> -------------------
>>>
>>>
>>> If everyone needs to implement the same default implementation then 
>>> great the JCK/TCK can test it and IMHO we should have a javadoc tag 
>>> for this.
>>>
>>> If everyone is free to choose what the default behavior is, then we 
>>> cannot test it.
>>>
>>> So has there been a decision WRT the requirements for default methods?
>>>
>>>
>>> Best
>>> Lance
>>>> Thanks,
>>>> -leonid
>>>>
>>>> On 12/13/2012 1:05 PM, Joe Darcy wrote:
>>>>> Hello,
>>>>>
>>>>> As with concrete methods on abstract classes, I would expect the 
>>>>> specifications of the default methods to often contain text akin 
>>>>> to "This default implementation does x, y, and z" since if the 
>>>>> method is to be called by subtypes, the self-use patterns in the 
>>>>> default method need to be known.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> -Joe
>>>>>
>>>>> On 12/13/2012 11:24 AM, Leonid Arbouzov wrote:
>>>>>> Hello Lance,
>>>>>>
>>>>>> My understanding would be that the signature test
>>>>>> should check that interface method is marked as default method
>>>>>> but do not track the code in its default body
>>>>>> (assuming that the body is not a part of a spec - API javadoc).
>>>>>>
>>>>>> (I've confirmed that with the signature test developer)
>>>>>>
>>>>>> Thanks,
>>>>>> -leonid
>>>>>>
>>>>>> On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote:
>>>>>>> Folks,
>>>>>>>
>>>>>>> Will the signatures for interfaces that are recorded by the TCKs 
>>>>>>> for interfaces record the fact that a method includes a default 
>>>>>>> method? or will it just record the method definition?
>>>>>>>
>>>>>>> I am assuming it will, but I know there has been discussion that 
>>>>>>> a implementor could choose a different default implementation on 
>>>>>>> one of the recent threads that was up for review.
>>>>>>>
>>>>>>> I am still trying to understand what our guidelines are, if any 
>>>>>>> for documenting the behavior of the supplied default methods 
>>>>>>> given the javadocs are part of the specification for many APIs 
>>>>>>> (and in some case the only spec).
>>>>>>>
>>>>>>> Best
>>>>>>> Lance
>>>>>>>
>>>>>>> Lance Andersen| Principal Member of Technical Staff | 
>>>>>>> +1.781.442.2037
>>>>>>> Oracle Java Engineering
>>>>>>> 1 Network Drive
>>>>>>> Burlington, MA 01803
>>>>>>> Lance.Andersen at oracle.com
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>
>>>
>>>
>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>>> Oracle Java Engineering
>>> 1 Network Drive
>>> Burlington, MA 01803
>>> Lance.Andersen at oracle.com
>>>
>>>
>>>
>>



From peter.levart at gmail.com  Fri Dec 14 09:41:40 2012
From: peter.levart at gmail.com (Peter Levart)
Date: Fri, 14 Dec 2012 10:41:40 +0100
Subject: signatures that are recorded for default methods
In-Reply-To: <50CAEC32.6060802@gmail.com>
References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com>
	<50CA2B58.5030103@oracle.com> <50CA4320.40408@oracle.com>
	<50CA61DA.7050205@oracle.com>
	<46D348C4-E38A-418E-A1D4-C789B038F078@oracle.com>
	
	<50CAC55A.3010602@oracle.com> <50CAEC32.6060802@gmail.com>
Message-ID: <50CAF454.4040309@gmail.com>

On 12/14/2012 10:06 AM, Peter Levart wrote:
> On 12/14/2012 07:21 AM, David Holmes wrote:
>> Paul,
>>
>> On 14/12/2012 9:46 AM, Paul Benedict wrote:
>>> Lance,
>>>
>>> Good questions. Someone with authority will surely answer, but here's
>>> my armchair opinion...
>>>
>>> If the Javadoc is to specify how the default method executes, than
>>> that would naturally infer all default implementations must have a
>>> stated contract. You can't document the default execution behavior in
>>> the public API and then let a provider switch the behavior. The two go
>>> hand-in-hand, imo.
>>
>> I couldn't really make sense of that. :) The method has a contract. 
>> The "default implementation" has to honor that contract. The question 
>> is whether how the "default implementation" honors the method 
>> contract is required to be part of a second contract.
>>
>> I hope that made sense :)
> I think that the answer is obvious. A default method provider has only 
> as much freedom in choosing the implementation of the default method 
> that particular implementation differences among various providers are 
> not observable by the "sane" usage of the API. The only soft aspect 
> might be performance. Any other behavioural difference should not be 
> allowed. Otherwise there will be in-compatibilities among platform 
> providers.
>
> For example, the default Iterator.remove() is implemented in Oracle's 
> JDK as always throwing UnsupportedOperationException. The TCK should 
> test for that and the Javadoc should specify that.
Ok, I admit that in this particular case and other similar cases (where 
the default method does nothing useful), the specification could 
alternatively specify: "The default method behaviour is unspecified and 
useless. Don't call that method or make sure it is always overridden if 
you call it" - the TCK in that case doesn't test the behaviour of such 
method.

Peter
>
> As Joe said, default interface methods are no different than any other 
> overridable methods. They have a contract and behaviour. The behaviour 
> can be changed (overriden) within constraints defined by contract, but 
> the behaviour itself should also be specified and followed by 
> different providers.
>
> Just my 2 cents.
>
> Regards, Peter
>
>>
>> David
>> -----
>>
>>
>>> Paul
>>>
>>> On Thu, Dec 13, 2012 at 5:30 PM, Lance Andersen - Oracle
>>>   wrote:
>>>>
>>>> On Dec 13, 2012, at 6:16 PM, Leonid Arbuzov wrote:
>>>>
>>>>> Good point, Joe.
>>>>> Those extra assertions for default methods can be checked
>>>>> by regular API tests separately from signature tests.
>>>>
>>>> I am not clear on this.  See the message attached from David which 
>>>> ask a similar question (from the attached email):
>>>> -------------------
>>>> 2. It is not obvious to me that the JDK's choice for a default 
>>>> implementation has to be _the_ only possible implementation choice. 
>>>> In many/most cases there will be a very obvious choice, but that 
>>>> doesn't mean that all suppliers of OpenJDK classes have to be 
>>>> locked in to that choice.
>>>> -------------------
>>>>
>>>>
>>>> If everyone needs to implement the same default implementation then 
>>>> great the JCK/TCK can test it and IMHO we should have a javadoc tag 
>>>> for this.
>>>>
>>>> If everyone is free to choose what the default behavior is, then we 
>>>> cannot test it.
>>>>
>>>> So has there been a decision WRT the requirements for default methods?
>>>>
>>>>
>>>> Best
>>>> Lance
>>>>> Thanks,
>>>>> -leonid
>>>>>
>>>>> On 12/13/2012 1:05 PM, Joe Darcy wrote:
>>>>>> Hello,
>>>>>>
>>>>>> As with concrete methods on abstract classes, I would expect the 
>>>>>> specifications of the default methods to often contain text akin 
>>>>>> to "This default implementation does x, y, and z" since if the 
>>>>>> method is to be called by subtypes, the self-use patterns in the 
>>>>>> default method need to be known.
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> -Joe
>>>>>>
>>>>>> On 12/13/2012 11:24 AM, Leonid Arbouzov wrote:
>>>>>>> Hello Lance,
>>>>>>>
>>>>>>> My understanding would be that the signature test
>>>>>>> should check that interface method is marked as default method
>>>>>>> but do not track the code in its default body
>>>>>>> (assuming that the body is not a part of a spec - API javadoc).
>>>>>>>
>>>>>>> (I've confirmed that with the signature test developer)
>>>>>>>
>>>>>>> Thanks,
>>>>>>> -leonid
>>>>>>>
>>>>>>> On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote:
>>>>>>>> Folks,
>>>>>>>>
>>>>>>>> Will the signatures for interfaces that are recorded by the 
>>>>>>>> TCKs for interfaces record the fact that a method includes a 
>>>>>>>> default method? or will it just record the method definition?
>>>>>>>>
>>>>>>>> I am assuming it will, but I know there has been discussion 
>>>>>>>> that a implementor could choose a different default 
>>>>>>>> implementation on one of the recent threads that was up for 
>>>>>>>> review.
>>>>>>>>
>>>>>>>> I am still trying to understand what our guidelines are, if any 
>>>>>>>> for documenting the behavior of the supplied default methods 
>>>>>>>> given the javadocs are part of the specification for many APIs 
>>>>>>>> (and in some case the only spec).
>>>>>>>>
>>>>>>>> Best
>>>>>>>> Lance
>>>>>>>>
>>>>>>>> Lance Andersen| Principal Member of Technical Staff | 
>>>>>>>> +1.781.442.2037
>>>>>>>> Oracle Java Engineering
>>>>>>>> 1 Network Drive
>>>>>>>> Burlington, MA 01803
>>>>>>>> Lance.Andersen at oracle.com
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>>>
>>>>
>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>>>> Oracle Java Engineering
>>>> 1 Network Drive
>>>> Burlington, MA 01803
>>>> Lance.Andersen at oracle.com
>>>>
>>>>
>>>>
>>>
>



From chris.hegarty at oracle.com  Fri Dec 14 09:54:01 2012
From: chris.hegarty at oracle.com (Chris Hegarty)
Date: Fri, 14 Dec 2012 09:54:01 +0000
Subject: signatures that are recorded for default methods
In-Reply-To: <50CAF454.4040309@gmail.com>
References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com>
	<50CA2B58.5030103@oracle.com> <50CA4320.40408@oracle.com>
	<50CA61DA.7050205@oracle.com>
	<46D348C4-E38A-418E-A1D4-C789B038F078@oracle.com>
	
	<50CAC55A.3010602@oracle.com> <50CAEC32.6060802@gmail.com>
	<50CAF454.4040309@gmail.com>
Message-ID: <50CAF739.7080203@oracle.com>

On 14/12/2012 09:41, Peter Levart wrote:
> On 12/14/2012 10:06 AM, Peter Levart wrote:
>> On 12/14/2012 07:21 AM, David Holmes wrote:
>>> Paul,
>>>
>>> On 14/12/2012 9:46 AM, Paul Benedict wrote:
>>>> Lance,
>>>>
>>>> Good questions. Someone with authority will surely answer, but here's
>>>> my armchair opinion...
>>>>
>>>> If the Javadoc is to specify how the default method executes, than
>>>> that would naturally infer all default implementations must have a
>>>> stated contract. You can't document the default execution behavior in
>>>> the public API and then let a provider switch the behavior. The two go
>>>> hand-in-hand, imo.
>>>
>>> I couldn't really make sense of that. :) The method has a contract.
>>> The "default implementation" has to honor that contract. The question
>>> is whether how the "default implementation" honors the method
>>> contract is required to be part of a second contract.
>>>
>>> I hope that made sense :)
>> I think that the answer is obvious. A default method provider has only
>> as much freedom in choosing the implementation of the default method
>> that particular implementation differences among various providers are
>> not observable by the "sane" usage of the API. The only soft aspect
>> might be performance. Any other behavioural difference should not be
>> allowed. Otherwise there will be in-compatibilities among platform
>> providers.
>>
>> For example, the default Iterator.remove() is implemented in Oracle's
>> JDK as always throwing UnsupportedOperationException. The TCK should
>> test for that and the Javadoc should specify that.
> Ok, I admit that in this particular case and other similar cases (where
> the default method does nothing useful), the specification could
> alternatively specify: "The default method behaviour is unspecified and
> useless. Don't call that method or make sure it is always overridden if
> you call it" - the TCK in that case doesn't test the behaviour of such

And forever more ever concrete Iterator implementation, that does not 
support remove, will have to implement the remove method to throw UOE. I 
think this is a big loss.

-Chris.

> method.
>
> Peter
>>
>> As Joe said, default interface methods are no different than any other
>> overridable methods. They have a contract and behaviour. The behaviour
>> can be changed (overriden) within constraints defined by contract, but
>> the behaviour itself should also be specified and followed by
>> different providers.
>>
>> Just my 2 cents.
>>
>> Regards, Peter
>>
>>>
>>> David
>>> -----
>>>
>>>
>>>> Paul
>>>>
>>>> On Thu, Dec 13, 2012 at 5:30 PM, Lance Andersen - Oracle
>>>>  wrote:
>>>>>
>>>>> On Dec 13, 2012, at 6:16 PM, Leonid Arbuzov wrote:
>>>>>
>>>>>> Good point, Joe.
>>>>>> Those extra assertions for default methods can be checked
>>>>>> by regular API tests separately from signature tests.
>>>>>
>>>>> I am not clear on this. See the message attached from David which
>>>>> ask a similar question (from the attached email):
>>>>> -------------------
>>>>> 2. It is not obvious to me that the JDK's choice for a default
>>>>> implementation has to be _the_ only possible implementation choice.
>>>>> In many/most cases there will be a very obvious choice, but that
>>>>> doesn't mean that all suppliers of OpenJDK classes have to be
>>>>> locked in to that choice.
>>>>> -------------------
>>>>>
>>>>>
>>>>> If everyone needs to implement the same default implementation then
>>>>> great the JCK/TCK can test it and IMHO we should have a javadoc tag
>>>>> for this.
>>>>>
>>>>> If everyone is free to choose what the default behavior is, then we
>>>>> cannot test it.
>>>>>
>>>>> So has there been a decision WRT the requirements for default methods?
>>>>>
>>>>>
>>>>> Best
>>>>> Lance
>>>>>> Thanks,
>>>>>> -leonid
>>>>>>
>>>>>> On 12/13/2012 1:05 PM, Joe Darcy wrote:
>>>>>>> Hello,
>>>>>>>
>>>>>>> As with concrete methods on abstract classes, I would expect the
>>>>>>> specifications of the default methods to often contain text akin
>>>>>>> to "This default implementation does x, y, and z" since if the
>>>>>>> method is to be called by subtypes, the self-use patterns in the
>>>>>>> default method need to be known.
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>> -Joe
>>>>>>>
>>>>>>> On 12/13/2012 11:24 AM, Leonid Arbouzov wrote:
>>>>>>>> Hello Lance,
>>>>>>>>
>>>>>>>> My understanding would be that the signature test
>>>>>>>> should check that interface method is marked as default method
>>>>>>>> but do not track the code in its default body
>>>>>>>> (assuming that the body is not a part of a spec - API javadoc).
>>>>>>>>
>>>>>>>> (I've confirmed that with the signature test developer)
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> -leonid
>>>>>>>>
>>>>>>>> On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote:
>>>>>>>>> Folks,
>>>>>>>>>
>>>>>>>>> Will the signatures for interfaces that are recorded by the
>>>>>>>>> TCKs for interfaces record the fact that a method includes a
>>>>>>>>> default method? or will it just record the method definition?
>>>>>>>>>
>>>>>>>>> I am assuming it will, but I know there has been discussion
>>>>>>>>> that a implementor could choose a different default
>>>>>>>>> implementation on one of the recent threads that was up for
>>>>>>>>> review.
>>>>>>>>>
>>>>>>>>> I am still trying to understand what our guidelines are, if any
>>>>>>>>> for documenting the behavior of the supplied default methods
>>>>>>>>> given the javadocs are part of the specification for many APIs
>>>>>>>>> (and in some case the only spec).
>>>>>>>>>
>>>>>>>>> Best
>>>>>>>>> Lance
>>>>>>>>>
>>>>>>>>> Lance Andersen| Principal Member of Technical Staff |
>>>>>>>>> +1.781.442.2037
>>>>>>>>> Oracle Java Engineering
>>>>>>>>> 1 Network Drive
>>>>>>>>> Burlington, MA 01803
>>>>>>>>> Lance.Andersen at oracle.com
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>>>>> Oracle Java Engineering
>>>>> 1 Network Drive
>>>>> Burlington, MA 01803
>>>>> Lance.Andersen at oracle.com
>>>>>
>>>>>
>>>>>
>>>>
>>
>


From Ulf.Zibis at CoSoCo.de  Fri Dec 14 10:47:45 2012
From: Ulf.Zibis at CoSoCo.de (Ulf Zibis)
Date: Fri, 14 Dec 2012 11:47:45 +0100
Subject: Review request: 8003562: Provide a command-line tool to find
	static dependencies
In-Reply-To: <50CA8BB1.1030502@oracle.com>
References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com>
	<50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com>
	<50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com>
Message-ID: <50CB03D1.5030400@CoSoCo.de>

Am 14.12.2012 03:15, schrieb Mandy Chung:
>> JDepsTask:111
>> Did you mean --summary?
>
> Yes will fix it.

Why don't you remain consistent to all other existing java tools?
E.g. javac uses: -cp path or -classpath path
Double hyphen '--' is never used until today.

So better:
   -P  -profile            Show profile or the file containing a package
   -R  -recursive          Traverse all dependencies recursively

Anyway, if you prefer to stick at '--', then you should consistently use it for '--version', 
'--classpath', '--all'

-Ulf

>>>>>   -version                 Version information
>>>>>   -classpath         Specify where to find class files
>>>>>   -summary                 Print dependency summary only
>>>>>   -v:class                 Print class-level dependencies
>>>>>   -v:package               Print package-level dependencies
>>>>>   -p         Restrict analysis to classes in this package
>>>>>                            (may be given multiple times)
>>>>>   -e                Restrict analysis to packages matching pattern
>>>>>                            (-p and -e are exclusive)
>>>>>   -P  --profile            Show profile or the file containing a package
>>>>>   -R  --recursive          Traverse all dependencies recursively
>>>>>   -all                     Process all classes specified in -classpath
>>>>
>>
>



From forax at univ-mlv.fr  Fri Dec 14 10:54:51 2012
From: forax at univ-mlv.fr (Remi Forax)
Date: Fri, 14 Dec 2012 11:54:51 +0100
Subject: RFR: 8005051: default methods for Iterator
In-Reply-To: <50CA7FD3.5020701@oracle.com>
References: <50CA7FD3.5020701@oracle.com>
Message-ID: <50CB057B.3070203@univ-mlv.fr>

Hi Akhil,

On 12/14/2012 02:24 AM, Akhil Arora wrote:
> As part of the library lambdafication, this patch adds a forEach default
> method to Iterator, and converts remove() into a default method so that
> implementations of Iterator no longer have to override remove if they
> desire the default behavior, which is to throw an
> UnsupportedOperationException.
>
> http://cr.openjdk.java.net/~akhil/8005051.0/webrev/
>
> The above patch requires a small patch to an internal class which
> happens to implement both Iterable and Iterator. Now both Iterable and
> Iterator supply a default forEach method, so the compiler balks. One
> minimally intrusive solution is for this class to override both defaults
> and provide its own version of forEach.
>
> http://cr.openjdk.java.net/~akhil/8005053.0/webrev/

The issue here is in the code of ASM wich is an external library 
imported in the JDK,
so not sure it's a good idea to patch it.

Moreover, goggling for "implement Iterable, Iterator" shows that this 
anti-pattern is used too frequently to not step back and see if a better 
solution is not possible.
https://encrypted.google.com/search?hl=en&q=%22implements+Iterable%3C*%3E%2C+Iterator%3C*%3E%22

We can't remove Collection.forEach without having perf issue because the 
stream pipeline use it.
Iterator.forEach can be removed but it's a pity because it's really 
convenient,
a possble solution is to rename Iterator.forEach() to something else.

>
> Please review
> Thanks
>

cheers,
R?mi



From chris.hegarty at oracle.com  Fri Dec 14 11:46:57 2012
From: chris.hegarty at oracle.com (Chris Hegarty)
Date: Fri, 14 Dec 2012 11:46:57 +0000
Subject: RFR: 8005051: default methods for Iterator
In-Reply-To: <50CA7FD3.5020701@oracle.com>
References: <50CA7FD3.5020701@oracle.com>
Message-ID: <50CB11B1.5050105@oracle.com>



On 14/12/2012 01:24, Akhil Arora wrote:
> As part of the library lambdafication, this patch adds a forEach default
> method to Iterator, and converts remove() into a default method so that
> implementations of Iterator no longer have to override remove if they
> desire the default behavior, which is to throw an
> UnsupportedOperationException.

This is not specified. Different Java SE implementations can have 
different default implementations of remove(). Your statement is either 
mistaken, or the changes will not meet their original intent.

forEach, it is not clear to me if the method description is specifying 
what the default implementation is supposed to do, or if it is 
specifying the contract for the method.

This, of course, has the same underlying cause as what is being 
discussed in other mail threads. I would like to see a clear decision 
being made around how default methods are to be specified before we 
start moving them into jdk8.

-Chris.

>
> http://cr.openjdk.java.net/~akhil/8005051.0/webrev/
>
> The above patch requires a small patch to an internal class which
> happens to implement both Iterable and Iterator. Now both Iterable and
> Iterator supply a default forEach method, so the compiler balks. One
> minimally intrusive solution is for this class to override both defaults
> and provide its own version of forEach.
>
> http://cr.openjdk.java.net/~akhil/8005053.0/webrev/
>
> Please review
> Thanks


From Ulf.Zibis at CoSoCo.de  Fri Dec 14 11:54:03 2012
From: Ulf.Zibis at CoSoCo.de (Ulf Zibis)
Date: Fri, 14 Dec 2012 12:54:03 +0100
Subject: Review request: 8003562: Provide a command-line tool to find
	static dependencies
In-Reply-To: <50CAD3A3.5040300@oracle.com>
References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com>
	<50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com>
	<50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com>
	<50CAD3A3.5040300@oracle.com>
Message-ID: <50CB135B.7070707@CoSoCo.de>

Some nits again:

_private_ static class Options has _public_ members, why?

IMHO, defining a distinct inner class for each Option is a little bit oversized. I also do not see 
the need for class Options, as it is only instantiated once. Instead you could define:
     enum Options
Anyway, isn'd there still an options parser from other java langtools, which could be reused ???

In many places the source is exhausting to read, e.g
         if (f.exists()) {
             ClassFileReader reader = ClassFileReader.newInstance(f);
             Archive archive = new Archive(f, reader);
             result.add(archive);
         }
could simply be:
         if (f.exists())
             result.add(new Archive(f, ClassFileReader.newInstance(f)));

... also spreading around the variable definitions at different places.

-Ulf


Am 14.12.2012 08:22, schrieb Mandy Chung:
> Updated webrev:
> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.04/
>
> The binary name of an inner class has a '$' and so ClassFileReader.java:74 should do it.  Once the 
> jdeps change is pulled down to the profiles forest, I may make the change there to use the API as 
> javac uses.
>
> thanks
> Mandy
>
> On 12/13/2012 6:15 PM, Mandy Chung wrote:
>> On 12/13/2012 4:06 PM, Jonathan Gibbons wrote:
>>> Mandy,
>>>
>>> Mostly good -- and nice to see Dependencies getting the full tool treatment.
>>>
>>
>> Thanks for the review, Jon.
>>
>>> -- Jon
>>>
>>>
>>> Archive.java:128
>>> non-localized text: "not found"
>>>
>>
>> Oh I missed that - will fix it.
>>
>>> ClassFileReader.java:74, ditto similar code in JarFileReader
>>> Will not work for inner classes.
>>>
>>
>> That's right.  What's the best way handling inner classes besides retrying?
>>
>>> ClassFileReader.java:various
>>> Langtools is (for a while longer) still using -source 6. This is to allow NetBeans to build and 
>>> use langtools. I guess the code here is OK as long as NB don't try and build all of langtools.
>>>
>>
>> We talked about this and I hope that some part of langtools could be built with -source 7 as they 
>> are not needed in the bootstrap phase.  I will fix it since it's close to integration.   That'll 
>> help when you use NB to open langtools repo; otherwise, NB will indicate the files with syntax 
>> error which is kind of annoying.
>>
>>
>>> JDepsTask:111
>>> Did you mean --summary?
>>
>> Yes will fix it.
>>
>>> If you're wanting to emulate the GNU-style --options, these options normally use =, as in 
>>> --name=value, so you might want to update handleOption.
>>>
>>
>> That's right - will fix it.
>>
>>> PlatformClassPath
>>> The API you are looking for is now available in the profiles forest, in 
>>> langtools/src/classes/com/sun/tools/javac/sym
>>
>> Good - I'll check that out and send out a new webrev.
>>
>> Thanks
>> Mandy
>>
>>>
>>> -- Jon
>>>
>>> On 12/10/2012 02:30 AM, Erik Joelsson wrote:
>>>> Looks good.
>>>>
>>>> /Erik
>>>>
>>>> On 2012-12-07 22:55, Mandy Chung wrote:
>>>>> This is the updated webrev. It includes Erik's makefile changes and
>>>>> small change - be consistent with javap, jdeps can take classnames as
>>>>> the input argument or wildcard "*" to analyze all class files that
>>>>> replaces the "-all" option.
>>>>>
>>>>> Webrev:
>>>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.03/
>>>>>
>>>>> Mandy
>>>>>
>>>>> On 12/5/12 5:36 PM, Mandy Chung wrote:
>>>>>> This review request (add a new jdeps tool in the JDK) include changes in
>>>>>> langtools and the jdk build.  I would need reviewers from the langtools
>>>>>> and the build-infra team.
>>>>>>
>>>>>> Webrev for review:
>>>>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/langtools-webrev.02/
>>>>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/jdk-webrev.02/
>>>>>>
>>>>>> The jdeps source is in the langtools repo.  The change in the jdk repo is
>>>>>> to add the new jdeps executable.  I made change in the old and new build
>>>>>> for the addition of this new jdeps tool.  I discussed with Jon whether I
>>>>>> should modify langtools/make/build.xml to add a new jdeps target. Since
>>>>>> the old build will be replaced by the new build soon, I simply add
>>>>>> com/sun/tools/jdeps as part of javap.includes.
>>>>>>
>>>>>> Alan,
>>>>>>
>>>>>> The -d option is kept as a hidden option and use as implementation. We
>>>>>> can remove it when it's determined not useful in the future. I also
>>>>>> rename -v:summary to -summary.
>>>>>>
>>>>>> Thanks
>>>>>> Mandy
>>>>>>
>>>>>> ----------------------------
>>>>>>
>>>>>> $ jdep -h
>>>>>> Usage: jdeps  
>>>>>> where possible options include:
>>>>>>   -version                 Version information
>>>>>>   -classpath         Specify where to find class files
>>>>>>   -summary                 Print dependency summary only
>>>>>>   -v:class                 Print class-level dependencies
>>>>>>   -v:package               Print package-level dependencies
>>>>>>   -p         Restrict analysis to classes in this package
>>>>>>                            (may be given multiple times)
>>>>>>   -e                Restrict analysis to packages matching pattern
>>>>>>                            (-p and -e are exclusive)
>>>>>>   -P  --profile            Show profile or the file containing a package
>>>>>>   -R  --recursive          Traverse all dependencies recursively
>>>>>>   -all                     Process all classes specified in -classpath
>>>>>>
>>>>>> $ jdep Notepad.jar Ensemble.jar
>>>>>> Notepad.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar
>>>>>>  (Notepad.jar)
>>>>>>       -> java.awt
>>>>>>       -> java.awt.event
>>>>>>       -> java.beans
>>>>>>       -> java.io
>>>>>>       -> java.lang
>>>>>>       -> java.net
>>>>>>       -> java.util
>>>>>>       -> java.util.logging
>>>>>>       -> javax.swing
>>>>>>       -> javax.swing.border
>>>>>>       -> javax.swing.event
>>>>>>       -> javax.swing.text
>>>>>>       -> javax.swing.tree
>>>>>>       -> javax.swing.undo
>>>>>>
>>>>>> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\jfxrt.jar
>>>>>> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar
>>>>>>    com.javafx.main (Ensemble.jar)
>>>>>>       -> java.applet
>>>>>>       -> java.awt
>>>>>>       -> java.awt.event
>>>>>>       -> java.io
>>>>>>       -> java.lang
>>>>>>       -> java.lang.reflect
>>>>>>       -> java.net
>>>>>>       -> java.security
>>>>>>       -> java.util
>>>>>>       -> java.util.jar
>>>>>>       -> javax.swing
>>>>>>       -> sun.misc                                 JDK internal API (rt.jar)
>>>>>
>>>
>



From alexey.utkin at oracle.com  Fri Dec 14 12:14:22 2012
From: alexey.utkin at oracle.com (Alexey Utkin)
Date: Fri, 14 Dec 2012 16:14:22 +0400
Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib
	tests from the AWT subsystem (ver. 3)
In-Reply-To: <50CA0974.3060608@oracle.com>
References: <50C8A5C4.4030602@oracle.com> <50C8D419.8000608@oracle.com>
	<50C9C09F.1030005@oracle.com> <50C9C254.2010307@oracle.com>
	<50C9C336.7020104@oracle.com> <50CA0974.3060608@oracle.com>
Message-ID: <50CB181E.1050902@oracle.com>

On 13.12.2012 20:59, Alan Bateman wrote:
> One other one that I ran into today is this one:
> test/java/lang/Throwable/LegacyChainedExceptionSerialization.java
>
> It uses java.awt.print.PrinterIOException and I think that can be 
> safely removed. Do you think this could be included in your changes?
Done. A PrinterIOException instance was removed from tested sequence.

Bug description:
     https://jbs.oracle.com/bugs/browse/JDK-8004928

Here is the suggested fix:
     http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8004928/webrev.03

Regards,
-uta




From Alan.Bateman at oracle.com  Fri Dec 14 12:28:30 2012
From: Alan.Bateman at oracle.com (Alan Bateman)
Date: Fri, 14 Dec 2012 12:28:30 +0000
Subject: RFR: 8005051: default methods for Iterator
In-Reply-To: <50CA7FD3.5020701@oracle.com>
References: <50CA7FD3.5020701@oracle.com>
Message-ID: <50CB1B6E.7030102@oracle.com>

On 14/12/2012 01:24, Akhil Arora wrote:
> As part of the library lambdafication, this patch adds a forEach 
> default method to Iterator, and converts remove() into a default 
> method so that implementations of Iterator no longer have to override 
> remove if they desire the default behavior, which is to throw an 
> UnsupportedOperationException.
>
> http://cr.openjdk.java.net/~akhil/8005051.0/webrev/
I looked at the changes to Iterator, a few minor comments:

I think it would help to change "This default implementation" to "The 
default implementation", it makes it more obviously normative (and so 
testable) and might help for sub-types that override the method but 
don't inherit the javadoc.

I assume the generated javadoc ends as a long paragraph, did you 
consider putting in 

tags to make it a bit easier on the reader, minimally put the description of the default implementation isn't own paragraph. Should Collection have a lowercase "c" as it may be an iterator over a collection that is not a java.util.Collection? In forEach then it may be smoother to change "... execution subsequent ..." to "... execution then subsequent ...". As per the other thread, if new methods are coming with the public modifier then I think it should be added to the existing methods. -Alan. From Alan.Bateman at oracle.com Fri Dec 14 12:34:52 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 14 Dec 2012 12:34:52 +0000 Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib tests from the AWT subsystem (ver. 3) In-Reply-To: <50CB181E.1050902@oracle.com> References: <50C8A5C4.4030602@oracle.com> <50C8D419.8000608@oracle.com> <50C9C09F.1030005@oracle.com> <50C9C254.2010307@oracle.com> <50C9C336.7020104@oracle.com> <50CA0974.3060608@oracle.com> <50CB181E.1050902@oracle.com> Message-ID: <50CB1CEC.3090509@oracle.com> On 14/12/2012 12:14, Alexey Utkin wrote: > On 13.12.2012 20:59, Alan Bateman wrote: >> One other one that I ran into today is this one: >> test/java/lang/Throwable/LegacyChainedExceptionSerialization.java >> >> It uses java.awt.print.PrinterIOException and I think that can be >> safely removed. Do you think this could be included in your changes? > Done. A PrinterIOException instance was removed from tested sequence. > > Bug description: > https://jbs.oracle.com/bugs/browse/JDK-8004928 > > Here is the suggested fix: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8004928/webrev.03 > > Regards, > -uta > Thanks for including this one, thumbs up from me. -Alan From Alan.Bateman at oracle.com Fri Dec 14 12:43:02 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 14 Dec 2012 12:43:02 +0000 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50CAD3A3.5040300@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CAD3A3.5040300@oracle.com> Message-ID: <50CB1ED6.4030605@oracle.com> On 14/12/2012 07:22, Mandy Chung wrote: > Once the jdeps change is pulled down to the profiles forest, I may > make the change there to use the API as javac uses. > That would be fine, alternatively when the profiles changes get to jdk8 and jdk8/tl. -Alan. From Lance.Andersen at oracle.com Fri Dec 14 12:50:48 2012 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Fri, 14 Dec 2012 07:50:48 -0500 Subject: RFR: 8005051: default methods for Iterator In-Reply-To: <50CB1B6E.7030102@oracle.com> References: <50CA7FD3.5020701@oracle.com> <50CB1B6E.7030102@oracle.com> Message-ID: On Dec 14, 2012, at 7:28 AM, Alan Bateman wrote: > On 14/12/2012 01:24, Akhil Arora wrote: >> As part of the library lambdafication, this patch adds a forEach default method to Iterator, and converts remove() into a default method so that implementations of Iterator no longer have to override remove if they desire the default behavior, which is to throw an UnsupportedOperationException. >> >> http://cr.openjdk.java.net/~akhil/8005051.0/webrev/ > I looked at the changes to Iterator, a few minor comments: > > I think it would help to change "This default implementation" to "The default implementation", it makes it more obviously normative (and so testable) and might help for sub-types that override the method but don't inherit the javadoc. > > I assume the generated javadoc ends as a long paragraph, did you consider putting in

tags to make it a bit easier on the reader, minimally put the description of the default implementation isn't own paragraph. This is why i am a proponent of adding a javadoc tag for default methods so that everyone is consistent in where/how we document the default method. I worry if we do not developers will place this info in various places making it easy to overlook. > > Should Collection have a lowercase "c" as it may be an iterator over a collection that is not a java.util.Collection? > > In forEach then it may be smoother to change "... execution subsequent ..." to "... execution then subsequent ...". > > As per the other thread, if new methods are coming with the public modifier then I think it should be added to the existing methods. > > -Alan. > > -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From paul.sandoz at oracle.com Fri Dec 14 13:00:43 2012 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 14 Dec 2012 14:00:43 +0100 Subject: RFR: 8005051: default methods for Iterator In-Reply-To: <50CB057B.3070203@univ-mlv.fr> References: <50CA7FD3.5020701@oracle.com> <50CB057B.3070203@univ-mlv.fr> Message-ID: On Dec 14, 2012, at 11:54 AM, Remi Forax wrote: > > We can't remove Collection.forEach without having perf issue because the stream pipeline use it. > Iterator.forEach can be removed but it's a pity because it's really convenient, And a case can be made performance wise too (there are optimal implementations in the stream code base). I have found that forEach, in general, has been very useful. Since it abstracts away the details of traversal it has enabled better re-use of code. Paul. > a possble solution is to rename Iterator.forEach() to something else. > >> >> Please review >> Thanks >> > > cheers, > R?mi > From forax at univ-mlv.fr Fri Dec 14 13:19:02 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Fri, 14 Dec 2012 14:19:02 +0100 Subject: RFR: 8005051: default methods for Iterator In-Reply-To: References: <50CA7FD3.5020701@oracle.com> <50CB057B.3070203@univ-mlv.fr> Message-ID: <50CB2746.7080007@univ-mlv.fr> On 12/14/2012 02:00 PM, Paul Sandoz wrote: > On Dec 14, 2012, at 11:54 AM, Remi Forax wrote: >> We can't remove Collection.forEach without having perf issue because the stream pipeline use it. >> Iterator.forEach can be removed but it's a pity because it's really convenient, > And a case can be made performance wise too (there are optimal implementations in the stream code base). > > I have found that forEach, in general, has been very useful. Since it abstracts away the details of traversal it has enabled better re-use of code. The VM profiles the iterator when calling hasNext and next, if you end up by using Iterator.forEach instead of one of its overriden methods, you share the profile between part of the pipeline that should not be shared. So using Iterator.forEach may be less performant or not depending if forEach is overriden by a specific implementation or not. > > Paul. R?mi > >> a possble solution is to rename Iterator.forEach() to something else. >> >>> Please review >>> Thanks >>> >> cheers, >> R?mi >> From peter.levart at gmail.com Fri Dec 14 13:38:06 2012 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 14 Dec 2012 14:38:06 +0100 Subject: RFR: 8005051: default methods for Iterator In-Reply-To: <50CA7FD3.5020701@oracle.com> References: <50CA7FD3.5020701@oracle.com> Message-ID: <50CB2BBE.8040908@gmail.com> Hi, Iterator.forEach(Block) does not specify anything about the order of internal iteration in correspondence to the order of classical external iteration (hasNext()/next()). I think that if the order must be the same then Javadoc should mention it. If the orders are allowed be different, then Javadoc should mention it too. As for the clash with Iterable.forEach(Block): The name "forEach" suggests just that - each element will be passed to Block. Nothing is said about the order of elements or even Threads. I dont't think it should be, since Iterables can be various kinds. But Iterator is a one-shot single-threaded API and it's hard to imagine the implementation where internal iteration would want to be different than external. So the Iterator method be better called differently. What about Iterator.iterate(Block) ? Regards, Peter On 12/14/2012 02:24 AM, Akhil Arora wrote: > As part of the library lambdafication, this patch adds a forEach > default method to Iterator, and converts remove() into a default > method so that implementations of Iterator no longer have to override > remove if they desire the default behavior, which is to throw an > UnsupportedOperationException. > > http://cr.openjdk.java.net/~akhil/8005051.0/webrev/ > > The above patch requires a small patch to an internal class which > happens to implement both Iterable and Iterator. Now both Iterable and > Iterator supply a default forEach method, so the compiler balks. One > minimally intrusive solution is for this class to override both > defaults and provide its own version of forEach. > > http://cr.openjdk.java.net/~akhil/8005053.0/webrev/ > > Please review > Thanks From Ulf.Zibis at CoSoCo.de Fri Dec 14 14:13:18 2012 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Fri, 14 Dec 2012 15:13:18 +0100 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50CB03D1.5030400@CoSoCo.de> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> Message-ID: <50CB33FE.7000605@CoSoCo.de> Am 14.12.2012 11:47, schrieb Ulf Zibis: > Am 14.12.2012 03:15, schrieb Mandy Chung: >>> JDepsTask:111 >>> Did you mean --summary? >> >> Yes will fix it. > > Why don't you remain consistent to all other existing java tools? > E.g. javac uses: -cp path or -classpath path > Double hyphen '--' is never used until today. > > So better: > -P -profile Show profile or the file containing a package > -R -recursive Traverse all dependencies recursively > > Anyway, if you prefer to stick at '--', then you should consistently use it for '--version', > '--classpath', '--all' Maybe I'm in error, but additionally it seems to me, that "-classpath=Foo" doesn't match by: if (a.equals(opt)) { return true; } else if (opt.startsWith("--") && hasArg && opt.startsWith(a + "=")) { return true; } -Ulf >>>>>> -version Version information >>>>>> -classpath Specify where to find class files >>>>>> -summary Print dependency summary only >>>>>> -v:class Print class-level dependencies >>>>>> -v:package Print package-level dependencies >>>>>> -p Restrict analysis to classes in this package >>>>>> (may be given multiple times) >>>>>> -e Restrict analysis to packages matching pattern >>>>>> (-p and -e are exclusive) >>>>>> -P --profile Show profile or the file containing a package >>>>>> -R --recursive Traverse all dependencies recursively >>>>>> -all Process all classes specified in -classpath >>>>> >>> >> > > From peter.levart at gmail.com Fri Dec 14 14:13:07 2012 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 14 Dec 2012 15:13:07 +0100 Subject: signatures that are recorded for default methods In-Reply-To: References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com> <50CA2B58.5030103@oracle.com> <50CA4320.40408@oracle.com> <50CA61DA.7050205@oracle.com> <46D348C4-E38A-418E-A1D4-C789B038F078@oracle.com> <50CAC55A.3010602@oracle.com> <50CAEC32.6060802@gmail.com> <50CAF454.4040309@gmail.com> Message-ID: <50CB33F3.8020309@gmail.com> On 12/14/2012 01:41 PM, Ricky Clarkson wrote: > > Surely a default method that all subclasses are instructed to override > just shouldn't exist, right? > > Then the compiler will 'instruct' subtypes to implement it > automatically (i.e., by failing to compile). > I just wanted to illustrate how a sub-optimal specification of default method behaviour for "optional" methods would sound like if one didn't want to specify that it always throws UnsupportedOperationException ;-) Peter > On Dec 14, 2012 6:42 AM, "Peter Levart" > wrote: > > On 12/14/2012 10:06 AM, Peter Levart wrote: > > On 12/14/2012 07:21 AM, David Holmes wrote: > >> Paul, > >> > >> On 14/12/2012 9:46 AM, Paul Benedict wrote: > >>> Lance, > >>> > >>> Good questions. Someone with authority will surely answer, but > here's > >>> my armchair opinion... > >>> > >>> If the Javadoc is to specify how the default method executes, than > >>> that would naturally infer all default implementations must have a > >>> stated contract. You can't document the default execution > behavior in > >>> the public API and then let a provider switch the behavior. > The two go > >>> hand-in-hand, imo. > >> > >> I couldn't really make sense of that. :) The method has a contract. > >> The "default implementation" has to honor that contract. The > question > >> is whether how the "default implementation" honors the method > >> contract is required to be part of a second contract. > >> > >> I hope that made sense :) > > I think that the answer is obvious. A default method provider > has only > > as much freedom in choosing the implementation of the default method > > that particular implementation differences among various > providers are > > not observable by the "sane" usage of the API. The only soft aspect > > might be performance. Any other behavioural difference should not be > > allowed. Otherwise there will be in-compatibilities among platform > > providers. > > > > For example, the default Iterator.remove() is implemented in > Oracle's > > JDK as always throwing UnsupportedOperationException. The TCK should > > test for that and the Javadoc should specify that. > Ok, I admit that in this particular case and other similar cases > (where > the default method does nothing useful), the specification could > alternatively specify: "The default method behaviour is > unspecified and > useless. Don't call that method or make sure it is always > overridden if > you call it" - the TCK in that case doesn't test the behaviour of such > method. > > Peter > > > > As Joe said, default interface methods are no different than any > other > > overridable methods. They have a contract and behaviour. The > behaviour > > can be changed (overriden) within constraints defined by > contract, but > > the behaviour itself should also be specified and followed by > > different providers. > > > > Just my 2 cents. > > > > Regards, Peter > > > >> > >> David > >> ----- > >> > >> > >>> Paul > >>> > >>> On Thu, Dec 13, 2012 at 5:30 PM, Lance Andersen - Oracle > >>> > > wrote: > >>>> > >>>> On Dec 13, 2012, at 6:16 PM, Leonid Arbuzov wrote: > >>>> > >>>>> Good point, Joe. > >>>>> Those extra assertions for default methods can be checked > >>>>> by regular API tests separately from signature tests. > >>>> > >>>> I am not clear on this. See the message attached from David > which > >>>> ask a similar question (from the attached email): > >>>> ------------------- > >>>> 2. It is not obvious to me that the JDK's choice for a default > >>>> implementation has to be _the_ only possible implementation > choice. > >>>> In many/most cases there will be a very obvious choice, but that > >>>> doesn't mean that all suppliers of OpenJDK classes have to be > >>>> locked in to that choice. > >>>> ------------------- > >>>> > >>>> > >>>> If everyone needs to implement the same default > implementation then > >>>> great the JCK/TCK can test it and IMHO we should have a > javadoc tag > >>>> for this. > >>>> > >>>> If everyone is free to choose what the default behavior is, > then we > >>>> cannot test it. > >>>> > >>>> So has there been a decision WRT the requirements for default > methods? > >>>> > >>>> > >>>> Best > >>>> Lance > >>>>> Thanks, > >>>>> -leonid > >>>>> > >>>>> On 12/13/2012 1:05 PM, Joe Darcy wrote: > >>>>>> Hello, > >>>>>> > >>>>>> As with concrete methods on abstract classes, I would > expect the > >>>>>> specifications of the default methods to often contain text > akin > >>>>>> to "This default implementation does x, y, and z" since if the > >>>>>> method is to be called by subtypes, the self-use patterns > in the > >>>>>> default method need to be known. > >>>>>> > >>>>>> Cheers, > >>>>>> > >>>>>> -Joe > >>>>>> > >>>>>> On 12/13/2012 11:24 AM, Leonid Arbouzov wrote: > >>>>>>> Hello Lance, > >>>>>>> > >>>>>>> My understanding would be that the signature test > >>>>>>> should check that interface method is marked as default method > >>>>>>> but do not track the code in its default body > >>>>>>> (assuming that the body is not a part of a spec - API > javadoc). > >>>>>>> > >>>>>>> (I've confirmed that with the signature test developer) > >>>>>>> > >>>>>>> Thanks, > >>>>>>> -leonid > >>>>>>> > >>>>>>> On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote: > >>>>>>>> Folks, > >>>>>>>> > >>>>>>>> Will the signatures for interfaces that are recorded by the > >>>>>>>> TCKs for interfaces record the fact that a method includes a > >>>>>>>> default method? or will it just record the method definition? > >>>>>>>> > >>>>>>>> I am assuming it will, but I know there has been discussion > >>>>>>>> that a implementor could choose a different default > >>>>>>>> implementation on one of the recent threads that was up for > >>>>>>>> review. > >>>>>>>> > >>>>>>>> I am still trying to understand what our guidelines are, > if any > >>>>>>>> for documenting the behavior of the supplied default methods > >>>>>>>> given the javadocs are part of the specification for many > APIs > >>>>>>>> (and in some case the only spec). > >>>>>>>> > >>>>>>>> Best > >>>>>>>> Lance > >>>>>>>> > >>>>>>>> Lance Andersen| Principal Member of Technical Staff | > >>>>>>>> +1.781.442.2037 > >>>>>>>> Oracle Java Engineering > >>>>>>>> 1 Network Drive > >>>>>>>> Burlington, MA 01803 > >>>>>>>> Lance.Andersen at oracle.com > >>>>>>>> > >>>>>>>> > >>>>>>> > >>>>>> > >>>> > >>>> > >>>> > >>>> Lance Andersen| Principal Member of Technical Staff | > +1.781.442.2037 > >>>> Oracle Java Engineering > >>>> 1 Network Drive > >>>> Burlington, MA 01803 > >>>> Lance.Andersen at oracle.com > >>>> > >>>> > >>>> > >>> > > > > From vitalyd at gmail.com Fri Dec 14 14:38:34 2012 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Fri, 14 Dec 2012 09:38:34 -0500 Subject: RFR: 8005051: default methods for Iterator In-Reply-To: <50CB2BBE.8040908@gmail.com> References: <50CA7FD3.5020701@oracle.com> <50CB2BBE.8040908@gmail.com> Message-ID: One interesting thing for me here is .net's IEnumerable (akin to Iterable) never received a ForEach extension method - this method only exists on their List class. From what I gather this was to avoid passing a block (Action in .net) that modifies the underlying collection (e.g removes an item). I never really thought that paranoia was worth it since most uses will not want to mutate. I'm glad Iterable will have this, but curious if anyone thought about this case explicitly. Thanks Sent from my phone On Dec 14, 2012 8:38 AM, "Peter Levart" wrote: > Hi, > > Iterator.forEach(Block) does not specify anything about the order of > internal iteration in correspondence to the order of classical external > iteration (hasNext()/next()). I think that if the order must be the same > then Javadoc should mention it. If the orders are allowed be different, > then Javadoc should mention it too. > > As for the clash with Iterable.forEach(Block): The name "forEach" suggests > just that - each element will be passed to Block. Nothing is said about the > order of elements or even Threads. I dont't think it should be, since > Iterables can be various kinds. > > But Iterator is a one-shot single-threaded API and it's hard to imagine > the implementation where internal iteration would want to be different than > external. So the Iterator method be better called differently. What about > Iterator.iterate(Block) ? > > Regards, Peter > > On 12/14/2012 02:24 AM, Akhil Arora wrote: > >> As part of the library lambdafication, this patch adds a forEach default >> method to Iterator, and converts remove() into a default method so that >> implementations of Iterator no longer have to override remove if they >> desire the default behavior, which is to throw an >> UnsupportedOperationException. >> >> http://cr.openjdk.java.net/~**akhil/8005051.0/webrev/ >> >> The above patch requires a small patch to an internal class which happens >> to implement both Iterable and Iterator. Now both Iterable and Iterator >> supply a default forEach method, so the compiler balks. One minimally >> intrusive solution is for this class to override both defaults and provide >> its own version of forEach. >> >> http://cr.openjdk.java.net/~**akhil/8005053.0/webrev/ >> >> Please review >> Thanks >> > > From zhong.j.yu at gmail.com Fri Dec 14 14:42:31 2012 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Fri, 14 Dec 2012 08:42:31 -0600 Subject: RFR: 8005051: default methods for Iterator In-Reply-To: <50CB057B.3070203@univ-mlv.fr> References: <50CA7FD3.5020701@oracle.com> <50CB057B.3070203@univ-mlv.fr> Message-ID: On Fri, Dec 14, 2012 at 4:54 AM, Remi Forax wrote: > Hi Akhil, > > On 12/14/2012 02:24 AM, Akhil Arora wrote: >> >> As part of the library lambdafication, this patch adds a forEach default >> method to Iterator, and converts remove() into a default method so that >> implementations of Iterator no longer have to override remove if they >> desire the default behavior, which is to throw an >> UnsupportedOperationException. >> >> http://cr.openjdk.java.net/~akhil/8005051.0/webrev/ >> >> The above patch requires a small patch to an internal class which >> happens to implement both Iterable and Iterator. Now both Iterable and >> Iterator supply a default forEach method, so the compiler balks. One >> minimally intrusive solution is for this class to override both defaults >> and provide its own version of forEach. >> >> http://cr.openjdk.java.net/~akhil/8005053.0/webrev/ > > > The issue here is in the code of ASM wich is an external library imported in > the JDK, > so not sure it's a good idea to patch it. > > Moreover, goggling for "implement Iterable, Iterator" shows that this > anti-pattern is used too frequently to not step back and see if a better > solution is not possible. > https://encrypted.google.com/search?hl=en&q=%22implements+Iterable%3C*%3E%2C+Iterator%3C*%3E%22 > > We can't remove Collection.forEach without having perf issue because the > stream pipeline use it. > Iterator.forEach can be removed but it's a pity because it's really > convenient, > a possble solution is to rename Iterator.forEach() to something else. I agree with renaming the method; it shouldn't be confused with the typical forEach() on a collection which visits *all* elements; here it only visits the remaining elements. >> >> Please review >> Thanks >> > > cheers, > R?mi > From zhong.j.yu at gmail.com Fri Dec 14 14:58:34 2012 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Fri, 14 Dec 2012 08:58:34 -0600 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50C917DE.6010200@oracle.com> References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> <50C56053.1060306@oracle.com> <50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com> <50C6FCDE.7070404@oracle.com> <50C70087.4030003@gmail.com> <50C718BD.2010201@oracle.com> <50C71FE0.5020704@gmail.com> <50C7E086.6040805@oracle.com> <50C917DE.6010200@oracle.com> Message-ID: On Wed, Dec 12, 2012 at 5:48 PM, David Holmes wrote: > On 13/12/2012 1:51 AM, Zhong Yu wrote: >> >> If a class loader is declared fully concurrent, yet >> getClassLoadingLock() is invoked, what's the harm of returning a >> dedicated lock anyway, exactly like what's done before? > > > The whole point is to get rid of the lockMap and these lock objects. > > I could return a sentinel Object in all cases rather than null but that just > seems to encourage continued use of something that shouldn't be used with a > fully concurrent loader. > > Returning null versus throwing an exception is mostly a matter of style. I'd > want to hear from anyone who invokes getClassLoadingLock() on any of the > system classloaders to see which is preferable. Since this change will break some applications, the failure should be loud, with immediate and detailed information on what's going on, so the poor developers can fix the problem quickly. I had the pleasure of implementing classloaders before, and I think it might be underestimated how many classloaders are actually out there. Zhong > Thanks for the comments. > > David > > >> On Tue, Dec 11, 2012 at 7:40 PM, David Holmes >> wrote: >>> >>> On 11/12/2012 9:58 PM, Peter Levart wrote: >>>> >>>> >>>> On 12/11/2012 12:27 PM, David Holmes wrote: >>>>> >>>>> >>>>> Peter, >>>>> >>>>> You are convincing me that all superclasses must be fully concurrent >>>>> too. Otherwise we are just trying to second-guess a whole bunch of >>>>> what-ifs. :) >>>> >>>> >>>> >>>> If you think some more, yes. The superclass might not use >>>> getClassLoadingLock() but rely on the fact that findClass() is allways >>>> called under a guard of per-class-name lock, for example. It's a matter >>>> of how far to go to prevent such miss-behaving fully-concurrent >>>> subclasses. So far to also prevent fully-concurrent subclasses that >>>> would otherwise be perfectly correct? >>>> >>>> Maybe not. Creating custom ClassLoaders is not an average programmer's >>>> job. Those that do this things will of course study the implementations >>>> of superclasses they extend and do the right thing. And it's reasonable >>>> to expect that they more or less will only extend JDK's ClassLoaders - >>>> but on the other hand if they only extend JDK's class loaders, they are >>>> not prevented to be fully-concurrent either way. Hm... >>> >>> >>> >>> Again I think it is just too hard to try and second-guess how a >>> parallel-loader might rely on the per-class locks (I actually don't see >>> any >>> reasonable use for them beyond flow-control), and then how a concurrent >>> loader subclass might need to modify things. >>> >>> If we simply disallow this then we can relax that constraint in the >>> future >>> if valid use-cases turn up for that capability. Of course if someone has >>> a >>> valid use-case during this discussion phase then of course that will >>> influence the decision. >>> >>> Thanks, >>> David >>> >>>> Peter >>>> >>>>> >>>>> Thanks, >>>>> David >>>>> >>>>> On 11/12/2012 7:44 PM, Peter Levart wrote: >>>>>> >>>>>> >>>>>> On 12/11/2012 10:29 AM, David Holmes wrote: >>>>>>> >>>>>>> >>>>>>> On 11/12/2012 7:20 PM, Peter Levart wrote: >>>>>>>> >>>>>>>> >>>>>>>> On 12/11/2012 03:55 AM, David Holmes wrote: >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Question on the source code: registerAsFullyConcurrent has >>>>>>>>>> confusing >>>>>>>>>> comment - >>>>>>>>>> do the super classes all need to be parallel capable? Or do the >>>>>>>>>> super >>>>>>>>>> classes all need >>>>>>>>>> to be FullyConcurrent? I assume the latter, so just fix the >>>>>>>>>> comments. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> Actually it is the former. There's no reason to require that all >>>>>>>>> superclasses be fully-concurrent. Of course a given loaders degree >>>>>>>>> of >>>>>>>>> concurrency may be constrained by what it's supertype allows, but >>>>>>>>> there's no reason to actually force all the supertypes to be >>>>>>>>> fully-concurrent: it is enough that they are at least all parallel >>>>>>>>> capable. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Hi David, >>>>>>>> >>>>>>>> There is one caveat: if ClassLoader X declares that it is >>>>>>>> fully-concurrent and it's superclass Y is only parallel-capable, >>>>>>>> then X >>>>>>>> will act as fully-concurrent (returning null from >>>>>>>> getClassLoadingLock()). superclass Y might or might not be coded to >>>>>>>> use >>>>>>>> the getClassLoadingLock(). X therefore has to know how Y is coded. >>>>>>>> To be >>>>>>>> defensive, X could ask for Y's registration and declare itself as >>>>>>>> only >>>>>>>> parallel-capable if Y declares the same so that when Y is upgraded >>>>>>>> to be >>>>>>>> fully-concurrent, X would become fully-concurrent automatically. To >>>>>>>> support situations where the same version of X would work in two >>>>>>>> environments where in one Y is only parallel-capable and in the >>>>>>>> other Y >>>>>>>> is fully-concurrent, there could be a static API to retrieve the >>>>>>>> registrations of superclasses. >>>>>>> >>>>>>> >>>>>>> >>>>>>> I don't quite follow this. What code in the superclass are you >>>>>>> anticipating that the subclass will use which relies on the lock? Or >>>>>>> is this just an abstract "what if" scenario? >>>>>> >>>>>> >>>>>> >>>>>> This is more or less "what if". There might be a subclass Y of say >>>>>> java.lang.ClassLoader that overrides loadClass or findClass, declares >>>>>> that it is parallel-capable and in the implementation of it's >>>>>> loadClass >>>>>> or findClass, uses getClassLoadingLock() to synchronize access to it's >>>>>> internal state. Now there comes class X extends Y that declares that >>>>>> it >>>>>> is fully-concurrent. Of course this will not work, X has to declare >>>>>> that >>>>>> it is parallel-capable, because Y uses getClassLoadingLock(). >>>>>> >>>>>> What I suggested in the next message is to not change the registration >>>>>> API but rather provide getClassLoadingLock() that returns non-null >>>>>> locks >>>>>> when any of the superclasses declare that they are only >>>>>> parallel-capable, not fully-concurrent. >>>>>> >>>>>> Regards, Peter >>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> David >>>>>>> ----- >>>>>>> >>>>>>>> Or, to have less impact on future deprecation of old >>>>>>>> parallel-capable >>>>>>>> registration API, the fully-concurrent registration API: >>>>>>>> >>>>>>>> protected static boolean registerAsFullyConcurrent() >>>>>>>> >>>>>>>> might take a boolean parameter: >>>>>>>> >>>>>>>> protected static boolean registerAsFullyConcurrent(boolean >>>>>>>> downgradeToPrallelCapableIfAnySuperclassIsNotFullyConcurrent) >>>>>>>> >>>>>>>> >>>>>>>> and provide no accessible API to find out what the registration >>>>>>>> actually >>>>>>>> did (register as parallel-capable or fully-concurrent - return true >>>>>>>> in >>>>>>>> any case). >>>>>>>> >>>>>>>> Since all JDK provided ClassLoaders will be made fully concurrent, >>>>>>>> this >>>>>>>> might only be relevant if there is vendor A that currently provides >>>>>>>> only >>>>>>>> parallel-capable ClassLoader implementation and there is vendor B >>>>>>>> that >>>>>>>> subclasses A's loader and wants to upgrade and be backward >>>>>>>> compatible at >>>>>>>> the same time. >>>>>>>> >>>>>>>> Does this complicate things to much for no real benefit? >>>>>>>> >>>>>>>> Regards, Peter >>>>>>>> >>>>>> >>>> >>> > From Alan.Bateman at oracle.com Fri Dec 14 15:13:50 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 14 Dec 2012 15:13:50 +0000 Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present In-Reply-To: <50CA4C9D.50101@oracle.com> References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com> <50C27AC1.2050600@oracle.com> <50C27DBA.3050808@oracle.com> <50C61B4B.1080901@oracle.com> <50C72618.5000407@oracle.com> <7706A692-773E-4282-8B2C-9B2D85FD49A5@oracle.com> <50C85DFE.5010300@oracle.com> <50CA4C9D.50101@oracle.com> Message-ID: <50CB422E.2080402@oracle.com> On 13/12/2012 21:46, Joe Wang wrote: > : > > What I was thinking?! I had the property dtd in mind that requires > the elements all be in lower cases, so therefore I should ignore case > and allow it -- any better logic than that? :-) > > Fixed now. And also added a couple of test cases. Elements with wrong > case would still have been rejected, but the error messages would be > different. I've put an updated webrev here: http://cr.openjdk.java.net/~alanb/8004371/webrev.03/ This has the equalsIgnoreCase -> case change to address the issue that Paul spotted. I've also liberated two tests for this area that we had elsewhere. They are moved into un-changed for now and will exercise the new code when run the smallest profile. Joe - if you can get your additional tests into a form that can be included in the jdk repository then we can include them in this push, alternatively you can do it as a follow-up change-set that expands the test coverage. -Alan. From mandy.chung at oracle.com Fri Dec 14 16:35:48 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 14 Dec 2012 08:35:48 -0800 Subject: Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib tests from the AWT subsystem (ver. 3) In-Reply-To: <50CB181E.1050902@oracle.com> References: <50C8A5C4.4030602@oracle.com> <50C8D419.8000608@oracle.com> <50C9C09F.1030005@oracle.com> <50C9C254.2010307@oracle.com> <50C9C336.7020104@oracle.com> <50CA0974.3060608@oracle.com> <50CB181E.1050902@oracle.com> Message-ID: <50CB5564.5010008@oracle.com> Looks good to me. Mandy On 12/14/2012 4:14 AM, Alexey Utkin wrote: > On 13.12.2012 20:59, Alan Bateman wrote: >> One other one that I ran into today is this one: >> test/java/lang/Throwable/LegacyChainedExceptionSerialization.java >> >> It uses java.awt.print.PrinterIOException and I think that can be >> safely removed. Do you think this could be included in your changes? > Done. A PrinterIOException instance was removed from tested sequence. > > Bug description: > https://jbs.oracle.com/bugs/browse/JDK-8004928 > > Here is the suggested fix: > http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8004928/webrev.03 > > Regards, > -uta > > From chris.hegarty at oracle.com Fri Dec 14 17:36:13 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 14 Dec 2012 17:36:13 +0000 Subject: RFR 8005081: java/util/prefs/PrefsSpi.sh fails on macos-x Message-ID: <50CB638D.8040708@oracle.com> Strangely, this test passed in my test runs, on all platforms, before the push with the changes that pass the TESTVMOPTS, 8003890. It has now been seen to fail on some mac machines. There appears to be an issue with the use of quotes around TESTVMOPTS. The below change resolves the failure on the problem machines, and also continues to pass on all other platforms. ----- diff -r 8d7323a9d8ed test/java/util/prefs/PrefsSpi.sh --- a/test/java/util/prefs/PrefsSpi.sh Thu Dec 13 21:18:27 2012 -0500 +++ b/test/java/util/prefs/PrefsSpi.sh Fri Dec 14 16:36:17 2012 +0000 @@ -87,17 +87,17 @@ Sys "$javac" -d jarDir StubPreferencesFa case "`uname`" in Windows*|CYGWIN* ) CPS=';';; *) CPS=':';; esac -Sys "$java" "${TESTVMOPTS}" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \ +Sys "$java" ${TESTVMOPTS} "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \ -Djava.util.prefs.PreferencesFactory=StubPreferencesFactory \ -Djava.util.prefs.userRoot=. \ PrefsSpi "StubPreferences" -Sys "$java" "${TESTVMOPTS}" "-cp" "$TESTCLASSES" \ +Sys "$java" ${TESTVMOPTS} "-cp" "$TESTCLASSES" \ -Djava.util.prefs.userRoot=. \ PrefsSpi "java.util.prefs.*" -Sys "$java" "${TESTVMOPTS}" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \ +Sys "$java" ${TESTVMOPTS} "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \ -Djava.util.prefs.userRoot=. \ PrefsSpi "StubPreferences" -Sys "$java" "${TESTVMOPTS}" "-cp" "$TESTCLASSES" "-Djava.ext.dirs=extDir" \ +Sys "$java" ${TESTVMOPTS} "-cp" "$TESTCLASSES" "-Djava.ext.dirs=extDir" \ -Djava.util.prefs.userRoot=. \ PrefsSpi "StubPreferences" -Chris. From huizhe.wang at oracle.com Fri Dec 14 18:18:32 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Fri, 14 Dec 2012 10:18:32 -0800 Subject: code review request : 8003147 port fix for BCEL bug 39695 In-Reply-To: <50C95B95.9050204@oracle.com> References: <50C58072.4060802@oracle.com> <50C8D778.20506@oracle.com> <50C95B95.9050204@oracle.com> Message-ID: <50CB6D78.8080903@oracle.com> On 12/12/2012 8:37 PM, David Buck wrote: > Hi Joe! > > Thank you for looking at this. > > > You didn't apply the original Apache completely. Was the omission of > the > > change in toString() method intentional? > > Yes, the improvement in toString() was not related to the issue and > seems to have been included in the apache version of this fix on a > whim. I did not feel it was appropriate to include it in the port as > it is clearly outside of the scope of BCEL bug 39695. Ok. > > > I see that you've sent your test to Patrick. Have you run regression > > test for this patch? > > I have only tested the different versions of my own testcase. I do not > know anything about the test cases that Patrick is maintaining. If you > or Patrick can walk me through how to get and run the test cases SQE > uses, I will be more than happy to do that. Or if Patrick or you > prefer, I can send you my build if it would be easier for one of you > to run the tests yourself. You may ask Patrick for instructions on how to run regression test. It needs to be run separately since they are not in the jdk repo yet. Thanks, Joe > > Cheers, > -Buck > > On 2012/12/13 4:14, Joe Wang wrote: >> Hi David, >> >> You didn't apply the original Apache completely. Was the omission of the >> change in toString() method intentional? >> >> I see that you've sent your test to Patrick. Have you run regression >> test for this patch? >> >> Thanks, >> Joe >> >> On 12/9/2012 10:25 PM, David Buck wrote: >>> Hi! >>> >>> I would like to request a code review of my JDK8 fix for the following >>> issue: >>> >>> [ 8003147 : port fix for BCEL bug 39695 to our copy bundled as part of >>> jaxp ] >>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8003147 >>> >>> In addition to the fix that the BCEL project had for this issue, I >>> needed to "port" some of their support for LocalVariableTypeTable:s to >>> our copy of BCEL as well. Implementing support for LVTT is very >>> straightforward and does not add much to the complexity or risk of >>> this change (especially considering the limited scope of jaxp's use of >>> BCEL). >>> >>> Here is the webrev for my fix: >>> >>> [ Code Review for jaxp ] >>> http://cr.openjdk.java.net/~dbuck/8003147/webrev.00/ >>> >>> My understanding is that the test cases for our copy of the jaxp code >>> are handled in a separate repository / test suite. I have been in >>> contact with Patrick Zhang (Oracle QA) and Joe Wang and have provided >>> a junit test for this issue as requested. Please see bug report for a >>> simpler (non-junit) test-case. If for some reason anyone wants to see >>> the junit-based test, please let me know and I can provide a copy of >>> that as well. >>> >>> Best Regards, >>> -Buck From huizhe.wang at oracle.com Fri Dec 14 18:33:47 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Fri, 14 Dec 2012 10:33:47 -0800 Subject: RFR: (jaxp) 8003260 : some fields should be package protected Message-ID: <50CB710B.1000008@oracle.com> Hi, This is one of the three [findbug] issues. I've checked with Drew. None of them are vulnerabilities. Nonetheless, the fields should have been private or package private. webrev: http://cr.openjdk.java.net/~joehw/7u12/8003260/webrev/ Test: No new test. Existing regression tests passed. Thanks, Joe From Lance.Andersen at oracle.com Fri Dec 14 18:36:47 2012 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Fri, 14 Dec 2012 13:36:47 -0500 Subject: RFR: (jaxp) 8003260 : some fields should be package protected In-Reply-To: <50CB710B.1000008@oracle.com> References: <50CB710B.1000008@oracle.com> Message-ID: <52885E36-A13C-4DE6-B7E6-BF8F77D263A1@oracle.com> Hi Joe, Shouldn't this also be private: static final char [] xmlDecl = {'<','?','x','m','l'}; otherwise it is fine Best Lance On Dec 14, 2012, at 1:33 PM, Joe Wang wrote: > Hi, > > This is one of the three [findbug] issues. I've checked with Drew. None of them are vulnerabilities. Nonetheless, the fields should have been private or package private. > > webrev: > http://cr.openjdk.java.net/~joehw/7u12/8003260/webrev/ > > Test: > No new test. Existing regression tests passed. > > Thanks, > Joe -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From mike.duigou at oracle.com Fri Dec 14 18:58:09 2012 From: mike.duigou at oracle.com (Mike Duigou) Date: Fri, 14 Dec 2012 10:58:09 -0800 Subject: RFR : CR8004015 : Add parent interfaces and default methods to basic functional interfaces In-Reply-To: <50CAC719.7090308@oracle.com> References: <99DC2763-ED44-42CA-90F3-04AD07B2846D@oracle.com> <50CAC719.7090308@oracle.com> Message-ID: <0A9D8113-780C-4BA7-9380-AAD53A0DAA58@oracle.com> On Dec 13 2012, at 22:28 , David Holmes wrote: >> I have added @throws NPE for a number of the default methods. We won't be including @throws NPE in all cases where null is disallowed because when the @throws NPE is declared the API is required to throw NPE in that circumstance. So for cases where the NPE is "naturally" thrown or that aren't performance sensitive we will likely add @throws NPE declarations but for performance sensitive methods we won't be adding explicit null checks to match a @throws NPE specification. There's a tradeoff here in some cases. Please feel free to quibble about specific cases as they occur. :-) > > That doesn't make sense to me. The throwing of the NPE is intended to be part of the specification not an implementation choice. Further @param foo non-null, is just as binding on implementations as @throws NPE if foo is null. ??? An "@param foo non-null" by itself is not considered normative because it doesn't document what happens when null is passed. So it ends up being advisory only. An "@throws NPE" is considered normative and the implementation must throw in all circumstances described. (Please bear with the step-by-step nature of the following sample, it's incremental pace is not meant to be insulting--it's a write-up for a general FAQ). If I have a method: /** * If the object is visible then write it's string form to the provided PrintStream. * * @param bar destination for display / public void display(PrintStream bar) { if(visible) { bar.write(toString()); } } This implementation isn't going to work well if "bar" is ever null. So I document that in the "@param bar": /** * If the object is visible then write it's string form to the provided PrintStream. * * @param bar destination for display, must be non-null / public void display(PrintStream bar) { if(visible) { bar.write(toString()); } } The "@param bar" documentation now says that it must be non-null but doesn't explain what happens if null is passed. Having documented that null shouldn't be passed is helpful but not as helpful as it could be. To specify what happens I must add "@throws NPE": /** * If the object is visible then write it's string form to the provided PrintStream. * * @param bar destination for display, must be non-null * @throws NullPointerException if bar is null / public void display(PrintStream bar) { if(visible) { bar.write(toString()); } } This implementation would superficially seem to conform to the contract described in the javadoc. However, when the "if(visible)" conditional is false then no NPE will be thrown. Contract broken. It is required to add an explicit null check on "bar" ie. /** * If the object is visible then write it's string form to the provided PrintStream. * * @param bar destination for display, must be non-null * @throws NullPointerException if bar is null / public void display(PrintStream bar) { Objects.requireNonNull(bar); if(visible) { bar.write(toString()); } } Adding the "Objects.requireNonNull" ensures that the NPE is thrown in all appropriate cases. There is also another alternative: /** * If the object is visible then write it's string form to the provided PrintStream. * * @param bar destination for display, must be non-null * @throws NullPointerException if bar is null and the component is visible. / public void display(PrintStream bar) { if(visible) { bar.write(toString()); } } The conditions in which NPE are thrown are amended so that throwing is only required if the component is visible. Documenting the conditions could quickly become complicated if display was a more involved method. At some point it becomes easier to just add an explicit check. It can also be useful to add explicit NPE checks as pre-conditions before a multi-stage operation where a late stage NPE might corrupt the object state. In a very few cases an explicit null check might add too much overhead to a performance sensitive method and writing an accurate "@throws NPE" isn't possible (perhaps because of delegation) then the "@throws NPE" should be removed and only the advisory "@param bar ... must be non-null" will have to suffice. Mike > I think defining the NPE via the @param and @throws is a lose-lose situation: > > ! * @param left {@inheritDoc}, must be non-null > ! * @param right {@inheritDoc}, must be non-null > ! * @return {@inheritDoc}, always non-null > ! * @throws NullPointerException if {@code left} or {@code right} is null > > You only need one convention. > > David > ----- > > >> Mike From huizhe.wang at oracle.com Fri Dec 14 19:49:04 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Fri, 14 Dec 2012 11:49:04 -0800 Subject: RFR: (jaxp) 8003260 : some fields should be package protected In-Reply-To: <52885E36-A13C-4DE6-B7E6-BF8F77D263A1@oracle.com> References: <50CB710B.1000008@oracle.com> <52885E36-A13C-4DE6-B7E6-BF8F77D263A1@oracle.com> Message-ID: <50CB82B0.5040901@oracle.com> On 12/14/2012 10:36 AM, Lance Andersen - Oracle wrote: > Hi Joe, > > Shouldn't this also be private: > > static final char [] xmlDecl = {'<','?','x','m','l'}; A subclass in the same package, XMLDocumentScannerImpl, referred to it. That's why I made it package private. Joe > > otherwise it is fine > Best > Lance > On Dec 14, 2012, at 1:33 PM, Joe Wang wrote: > >> Hi, >> >> This is one of the three [findbug] issues. I've checked with Drew. None of them are vulnerabilities. Nonetheless, the fields should have been private or package private. >> >> webrev: >> http://cr.openjdk.java.net/~joehw/7u12/8003260/webrev/ >> >> Test: >> No new test. Existing regression tests passed. >> >> Thanks, >> Joe > > > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > From Lance.Andersen at oracle.com Fri Dec 14 19:52:11 2012 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Fri, 14 Dec 2012 14:52:11 -0500 Subject: RFR: (jaxp) 8003260 : some fields should be package protected In-Reply-To: <50CB82B0.5040901@oracle.com> References: <50CB710B.1000008@oracle.com> <52885E36-A13C-4DE6-B7E6-BF8F77D263A1@oracle.com> <50CB82B0.5040901@oracle.com> Message-ID: <26CE6211-331D-4C31-A594-181803E1E9A2@oracle.com> Thanks Joe. maybe a quick comment would help in the code could be useful Best Lance On Dec 14, 2012, at 2:49 PM, Joe Wang wrote: > > > On 12/14/2012 10:36 AM, Lance Andersen - Oracle wrote: >> >> Hi Joe, >> >> Shouldn't this also be private: >> >> static final char [] xmlDecl = {'<','?','x','m','l'}; > > A subclass in the same package, XMLDocumentScannerImpl, referred to it. That's why I made it package private. > > Joe >> >> otherwise it is fine >> Best >> Lance >> On Dec 14, 2012, at 1:33 PM, Joe Wang wrote: >> >>> Hi, >>> >>> This is one of the three [findbug] issues. I've checked with Drew. None of them are vulnerabilities. Nonetheless, the fields should have been private or package private. >>> >>> webrev: >>> http://cr.openjdk.java.net/~joehw/7u12/8003260/webrev/ >>> >>> Test: >>> No new test. Existing regression tests passed. >>> >>> Thanks, >>> Joe >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From huizhe.wang at oracle.com Fri Dec 14 20:43:41 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Fri, 14 Dec 2012 12:43:41 -0800 Subject: RFR: (jaxp) 8003260 : some fields should be package protected In-Reply-To: <26CE6211-331D-4C31-A594-181803E1E9A2@oracle.com> References: <50CB710B.1000008@oracle.com> <52885E36-A13C-4DE6-B7E6-BF8F77D263A1@oracle.com> <50CB82B0.5040901@oracle.com> <26CE6211-331D-4C31-A594-181803E1E9A2@oracle.com> Message-ID: <50CB8F7D.6060304@oracle.com> Thanks. I added a comment. Here's the webrev again: http://cr.openjdk.java.net/~joehw/7u12/8003260/webrev/ Best Joe On 12/14/2012 11:52 AM, Lance Andersen - Oracle wrote: > Thanks Joe. maybe a quick comment would help in the code could be useful > > Best > Lance > On Dec 14, 2012, at 2:49 PM, Joe Wang wrote: > >> >> >> On 12/14/2012 10:36 AM, Lance Andersen - Oracle wrote: >>> Hi Joe, >>> >>> Shouldn't this also be private: >>> >>> static final char [] xmlDecl = {'<','?','x','m','l'}; >> >> A subclass in the same package, XMLDocumentScannerImpl, referred to >> it. That's why I made it package private. >> >> Joe >>> otherwise it is fine >>> Best >>> Lance >>> On Dec 14, 2012, at 1:33 PM, Joe Wang wrote: >>> >>>> Hi, >>>> >>>> This is one of the three [findbug] issues. I've checked with Drew. None of them are vulnerabilities. Nonetheless, the fields should have been private or package private. >>>> >>>> webrev: >>>> http://cr.openjdk.java.net/~joehw/7u12/8003260/webrev/ >>>> >>>> Test: >>>> No new test. Existing regression tests passed. >>>> >>>> Thanks, >>>> Joe >>> >>> >>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>> Oracle Java Engineering >>> 1 Network Drive >>> Burlington, MA 01803 >>> Lance.Andersen at oracle.com >>> > > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > From Lance.Andersen at oracle.com Fri Dec 14 20:44:41 2012 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Fri, 14 Dec 2012 15:44:41 -0500 Subject: RFR: (jaxp) 8003260 : some fields should be package protected In-Reply-To: <50CB8F7D.6060304@oracle.com> References: <50CB710B.1000008@oracle.com> <52885E36-A13C-4DE6-B7E6-BF8F77D263A1@oracle.com> <50CB82B0.5040901@oracle.com> <26CE6211-331D-4C31-A594-181803E1E9A2@oracle.com> <50CB8F7D.6060304@oracle.com> Message-ID: +1 On Dec 14, 2012, at 3:43 PM, Joe Wang wrote: > Thanks. I added a comment. Here's the webrev again: > http://cr.openjdk.java.net/~joehw/7u12/8003260/webrev/ > > Best > Joe > > On 12/14/2012 11:52 AM, Lance Andersen - Oracle wrote: >> >> Thanks Joe. maybe a quick comment would help in the code could be useful >> >> Best >> Lance >> On Dec 14, 2012, at 2:49 PM, Joe Wang wrote: >> >>> >>> >>> On 12/14/2012 10:36 AM, Lance Andersen - Oracle wrote: >>>> >>>> Hi Joe, >>>> >>>> Shouldn't this also be private: >>>> >>>> static final char [] xmlDecl = {'<','?','x','m','l'}; >>> >>> A subclass in the same package, XMLDocumentScannerImpl, referred to it. That's why I made it package private. >>> >>> Joe >>>> otherwise it is fine >>>> Best >>>> Lance >>>> On Dec 14, 2012, at 1:33 PM, Joe Wang wrote: >>>> >>>>> Hi, >>>>> >>>>> This is one of the three [findbug] issues. I've checked with Drew. None of them are vulnerabilities. Nonetheless, the fields should have been private or package private. >>>>> >>>>> webrev: >>>>> http://cr.openjdk.java.net/~joehw/7u12/8003260/webrev/ >>>>> >>>>> Test: >>>>> No new test. Existing regression tests passed. >>>>> >>>>> Thanks, >>>>> Joe >>>> >>>> >>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>> Oracle Java Engineering >>>> 1 Network Drive >>>> Burlington, MA 01803 >>>> Lance.Andersen at oracle.com >>>> >> >> >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >> Oracle Java Engineering >> 1 Network Drive >> Burlington, MA 01803 >> Lance.Andersen at oracle.com >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From mandy.chung at oracle.com Fri Dec 14 20:54:34 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 14 Dec 2012 12:54:34 -0800 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50CB135B.7070707@CoSoCo.de> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CAD3A3.5040300@oracle.com> <50CB135B.7070707@CoSoCo.de> Message-ID: <50CB920A.7080208@oracle.com> I have cleaned up per your comments, Ulf. Here is the updated webrev: http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.05/ This also cleans up how the inner classes are handled since Location.getClassName returns a fully-qualified classname. On 12/14/2012 3:54 AM, Ulf Zibis wrote: > Some nits again: > > _private_ static class Options has _public_ members, why? > Fixed. > IMHO, defining a distinct inner class for each Option is a little bit > oversized. I also do not see the need for class Options, as it is only > instantiated once. Instead you could define: > enum Options > Anyway, isn'd there still an options parser from other java langtools, > which could be reused ??? > I tried to be consistent with the javap implementation. It's reasonable to have a common option parsing library for the command-line tools to use - for example [1] that we hope to get to it. > In many places the source is exhausting to read, e.g > if (f.exists()) { > ClassFileReader reader = ClassFileReader.newInstance(f); > Archive archive = new Archive(f, reader); > result.add(archive); > } > could simply be: > if (f.exists()) > result.add(new Archive(f, ClassFileReader.newInstance(f))); > > ... also spreading around the variable definitions at different places. Fixed. Thanks Mandy > > > Am 14.12.2012 08:22, schrieb Mandy Chung: >> Updated webrev: >> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.04/ >> >> The binary name of an inner class has a '$' and so >> ClassFileReader.java:74 should do it. Once the jdeps change is >> pulled down to the profiles forest, I may make the change there to >> use the API as javac uses. >> >> thanks >> Mandy >> http://hg.openjdk.java.net/jigsaw/jigsaw/jdk/file/ce66890e6d86/src/share/classes/org/openjdk/internal/joptsimple/ >> On 12/13/2012 6:15 PM, Mandy Chung wrote: >>> On 12/13/2012 4:06 PM, Jonathan Gibbons wrote: >>>> Mandy, >>>> >>>> Mostly good -- and nice to see Dependencies getting the full tool >>>> treatment. >>>> >>> >>> Thanks for the review, Jon. >>> >>>> -- Jon >>>> >>>> >>>> Archive.java:128 >>>> non-localized text: "not found" >>>> >>> >>> Oh I missed that - will fix it. >>> >>>> ClassFileReader.java:74, ditto similar code in JarFileReader >>>> Will not work for inner classes. >>>> >>> >>> That's right. What's the best way handling inner classes besides >>> retrying? >>> >>>> ClassFileReader.java:various >>>> Langtools is (for a while longer) still using -source 6. This is to >>>> allow NetBeans to build and use langtools. I guess the code here is >>>> OK as long as NB don't try and build all of langtools. >>>> >>> >>> We talked about this and I hope that some part of langtools could be >>> built with -source 7 as they are not needed in the bootstrap phase. >>> I will fix it since it's close to integration. That'll help when >>> you use NB to open langtools repo; otherwise, NB will indicate the >>> files with syntax error which is kind of annoying. >>> >>> >>>> JDepsTask:111 >>>> Did you mean --summary? >>> >>> Yes will fix it. >>> >>>> If you're wanting to emulate the GNU-style --options, these options >>>> normally use =, as in --name=value, so you might want to update >>>> handleOption. >>>> >>> >>> That's right - will fix it. >>> >>>> PlatformClassPath >>>> The API you are looking for is now available in the profiles >>>> forest, in langtools/src/classes/com/sun/tools/javac/sym >>> >>> Good - I'll check that out and send out a new webrev. >>> >>> Thanks >>> Mandy >>> >>>> >>>> -- Jon >>>> >>>> On 12/10/2012 02:30 AM, Erik Joelsson wrote: >>>>> Looks good. >>>>> >>>>> /Erik >>>>> >>>>> On 2012-12-07 22:55, Mandy Chung wrote: >>>>>> This is the updated webrev. It includes Erik's makefile changes and >>>>>> small change - be consistent with javap, jdeps can take >>>>>> classnames as >>>>>> the input argument or wildcard "*" to analyze all class files that >>>>>> replaces the "-all" option. >>>>>> >>>>>> Webrev: >>>>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.03/ >>>>>> >>>>>> Mandy >>>>>> >>>>>> On 12/5/12 5:36 PM, Mandy Chung wrote: >>>>>>> This review request (add a new jdeps tool in the JDK) include >>>>>>> changes in >>>>>>> langtools and the jdk build. I would need reviewers from the >>>>>>> langtools >>>>>>> and the build-infra team. >>>>>>> >>>>>>> Webrev for review: >>>>>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/langtools-webrev.02/ >>>>>>> >>>>>>> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/jdk-webrev.02/ >>>>>>> >>>>>>> >>>>>>> The jdeps source is in the langtools repo. The change in the >>>>>>> jdk repo is >>>>>>> to add the new jdeps executable. I made change in the old and >>>>>>> new build >>>>>>> for the addition of this new jdeps tool. I discussed with Jon >>>>>>> whether I >>>>>>> should modify langtools/make/build.xml to add a new jdeps >>>>>>> target. Since >>>>>>> the old build will be replaced by the new build soon, I simply add >>>>>>> com/sun/tools/jdeps as part of javap.includes. >>>>>>> >>>>>>> Alan, >>>>>>> >>>>>>> The -d option is kept as a hidden option and use as >>>>>>> implementation. We >>>>>>> can remove it when it's determined not useful in the future. I also >>>>>>> rename -v:summary to -summary. >>>>>>> >>>>>>> Thanks >>>>>>> Mandy >>>>>>> >>>>>>> ---------------------------- >>>>>>> >>>>>>> $ jdep -h >>>>>>> Usage: jdeps >>>>>>> where possible options include: >>>>>>> -version Version information >>>>>>> -classpath Specify where to find class files >>>>>>> -summary Print dependency summary only >>>>>>> -v:class Print class-level dependencies >>>>>>> -v:package Print package-level dependencies >>>>>>> -p Restrict analysis to classes in this >>>>>>> package >>>>>>> (may be given multiple times) >>>>>>> -e Restrict analysis to packages >>>>>>> matching pattern >>>>>>> (-p and -e are exclusive) >>>>>>> -P --profile Show profile or the file containing a >>>>>>> package >>>>>>> -R --recursive Traverse all dependencies recursively >>>>>>> -all Process all classes specified in >>>>>>> -classpath >>>>>>> >>>>>>> $ jdep Notepad.jar Ensemble.jar >>>>>>> Notepad.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar >>>>>>> (Notepad.jar) >>>>>>> -> java.awt >>>>>>> -> java.awt.event >>>>>>> -> java.beans >>>>>>> -> java.io >>>>>>> -> java.lang >>>>>>> -> java.net >>>>>>> -> java.util >>>>>>> -> java.util.logging >>>>>>> -> javax.swing >>>>>>> -> javax.swing.border >>>>>>> -> javax.swing.event >>>>>>> -> javax.swing.text >>>>>>> -> javax.swing.tree >>>>>>> -> javax.swing.undo >>>>>>> >>>>>>> Ensemble.jar -> >>>>>>> D:\tools\devtools\jdk8\windows-i586\jre\lib\jfxrt.jar >>>>>>> Ensemble.jar -> D:\tools\devtools\jdk8\windows-i586\jre\lib\rt.jar >>>>>>> com.javafx.main (Ensemble.jar) >>>>>>> -> java.applet >>>>>>> -> java.awt >>>>>>> -> java.awt.event >>>>>>> -> java.io >>>>>>> -> java.lang >>>>>>> -> java.lang.reflect >>>>>>> -> java.net >>>>>>> -> java.security >>>>>>> -> java.util >>>>>>> -> java.util.jar >>>>>>> -> javax.swing >>>>>>> -> sun.misc JDK internal >>>>>>> API (rt.jar) >>>>>> >>>> >> > From huizhe.wang at oracle.com Fri Dec 14 21:21:58 2012 From: huizhe.wang at oracle.com (huizhe.wang at oracle.com) Date: Fri, 14 Dec 2012 21:21:58 +0000 Subject: hg: jdk8/tl/jaxp: 8003260: [findbug] some fields should be package protected Message-ID: <20121214212203.216C64717E@hg.openjdk.java.net> Changeset: b1fdb101c82e Author: joehw Date: 2012-12-14 13:24 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/b1fdb101c82e 8003260: [findbug] some fields should be package protected Summary: change public or protected mutable static fields to private or package private. Reviewed-by: lancea ! src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java ! src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java From mandy.chung at oracle.com Fri Dec 14 21:41:09 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 14 Dec 2012 13:41:09 -0800 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50CB33FE.7000605@CoSoCo.de> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> <50CB33FE.7000605@CoSoCo.de> Message-ID: <50CB9CF5.4090300@oracle.com> Ulf, Thanks for the review. On 12/14/2012 6:13 AM, Ulf Zibis wrote: > Am 14.12.2012 11:47, schrieb Ulf Zibis: >> Am 14.12.2012 03:15, schrieb Mandy Chung: >>>> JDepsTask:111 >>>> Did you mean --summary? >>> >>> Yes will fix it. >> >> Why don't you remain consistent to all other existing java tools? >> E.g. javac uses: -cp path or -classpath path >> Double hyphen '--' is never used until today. >> '--' is the GNU-style option. pack200 uses GNU-style options for some time. There was some discussion in jigsaw-dev [1] and the new jigsaw CLIs are moving to that direction. >> So better: >> -P -profile Show profile or the file containing a package >> -R -recursive Traverse all dependencies recursively >> >> Anyway, if you prefer to stick at '--', then you should consistently >> use it for '--version', '--classpath', '--all' Renamed to --version. > > Maybe I'm in error, but additionally it seems to me, that > "-classpath=Foo" doesn't match by: -classpath is the one inconsistent with others. We think that it would be better to live with "-classpath" as people are familiar with -classpath option. Thanks Mandy [1] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2009-March/000046.html From jim.gish at oracle.com Fri Dec 14 22:49:11 2012 From: jim.gish at oracle.com (Jim Gish) Date: Fri, 14 Dec 2012 17:49:11 -0500 Subject: RFR: 4247235: (spec str) StringBuffer.insert(int, char[]) specification is inconsistent Message-ID: <50CBACE7.70701@oracle.com> Please review http://cr.openjdk.java.net/~jgish/Bug4247235-Add-Blanket-Null-Stmt/ This minor spec change (which will require CCC approval), adds blanket null-handling statements to both StringBuffer and StringBuilder, equivalent to the one already in String. Thanks, Jim -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From Ulf.Zibis at CoSoCo.de Sat Dec 15 00:35:00 2012 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Sat, 15 Dec 2012 01:35:00 +0100 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50CB920A.7080208@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CAD3A3.5040300@oracle.com> <50CB135B.7070707@CoSoCo.de> <50CB920A.7080208@oracle.com> Message-ID: <50CBC5B4.8010707@CoSoCo.de> Thanks for your explanations Mandy. Am 14.12.2012 21:54, schrieb Mandy Chung: > > On 12/14/2012 3:54 AM, Ulf Zibis wrote: >> In many places the source is exhausting to read, e.g >> if (f.exists()) { >> ClassFileReader reader = ClassFileReader.newInstance(f); >> Archive archive = new Archive(f, reader); >> result.add(archive); >> } >> could simply be: >> if (f.exists()) >> result.add(new Archive(f, ClassFileReader.newInstance(f))); >> >> ... also spreading around the variable definitions at different places. > > Fixed. Other examples: =================================== 484 while (arg != null) { ... 490 arg = iter.hasNext() ? iter.next() : null; 491 } Could be: 484 for (; iter.hasNext(); arg = iter.next()) { ... 491 } =================================== 224 Dependency.Finder finder = Dependencies.getClassDependencyFinder(); ... 238 findDependencies(finder, filter); ... 273 private void findDependencies(Dependency.Finder finder, 274 Dependency.Filter filter) Could be: 238 findDependencies(filter); ... 273 private void findDependencies(Dependency.Filter filter) { 274 Dependency.Finder finder = Dependencies.getClassDependencyFinder(); at least remove line 224 and use: 238 findDependencies(Dependencies.getClassDependencyFinder(), filter); =================================== -Ulf From Ulf.Zibis at CoSoCo.de Sat Dec 15 00:44:00 2012 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Sat, 15 Dec 2012 01:44:00 +0100 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50CB9CF5.4090300@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> <50CB33FE.7000605@CoSoCo.de> <50CB9CF5.4090300@oracle.com> Message-ID: <50CBC7D0.9050103@CoSoCo.de> Am 14.12.2012 22:41, schrieb Mandy Chung: > >> Maybe I'm in error, but additionally it seems to me, that "-classpath=Foo" doesn't match by: > > -classpath is the one inconsistent with others. We think that it would be better to live with > "-classpath" as people are familiar with -classpath option. Ah, I see. But then you should still use: 108 new Option(true, "-cp", "-classpath") { Additionally, why not providing both, the old + new syntax: 108 new Option(true, "-cp", "-classpath", "--classpath") { People are also still familiar with -version ! -Ulf From jonathan.gibbons at oracle.com Sat Dec 15 01:23:28 2012 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Fri, 14 Dec 2012 17:23:28 -0800 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50CBC7D0.9050103@CoSoCo.de> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> <50CB33FE.7000605@CoSoCo.de> <50CB9CF5.4090300@oracle.com> <50CBC7D0.9050103@CoSoCo.de> Message-ID: <50CBD110.1080208@oracle.com> On 12/14/2012 04:44 PM, Ulf Zibis wrote: > Am 14.12.2012 22:41, schrieb Mandy Chung: >> >>> Maybe I'm in error, but additionally it seems to me, that >>> "-classpath=Foo" doesn't match by: >> >> -classpath is the one inconsistent with others. We think that it >> would be better to live with "-classpath" as people are familiar with >> -classpath option. > > Ah, I see. But then you should still use: > 108 new Option(true, "-cp", "-classpath") { > > Additionally, why not providing both, the old + new syntax: > 108 new Option(true, "-cp", "-classpath", "--classpath") { > > People are also still familiar with -version ! > > -Ulf > I guess I am against inconsistent use of the GNU option pattern. It is bad enough that we have to have different tools with different standards, but if we're going to a more GNU like pattern, we should have a more consistent policy about how we mix these styles. Inconsistently adopting GNU style is in my opinion worse than not adopting it. -- Jon From mandy.chung at oracle.com Sat Dec 15 01:30:39 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 14 Dec 2012 17:30:39 -0800 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50CBD110.1080208@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> <50CB33FE.7000605@CoSoCo.de> <50CB9CF5.4090300@oracle.com> <50CBC7D0.9050103@CoSoCo.de> <50CBD110.1080208@oracle.com> Message-ID: <50CBD2BF.90100@oracle.com> On 12/14/2012 5:23 PM, Jonathan Gibbons wrote: >>> -classpath is the one inconsistent with others. We think that it >>> would be better to live with "-classpath" as people are familiar >>> with -classpath option. >> >> Ah, I see. But then you should still use: >> 108 new Option(true, "-cp", "-classpath") { >> >> Additionally, why not providing both, the old + new syntax: >> 108 new Option(true, "-cp", "-classpath", "--classpath") { >> >> People are also still familiar with -version ! >> >> -Ulf >> > > I guess I am against inconsistent use of the GNU option pattern. It is > bad enough that we have to have different tools with different > standards, but if we're going to a more GNU like pattern, we should > have a more consistent policy about how we mix these styles. > Inconsistently adopting GNU style is in my opinion worse than not > adopting it. Having a second thought, it's a new tool and we need to learn its options anyway. I'd opt for consistency than familiarity and not to have mixture of Unix-style and GNU-style options. If no objection, I will change it to --classpath for the initial push. Mandy From david.holmes at oracle.com Sat Dec 15 09:24:51 2012 From: david.holmes at oracle.com (David Holmes) Date: Sat, 15 Dec 2012 19:24:51 +1000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> <50C56053.1060306@oracle.com> <50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com> <50C6FCDE.7070404@oracle.com> <50C70087.4030003@gmail.com> <50C718BD.2010201@oracle.com> <50C71FE0.5020704@gmail.com> <50C7E086.6040805@oracle.com> <50C917DE.6010200@oracle.com> Message-ID: <50CC41E3.3040504@oracle.com> On 15/12/2012 12:58 AM, Zhong Yu wrote: > On Wed, Dec 12, 2012 at 5:48 PM, David Holmes wrote: >> On 13/12/2012 1:51 AM, Zhong Yu wrote: >>> >>> If a class loader is declared fully concurrent, yet >>> getClassLoadingLock() is invoked, what's the harm of returning a >>> dedicated lock anyway, exactly like what's done before? >> >> >> The whole point is to get rid of the lockMap and these lock objects. >> >> I could return a sentinel Object in all cases rather than null but that just >> seems to encourage continued use of something that shouldn't be used with a >> fully concurrent loader. >> >> Returning null versus throwing an exception is mostly a matter of style. I'd >> want to hear from anyone who invokes getClassLoadingLock() on any of the >> system classloaders to see which is preferable. > > Since this change will break some applications, the failure should be > loud, with immediate and detailed information on what's going on, so > the poor developers can fix the problem quickly. Can you suggest any actual use of the result of getClassLoadingLock() that won't cause a NullPointerException if null is returned? > I had the pleasure of implementing classloaders before, and I think it > might be underestimated how many classloaders are actually out there. The question is how many of them became parallel capable in Java 7 and out of those how many actually use the lockMap (via getClassLoadingLock()) themselves? Do you have any real data on that? Can you even conceive a realistic example of how a custom loader might use the lock supplied by a parent loader? Cheers, David > Zhong > > From Alan.Bateman at oracle.com Sat Dec 15 13:58:23 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 15 Dec 2012 13:58:23 +0000 Subject: RFR: 4247235: (spec str) StringBuffer.insert(int, char[]) specification is inconsistent In-Reply-To: <50CBACE7.70701@oracle.com> References: <50CBACE7.70701@oracle.com> Message-ID: <50CC81FF.3000602@oracle.com> On 14/12/2012 22:49, Jim Gish wrote: > Please review > http://cr.openjdk.java.net/~jgish/Bug4247235-Add-Blanket-Null-Stmt/ > > > This minor spec change (which will require CCC approval), adds blanket > null-handling statements to both StringBuffer and StringBuilder, > equivalent to the one already in String. It looks like most (all?) of the methods defined by StringBuffer and StringBuilder that can throw NPE already specify it. Are you planning on removing the @throws from the methods? I see that String uses null, the proposed update to StringBuilder uses null, and the proposed update to StringBuffer uses {@code null}. We should try to be consistent. -Alan. From alan.bateman at oracle.com Sat Dec 15 15:11:18 2012 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Sat, 15 Dec 2012 15:11:18 +0000 Subject: hg: jdk8/tl/jdk: 8004963: URLConnection, downgrade normative reference to ${java.home}/lib/content-types.properties Message-ID: <20121215151130.417F44719C@hg.openjdk.java.net> Changeset: 69fd3f3d20c1 Author: alanb Date: 2012-12-15 15:07 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/69fd3f3d20c1 8004963: URLConnection, downgrade normative reference to ${java.home}/lib/content-types.properties Reviewed-by: chegar ! src/share/classes/java/net/URLConnection.java From zhong.j.yu at gmail.com Sun Dec 16 16:12:19 2012 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Sun, 16 Dec 2012 10:12:19 -0600 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: <50CC41E3.3040504@oracle.com> References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> <50C56053.1060306@oracle.com> <50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com> <50C6FCDE.7070404@oracle.com> <50C70087.4030003@gmail.com> <50C718BD.2010201@oracle.com> <50C71FE0.5020704@gmail.com> <50C7E086.6040805@oracle.com> <50C917DE.6010200@oracle.com> <50CC41E3.3040504@oracle.com> Message-ID: On Sat, Dec 15, 2012 at 3:24 AM, David Holmes wrote: > On 15/12/2012 12:58 AM, Zhong Yu wrote: >> >> On Wed, Dec 12, 2012 at 5:48 PM, David Holmes >> wrote: >>> >>> On 13/12/2012 1:51 AM, Zhong Yu wrote: >>>> >>>> >>>> If a class loader is declared fully concurrent, yet >>>> getClassLoadingLock() is invoked, what's the harm of returning a >>>> dedicated lock anyway, exactly like what's done before? >>> >>> >>> >>> The whole point is to get rid of the lockMap and these lock objects. >>> >>> I could return a sentinel Object in all cases rather than null but that >>> just >>> seems to encourage continued use of something that shouldn't be used with >>> a >>> fully concurrent loader. >>> >>> Returning null versus throwing an exception is mostly a matter of style. >>> I'd >>> want to hear from anyone who invokes getClassLoadingLock() on any of the >>> system classloaders to see which is preferable. >> >> >> Since this change will break some applications, the failure should be >> loud, with immediate and detailed information on what's going on, so >> the poor developers can fix the problem quickly. > > > Can you suggest any actual use of the result of getClassLoadingLock() that > won't cause a NullPointerException if null is returned? I'm saying a more specific exception could be more helpful than NPE, for example, UnsupportedOperationException("getClassLoadingLock() not supported in a fully concurrent class loader") >> I had the pleasure of implementing classloaders before, and I think it >> might be underestimated how many classloaders are actually out there. > > > The question is how many of them became parallel capable in Java 7 and out > of those how many actually use the lockMap (via getClassLoadingLock()) > themselves? Do you have any real data on that? > > Can you even conceive a realistic example of how a custom loader might use > the lock supplied by a parent loader? > > Cheers, > David > >> Zhong >> >> > From peter.levart at gmail.com Sun Dec 16 17:26:23 2012 From: peter.levart at gmail.com (Peter Levart) Date: Sun, 16 Dec 2012 18:26:23 +0100 Subject: ReflectionData space optimization in java.lang.Class (JEP-149) In-Reply-To: <50CAB245.6010004@oracle.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com> <50C8793F.1050205@gmail.com> <50C90C35.7020000@oracle.com> <50C9AA46.5030401@gmail.com> <50C9B1F0.5080808@oracle.com> <50C9C997.10900@gmail.com> <50CAB245.6010004@oracle.com> Message-ID: <50CE043F.7090609@gmail.com> Hi David, Mandy, Joel and others, I prepared the 3rd revision of the patch: http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev.03/index.html Changes from the 1st revision (disregard 2nd revision) are as follows: - The split of reflectionData() method into short fast-path and longer slow-path newReflectionData() as already proposed in 2nd revision of the patch. - The logic of privateGetDeclared[Fields|Methods|Constructors](boolean publicOnly) methods has been rewritten to eliminate caching of duplicate Field/Method/Constructor instances for the same field, method or constructor. As it turns out, the same public Member can be cached twice. One instance in ReflectionData.declared[Fields|Methods|Constructors] array and the other instance in ReflectionData.declaredPublic[Fields|Methods] or publicConstructors array. These arrays pairs (declared/declaredPublic) retain distinct instances, because they are obtained by separate calls to VM which always constructs new instances. The new proposed logic eliminates duplicate instances, but does not otherwise present any new overhead. It never requests more data from VM then needed at a particular moment (it may request less data from VM if external calls are issued in a particular order). Some applications may benefit from saved allocated space if they request "declared" members and "public" members on same Class instances. Here's the comparison of bytes allocated for the ReflectionData object in some Class instances after invoking particular reflection methods: *** *** Original JDK8 privateGetDeclaredXXX methods: *** Deep size of ReflectionData in: java.lang.Object.class before any calls: 0 bytes after getDeclaredConstructors: 192 bytes after getDeclaredFields: 192 bytes after getDeclaredMethods: 1,552 bytes after getConstructors: 1,664 bytes after getFields: 1,696 bytes after getMethods: 2,856 bytes Deep size of ReflectionData in: java.lang.String.class before any calls: 704 bytes after getDeclaredConstructors: 2,472 bytes after getDeclaredFields: 2,472 bytes after getDeclaredMethods: 10,808 bytes after getConstructors: 12,464 bytes after getFields: 12,712 bytes after getMethods: 21,056 bytes Deep size of ReflectionData in: java.util.HashMap.class before any calls: 0 bytes after getDeclaredConstructors: 472 bytes after getDeclaredFields: 1,328 bytes after getDeclaredMethods: 5,856 bytes after getConstructors: 6,360 bytes after getFields: 6,392 bytes after getMethods: 9,576 bytes Deep size of ReflectionData in: javax.swing.JTable.class before any calls: 0 bytes after getDeclaredConstructors: 784 bytes after getDeclaredFields: 4,224 bytes after getDeclaredMethods: 26,072 bytes after getConstructors: 26,792 bytes after getFields: 28,600 bytes after getMethods: 79,912 bytes *** *** With modified privateGetDeclaredXXX methods: *** Deep size of ReflectionData in: java.lang.Object.class before any calls: 0 bytes after getDeclaredConstructors: 192 bytes after getDeclaredFields: 192 bytes after getDeclaredMethods: 1,552 bytes after getConstructors: 1,552 bytes after getFields: 1,568 bytes after getMethods: 1,680 bytes Deep size of ReflectionData in: java.lang.String.class before any calls: 0 bytes after getDeclaredConstructors: 1,816 bytes after getDeclaredFields: 2,368 bytes after getDeclaredMethods: 10,704 bytes after getConstructors: 10,784 bytes after getFields: 10,832 bytes after getMethods: 12,096 bytes Deep size of ReflectionData in: java.util.HashMap.class before any calls: 0 bytes after getDeclaredConstructors: 472 bytes after getDeclaredFields: 1,328 bytes after getDeclaredMethods: 5,856 bytes after getConstructors: 5,856 bytes after getFields: 5,888 bytes after getMethods: 7,024 bytes Deep size of ReflectionData in: javax.swing.JTable.class before any calls: 0 bytes after getDeclaredConstructors: 784 bytes after getDeclaredFields: 4,224 bytes after getDeclaredMethods: 26,072 bytes after getConstructors: 26,072 bytes after getFields: 27,520 bytes after getMethods: 62,960 bytes My micro-benchmarks show no performance degradations with changed caching logic. So what do you think, David? Regards, Peter On 12/14/2012 05:59 AM, David Holmes wrote: > Hi Peter, > > On 13/12/2012 10:27 PM, Peter Levart wrote: >> On 12/13/2012 11:46 AM, David Holmes wrote: > > > >>>> I also found code-paths that evaluated reflectionData() method more >>>> than >>>> once for each external call. It's the methods: >>>> >>>> private Field[] privateGetDeclaredFields(boolean publicOnly) >>>> >>>> and >>>> >>>> private Method[] privateGetDeclaredMethods(boolean publicOnly) >>>> >>>> which are called from: >>>> >>>> private Field[] privateGetPublicFields(Set> >>>> traversedInterfaces) >>>> >>>> and >>>> >>>> private Method[] privateGetPublicMethods() >>>> >>>> respectively. I therefore introduced overloaded variants of the former >>>> methods taking a ReflectionData parameter like the following: >>>> >>>> private Field[] privateGetDeclaredFields(boolean publicOnly) { >>>> return privateGetDeclaredFields(publicOnly, reflectionData()); >>>> } >>>> // A variant called from methods that already obtained ReflectionData >>>> instance >>>> private Field[] privateGetDeclaredFields(boolean publicOnly, >>>> ReflectionData rd) { >>>> ... >>>> >>>> the same for privateGetDeclaredMethods. This is not for performance >>>> reasons (though it might help) but for correctness. Each external call >>>> should be a separate "transaction" and should work on the same >>>> ReflectionData instance. The "transaction" is only guaranteed on the >>>> level of a particular java.lang.Class instance though. Some methods >>>> also >>>> invoke other Class instances (to gather inherited public methods / >>>> fields) and those invocations might be separate transactions in the >>>> face >>>> of concurrent class re-definitions. But we are not going to >>>> implement a >>>> database here, are we? >>> >>> Sorry I don't understand the problem you are seeing here. If we find a >>> cached public fields, for example, we will return it. Else we start >>> the process of calculating anew. If someone else manages to fill in >>> the cache then we will get it when we call privateGetDeclaredFields. >>> The results are expected to be idempotent so I don't see what the >>> problem is. >>> >> It's true, yes. For the outside caller there is no observable >> difference. It can only happen that we retrieve declaredFields from a >> newer snapshot (say v.2) of ReflectionData and then compute publicFields >> and install them into an older ReflectionData instance v.1 which is >> already obsolete. But for the outside observer there's no difference. >> From performance standpoint, the additional call to reflectionData() >> that we save is on the slow-path so it's not worth it. > > Okay - so I'll ignore this :) > >> The split of reflectionData() into two methods does have an impact >> though. FWIW my micro-benchmark shows that without the split, only the >> following public method is observed to be faster then in the original >> JDK8 code: >> >> - getFields - 4x >> >> With the split of reflectionData() but without these unneeded overloaded >> privateGetDeclaredFields methods, the following methods are faster: >> >> - getMethods - 1.7x (1, 2 threads) ... 1x (4...32 threads) >> - getFields - 4x >> - getDeclaredConstructor - 6x ... 11x >> - getDeclaredMethod - 3x >> >> But for performance tests that you already initiated, it is important to >> note that original patch is good enough since it appears that no public >> method is any slower than in the original JDK8 code. >> >> Speaking of that, I don't know much about the constraints of the JIT >> compiler, but it seems from the results above, that it can in-line >> multiple levels of method calls and that the total size of the methods >> matter. If this is true then it might be possible to split several >> private methods in java.lang.Class into pairs of short fast-path and >> longer slow-path. Is this worth the maintenance cost? > > Method size certainly does affect inlining. Generally however we would > only refactor this way if we find a bottleneck that needs to be broken > - splitting methods adds additional meta-data overhead etc. > > As you've already done the investigation here I think the split is a > reasonable one to make. But I wonder in general applications how often > we'll even end up compiling this method. > > Thanks, > David > >> Regards, Peter >> >>> Thanks, >>> David >>> ------ >>> >>>> I prepared some micro benchmarks for individual public methods. >>>> Here're >>>> the results: >>>> >>>> https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/reflection_data_benchmark_results_i7-2600K.txt >>>> >>>> >>>> >>>> they indicate no noticeable performance decreases. Some methods are in >>>> fact faster (more in-linable?): >>>> >>>> - getFields - 4x >>>> - getDeclaredConstructor - 4x ... 10x >>>> - getDeclaredMethod - 3x >>>> >>>> Here's the code for micro-benchmarks: >>>> >>>> https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/src/test/ReflectionDataTest.java >>>> >>>> >>>> >>>> >>>> Regards, Peter >>>> >>>> >>>> On 12/12/2012 11:59 PM, Mandy Chung wrote: >>>>> Hi Peter, >>>>> >>>>> On 12/12/12 4:31 AM, Peter Levart wrote: >>>>>> Hi all, >>>>>> >>>>>> Ok, no problem. So here's a patch that summarizes what I did in the >>>>>> previous patch, but only for reflective fields (Field[], Method[], >>>>>> Constructor[]) not including annotations: >>>>>> >>>>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev/index.html >>>>>> >>>>>> >>>>> >>>>> Finally able to make time to review this patch. It's good work. While >>>>> it's good to see the synchronization issue with annotations be fixed, >>>>> separating the cache for reflection and annotation helps. As David >>>>> replied, he will take your patch and run with it for JEP-149. >>>>> >>>>> The change looks good. Nit: there are several long lines >>>>> L2235,2244,2245,2249,2269 etc that should be broken into separate >>>>> lines. The remaining open question is the performance difference in >>>>> the reflectionData() method and how well it will be jit'ed. In the >>>>> common case, there is no class redefinition where >>>>> classCachesOnClassRedefinition() is essentially like an nop. I >>>>> believe >>>>> David will look at the footprint and performance numbers as he has >>>>> initiated the performance testing (need to do it with this new >>>>> patch). >>>>> >>>>> Thanks >>>>> Mandy >>>>> >>>>>> The annotations part is unchanged semantically, but I had to: >>>>>> >>>>>> - modify private method clearCachesOnClassRedefinition to only >>>>>> include invalidation of annotations and declaredAnnotations >>>>>> fields. I >>>>>> also renamed it to clearAnnotationCachesOnClassRedefinition >>>>>> - renamed lastRedefinedCount to lastAnnotationsRedefinedCount and, >>>>>> since this field is now only accessed while holding a lock (from >>>>>> synchronized initAnnotationsIfNecessary), I removed the volatile >>>>>> keyword. >>>>>> >>>>>> That's it. >>>>>> >>>>>> While looking at this unchanged part of code some more, I see other >>>>>> races as well. For example: two concurrent accesses to annotations >>>>>> combined with redefinition of a class can result in NPE. Here's a >>>>>> serial execution: >>>>>> >>>>>> Thread 1: >>>>>> getAnnotation(annotationType); >>>>>> initAnnotationsIfNecessary(); >>>>>> >>>>>> VM: >>>>>> classRedefinedCount++; >>>>>> >>>>>> Thread 2: >>>>>> getAnnotation(annotationType); >>>>>> initAnnotationsIfNecessary(); >>>>>> clearAnnotationCachesOnClassRedefinition(); >>>>>> annotations = null; >>>>>> >>>>>> Thread 1: >>>>>> return AnnotationSupport.getOneAnnotation(annotations, >>>>>> annotationClass); >>>>>> // 'annotations' field can be null >>>>>> >>>>>> >>>>>> So this needs to be fixed sooner or later. >>>>>> >>>>>> Joel! >>>>>> >>>>>> Are your JSR 308 canges involving java.lang.Class too? >>>>>> >>>>>> Regards, Peter >>>>>> >>>>>> >>>>>> On 12/12/2012 11:59 AM, Joel Borggr?n-Franck wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> First, thanks all of you that are involved in this! >>>>>>> >>>>>>> I agree with David here, lets split this up (for now) and do >>>>>>> reflective objects in the context of jep-149 and annotations >>>>>>> separately. >>>>>>> >>>>>>> As you may know there are even more annotation coming in with JSR >>>>>>> 308 annotations on type (use), so I want to complete that work >>>>>>> first >>>>>>> and then do the effort of reducing contention and overhead for both >>>>>>> type and regular annotations and also fixing up the behaviour for >>>>>>> redefine/retransform class. >>>>>>> >>>>>>> One other point to consider is that some of the fields in >>>>>>> java/lang/reflect/ classes are known by the VM so not all >>>>>>> changes in >>>>>>> Java-land are actually doable. Glancing over your patches very >>>>>>> quickly I don't think you have done anything to upset the VM, but >>>>>>> then I am not an expert in this area. >>>>>>> >>>>>>> Also, with the VM permgen changes we might have to rethink our >>>>>>> assumptions in order to reduce total overhead. For example as I >>>>>>> understand it previously we could just ship the same pointer into >>>>>>> permgen for the annotations arrays, now that isn't possible so we >>>>>>> create a new copy of the array for every Field/Method/Constructor >>>>>>> instance. Perhaps there is some clever way of eliminating those >>>>>>> copies. >>>>>>> >>>>>>> So while I think your patches generally makes sense, I think it is >>>>>>> prudent to delay this for annotations until all our new annotation >>>>>>> features are in. >>>>>>> >>>>>>> cheers >>>>>>> /Joel >>>>>>> >>>>>>> On Dec 10, 2012, at 7:18 AM, David Holmes >>>>>>> wrote: >>>>>>> >>>>>>>> Hi Peter, >>>>>>>> >>>>>>>> Sorry for the delay on this. >>>>>>>> >>>>>>>> Generally your VolatileData and my ReflectionHelper are doing a >>>>>>>> similar job. But I agree with your reasoning that all of the >>>>>>>> cached >>>>>>>> SoftReferences are likely to be cleared at once, and so a >>>>>>>> SoftReference to a helper object with direct references, is more >>>>>>>> effective than a direct reference to a helper object with >>>>>>>> SoftReferences. My initial stance with this was very conservative >>>>>>>> as the more change that is introduced the more uncertainty >>>>>>>> there is >>>>>>>> about the impact. >>>>>>>> >>>>>>>> I say the above primarily because I think, if I am to proceed with >>>>>>>> this, I will need to separate out the general reflection caching >>>>>>>> changes from the annotation changes. There are a number of reasons >>>>>>>> for this: >>>>>>>> >>>>>>>> First, I'm not at all familiar with the implementation of >>>>>>>> annotations at the VM or Java level, and the recent changes in >>>>>>>> this >>>>>>>> area just exacerbate my ignorance of the mechanics. So I don't >>>>>>>> feel >>>>>>>> qualified to evaluate that aspect. >>>>>>>> >>>>>>>> Second, the bulk of the reflection caching code is simplified by >>>>>>>> the fact that due to current constraints on class redefinition the >>>>>>>> caching is effectively idempotent for fields/methods/constructors. >>>>>>>> But that is not the case for annotations. >>>>>>>> >>>>>>>> Finally, the use of synchronization with the annotations method is >>>>>>>> perplexing me. I sent Joe a private email on this but I may as >>>>>>>> well >>>>>>>> raise it here - and I think you have alluded to this in your >>>>>>>> earlier emails as well: initAnnotationsIfNecessary() is a >>>>>>>> synchronized instance method but I can not find any other code in >>>>>>>> the VM that synchronizes on the Class object's monitor. So if this >>>>>>>> synchronization is trying to establish consistency in the face of >>>>>>>> class redefinition, I do not see where class redefinition is >>>>>>>> participating in the synchronization! >>>>>>>> >>>>>>>> So what I would like to do is take your basic VolatileData part of >>>>>>>> the patch and run with it for JEP-149 purposes, while separating >>>>>>>> the annotations issue so they can be dealt with by the experts in >>>>>>>> that particular area. >>>>>>>> >>>>>>>> I'm sorry it has taken so long to arrive at a fairly negative >>>>>>>> position, but I need someone else to take up the annotations >>>>>>>> gauntlet and run with it. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> David >>>>>>>> >>>> >> From david.holmes at oracle.com Sun Dec 16 21:20:39 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 17 Dec 2012 07:20:39 +1000 Subject: ReflectionData space optimization in java.lang.Class (JEP-149) In-Reply-To: <50CE043F.7090609@gmail.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com> <50C8793F.1050205@gmail.com> <50C90C35.7020000@oracle.com> <50C9AA46.5030401@gmail.com> <50C9B1F0.5080808@oracle.com> <50C9C997.10900@gmail.com> <50CAB245.6010004@oracle.com> <50CE043F.7090609@gmail.com> Message-ID: <50CE3B27.5070306@oracle.com> Hi Peter, We have to be careful not to disrupt the dynamics of things too much. Duplicate copies wastes memory but doing the replacement wastes time. If we could be purely memory focused then we would do anything to save memory, but we can't do that - we're trying to save some memory without being too disruptive to performance aspects. The more changes like this that are made the less idea we have about the impact on existing reflection-using applications. And we don't have any compelling use-case to motivate this. So I'm inclined to not take this additional step at this time. Thanks, David On 17/12/2012 3:26 AM, Peter Levart wrote: > Hi David, Mandy, Joel and others, > > I prepared the 3rd revision of the patch: > > http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev.03/index.html > > Changes from the 1st revision (disregard 2nd revision) are as follows: > > - The split of reflectionData() method into short fast-path and longer > slow-path newReflectionData() as already proposed in 2nd revision of the > patch. > - The logic of privateGetDeclared[Fields|Methods|Constructors](boolean > publicOnly) methods has been rewritten to eliminate caching of duplicate > Field/Method/Constructor instances for the same field, method or > constructor. > > As it turns out, the same public Member can be cached twice. One > instance in ReflectionData.declared[Fields|Methods|Constructors] array > and the other instance in ReflectionData.declaredPublic[Fields|Methods] > or publicConstructors array. These arrays pairs > (declared/declaredPublic) retain distinct instances, because they are > obtained by separate calls to VM which always constructs new instances. > > The new proposed logic eliminates duplicate instances, but does not > otherwise present any new overhead. It never requests more data from VM > then needed at a particular moment (it may request less data from VM if > external calls are issued in a particular order). > > Some applications may benefit from saved allocated space if they request > "declared" members and "public" members on same Class instances. > > Here's the comparison of bytes allocated for the ReflectionData object > in some Class instances after invoking particular reflection methods: > > *** > *** Original JDK8 privateGetDeclaredXXX methods: > *** > > Deep size of ReflectionData in: java.lang.Object.class > > before any calls: 0 bytes > after getDeclaredConstructors: 192 bytes > after getDeclaredFields: 192 bytes > after getDeclaredMethods: 1,552 bytes > after getConstructors: 1,664 bytes > after getFields: 1,696 bytes > after getMethods: 2,856 bytes > > Deep size of ReflectionData in: java.lang.String.class > > before any calls: 704 bytes > after getDeclaredConstructors: 2,472 bytes > after getDeclaredFields: 2,472 bytes > after getDeclaredMethods: 10,808 bytes > after getConstructors: 12,464 bytes > after getFields: 12,712 bytes > after getMethods: 21,056 bytes > > Deep size of ReflectionData in: java.util.HashMap.class > > before any calls: 0 bytes > after getDeclaredConstructors: 472 bytes > after getDeclaredFields: 1,328 bytes > after getDeclaredMethods: 5,856 bytes > after getConstructors: 6,360 bytes > after getFields: 6,392 bytes > after getMethods: 9,576 bytes > > Deep size of ReflectionData in: javax.swing.JTable.class > > before any calls: 0 bytes > after getDeclaredConstructors: 784 bytes > after getDeclaredFields: 4,224 bytes > after getDeclaredMethods: 26,072 bytes > after getConstructors: 26,792 bytes > after getFields: 28,600 bytes > after getMethods: 79,912 bytes > > > *** > *** With modified privateGetDeclaredXXX methods: > *** > > Deep size of ReflectionData in: java.lang.Object.class > > before any calls: 0 bytes > after getDeclaredConstructors: 192 bytes > after getDeclaredFields: 192 bytes > after getDeclaredMethods: 1,552 bytes > after getConstructors: 1,552 bytes > after getFields: 1,568 bytes > after getMethods: 1,680 bytes > > Deep size of ReflectionData in: java.lang.String.class > > before any calls: 0 bytes > after getDeclaredConstructors: 1,816 bytes > after getDeclaredFields: 2,368 bytes > after getDeclaredMethods: 10,704 bytes > after getConstructors: 10,784 bytes > after getFields: 10,832 bytes > after getMethods: 12,096 bytes > > Deep size of ReflectionData in: java.util.HashMap.class > > before any calls: 0 bytes > after getDeclaredConstructors: 472 bytes > after getDeclaredFields: 1,328 bytes > after getDeclaredMethods: 5,856 bytes > after getConstructors: 5,856 bytes > after getFields: 5,888 bytes > after getMethods: 7,024 bytes > > Deep size of ReflectionData in: javax.swing.JTable.class > > before any calls: 0 bytes > after getDeclaredConstructors: 784 bytes > after getDeclaredFields: 4,224 bytes > after getDeclaredMethods: 26,072 bytes > after getConstructors: 26,072 bytes > after getFields: 27,520 bytes > after getMethods: 62,960 bytes > > > My micro-benchmarks show no performance degradations with changed > caching logic. > > So what do you think, David? > > > Regards, Peter > > > On 12/14/2012 05:59 AM, David Holmes wrote: >> Hi Peter, >> >> On 13/12/2012 10:27 PM, Peter Levart wrote: >>> On 12/13/2012 11:46 AM, David Holmes wrote: >> >> >> >>>>> I also found code-paths that evaluated reflectionData() method more >>>>> than >>>>> once for each external call. It's the methods: >>>>> >>>>> private Field[] privateGetDeclaredFields(boolean publicOnly) >>>>> >>>>> and >>>>> >>>>> private Method[] privateGetDeclaredMethods(boolean publicOnly) >>>>> >>>>> which are called from: >>>>> >>>>> private Field[] privateGetPublicFields(Set> >>>>> traversedInterfaces) >>>>> >>>>> and >>>>> >>>>> private Method[] privateGetPublicMethods() >>>>> >>>>> respectively. I therefore introduced overloaded variants of the former >>>>> methods taking a ReflectionData parameter like the following: >>>>> >>>>> private Field[] privateGetDeclaredFields(boolean publicOnly) { >>>>> return privateGetDeclaredFields(publicOnly, reflectionData()); >>>>> } >>>>> // A variant called from methods that already obtained ReflectionData >>>>> instance >>>>> private Field[] privateGetDeclaredFields(boolean publicOnly, >>>>> ReflectionData rd) { >>>>> ... >>>>> >>>>> the same for privateGetDeclaredMethods. This is not for performance >>>>> reasons (though it might help) but for correctness. Each external call >>>>> should be a separate "transaction" and should work on the same >>>>> ReflectionData instance. The "transaction" is only guaranteed on the >>>>> level of a particular java.lang.Class instance though. Some methods >>>>> also >>>>> invoke other Class instances (to gather inherited public methods / >>>>> fields) and those invocations might be separate transactions in the >>>>> face >>>>> of concurrent class re-definitions. But we are not going to >>>>> implement a >>>>> database here, are we? >>>> >>>> Sorry I don't understand the problem you are seeing here. If we find a >>>> cached public fields, for example, we will return it. Else we start >>>> the process of calculating anew. If someone else manages to fill in >>>> the cache then we will get it when we call privateGetDeclaredFields. >>>> The results are expected to be idempotent so I don't see what the >>>> problem is. >>>> >>> It's true, yes. For the outside caller there is no observable >>> difference. It can only happen that we retrieve declaredFields from a >>> newer snapshot (say v.2) of ReflectionData and then compute publicFields >>> and install them into an older ReflectionData instance v.1 which is >>> already obsolete. But for the outside observer there's no difference. >>> From performance standpoint, the additional call to reflectionData() >>> that we save is on the slow-path so it's not worth it. >> >> Okay - so I'll ignore this :) >> >>> The split of reflectionData() into two methods does have an impact >>> though. FWIW my micro-benchmark shows that without the split, only the >>> following public method is observed to be faster then in the original >>> JDK8 code: >>> >>> - getFields - 4x >>> >>> With the split of reflectionData() but without these unneeded overloaded >>> privateGetDeclaredFields methods, the following methods are faster: >>> >>> - getMethods - 1.7x (1, 2 threads) ... 1x (4...32 threads) >>> - getFields - 4x >>> - getDeclaredConstructor - 6x ... 11x >>> - getDeclaredMethod - 3x >>> >>> But for performance tests that you already initiated, it is important to >>> note that original patch is good enough since it appears that no public >>> method is any slower than in the original JDK8 code. >>> >>> Speaking of that, I don't know much about the constraints of the JIT >>> compiler, but it seems from the results above, that it can in-line >>> multiple levels of method calls and that the total size of the methods >>> matter. If this is true then it might be possible to split several >>> private methods in java.lang.Class into pairs of short fast-path and >>> longer slow-path. Is this worth the maintenance cost? >> >> Method size certainly does affect inlining. Generally however we would >> only refactor this way if we find a bottleneck that needs to be broken >> - splitting methods adds additional meta-data overhead etc. >> >> As you've already done the investigation here I think the split is a >> reasonable one to make. But I wonder in general applications how often >> we'll even end up compiling this method. >> >> Thanks, >> David >> >>> Regards, Peter >>> >>>> Thanks, >>>> David >>>> ------ >>>> >>>>> I prepared some micro benchmarks for individual public methods. >>>>> Here're >>>>> the results: >>>>> >>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/reflection_data_benchmark_results_i7-2600K.txt >>>>> >>>>> >>>>> >>>>> they indicate no noticeable performance decreases. Some methods are in >>>>> fact faster (more in-linable?): >>>>> >>>>> - getFields - 4x >>>>> - getDeclaredConstructor - 4x ... 10x >>>>> - getDeclaredMethod - 3x >>>>> >>>>> Here's the code for micro-benchmarks: >>>>> >>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/src/test/ReflectionDataTest.java >>>>> >>>>> >>>>> >>>>> >>>>> Regards, Peter >>>>> >>>>> >>>>> On 12/12/2012 11:59 PM, Mandy Chung wrote: >>>>>> Hi Peter, >>>>>> >>>>>> On 12/12/12 4:31 AM, Peter Levart wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> Ok, no problem. So here's a patch that summarizes what I did in the >>>>>>> previous patch, but only for reflective fields (Field[], Method[], >>>>>>> Constructor[]) not including annotations: >>>>>>> >>>>>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev/index.html >>>>>>> >>>>>>> >>>>>> >>>>>> Finally able to make time to review this patch. It's good work. While >>>>>> it's good to see the synchronization issue with annotations be fixed, >>>>>> separating the cache for reflection and annotation helps. As David >>>>>> replied, he will take your patch and run with it for JEP-149. >>>>>> >>>>>> The change looks good. Nit: there are several long lines >>>>>> L2235,2244,2245,2249,2269 etc that should be broken into separate >>>>>> lines. The remaining open question is the performance difference in >>>>>> the reflectionData() method and how well it will be jit'ed. In the >>>>>> common case, there is no class redefinition where >>>>>> classCachesOnClassRedefinition() is essentially like an nop. I >>>>>> believe >>>>>> David will look at the footprint and performance numbers as he has >>>>>> initiated the performance testing (need to do it with this new >>>>>> patch). >>>>>> >>>>>> Thanks >>>>>> Mandy >>>>>> >>>>>>> The annotations part is unchanged semantically, but I had to: >>>>>>> >>>>>>> - modify private method clearCachesOnClassRedefinition to only >>>>>>> include invalidation of annotations and declaredAnnotations >>>>>>> fields. I >>>>>>> also renamed it to clearAnnotationCachesOnClassRedefinition >>>>>>> - renamed lastRedefinedCount to lastAnnotationsRedefinedCount and, >>>>>>> since this field is now only accessed while holding a lock (from >>>>>>> synchronized initAnnotationsIfNecessary), I removed the volatile >>>>>>> keyword. >>>>>>> >>>>>>> That's it. >>>>>>> >>>>>>> While looking at this unchanged part of code some more, I see other >>>>>>> races as well. For example: two concurrent accesses to annotations >>>>>>> combined with redefinition of a class can result in NPE. Here's a >>>>>>> serial execution: >>>>>>> >>>>>>> Thread 1: >>>>>>> getAnnotation(annotationType); >>>>>>> initAnnotationsIfNecessary(); >>>>>>> >>>>>>> VM: >>>>>>> classRedefinedCount++; >>>>>>> >>>>>>> Thread 2: >>>>>>> getAnnotation(annotationType); >>>>>>> initAnnotationsIfNecessary(); >>>>>>> clearAnnotationCachesOnClassRedefinition(); >>>>>>> annotations = null; >>>>>>> >>>>>>> Thread 1: >>>>>>> return AnnotationSupport.getOneAnnotation(annotations, >>>>>>> annotationClass); >>>>>>> // 'annotations' field can be null >>>>>>> >>>>>>> >>>>>>> So this needs to be fixed sooner or later. >>>>>>> >>>>>>> Joel! >>>>>>> >>>>>>> Are your JSR 308 canges involving java.lang.Class too? >>>>>>> >>>>>>> Regards, Peter >>>>>>> >>>>>>> >>>>>>> On 12/12/2012 11:59 AM, Joel Borggr?n-Franck wrote: >>>>>>>> Hi all, >>>>>>>> >>>>>>>> First, thanks all of you that are involved in this! >>>>>>>> >>>>>>>> I agree with David here, lets split this up (for now) and do >>>>>>>> reflective objects in the context of jep-149 and annotations >>>>>>>> separately. >>>>>>>> >>>>>>>> As you may know there are even more annotation coming in with JSR >>>>>>>> 308 annotations on type (use), so I want to complete that work >>>>>>>> first >>>>>>>> and then do the effort of reducing contention and overhead for both >>>>>>>> type and regular annotations and also fixing up the behaviour for >>>>>>>> redefine/retransform class. >>>>>>>> >>>>>>>> One other point to consider is that some of the fields in >>>>>>>> java/lang/reflect/ classes are known by the VM so not all >>>>>>>> changes in >>>>>>>> Java-land are actually doable. Glancing over your patches very >>>>>>>> quickly I don't think you have done anything to upset the VM, but >>>>>>>> then I am not an expert in this area. >>>>>>>> >>>>>>>> Also, with the VM permgen changes we might have to rethink our >>>>>>>> assumptions in order to reduce total overhead. For example as I >>>>>>>> understand it previously we could just ship the same pointer into >>>>>>>> permgen for the annotations arrays, now that isn't possible so we >>>>>>>> create a new copy of the array for every Field/Method/Constructor >>>>>>>> instance. Perhaps there is some clever way of eliminating those >>>>>>>> copies. >>>>>>>> >>>>>>>> So while I think your patches generally makes sense, I think it is >>>>>>>> prudent to delay this for annotations until all our new annotation >>>>>>>> features are in. >>>>>>>> >>>>>>>> cheers >>>>>>>> /Joel >>>>>>>> >>>>>>>> On Dec 10, 2012, at 7:18 AM, David Holmes >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Hi Peter, >>>>>>>>> >>>>>>>>> Sorry for the delay on this. >>>>>>>>> >>>>>>>>> Generally your VolatileData and my ReflectionHelper are doing a >>>>>>>>> similar job. But I agree with your reasoning that all of the >>>>>>>>> cached >>>>>>>>> SoftReferences are likely to be cleared at once, and so a >>>>>>>>> SoftReference to a helper object with direct references, is more >>>>>>>>> effective than a direct reference to a helper object with >>>>>>>>> SoftReferences. My initial stance with this was very conservative >>>>>>>>> as the more change that is introduced the more uncertainty >>>>>>>>> there is >>>>>>>>> about the impact. >>>>>>>>> >>>>>>>>> I say the above primarily because I think, if I am to proceed with >>>>>>>>> this, I will need to separate out the general reflection caching >>>>>>>>> changes from the annotation changes. There are a number of reasons >>>>>>>>> for this: >>>>>>>>> >>>>>>>>> First, I'm not at all familiar with the implementation of >>>>>>>>> annotations at the VM or Java level, and the recent changes in >>>>>>>>> this >>>>>>>>> area just exacerbate my ignorance of the mechanics. So I don't >>>>>>>>> feel >>>>>>>>> qualified to evaluate that aspect. >>>>>>>>> >>>>>>>>> Second, the bulk of the reflection caching code is simplified by >>>>>>>>> the fact that due to current constraints on class redefinition the >>>>>>>>> caching is effectively idempotent for fields/methods/constructors. >>>>>>>>> But that is not the case for annotations. >>>>>>>>> >>>>>>>>> Finally, the use of synchronization with the annotations method is >>>>>>>>> perplexing me. I sent Joe a private email on this but I may as >>>>>>>>> well >>>>>>>>> raise it here - and I think you have alluded to this in your >>>>>>>>> earlier emails as well: initAnnotationsIfNecessary() is a >>>>>>>>> synchronized instance method but I can not find any other code in >>>>>>>>> the VM that synchronizes on the Class object's monitor. So if this >>>>>>>>> synchronization is trying to establish consistency in the face of >>>>>>>>> class redefinition, I do not see where class redefinition is >>>>>>>>> participating in the synchronization! >>>>>>>>> >>>>>>>>> So what I would like to do is take your basic VolatileData part of >>>>>>>>> the patch and run with it for JEP-149 purposes, while separating >>>>>>>>> the annotations issue so they can be dealt with by the experts in >>>>>>>>> that particular area. >>>>>>>>> >>>>>>>>> I'm sorry it has taken so long to arrive at a fairly negative >>>>>>>>> position, but I need someone else to take up the annotations >>>>>>>>> gauntlet and run with it. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> David >>>>>>>>> >>>>> >>> > From david.holmes at oracle.com Sun Dec 16 21:35:40 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 17 Dec 2012 07:35:40 +1000 Subject: Proposal: Fully Concurrent ClassLoading In-Reply-To: References: <50BF371A.1060604@oracle.com> <50C27FE6.1050107@oracle.com> <50C56053.1060306@oracle.com> <50C6A09C.6000508@oracle.com> <50C6FAD1.40506@gmail.com> <50C6FCDE.7070404@oracle.com> <50C70087.4030003@gmail.com> <50C718BD.2010201@oracle.com> <50C71FE0.5020704@gmail.com> <50C7E086.6040805@oracle.com> <50C917DE.6010200@oracle.com> <50CC41E3.3040504@oracle.com> Message-ID: <50CE3EAC.7090904@oracle.com> On 17/12/2012 2:12 AM, Zhong Yu wrote: > On Sat, Dec 15, 2012 at 3:24 AM, David Holmes wrote: >> Can you suggest any actual use of the result of getClassLoadingLock() that >> won't cause a NullPointerException if null is returned? > > I'm saying a more specific exception could be more helpful than NPE, > for example, UnsupportedOperationException("getClassLoadingLock() not > supported in a fully concurrent class loader") Okay - noted. Thanks, David From david.holmes at oracle.com Mon Dec 17 04:12:31 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 17 Dec 2012 14:12:31 +1000 Subject: signatures that are recorded for default methods In-Reply-To: References: <00C97E54-7649-4FC5-8A59-C5133E4426C2@oracle.com> <50CA2B58.5030103@oracle.com> <50CA4320.40408@oracle.com> <50CA61DA.7050205@oracle.com> <46D348C4-E38A-418E-A1D4-C789B038F078@oracle.com> <50CAC55A.3010602@oracle.com> Message-ID: <50CE9BAF.4090000@oracle.com> On 15/12/2012 1:01 AM, Paul Benedict wrote: > David, forgive me for lousy sentence construction :-) > > There's no way to say "The default implementation does..." and not > have it be part of the interface spec. Whatever the default method > does becomes the stated contract for any other implementation of > OpenJDK. That need not be true and that is exactly what has yet to be determined. The precedent already exists with implementation notes in existing JDK classes. Such notes do not constrain others who wish to provide an implementation of the JDK. David ----- > Paul > > On Fri, Dec 14, 2012 at 12:21 AM, David Holmes wrote: >> Paul, >> >> >> On 14/12/2012 9:46 AM, Paul Benedict wrote: >>> >>> Lance, >>> >>> Good questions. Someone with authority will surely answer, but here's >>> my armchair opinion... >>> >>> If the Javadoc is to specify how the default method executes, than >>> that would naturally infer all default implementations must have a >>> stated contract. You can't document the default execution behavior in >>> the public API and then let a provider switch the behavior. The two go >>> hand-in-hand, imo. >> >> >> I couldn't really make sense of that. :) The method has a contract. The >> "default implementation" has to honor that contract. The question is whether >> how the "default implementation" honors the method contract is required to >> be part of a second contract. >> >> I hope that made sense :) >> >> David >> ----- >> >> >> >>> Paul >>> >>> On Thu, Dec 13, 2012 at 5:30 PM, Lance Andersen - Oracle >>> wrote: >>>> >>>> >>>> On Dec 13, 2012, at 6:16 PM, Leonid Arbuzov wrote: >>>> >>>>> Good point, Joe. >>>>> Those extra assertions for default methods can be checked >>>>> by regular API tests separately from signature tests. >>>> >>>> >>>> I am not clear on this. See the message attached from David which ask a >>>> similar question (from the attached email): >>>> ------------------- >>>> 2. It is not obvious to me that the JDK's choice for a default >>>> implementation has to be _the_ only possible implementation choice. In >>>> many/most cases there will be a very obvious choice, but that doesn't mean >>>> that all suppliers of OpenJDK classes have to be locked in to that choice. >>>> ------------------- >>>> >>>> >>>> If everyone needs to implement the same default implementation then great >>>> the JCK/TCK can test it and IMHO we should have a javadoc tag for this. >>>> >>>> If everyone is free to choose what the default behavior is, then we >>>> cannot test it. >>>> >>>> So has there been a decision WRT the requirements for default methods? >>>> >>>> >>>> Best >>>> Lance >>>>> >>>>> Thanks, >>>>> -leonid >>>>> >>>>> On 12/13/2012 1:05 PM, Joe Darcy wrote: >>>>>> >>>>>> Hello, >>>>>> >>>>>> As with concrete methods on abstract classes, I would expect the >>>>>> specifications of the default methods to often contain text akin to "This >>>>>> default implementation does x, y, and z" since if the method is to be called >>>>>> by subtypes, the self-use patterns in the default method need to be known. >>>>>> >>>>>> Cheers, >>>>>> >>>>>> -Joe >>>>>> >>>>>> On 12/13/2012 11:24 AM, Leonid Arbouzov wrote: >>>>>>> >>>>>>> Hello Lance, >>>>>>> >>>>>>> My understanding would be that the signature test >>>>>>> should check that interface method is marked as default method >>>>>>> but do not track the code in its default body >>>>>>> (assuming that the body is not a part of a spec - API javadoc). >>>>>>> >>>>>>> (I've confirmed that with the signature test developer) >>>>>>> >>>>>>> Thanks, >>>>>>> -leonid >>>>>>> >>>>>>> On 12/6/2012 9:01 AM, Lance Andersen - Oracle wrote: >>>>>>>> >>>>>>>> Folks, >>>>>>>> >>>>>>>> Will the signatures for interfaces that are recorded by the TCKs for >>>>>>>> interfaces record the fact that a method includes a default method? or will >>>>>>>> it just record the method definition? >>>>>>>> >>>>>>>> I am assuming it will, but I know there has been discussion that a >>>>>>>> implementor could choose a different default implementation on one of the >>>>>>>> recent threads that was up for review. >>>>>>>> >>>>>>>> I am still trying to understand what our guidelines are, if any for >>>>>>>> documenting the behavior of the supplied default methods given the javadocs >>>>>>>> are part of the specification for many APIs (and in some case the only >>>>>>>> spec). >>>>>>>> >>>>>>>> Best >>>>>>>> Lance >>>>>>>> >>>>>>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>>>>>> Oracle Java Engineering >>>>>>>> 1 Network Drive >>>>>>>> Burlington, MA 01803 >>>>>>>> Lance.Andersen at oracle.com >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>> >>>> >>>> >>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 >>>> Oracle Java Engineering >>>> 1 Network Drive >>>> Burlington, MA 01803 >>>> Lance.Andersen at oracle.com >>>> >>>> >>>> >>> >> From david.holmes at oracle.com Mon Dec 17 04:18:42 2012 From: david.holmes at oracle.com (David Holmes) Date: Mon, 17 Dec 2012 14:18:42 +1000 Subject: RFR : CR8004015 : Add parent interfaces and default methods to basic functional interfaces In-Reply-To: <0A9D8113-780C-4BA7-9380-AAD53A0DAA58@oracle.com> References: <99DC2763-ED44-42CA-90F3-04AD07B2846D@oracle.com> <50CAC719.7090308@oracle.com> <0A9D8113-780C-4BA7-9380-AAD53A0DAA58@oracle.com> Message-ID: <50CE9D22.7060108@oracle.com> On 15/12/2012 4:58 AM, Mike Duigou wrote: > > On Dec 13 2012, at 22:28 , David Holmes wrote: > >>> I have added @throws NPE for a number of the default methods. We won't be including @throws NPE in all cases where null is disallowed because when the @throws NPE is declared the API is required to throw NPE in that circumstance. So for cases where the NPE is "naturally" thrown or that aren't performance sensitive we will likely add @throws NPE declarations but for performance sensitive methods we won't be adding explicit null checks to match a @throws NPE specification. There's a tradeoff here in some cases. Please feel free to quibble about specific cases as they occur. :-) >> >> That doesn't make sense to me. The throwing of the NPE is intended to be part of the specification not an implementation choice. Further @param foo non-null, is just as binding on implementations as @throws NPE if foo is null. ??? > > An "@param foo non-null" by itself is not considered normative because it doesn't document what happens when null is passed. So it ends up being advisory only. An "@throws NPE" is considered normative and the implementation must throw in all circumstances described. Aside: that is an interesting interpretation but from whence does it come? It is non-normative by definition because it is incomplete? Or is it just non-normative because it is an @param tag? > (Please bear with the step-by-step nature of the following sample, it's incremental pace is not meant to be insulting--it's a write-up for a general FAQ). If I have a method: But once you add the @throws the advisory of the @param is redundant. Hence to me it is an either/or situation. Further the advisory, being advisory, is useless in my opinion, so not something to use regardless. David ----- > /** > * If the object is visible then write it's string form to the provided PrintStream. > * > * @param bar destination for display > / > public void display(PrintStream bar) { > if(visible) { > bar.write(toString()); > } > } > > This implementation isn't going to work well if "bar" is ever null. So I document that in the "@param bar": > > /** > * If the object is visible then write it's string form to the provided PrintStream. > * > * @param bar destination for display, must be non-null > / > public void display(PrintStream bar) { > if(visible) { > bar.write(toString()); > } > } > > The "@param bar" documentation now says that it must be non-null but doesn't explain what happens if null is passed. Having documented that null shouldn't be passed is helpful but not as helpful as it could be. To specify what happens I must add "@throws NPE": > > /** > * If the object is visible then write it's string form to the provided PrintStream. > * > * @param bar destination for display, must be non-null > * @throws NullPointerException if bar is null > / > public void display(PrintStream bar) { > if(visible) { > bar.write(toString()); > } > } > > This implementation would superficially seem to conform to the contract described in the javadoc. However, when the "if(visible)" conditional is false then no NPE will be thrown. Contract broken. It is required to add an explicit null check on "bar" ie. > > /** > * If the object is visible then write it's string form to the provided PrintStream. > * > * @param bar destination for display, must be non-null > * @throws NullPointerException if bar is null > / > public void display(PrintStream bar) { > Objects.requireNonNull(bar); > if(visible) { > bar.write(toString()); > } > } > > Adding the "Objects.requireNonNull" ensures that the NPE is thrown in all appropriate cases. There is also another alternative: > > /** > * If the object is visible then write it's string form to the provided PrintStream. > * > * @param bar destination for display, must be non-null > * @throws NullPointerException if bar is null and the component is visible. > / > public void display(PrintStream bar) { > if(visible) { > bar.write(toString()); > } > } > > The conditions in which NPE are thrown are amended so that throwing is only required if the component is visible. Documenting the conditions could quickly become complicated if display was a more involved method. At some point it becomes easier to just add an explicit check. It can also be useful to add explicit NPE checks as pre-conditions before a multi-stage operation where a late stage NPE might corrupt the object state. > > In a very few cases an explicit null check might add too much overhead to a performance sensitive method and writing an accurate "@throws NPE" isn't possible (perhaps because of delegation) then the "@throws NPE" should be removed and only the advisory "@param bar ... must be non-null" will have to suffice. > > Mike > >> I think defining the NPE via the @param and @throws is a lose-lose situation: >> >> ! * @param left {@inheritDoc}, must be non-null >> ! * @param right {@inheritDoc}, must be non-null >> ! * @return {@inheritDoc}, always non-null >> ! * @throws NullPointerException if {@code left} or {@code right} is null >> >> You only need one convention. >> >> David >> ----- >> >> >>> Mike > From weijun.wang at oracle.com Mon Dec 17 04:42:00 2012 From: weijun.wang at oracle.com (weijun.wang at oracle.com) Date: Mon, 17 Dec 2012 04:42:00 +0000 Subject: hg: jdk8/tl/jdk: 7197159: accept different kvno if there no match Message-ID: <20121217044222.4A03C471B5@hg.openjdk.java.net> Changeset: eaaec81aa974 Author: weijun Date: 2012-12-17 12:18 +0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/eaaec81aa974 7197159: accept different kvno if there no match Reviewed-by: xuelei ! src/share/classes/sun/security/krb5/EncryptionKey.java ! test/sun/security/krb5/auto/DynamicKeytab.java + test/sun/security/krb5/auto/KvnoNA.java ! test/sun/security/krb5/auto/MoreKvno.java From lana.steuck at oracle.com Mon Dec 17 07:36:21 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Mon, 17 Dec 2012 07:36:21 +0000 Subject: hg: jdk8/tl: 13 new changesets Message-ID: <20121217073622.E5498471B9@hg.openjdk.java.net> Changeset: 98a7af257bee Author: erikj Date: 2012-12-03 10:26 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/rev/98a7af257bee 8003819: build-infra: backslashes at end of LIB and INCLUDE in spec.gmk Summary: Removing trailing backslash from LIB and INCLUDE. Reviewed-by: ohrstrom, ohair ! common/autoconf/generated-configure.sh ! common/autoconf/toolchain_windows.m4 Changeset: 754f91d22e1c Author: erikj Date: 2012-12-05 09:39 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/rev/754f91d22e1c 8001541: Cannot build on Solaris using softlinks Summary: Fixed softlink resolver macro in configure. Reviewed-by: tbell, ohair ! common/autoconf/basics.m4 ! common/autoconf/generated-configure.sh Changeset: ec187d02c95e Author: erikj Date: 2012-12-05 10:12 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/rev/ec187d02c95e 8004281: build-infra: Move all jar creation to images target and put jars in images/lib Summary: Fixed bug in setting up make dependencies in SetupArchive. Reviewed-by: ohair, tbell, dholmes ! common/makefiles/JavaCompilation.gmk Changeset: bd32ef0789ca Author: erikj Date: 2012-12-05 16:35 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/rev/bd32ef0789ca 8003414: build-infra: fails on on windows Summary: Added extra check that windows sdk is valid. Reviewed-by: tbell, ohrstrom, ohair ! common/autoconf/generated-configure.sh ! common/autoconf/toolchain_windows.m4 Changeset: 9a6ec97ec45c Author: katleman Date: 2012-12-05 12:52 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/9a6ec97ec45c Merge Changeset: c91c581321ce Author: katleman Date: 2012-12-06 12:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/c91c581321ce Added tag jdk8-b67 for changeset 9a6ec97ec45c ! .hgtags Changeset: 04435608c613 Author: lana Date: 2012-12-10 20:52 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/04435608c613 Merge Changeset: 6b96b7744913 Author: erikj Date: 2012-12-07 17:23 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/rev/6b96b7744913 8004045: build-infra: Error 12 from zip when updating src.zip Summary: Hiding this error from make so that it doesn't fail Reviewed-by: ohrstrom, dholmes ! common/makefiles/JavaCompilation.gmk Changeset: 2795874efd16 Author: erikj Date: 2012-12-11 11:29 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/rev/2795874efd16 8003945: build-infra: problems finding compiler when using --with-dev-kit Summary: Search all compiler names in dev-kit dir first. Reviewed-by: tbell ! common/autoconf/generated-configure.sh ! common/autoconf/toolchain.m4 Changeset: e175ecff1391 Author: erikj Date: 2012-12-11 11:33 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/rev/e175ecff1391 8001753: build-infra: mismatch with full debug symbol control for hotspot Summary: Enabling hotspot to use the FDS settings established at configure time Reviewed-by: dholmes, ohair ! common/autoconf/generated-configure.sh ! common/autoconf/hotspot-spec.gmk.in ! common/autoconf/jdk-options.m4 ! common/makefiles/NativeCompilation.gmk Changeset: cdb401a60cea Author: katleman Date: 2012-12-12 13:19 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/cdb401a60cea Merge Changeset: e9ec00893bb4 Author: katleman Date: 2012-12-13 09:05 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/e9ec00893bb4 Added tag jdk8-b68 for changeset cdb401a60cea ! .hgtags Changeset: 2ed5be3dd506 Author: lana Date: 2012-12-16 22:02 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/2ed5be3dd506 Merge From lana.steuck at oracle.com Mon Dec 17 07:36:21 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Mon, 17 Dec 2012 07:36:21 +0000 Subject: hg: jdk8/tl/corba: 2 new changesets Message-ID: <20121217073624.2ABCA471BA@hg.openjdk.java.net> Changeset: 82000531feaa Author: katleman Date: 2012-12-06 12:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/corba/rev/82000531feaa Added tag jdk8-b67 for changeset 394515ad2a55 ! .hgtags Changeset: 22ddcac208a8 Author: katleman Date: 2012-12-13 09:05 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/corba/rev/22ddcac208a8 Added tag jdk8-b68 for changeset 82000531feaa ! .hgtags From lana.steuck at oracle.com Mon Dec 17 07:36:21 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Mon, 17 Dec 2012 07:36:21 +0000 Subject: hg: jdk8/tl/jaxws: 2 new changesets Message-ID: <20121217073630.41FAB471BB@hg.openjdk.java.net> Changeset: d3fe408f3a9a Author: katleman Date: 2012-12-06 12:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxws/rev/d3fe408f3a9a Added tag jdk8-b67 for changeset eb06aa51dfc2 ! .hgtags Changeset: 756323c99011 Author: katleman Date: 2012-12-13 09:05 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxws/rev/756323c99011 Added tag jdk8-b68 for changeset d3fe408f3a9a ! .hgtags From lana.steuck at oracle.com Mon Dec 17 07:36:21 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Mon, 17 Dec 2012 07:36:21 +0000 Subject: hg: jdk8/tl/jaxp: 3 new changesets Message-ID: <20121217073633.F1ED7471BC@hg.openjdk.java.net> Changeset: b854e7008421 Author: katleman Date: 2012-12-06 12:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/b854e7008421 Added tag jdk8-b67 for changeset 83df3493ca3c ! .hgtags Changeset: 789a855de959 Author: katleman Date: 2012-12-13 09:05 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/789a855de959 Added tag jdk8-b68 for changeset b854e7008421 ! .hgtags Changeset: 8a20e948b806 Author: lana Date: 2012-12-16 22:05 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/8a20e948b806 Merge From lana.steuck at oracle.com Mon Dec 17 07:36:24 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Mon, 17 Dec 2012 07:36:24 +0000 Subject: hg: jdk8/tl/langtools: 4 new changesets Message-ID: <20121217073636.62D0F471BD@hg.openjdk.java.net> Changeset: e9a13a6c9d5d Author: katleman Date: 2012-12-06 12:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/e9a13a6c9d5d Added tag jdk8-b67 for changeset 303b09787a69 ! .hgtags Changeset: 014a6a11dfe5 Author: lana Date: 2012-12-10 20:59 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/014a6a11dfe5 Merge - test/tools/javac/defaultMethodExecution/DefaultMethodRegressionTests.java - test/tools/javac/diags/examples/InvalidGenericDescInFunctionalInterface.java - test/tools/javac/lambda/LambdaConversionTest.java Changeset: 13ccb5269f3d Author: katleman Date: 2012-12-13 09:05 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/13ccb5269f3d Added tag jdk8-b68 for changeset 014a6a11dfe5 ! .hgtags Changeset: f72dc656a306 Author: lana Date: 2012-12-16 22:10 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/f72dc656a306 Merge From lana.steuck at oracle.com Mon Dec 17 07:36:38 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Mon, 17 Dec 2012 07:36:38 +0000 Subject: hg: jdk8/tl/hotspot: 48 new changesets Message-ID: <20121217073813.AEFEA471BE@hg.openjdk.java.net> Changeset: e1d42ba865de Author: amurillo Date: 2012-11-16 09:43 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/e1d42ba865de 8003541: new hotspot build - hs25-b11 Reviewed-by: jcoomes ! make/hotspot_version Changeset: 49cbd3e25ba9 Author: zgu Date: 2012-11-16 09:05 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/49cbd3e25ba9 8003487: NMT: incorrect assertion in VMMemPointerIterator::remove_released_region method (memSnapshot.cpp) Summary: The assertion is applied to only the region to be released, also performs region integrity checking Reviewed-by: acorn, coleenp ! src/share/vm/services/memSnapshot.cpp ! src/share/vm/services/memSnapshot.hpp Changeset: 3ed6de6e139b Author: coleenp Date: 2012-11-20 20:27 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/3ed6de6e139b Merge Changeset: 73e64867adb7 Author: mikael Date: 2012-11-21 09:02 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/73e64867adb7 8003690: Example code in JVMTI GetStackTrace documentation is broken Summary: Fixed to minor errors in example code Reviewed-by: sspitsyn, dholmes ! src/share/vm/prims/jvmti.xml Changeset: 6b881a6b0665 Author: dholmes Date: 2012-11-21 20:07 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/6b881a6b0665 8003591: Abstract_VM_Version::internal_vm_info_string needs to stringify FLOAT_ARCH for ease of use Reviewed-by: coleenp, kvn ! src/share/vm/runtime/vm_version.cpp Changeset: ca1be5fbe6ff Author: dholmes Date: 2012-11-21 21:26 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/ca1be5fbe6ff Merge Changeset: 7c15faa95ce7 Author: mikael Date: 2012-11-27 07:57 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/7c15faa95ce7 8003879: Duplicate definitions in vmStructs Summary: Removed duplicate entries Reviewed-by: dholmes, sspitsyn ! src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp ! src/share/vm/prims/jni.cpp ! src/share/vm/runtime/vmStructs.cpp ! src/share/vm/runtime/vmStructs.hpp Changeset: bbc14465e7db Author: zgu Date: 2012-11-28 09:19 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/bbc14465e7db 8003689: MemTracker::init_tracking_options() reads outside array if commandline argument is empty Summary: Fixed potential buffer overrun when giving empty option to NativeMemoryTracking commandline option Reviewed-by: ctornqvi, hseigel, kvn ! src/share/vm/services/memTracker.cpp Changeset: 5de2a5bd519e Author: zgu Date: 2012-11-28 06:42 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/5de2a5bd519e Merge Changeset: fe81517cfb77 Author: hseigel Date: 2012-11-28 08:17 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/fe81517cfb77 6924920: Class Data Sharing limit on the java version string can create failures Summary: Truncate the java version string and add a hash value if it is too long. Reviewed-by: dholmes, coleenp ! src/share/vm/memory/filemap.cpp Changeset: b51dc8df86e5 Author: coleenp Date: 2012-11-28 08:43 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/b51dc8df86e5 Merge Changeset: 59c790074993 Author: coleenp Date: 2012-11-28 17:50 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/59c790074993 8003635: NPG: AsynchGetCallTrace broken by Method* virtual call Summary: Make metaspace::contains be lock free and used to see if something is in metaspace, also compare Method* with vtbl pointer. Reviewed-by: dholmes, sspitsyn, dcubed, jmasa ! src/cpu/sparc/vm/frame_sparc.cpp ! src/cpu/x86/vm/frame_x86.cpp ! src/share/vm/gc_interface/collectedHeap.hpp ! src/share/vm/gc_interface/collectedHeap.inline.hpp ! src/share/vm/memory/allocation.cpp ! src/share/vm/memory/allocation.hpp ! src/share/vm/memory/metaspace.cpp ! src/share/vm/memory/metaspace.hpp ! src/share/vm/memory/universe.cpp ! src/share/vm/oops/compiledICHolder.cpp ! src/share/vm/oops/method.cpp ! src/share/vm/oops/method.hpp ! src/share/vm/prims/forte.cpp ! src/share/vm/utilities/globalDefinitions.hpp Changeset: 53715fb1597d Author: brutisso Date: 2012-11-20 11:40 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/53715fb1597d 7198334: UseNUMA modifies system parameters on non-NUMA system Summary: The flags MinHeapDeltaBytes and UseNUMAInterleaving must be adjusted after the OS have adjusted the UseNUMA flag in the method os::init_2. Reviewed-by: dholmes, brutisso Contributed-by: erik.helin at oracle.com ! src/share/vm/runtime/arguments.cpp ! src/share/vm/runtime/arguments.hpp ! src/share/vm/runtime/thread.cpp Changeset: 19c1bd641922 Author: coleenp Date: 2012-11-26 12:31 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/19c1bd641922 8003722: More gcc 4.7 compilation errors Summary: Add a few more this->qualifications. Reviewed-by: coleenp, dholmes Contributed-by: duboscq at ssw.jku.at ! src/share/vm/memory/binaryTreeDictionary.cpp Changeset: d0aa87f04bd5 Author: stefank Date: 2012-11-27 10:13 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/d0aa87f04bd5 8003720: NPG: Method in interpreter stack frame can be deallocated Summary: Pass down a closure during root scanning to keep the class of the method alive. Reviewed-by: coleenp, jcoomes ! src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp ! src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp ! src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp ! src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp ! src/share/vm/memory/iterator.cpp ! src/share/vm/memory/iterator.hpp ! src/share/vm/memory/sharedHeap.cpp ! src/share/vm/runtime/deoptimization.cpp ! src/share/vm/runtime/frame.cpp ! src/share/vm/runtime/frame.hpp ! src/share/vm/runtime/thread.cpp ! src/share/vm/runtime/thread.hpp ! src/share/vm/runtime/vmThread.cpp ! src/share/vm/runtime/vmThread.hpp + test/runtime/8003720/Asmator.java + test/runtime/8003720/Test8003720.java + test/runtime/8003720/Victim.java + test/runtime/8003720/VictimClassLoader.java Changeset: f34d701e952e Author: stefank Date: 2012-11-27 14:20 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/f34d701e952e 8003935: Simplify the needed includes for using Thread::current() Reviewed-by: dholmes, rbackman, coleenp ! src/cpu/sparc/vm/interp_masm_sparc.cpp ! src/cpu/sparc/vm/stubGenerator_sparc.cpp ! src/cpu/sparc/vm/stubRoutines_sparc.cpp ! src/cpu/x86/vm/interp_masm_x86_32.cpp ! src/cpu/x86/vm/interp_masm_x86_64.cpp ! src/cpu/x86/vm/stubGenerator_x86_32.cpp ! src/cpu/x86/vm/stubGenerator_x86_64.cpp ! src/cpu/x86/vm/stubRoutines_x86_32.cpp ! src/cpu/x86/vm/stubRoutines_x86_64.cpp ! src/cpu/zero/vm/interp_masm_zero.cpp ! src/cpu/zero/vm/stubGenerator_zero.cpp ! src/cpu/zero/vm/stubRoutines_zero.cpp ! src/os/bsd/vm/mutex_bsd.cpp ! src/os/bsd/vm/mutex_bsd.inline.hpp ! src/os/bsd/vm/os_bsd.cpp ! src/os/bsd/vm/threadCritical_bsd.cpp ! src/os/bsd/vm/thread_bsd.inline.hpp ! src/os/linux/vm/mutex_linux.cpp ! src/os/linux/vm/mutex_linux.inline.hpp ! src/os/linux/vm/os_linux.cpp ! src/os/linux/vm/threadCritical_linux.cpp ! src/os/linux/vm/thread_linux.inline.hpp ! src/os/solaris/vm/mutex_solaris.cpp ! src/os/solaris/vm/mutex_solaris.inline.hpp ! src/os/solaris/vm/os_solaris.cpp ! src/os/solaris/vm/threadCritical_solaris.cpp ! src/os/solaris/vm/thread_solaris.inline.hpp ! src/os/windows/vm/mutex_windows.cpp ! src/os/windows/vm/mutex_windows.inline.hpp ! src/os/windows/vm/os_windows.cpp ! src/os/windows/vm/threadCritical_windows.cpp ! src/os/windows/vm/thread_windows.inline.hpp ! src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp ! src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.cpp ! src/os_cpu/bsd_x86/vm/thread_bsd_x86.cpp ! src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp ! src/os_cpu/bsd_zero/vm/threadLS_bsd_zero.cpp ! src/os_cpu/bsd_zero/vm/thread_bsd_zero.cpp ! src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp ! src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp ! src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp ! src/os_cpu/linux_x86/vm/os_linux_x86.cpp ! src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp ! src/os_cpu/linux_x86/vm/thread_linux_x86.cpp ! src/os_cpu/linux_zero/vm/os_linux_zero.cpp ! src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp ! src/os_cpu/linux_zero/vm/thread_linux_zero.cpp ! src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp ! src/os_cpu/solaris_sparc/vm/threadLS_solaris_sparc.cpp ! src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp ! src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp ! src/os_cpu/solaris_x86/vm/threadLS_solaris_x86.cpp ! src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp ! src/os_cpu/windows_x86/vm/os_windows_x86.cpp ! src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp ! src/os_cpu/windows_x86/vm/thread_windows_x86.cpp ! src/share/vm/classfile/javaClasses.cpp ! src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp ! src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp ! src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp ! src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp ! src/share/vm/gc_implementation/g1/ptrQueue.cpp ! src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp ! src/share/vm/gc_interface/collectedHeap.cpp ! src/share/vm/gc_interface/collectedHeap.inline.hpp ! src/share/vm/interpreter/abstractInterpreter.hpp ! src/share/vm/interpreter/interpreterRuntime.hpp ! src/share/vm/interpreter/linkResolver.cpp ! src/share/vm/memory/collectorPolicy.cpp ! src/share/vm/memory/defNewGeneration.cpp ! src/share/vm/memory/freeBlockDictionary.cpp ! src/share/vm/memory/gcLocker.hpp ! src/share/vm/memory/genMarkSweep.cpp ! src/share/vm/memory/resourceArea.cpp ! src/share/vm/memory/resourceArea.hpp ! src/share/vm/memory/threadLocalAllocBuffer.cpp ! src/share/vm/memory/universe.cpp ! src/share/vm/oops/instanceKlass.cpp ! src/share/vm/oops/markOop.cpp ! src/share/vm/oops/oop.cpp ! src/share/vm/oops/oopsHierarchy.cpp ! src/share/vm/prims/jni.cpp ! src/share/vm/prims/jvmtiEnv.cpp ! src/share/vm/prims/jvmtiImpl.cpp ! src/share/vm/runtime/fprofiler.hpp ! src/share/vm/runtime/handles.cpp ! src/share/vm/runtime/handles.inline.hpp ! src/share/vm/runtime/interfaceSupport.hpp ! src/share/vm/runtime/java.cpp ! src/share/vm/runtime/javaCalls.cpp ! src/share/vm/runtime/javaCalls.hpp ! src/share/vm/runtime/jniHandles.cpp ! src/share/vm/runtime/memprofiler.cpp ! src/share/vm/runtime/mutex.cpp ! src/share/vm/runtime/mutexLocker.cpp ! src/share/vm/runtime/objectMonitor.cpp ! src/share/vm/runtime/os.cpp ! src/share/vm/runtime/safepoint.cpp ! src/share/vm/runtime/synchronizer.cpp ! src/share/vm/runtime/task.cpp ! src/share/vm/runtime/thread.cpp + src/share/vm/runtime/thread.inline.hpp ! src/share/vm/runtime/threadLocalStorage.cpp ! src/share/vm/runtime/vmStructs.cpp ! src/share/vm/runtime/vmThread.cpp ! src/share/vm/runtime/vmThread.hpp ! src/share/vm/runtime/vm_operations.cpp ! src/share/vm/services/memTracker.hpp ! src/share/vm/utilities/array.cpp ! src/share/vm/utilities/debug.cpp ! src/share/vm/utilities/events.cpp ! src/share/vm/utilities/exceptions.cpp ! src/share/vm/utilities/growableArray.cpp ! src/share/vm/utilities/preserveException.hpp ! src/share/vm/utilities/taskqueue.cpp ! src/share/vm/utilities/workgroup.hpp Changeset: 2fc0334f613a Author: johnc Date: 2012-11-27 14:11 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/2fc0334f613a 7194633: G1: Assertion and guarantee failures in block offset table Summary: Add detailed error messages to assertions and guarantees in G1's block offset table. Reviewed-by: ysr, brutisso ! src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp ! src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp ! src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp ! src/share/vm/memory/space.cpp Changeset: c24f778e9401 Author: johnc Date: 2012-11-29 11:23 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/c24f778e9401 Merge ! src/share/vm/gc_interface/collectedHeap.inline.hpp ! src/share/vm/memory/universe.cpp ! src/share/vm/prims/jni.cpp ! src/share/vm/runtime/vmStructs.cpp Changeset: b2dbd323c668 Author: jiangli Date: 2012-11-27 17:03 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/b2dbd323c668 8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod. Summary: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod. Reviewed-by: bdelsart, sspitsyn, coleenp ! agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java ! agent/src/share/classes/sun/jvm/hotspot/oops/Method.java ! src/cpu/sparc/vm/cppInterpreter_sparc.cpp ! src/cpu/sparc/vm/interp_masm_sparc.cpp ! src/cpu/sparc/vm/templateInterpreter_sparc.cpp ! src/cpu/x86/vm/cppInterpreter_x86.cpp ! src/share/vm/classfile/classFileParser.cpp ! src/share/vm/classfile/defaultMethods.cpp ! src/share/vm/oops/constMethod.cpp ! src/share/vm/oops/constMethod.hpp ! src/share/vm/oops/method.cpp ! src/share/vm/oops/method.hpp ! src/share/vm/runtime/vmStructs.cpp Changeset: 5505fbbae3d3 Author: cjplummer Date: 2012-11-29 13:55 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/5505fbbae3d3 Merge ! src/cpu/sparc/vm/interp_masm_sparc.cpp ! src/share/vm/oops/method.cpp ! src/share/vm/oops/method.hpp ! src/share/vm/runtime/vmStructs.cpp Changeset: 90273fc0a981 Author: coleenp Date: 2012-11-29 16:50 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/90273fc0a981 8000662: NPG: nashorn ant clean test262 out-of-memory with Java heap Summary: Add ClassLoaderData object for each anonymous class with metaspaces to allocate in. Reviewed-by: twisti, jrose, stefank ! src/share/vm/asm/codeBuffer.cpp ! src/share/vm/ci/ciReplay.cpp ! src/share/vm/ci/ciReplay.hpp ! src/share/vm/classfile/classFileParser.cpp ! src/share/vm/classfile/classFileParser.hpp ! src/share/vm/classfile/classLoader.cpp ! src/share/vm/classfile/classLoaderData.cpp ! src/share/vm/classfile/classLoaderData.hpp ! src/share/vm/classfile/classLoaderData.inline.hpp ! src/share/vm/classfile/dictionary.cpp ! src/share/vm/classfile/javaClasses.cpp ! src/share/vm/classfile/javaClasses.hpp ! src/share/vm/classfile/loaderConstraints.cpp ! src/share/vm/classfile/systemDictionary.cpp ! src/share/vm/classfile/systemDictionary.hpp ! src/share/vm/compiler/compileBroker.cpp ! src/share/vm/compiler/compileBroker.hpp ! src/share/vm/memory/metachunk.hpp ! src/share/vm/memory/metaspace.cpp ! src/share/vm/memory/metaspace.hpp ! src/share/vm/memory/universe.cpp ! src/share/vm/oops/constantPool.cpp ! src/share/vm/oops/klass.cpp ! src/share/vm/oops/klass.hpp ! src/share/vm/oops/objArrayKlass.cpp ! src/share/vm/prims/unsafe.cpp Changeset: dad48145e775 Author: stefank Date: 2012-11-29 23:02 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/dad48145e775 8004199: Change the ASM package for Test8003720 Reviewed-by: kvn, jrose ! test/runtime/8003720/Asmator.java ! test/runtime/8003720/Test8003720.java Changeset: 5fafdef522c6 Author: johnc Date: 2012-11-30 12:01 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/5fafdef522c6 Merge ! src/share/vm/classfile/classFileParser.cpp ! src/share/vm/memory/metaspace.cpp ! src/share/vm/memory/metaspace.hpp ! src/share/vm/memory/universe.cpp Changeset: b61d9c88b759 Author: amurillo Date: 2012-11-30 16:45 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/b61d9c88b759 Merge Changeset: 25bdce771bb3 Author: amurillo Date: 2012-11-30 16:45 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/25bdce771bb3 Added tag hs25-b11 for changeset b61d9c88b759 ! .hgtags Changeset: 10587a580c51 Author: katleman Date: 2012-12-06 12:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/10587a580c51 Added tag jdk8-b67 for changeset 25bdce771bb3 ! .hgtags Changeset: 816b7e5bf2ed Author: amurillo Date: 2012-11-30 17:00 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/816b7e5bf2ed 8004248: new hotspot build - hs25-b12 Reviewed-by: jcoomes ! make/hotspot_version Changeset: 7cc69864a29b Author: kvn Date: 2012-11-16 15:49 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/7cc69864a29b 7146636: compiler/6865265/StackOverflowBug.java fails due to changed stack minimum Summary: Increase the stack size in the run parameters. Reviewed-by: kvn Contributed-by: david.r.chase at oracle.com ! test/compiler/6865265/StackOverflowBug.java Changeset: ee32440febeb Author: vlivanov Date: 2012-11-21 05:57 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/ee32440febeb 8001538: hs_err file does not list anymore compiled methods in compilation events Summary: Fixed message buffer size calculation. Reviewed-by: kvn, twisti ! src/share/vm/runtime/deoptimization.cpp ! src/share/vm/utilities/events.hpp Changeset: beebba0acc11 Author: twisti Date: 2012-11-26 17:25 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/beebba0acc11 7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop() Reviewed-by: kvn, jrose ! src/share/vm/ci/ciMethod.cpp ! src/share/vm/ci/ciMethod.hpp ! src/share/vm/ci/ciSignature.hpp ! src/share/vm/interpreter/bytecodes.hpp ! src/share/vm/opto/callGenerator.cpp ! src/share/vm/opto/callnode.hpp ! src/share/vm/opto/doCall.cpp ! src/share/vm/opto/graphKit.cpp ! src/share/vm/opto/graphKit.hpp ! src/share/vm/opto/library_call.cpp ! src/share/vm/opto/locknode.cpp ! src/share/vm/opto/parse1.cpp ! src/share/vm/opto/parse2.cpp ! src/share/vm/opto/parse3.cpp ! src/share/vm/opto/parseHelper.cpp ! src/share/vm/opto/type.hpp Changeset: 2cd5e15048e6 Author: twisti Date: 2012-11-27 12:48 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/2cd5e15048e6 8003868: fix shark for latest HotSpot and LLVM Reviewed-by: twisti Contributed-by: Roman Kennke ! src/cpu/zero/vm/assembler_zero.cpp ! src/cpu/zero/vm/assembler_zero.hpp ! src/cpu/zero/vm/cppInterpreter_zero.cpp ! src/cpu/zero/vm/globals_zero.hpp ! src/share/vm/runtime/thread.cpp ! src/share/vm/shark/llvmHeaders.hpp ! src/share/vm/shark/llvmValue.hpp ! src/share/vm/shark/sharkBlock.cpp ! src/share/vm/shark/sharkBuilder.cpp ! src/share/vm/shark/sharkBuilder.hpp ! src/share/vm/shark/sharkCacheDecache.cpp ! src/share/vm/shark/sharkCacheDecache.hpp ! src/share/vm/shark/sharkCodeBuffer.hpp ! src/share/vm/shark/sharkCompiler.cpp ! src/share/vm/shark/sharkConstant.cpp ! src/share/vm/shark/sharkContext.cpp ! src/share/vm/shark/sharkContext.hpp ! src/share/vm/shark/sharkFunction.hpp ! src/share/vm/shark/sharkIntrinsics.cpp ! src/share/vm/shark/sharkMemoryManager.cpp ! src/share/vm/shark/sharkMemoryManager.hpp ! src/share/vm/shark/sharkNativeWrapper.cpp ! src/share/vm/shark/sharkStack.cpp ! src/share/vm/shark/sharkStack.hpp ! src/share/vm/shark/sharkState.cpp ! src/share/vm/shark/sharkTopLevelBlock.cpp ! src/share/vm/shark/sharkTopLevelBlock.hpp ! src/share/vm/shark/sharkType.hpp ! src/share/vm/shark/sharkValue.cpp ! src/share/vm/shark/shark_globals.hpp Changeset: 2aff40cb4703 Author: bharadwaj Date: 2012-11-27 17:24 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/2aff40cb4703 7092905: C2: Keep track of the number of dead nodes Summary: keep an (almost) accurate running count of the reachable (live) flow graph nodes. Reviewed-by: kvn, twisti, jrose, vlivanov ! src/share/tools/LogCompilation/README ! src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/CallSite.java ! src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogCompilation.java ! src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java ! src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/Phase.java ! src/share/vm/opto/block.hpp ! src/share/vm/opto/c2_globals.hpp ! src/share/vm/opto/chaitin.cpp ! src/share/vm/opto/compile.cpp ! src/share/vm/opto/compile.hpp ! src/share/vm/opto/escape.cpp ! src/share/vm/opto/gcm.cpp ! src/share/vm/opto/graphKit.cpp ! src/share/vm/opto/ifg.cpp ! src/share/vm/opto/lcm.cpp ! src/share/vm/opto/loopTransform.cpp ! src/share/vm/opto/loopUnswitch.cpp ! src/share/vm/opto/loopopts.cpp ! src/share/vm/opto/macro.cpp ! src/share/vm/opto/matcher.cpp ! src/share/vm/opto/node.cpp ! src/share/vm/opto/node.hpp ! src/share/vm/opto/output.cpp ! src/share/vm/opto/parse1.cpp ! src/share/vm/opto/phaseX.cpp ! src/share/vm/opto/postaloc.cpp ! src/share/vm/opto/reg_split.cpp ! src/share/vm/opto/stringopts.cpp Changeset: 1acccb7c0b01 Author: kvn Date: 2012-11-27 17:41 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/1acccb7c0b01 8003850: add support for constants in stub code Summary: remember the code section and switch back to the proper one when adding constants. Reviewed-by: twisti, kvn Contributed-by: goetz.lindenmaier at sap.com ! src/share/vm/asm/assembler.cpp ! src/share/vm/asm/assembler.hpp ! src/share/vm/asm/codeBuffer.cpp Changeset: 6ab62ad83507 Author: twisti Date: 2012-11-30 11:44 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/6ab62ad83507 8003195: AbstractAssembler should not store code pointers but use the CodeSection directly Reviewed-by: twisti, kvn Contributed-by: Bharadwaj Yadavalli ! src/cpu/x86/vm/assembler_x86.cpp ! src/cpu/x86/vm/assembler_x86.hpp ! src/cpu/x86/vm/assembler_x86.inline.hpp ! src/share/vm/asm/assembler.cpp ! src/share/vm/asm/assembler.hpp ! src/share/vm/asm/assembler.inline.hpp ! src/share/vm/asm/codeBuffer.hpp Changeset: cd3d6a6b95d9 Author: twisti Date: 2012-11-30 15:23 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/cd3d6a6b95d9 8003240: x86: move MacroAssembler into separate file Reviewed-by: kvn ! src/cpu/sparc/vm/assembler_sparc.cpp ! src/cpu/sparc/vm/codeBuffer_sparc.hpp ! src/cpu/sparc/vm/frame_sparc.hpp ! src/cpu/sparc/vm/frame_sparc.inline.hpp ! src/cpu/x86/vm/assembler_x86.cpp ! src/cpu/x86/vm/assembler_x86.hpp ! src/cpu/x86/vm/assembler_x86.inline.hpp ! src/cpu/x86/vm/c1_LIRAssembler_x86.cpp ! src/cpu/x86/vm/cppInterpreter_x86.cpp ! src/cpu/x86/vm/frame_x86.inline.hpp ! src/cpu/x86/vm/icBuffer_x86.cpp ! src/cpu/x86/vm/icache_x86.cpp ! src/cpu/x86/vm/interp_masm_x86_32.hpp ! src/cpu/x86/vm/interp_masm_x86_64.hpp ! src/cpu/x86/vm/interpreter_x86_32.cpp ! src/cpu/x86/vm/interpreter_x86_64.cpp ! src/cpu/x86/vm/jniFastGetField_x86_32.cpp ! src/cpu/x86/vm/jniFastGetField_x86_64.cpp + src/cpu/x86/vm/macroAssembler_x86.cpp + src/cpu/x86/vm/macroAssembler_x86.hpp ! src/cpu/x86/vm/metaspaceShared_x86_32.cpp ! src/cpu/x86/vm/metaspaceShared_x86_64.cpp ! src/cpu/x86/vm/methodHandles_x86.cpp ! src/cpu/x86/vm/nativeInst_x86.cpp ! src/cpu/x86/vm/relocInfo_x86.cpp ! src/cpu/x86/vm/runtime_x86_32.cpp ! src/cpu/x86/vm/runtime_x86_64.cpp ! src/cpu/x86/vm/sharedRuntime_x86_32.cpp ! src/cpu/x86/vm/sharedRuntime_x86_64.cpp ! src/cpu/x86/vm/stubGenerator_x86_32.cpp ! src/cpu/x86/vm/stubGenerator_x86_64.cpp ! src/cpu/x86/vm/templateInterpreter_x86_32.cpp ! src/cpu/x86/vm/templateInterpreter_x86_64.cpp ! src/cpu/x86/vm/templateTable_x86_32.cpp ! src/cpu/x86/vm/templateTable_x86_64.cpp ! src/cpu/x86/vm/vm_version_x86.cpp ! src/cpu/x86/vm/vtableStubs_x86_32.cpp ! src/cpu/x86/vm/vtableStubs_x86_64.cpp ! src/os/bsd/vm/osThread_bsd.cpp ! src/os/bsd/vm/os_bsd.cpp ! src/os/bsd/vm/os_bsd.inline.hpp ! src/os/linux/vm/osThread_linux.cpp ! src/os/linux/vm/os_linux.cpp ! src/os/linux/vm/os_linux.inline.hpp ! src/os/solaris/vm/osThread_solaris.cpp ! src/os/solaris/vm/os_solaris.cpp ! src/os/solaris/vm/os_solaris.inline.hpp ! src/os/windows/vm/osThread_windows.cpp ! src/os/windows/vm/os_windows.cpp ! src/os/windows/vm/os_windows.inline.hpp ! src/os_cpu/bsd_x86/vm/assembler_bsd_x86.cpp ! src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp ! src/os_cpu/linux_x86/vm/assembler_linux_x86.cpp ! src/os_cpu/linux_x86/vm/os_linux_x86.cpp ! src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp ! src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp ! src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp ! src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp ! src/os_cpu/windows_x86/vm/os_windows_x86.cpp ! src/share/vm/asm/assembler.cpp ! src/share/vm/asm/assembler.hpp ! src/share/vm/asm/assembler.inline.hpp ! src/share/vm/asm/codeBuffer.cpp ! src/share/vm/asm/codeBuffer.hpp + src/share/vm/asm/macroAssembler.hpp + src/share/vm/asm/macroAssembler.inline.hpp ! src/share/vm/c1/c1_MacroAssembler.hpp ! src/share/vm/code/icBuffer.cpp ! src/share/vm/code/relocInfo.cpp ! src/share/vm/interpreter/interpreter.cpp ! src/share/vm/interpreter/interpreterRuntime.cpp ! src/share/vm/opto/compile.cpp ! src/share/vm/runtime/atomic.cpp ! src/share/vm/runtime/atomic.hpp + src/share/vm/runtime/atomic.inline.hpp ! src/share/vm/runtime/frame.cpp ! src/share/vm/runtime/frame.hpp ! src/share/vm/runtime/sharedRuntime.cpp ! src/share/vm/runtime/stubCodeGenerator.cpp Changeset: dd38cfd12c3a Author: twisti Date: 2012-12-03 15:48 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/dd38cfd12c3a 8004319: test/gc/7168848/HumongousAlloc.java fails after 7172640 Reviewed-by: kvn, johnc ! src/share/vm/opto/library_call.cpp Changeset: c5d414e98fd4 Author: neliasso Date: 2012-11-26 15:11 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/c5d414e98fd4 8003983: LogCompilation tool is broken since c1 support Summary: Fixed emitting and parsing Reviewed-by: jrose, kvn ! src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogCompilation.java ! src/share/tools/LogCompilation/src/com/sun/hotspot/tools/compiler/LogParser.java ! src/share/vm/c1/c1_Compilation.cpp Changeset: b7ff5879152e Author: neliasso Date: 2012-12-06 09:50 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/b7ff5879152e 8003934: Fix generation of malformed options to Projectcreator Summary: Makefile produces unmatched quotes due to nmake bug Reviewed-by: jwilhelm, brutisso ! make/windows/projectfiles/common/Makefile Changeset: 228a94f37a67 Author: neliasso Date: 2012-12-06 14:33 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/228a94f37a67 Merge Changeset: f0c2369fda5a Author: twisti Date: 2012-12-06 09:57 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/f0c2369fda5a 8003250: SPARC: move MacroAssembler into separate file Reviewed-by: jrose, kvn ! src/cpu/sparc/vm/assembler_sparc.cpp ! src/cpu/sparc/vm/assembler_sparc.hpp ! src/cpu/sparc/vm/assembler_sparc.inline.hpp ! src/cpu/sparc/vm/frame_sparc.inline.hpp ! src/cpu/sparc/vm/icBuffer_sparc.cpp ! src/cpu/sparc/vm/icache_sparc.cpp ! src/cpu/sparc/vm/interp_masm_sparc.hpp ! src/cpu/sparc/vm/interpreter_sparc.cpp ! src/cpu/sparc/vm/jniFastGetField_sparc.cpp + src/cpu/sparc/vm/macroAssembler_sparc.cpp + src/cpu/sparc/vm/macroAssembler_sparc.hpp + src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp ! src/cpu/sparc/vm/metaspaceShared_sparc.cpp ! src/cpu/sparc/vm/methodHandles_sparc.cpp ! src/cpu/sparc/vm/nativeInst_sparc.cpp ! src/cpu/sparc/vm/nativeInst_sparc.hpp ! src/cpu/sparc/vm/relocInfo_sparc.cpp ! src/cpu/sparc/vm/runtime_sparc.cpp ! src/cpu/sparc/vm/sharedRuntime_sparc.cpp ! src/cpu/sparc/vm/stubGenerator_sparc.cpp ! src/cpu/sparc/vm/templateInterpreter_sparc.cpp ! src/cpu/sparc/vm/vm_version_sparc.cpp ! src/cpu/sparc/vm/vmreg_sparc.cpp ! src/cpu/sparc/vm/vtableStubs_sparc.cpp ! src/cpu/x86/vm/assembler_x86.hpp ! src/cpu/x86/vm/macroAssembler_x86.cpp ! src/cpu/zero/vm/assembler_zero.cpp ! src/cpu/zero/vm/assembler_zero.hpp ! src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp ! src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp ! src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp ! src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp ! src/share/vm/adlc/main.cpp ! src/share/vm/asm/assembler.hpp ! src/share/vm/asm/macroAssembler.hpp ! src/share/vm/asm/macroAssembler.inline.hpp ! src/share/vm/asm/register.hpp ! src/share/vm/code/vmreg.hpp Changeset: 522662fa9c16 Author: twisti Date: 2012-12-06 11:05 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/522662fa9c16 Merge Changeset: d2f8c38e543d Author: roland Date: 2012-12-07 01:09 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/d2f8c38e543d Merge ! src/cpu/sparc/vm/stubGenerator_sparc.cpp ! src/cpu/sparc/vm/templateInterpreter_sparc.cpp ! src/cpu/x86/vm/cppInterpreter_x86.cpp ! src/cpu/x86/vm/stubGenerator_x86_32.cpp ! src/cpu/x86/vm/stubGenerator_x86_64.cpp ! src/os/bsd/vm/os_bsd.cpp ! src/os/linux/vm/os_linux.cpp ! src/os/solaris/vm/os_solaris.cpp ! src/os/windows/vm/os_windows.cpp ! src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp ! src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp ! src/os_cpu/linux_x86/vm/os_linux_x86.cpp ! src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp ! src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp ! src/os_cpu/windows_x86/vm/os_windows_x86.cpp ! src/share/vm/asm/codeBuffer.cpp ! src/share/vm/runtime/deoptimization.cpp ! src/share/vm/runtime/frame.cpp ! src/share/vm/runtime/frame.hpp ! src/share/vm/runtime/thread.cpp Changeset: 0f80645e9c26 Author: johnc Date: 2012-11-30 11:46 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/0f80645e9c26 8004170: G1: Verbose GC output is not getting flushed to log file using JDK 8 Summary: Add flushes to G1CollectedHeap::log_gc_footer() and TraceCPUTime destructor. Reviewed-by: jwilhelm, azeemj, brutisso ! src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp ! src/share/vm/runtime/timer.cpp Changeset: eade6b2e4782 Author: jmasa Date: 2012-11-29 10:09 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/eade6b2e4782 8003554: NPG: move Metablock and Metachunk code out of metaspace.cpp Reviewed-by: coleenp + src/share/vm/memory/metablock.cpp + src/share/vm/memory/metachunk.cpp ! src/share/vm/memory/metaspace.cpp Changeset: cbe736bc70fa Author: jwilhelm Date: 2012-12-07 07:36 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/cbe736bc70fa Merge Changeset: a35a72dd2e12 Author: amurillo Date: 2012-12-07 10:46 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/a35a72dd2e12 Merge Changeset: 121aa71316af Author: amurillo Date: 2012-12-07 10:46 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/121aa71316af Added tag hs25-b12 for changeset a35a72dd2e12 ! .hgtags Changeset: 8af7d22f1f8f Author: katleman Date: 2012-12-13 09:05 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/hotspot/rev/8af7d22f1f8f Added tag jdk8-b68 for changeset 121aa71316af ! .hgtags From lana.steuck at oracle.com Mon Dec 17 07:37:33 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Mon, 17 Dec 2012 07:37:33 +0000 Subject: hg: jdk8/tl/jdk: 31 new changesets Message-ID: <20121217074324.6403E471BF@hg.openjdk.java.net> Changeset: b0f008ab45d7 Author: twisti Date: 2012-11-30 11:42 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b0f008ab45d7 8001885: JSR 292 classes should use jdk.internal.org.objectweb.asm Reviewed-by: kvn, jrose, twisti Contributed-by: David Chase ! src/share/classes/java/lang/invoke/BoundMethodHandle.java ! src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Changeset: 0fda013e4638 Author: erikj Date: 2012-12-05 10:12 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0fda013e4638 8004281: build-infra: Move all jar creation to images target and put jars in images/lib Reviewed-by: ohair, tbell, dholmes ! makefiles/CompileDemos.gmk ! makefiles/CompileJavaClasses.gmk ! makefiles/CreateJars.gmk ! makefiles/Images.gmk ! makefiles/Import.gmk Changeset: ce9b02a3a17e Author: katleman Date: 2012-12-05 12:53 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ce9b02a3a17e Merge Changeset: ea0d3a9d0d01 Author: katleman Date: 2012-12-06 12:04 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ea0d3a9d0d01 Added tag jdk8-b67 for changeset ce9b02a3a17e ! .hgtags Changeset: 39f9b2cc5738 Author: bae Date: 2012-11-28 12:28 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/39f9b2cc5738 4649812: GIFImageReader handles transparency incorrectly Reviewed-by: bae, prr Contributed-by: Vadim Pakhnushev ! src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java Changeset: 6569819eb2fe Author: bae Date: 2012-11-28 12:38 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6569819eb2fe 5082749: GIF stream metadata specification of aspect ratio is incorrect Reviewed-by: bae, prr Contributed-by: Vadim Pakhnushev ! src/share/classes/javax/imageio/metadata/doc-files/gif_metadata.html Changeset: 934595726263 Author: bae Date: 2012-11-28 14:12 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/934595726263 7064516: ImageIO.read() fails to load an image Reviewed-by: jgodinez, prr ! src/share/classes/java/awt/color/ICC_Profile.java ! src/share/classes/java/awt/image/ColorConvertOp.java + test/sun/java2d/cmm/ColorConvertOp/InvalidRenderIntentTest.java Changeset: d54db1e16b97 Author: bae Date: 2012-11-30 11:32 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d54db1e16b97 7124223: [macosx] Regression test failure with new exception, when glyph is positioned explicitly Reviewed-by: jgodinez ! src/share/classes/sun/print/PathGraphics.java Changeset: bd3b3cda125d Author: lana Date: 2012-11-30 16:02 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/bd3b3cda125d Merge Changeset: 3c5bf5ed45a9 Author: bae Date: 2012-12-03 16:26 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/3c5bf5ed45a9 7124347: [macosx] java.lang.InternalError: not implemented yet on call Graphics2D.drawRenderedImage Reviewed-by: prr, flar ! src/share/classes/sun/java2d/opengl/OGLBlitLoops.java ! src/share/classes/sun/java2d/opengl/OGLSurfaceDataProxy.java + test/sun/java2d/OpenGL/CustomCompositeTest.java Changeset: 1175410d98ea Author: serb Date: 2012-11-21 15:50 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/1175410d98ea 7124552: [macosx] NullPointerException in getBufferStrategy() 7124219: [macosx] Unable to draw images to fullscreen Reviewed-by: bae, anthony ! src/macosx/classes/sun/awt/CGraphicsConfig.java ! src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java ! src/macosx/classes/sun/lwawt/LWCanvasPeer.java ! src/macosx/classes/sun/lwawt/LWComponentPeer.java + src/macosx/classes/sun/lwawt/LWGraphicsConfig.java ! src/macosx/classes/sun/lwawt/LWWindowPeer.java ! src/macosx/classes/sun/lwawt/PlatformWindow.java ! src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java ! src/macosx/classes/sun/lwawt/macosx/CPlatformView.java ! src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java - src/share/classes/sun/awt/TextureSizeConstraining.java Changeset: 5b2c31d20a64 Author: serb Date: 2012-11-21 15:54 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5b2c31d20a64 7193214: Consider simplifying CPlatformWindow.setResizable() Reviewed-by: anthony, denis ! src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java ! src/macosx/native/sun/awt/AWTWindow.m Changeset: c9dead63607c Author: serb Date: 2012-11-21 15:58 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c9dead63607c 7154516: [macosx] Popup menus have no visible borders Reviewed-by: anthony, denis ! src/macosx/classes/com/apple/laf/AquaLookAndFeel.java Changeset: 9cd48409539e Author: kizune Date: 2012-11-21 20:42 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/9cd48409539e 8003273: Missing testcase for 7171812 Reviewed-by: art, serb + test/javax/swing/dnd/7171812/JListWithScroll.java + test/javax/swing/dnd/7171812/bug7171812.java Changeset: 5600005b87fb Author: serb Date: 2012-11-27 17:03 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5600005b87fb 8002308: [macosx] 7198229 should be applied to the user action only Reviewed-by: anthony, skovatch ! src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java ! src/macosx/native/sun/awt/AWTWindow.m + test/java/awt/Frame/FrameSetSizeStressTest/FrameSetSizeStressTest.java Changeset: 0e91d6f3019c Author: alexsch Date: 2012-11-29 07:42 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0e91d6f3019c 8000423: Diacritic is not applyed to a base letter on Linux Reviewed-by: anthony, serb ! src/solaris/classes/sun/awt/X11/XToolkit.java Changeset: abee1d528df1 Author: kshefov Date: 2012-11-30 12:39 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/abee1d528df1 7124242: [macosx] Test doesn't work because of the frame round corners in the LaF Reviewed-by: anthony, yan, alexsch ! test/javax/swing/text/CSSBorder/6796710/bug6796710.java Changeset: 35d8085aa14a Author: lana Date: 2012-11-30 17:09 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/35d8085aa14a Merge Changeset: da55ef766e48 Author: alexsch Date: 2012-12-04 15:26 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/da55ef766e48 6671481: NPE at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection Reviewed-by: serb ! src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java Changeset: bd175c70684c Author: alexsch Date: 2012-12-04 15:56 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/bd175c70684c 8003830: NPE at BasicTreeUI$Actions.page:4470 Reviewed-by: serb, alexsch Contributed-by: Jaroslav Tulach ! src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java + test/javax/swing/JTree/8003830/bug8003830.java Changeset: 009fd6e1d9f5 Author: alexsch Date: 2012-12-04 16:42 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/009fd6e1d9f5 8002077: Possible mnemonic issue on JFileChooser Save button on nimbus L&F Reviewed-by: serb ! src/share/classes/sun/swing/plaf/synth/SynthFileChooserUI.java Changeset: 4aad3e6f68d2 Author: jviswana Date: 2012-12-04 17:17 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4aad3e6f68d2 4631925: JColor Chooser is not fully accessible Reviewed-by: alexsch ! src/share/classes/javax/swing/JColorChooser.java ! src/share/classes/javax/swing/colorchooser/ColorChooserPanel.java ! src/share/classes/javax/swing/colorchooser/ColorPanel.java ! src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java Changeset: ea20c9388d90 Author: aph Date: 2012-12-04 14:02 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ea20c9388d90 8004344: Fix a crash in ToolkitErrorHandler() in XlibWrapper.c Summary: Code does not check for JNU_GetEnv returning NULL. Reviewed-by: anthony ! src/solaris/native/sun/xawt/XlibWrapper.c Changeset: bbbb5c70aa59 Author: lana Date: 2012-12-04 11:41 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/bbbb5c70aa59 Merge - src/share/classes/sun/awt/TextureSizeConstraining.java Changeset: 87028eb3f020 Author: lana Date: 2012-12-04 11:46 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/87028eb3f020 Merge Changeset: b68a5404de60 Author: lana Date: 2012-12-10 20:58 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b68a5404de60 Merge ! makefiles/CompileJavaClasses.gmk - src/share/classes/sun/awt/TextureSizeConstraining.java Changeset: 379e3dfa521d Author: erikj Date: 2012-12-06 12:09 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/379e3dfa521d 8004104: build-infra: Minor cleanup Reviewed-by: ohrstrom, tbell ! makefiles/CompileJavaClasses.gmk ! makefiles/CompileNativeLibraries.gmk Changeset: 2689f6cfe835 Author: erikj Date: 2012-12-11 12:27 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/2689f6cfe835 8001753: build-infra: mismatch with full debug symbol control for hotspot Summary: Changing boolean values of ENABLE_DEBUG_SYMBOLS. Reviewed-by: dholmes, ohair ! makefiles/CompileNativeLibraries.gmk Changeset: 53fb43e4d614 Author: katleman Date: 2012-12-12 13:21 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/53fb43e4d614 Merge ! makefiles/CompileJavaClasses.gmk ! makefiles/CompileNativeLibraries.gmk Changeset: 7fd56a5abd94 Author: katleman Date: 2012-12-13 09:05 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7fd56a5abd94 Added tag jdk8-b68 for changeset 53fb43e4d614 ! .hgtags Changeset: f959e0cc8766 Author: lana Date: 2012-12-16 22:09 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f959e0cc8766 Merge ! makefiles/CompileNativeLibraries.gmk - src/share/classes/sun/awt/TextureSizeConstraining.java From peter.levart at gmail.com Mon Dec 17 10:31:50 2012 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 17 Dec 2012 11:31:50 +0100 Subject: ReflectionData space optimization in java.lang.Class (JEP-149) In-Reply-To: <50CE3B27.5070306@oracle.com> References: <924D06EC-F603-4E6A-A7FE-7A05C77B1217@gmail.com> <23313EDE-3AB7-4E53-8EB1-A6F6CC9383B9@gmail.com> <5093A8D3.4030800@gmail.com> <5096CFBD.2010604@gmail.com> <5096F5B0.8070304@gmail.com> <50974D3D.1040502@oracle.com> <50990CB8.2040400@gmail.com> <5099C2FA.2020202@oracle.com> <509A3A63.5010102@gmail.com> <50AF5930.5010903@gmail.com> <50AFADB4.9000204@gmail.com> <50B8FC99.401@gmail.com> <50B900F2.9060902@oracle.com> <50BBFD2F.1080108@oracle.com> <50BC57A0.8000108@gmail.com> <50C57EB0.1000202@oracle.com> <50C8793F.1050205@gmail.com> <50C90C35.7020000@oracle.com> <50C9AA46.5030401@gmail.com> <50C9B1F0.5080808@oracle.com> <50C9C997.10900@gmail.com> <50CAB245.6010004@oracle.com> <50CE043F.7090609@gmail.com> <50CE3B27.5070306@oracle.com> Message-ID: <50CEF496.2070206@gmail.com> Hi David, Fair enough. So only the basic ReflectionData patch for now. Here I prepared yet another revision that only contains the basic stuff from 1st revision of the patch but fixes long lines, splits the reflectionData method in two and also fixes an inconsistency - in one method there was a check left for "if (useCaches) ..." instead of "if (rd != null) ..." http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev.04/index.html Regards, Peter P.S. There might be an opportunity for further space optimization in java.lang.Class. There are two fields: enumConstants and enumConstantDirectory that are only used in Class instances representing Enum classes. I think the ratio of Enum classes vs. non-Enum classes in typical apps is strongly in favour of non-Enum classes. These two fields could be replaced with a single field pointing to "EnumData". Do you think it's worth it? On 12/16/2012 10:20 PM, David Holmes wrote: > Hi Peter, > > We have to be careful not to disrupt the dynamics of things too much. > Duplicate copies wastes memory but doing the replacement wastes time. > If we could be purely memory focused then we would do anything to save > memory, but we can't do that - we're trying to save some memory > without being too disruptive to performance aspects. The more changes > like this that are made the less idea we have about the impact on > existing reflection-using applications. And we don't have any > compelling use-case to motivate this. So I'm inclined to not take this > additional step at this time. > > Thanks, > David > > On 17/12/2012 3:26 AM, Peter Levart wrote: >> Hi David, Mandy, Joel and others, >> >> I prepared the 3rd revision of the patch: >> >> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev.03/index.html >> >> Changes from the 1st revision (disregard 2nd revision) are as follows: >> >> - The split of reflectionData() method into short fast-path and longer >> slow-path newReflectionData() as already proposed in 2nd revision of the >> patch. >> - The logic of privateGetDeclared[Fields|Methods|Constructors](boolean >> publicOnly) methods has been rewritten to eliminate caching of duplicate >> Field/Method/Constructor instances for the same field, method or >> constructor. >> >> As it turns out, the same public Member can be cached twice. One >> instance in ReflectionData.declared[Fields|Methods|Constructors] array >> and the other instance in ReflectionData.declaredPublic[Fields|Methods] >> or publicConstructors array. These arrays pairs >> (declared/declaredPublic) retain distinct instances, because they are >> obtained by separate calls to VM which always constructs new instances. >> >> The new proposed logic eliminates duplicate instances, but does not >> otherwise present any new overhead. It never requests more data from VM >> then needed at a particular moment (it may request less data from VM if >> external calls are issued in a particular order). >> >> Some applications may benefit from saved allocated space if they request >> "declared" members and "public" members on same Class instances. >> >> Here's the comparison of bytes allocated for the ReflectionData object >> in some Class instances after invoking particular reflection methods: >> >> *** >> *** Original JDK8 privateGetDeclaredXXX methods: >> *** >> >> Deep size of ReflectionData in: java.lang.Object.class >> >> before any calls: 0 bytes >> after getDeclaredConstructors: 192 bytes >> after getDeclaredFields: 192 bytes >> after getDeclaredMethods: 1,552 bytes >> after getConstructors: 1,664 bytes >> after getFields: 1,696 bytes >> after getMethods: 2,856 bytes >> >> Deep size of ReflectionData in: java.lang.String.class >> >> before any calls: 704 bytes >> after getDeclaredConstructors: 2,472 bytes >> after getDeclaredFields: 2,472 bytes >> after getDeclaredMethods: 10,808 bytes >> after getConstructors: 12,464 bytes >> after getFields: 12,712 bytes >> after getMethods: 21,056 bytes >> >> Deep size of ReflectionData in: java.util.HashMap.class >> >> before any calls: 0 bytes >> after getDeclaredConstructors: 472 bytes >> after getDeclaredFields: 1,328 bytes >> after getDeclaredMethods: 5,856 bytes >> after getConstructors: 6,360 bytes >> after getFields: 6,392 bytes >> after getMethods: 9,576 bytes >> >> Deep size of ReflectionData in: javax.swing.JTable.class >> >> before any calls: 0 bytes >> after getDeclaredConstructors: 784 bytes >> after getDeclaredFields: 4,224 bytes >> after getDeclaredMethods: 26,072 bytes >> after getConstructors: 26,792 bytes >> after getFields: 28,600 bytes >> after getMethods: 79,912 bytes >> >> >> *** >> *** With modified privateGetDeclaredXXX methods: >> *** >> >> Deep size of ReflectionData in: java.lang.Object.class >> >> before any calls: 0 bytes >> after getDeclaredConstructors: 192 bytes >> after getDeclaredFields: 192 bytes >> after getDeclaredMethods: 1,552 bytes >> after getConstructors: 1,552 bytes >> after getFields: 1,568 bytes >> after getMethods: 1,680 bytes >> >> Deep size of ReflectionData in: java.lang.String.class >> >> before any calls: 0 bytes >> after getDeclaredConstructors: 1,816 bytes >> after getDeclaredFields: 2,368 bytes >> after getDeclaredMethods: 10,704 bytes >> after getConstructors: 10,784 bytes >> after getFields: 10,832 bytes >> after getMethods: 12,096 bytes >> >> Deep size of ReflectionData in: java.util.HashMap.class >> >> before any calls: 0 bytes >> after getDeclaredConstructors: 472 bytes >> after getDeclaredFields: 1,328 bytes >> after getDeclaredMethods: 5,856 bytes >> after getConstructors: 5,856 bytes >> after getFields: 5,888 bytes >> after getMethods: 7,024 bytes >> >> Deep size of ReflectionData in: javax.swing.JTable.class >> >> before any calls: 0 bytes >> after getDeclaredConstructors: 784 bytes >> after getDeclaredFields: 4,224 bytes >> after getDeclaredMethods: 26,072 bytes >> after getConstructors: 26,072 bytes >> after getFields: 27,520 bytes >> after getMethods: 62,960 bytes >> >> >> My micro-benchmarks show no performance degradations with changed >> caching logic. >> >> So what do you think, David? >> >> >> Regards, Peter >> >> >> On 12/14/2012 05:59 AM, David Holmes wrote: >>> Hi Peter, >>> >>> On 13/12/2012 10:27 PM, Peter Levart wrote: >>>> On 12/13/2012 11:46 AM, David Holmes wrote: >>> >>> >>> >>>>>> I also found code-paths that evaluated reflectionData() method more >>>>>> than >>>>>> once for each external call. It's the methods: >>>>>> >>>>>> private Field[] privateGetDeclaredFields(boolean publicOnly) >>>>>> >>>>>> and >>>>>> >>>>>> private Method[] privateGetDeclaredMethods(boolean publicOnly) >>>>>> >>>>>> which are called from: >>>>>> >>>>>> private Field[] privateGetPublicFields(Set> >>>>>> traversedInterfaces) >>>>>> >>>>>> and >>>>>> >>>>>> private Method[] privateGetPublicMethods() >>>>>> >>>>>> respectively. I therefore introduced overloaded variants of the >>>>>> former >>>>>> methods taking a ReflectionData parameter like the following: >>>>>> >>>>>> private Field[] privateGetDeclaredFields(boolean publicOnly) { >>>>>> return privateGetDeclaredFields(publicOnly, reflectionData()); >>>>>> } >>>>>> // A variant called from methods that already obtained >>>>>> ReflectionData >>>>>> instance >>>>>> private Field[] privateGetDeclaredFields(boolean publicOnly, >>>>>> ReflectionData rd) { >>>>>> ... >>>>>> >>>>>> the same for privateGetDeclaredMethods. This is not for performance >>>>>> reasons (though it might help) but for correctness. Each external >>>>>> call >>>>>> should be a separate "transaction" and should work on the same >>>>>> ReflectionData instance. The "transaction" is only guaranteed on the >>>>>> level of a particular java.lang.Class instance though. Some methods >>>>>> also >>>>>> invoke other Class instances (to gather inherited public methods / >>>>>> fields) and those invocations might be separate transactions in the >>>>>> face >>>>>> of concurrent class re-definitions. But we are not going to >>>>>> implement a >>>>>> database here, are we? >>>>> >>>>> Sorry I don't understand the problem you are seeing here. If we >>>>> find a >>>>> cached public fields, for example, we will return it. Else we start >>>>> the process of calculating anew. If someone else manages to fill in >>>>> the cache then we will get it when we call privateGetDeclaredFields. >>>>> The results are expected to be idempotent so I don't see what the >>>>> problem is. >>>>> >>>> It's true, yes. For the outside caller there is no observable >>>> difference. It can only happen that we retrieve declaredFields from a >>>> newer snapshot (say v.2) of ReflectionData and then compute >>>> publicFields >>>> and install them into an older ReflectionData instance v.1 which is >>>> already obsolete. But for the outside observer there's no difference. >>>> From performance standpoint, the additional call to reflectionData() >>>> that we save is on the slow-path so it's not worth it. >>> >>> Okay - so I'll ignore this :) >>> >>>> The split of reflectionData() into two methods does have an impact >>>> though. FWIW my micro-benchmark shows that without the split, only the >>>> following public method is observed to be faster then in the original >>>> JDK8 code: >>>> >>>> - getFields - 4x >>>> >>>> With the split of reflectionData() but without these unneeded >>>> overloaded >>>> privateGetDeclaredFields methods, the following methods are faster: >>>> >>>> - getMethods - 1.7x (1, 2 threads) ... 1x (4...32 threads) >>>> - getFields - 4x >>>> - getDeclaredConstructor - 6x ... 11x >>>> - getDeclaredMethod - 3x >>>> >>>> But for performance tests that you already initiated, it is >>>> important to >>>> note that original patch is good enough since it appears that no >>>> public >>>> method is any slower than in the original JDK8 code. >>>> >>>> Speaking of that, I don't know much about the constraints of the JIT >>>> compiler, but it seems from the results above, that it can in-line >>>> multiple levels of method calls and that the total size of the methods >>>> matter. If this is true then it might be possible to split several >>>> private methods in java.lang.Class into pairs of short fast-path and >>>> longer slow-path. Is this worth the maintenance cost? >>> >>> Method size certainly does affect inlining. Generally however we would >>> only refactor this way if we find a bottleneck that needs to be broken >>> - splitting methods adds additional meta-data overhead etc. >>> >>> As you've already done the investigation here I think the split is a >>> reasonable one to make. But I wonder in general applications how often >>> we'll even end up compiling this method. >>> >>> Thanks, >>> David >>> >>>> Regards, Peter >>>> >>>>> Thanks, >>>>> David >>>>> ------ >>>>> >>>>>> I prepared some micro benchmarks for individual public methods. >>>>>> Here're >>>>>> the results: >>>>>> >>>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/reflection_data_benchmark_results_i7-2600K.txt >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> they indicate no noticeable performance decreases. Some methods >>>>>> are in >>>>>> fact faster (more in-linable?): >>>>>> >>>>>> - getFields - 4x >>>>>> - getDeclaredConstructor - 4x ... 10x >>>>>> - getDeclaredMethod - 3x >>>>>> >>>>>> Here's the code for micro-benchmarks: >>>>>> >>>>>> https://raw.github.com/plevart/jdk8-tl/JEP-149.c/test/src/test/ReflectionDataTest.java >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Regards, Peter >>>>>> >>>>>> >>>>>> On 12/12/2012 11:59 PM, Mandy Chung wrote: >>>>>>> Hi Peter, >>>>>>> >>>>>>> On 12/12/12 4:31 AM, Peter Levart wrote: >>>>>>>> Hi all, >>>>>>>> >>>>>>>> Ok, no problem. So here's a patch that summarizes what I did in >>>>>>>> the >>>>>>>> previous patch, but only for reflective fields (Field[], Method[], >>>>>>>> Constructor[]) not including annotations: >>>>>>>> >>>>>>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.c/webrev/index.html >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> Finally able to make time to review this patch. It's good work. >>>>>>> While >>>>>>> it's good to see the synchronization issue with annotations be >>>>>>> fixed, >>>>>>> separating the cache for reflection and annotation helps. As David >>>>>>> replied, he will take your patch and run with it for JEP-149. >>>>>>> >>>>>>> The change looks good. Nit: there are several long lines >>>>>>> L2235,2244,2245,2249,2269 etc that should be broken into separate >>>>>>> lines. The remaining open question is the performance difference in >>>>>>> the reflectionData() method and how well it will be jit'ed. In the >>>>>>> common case, there is no class redefinition where >>>>>>> classCachesOnClassRedefinition() is essentially like an nop. I >>>>>>> believe >>>>>>> David will look at the footprint and performance numbers as he has >>>>>>> initiated the performance testing (need to do it with this new >>>>>>> patch). >>>>>>> >>>>>>> Thanks >>>>>>> Mandy >>>>>>> >>>>>>>> The annotations part is unchanged semantically, but I had to: >>>>>>>> >>>>>>>> - modify private method clearCachesOnClassRedefinition to only >>>>>>>> include invalidation of annotations and declaredAnnotations >>>>>>>> fields. I >>>>>>>> also renamed it to clearAnnotationCachesOnClassRedefinition >>>>>>>> - renamed lastRedefinedCount to lastAnnotationsRedefinedCount and, >>>>>>>> since this field is now only accessed while holding a lock (from >>>>>>>> synchronized initAnnotationsIfNecessary), I removed the volatile >>>>>>>> keyword. >>>>>>>> >>>>>>>> That's it. >>>>>>>> >>>>>>>> While looking at this unchanged part of code some more, I see >>>>>>>> other >>>>>>>> races as well. For example: two concurrent accesses to annotations >>>>>>>> combined with redefinition of a class can result in NPE. Here's a >>>>>>>> serial execution: >>>>>>>> >>>>>>>> Thread 1: >>>>>>>> getAnnotation(annotationType); >>>>>>>> initAnnotationsIfNecessary(); >>>>>>>> >>>>>>>> VM: >>>>>>>> classRedefinedCount++; >>>>>>>> >>>>>>>> Thread 2: >>>>>>>> getAnnotation(annotationType); >>>>>>>> initAnnotationsIfNecessary(); >>>>>>>> clearAnnotationCachesOnClassRedefinition(); >>>>>>>> annotations = null; >>>>>>>> >>>>>>>> Thread 1: >>>>>>>> return AnnotationSupport.getOneAnnotation(annotations, >>>>>>>> annotationClass); >>>>>>>> // 'annotations' field can be null >>>>>>>> >>>>>>>> >>>>>>>> So this needs to be fixed sooner or later. >>>>>>>> >>>>>>>> Joel! >>>>>>>> >>>>>>>> Are your JSR 308 canges involving java.lang.Class too? >>>>>>>> >>>>>>>> Regards, Peter >>>>>>>> >>>>>>>> >>>>>>>> On 12/12/2012 11:59 AM, Joel Borggr?n-Franck wrote: >>>>>>>>> Hi all, >>>>>>>>> >>>>>>>>> First, thanks all of you that are involved in this! >>>>>>>>> >>>>>>>>> I agree with David here, lets split this up (for now) and do >>>>>>>>> reflective objects in the context of jep-149 and annotations >>>>>>>>> separately. >>>>>>>>> >>>>>>>>> As you may know there are even more annotation coming in with JSR >>>>>>>>> 308 annotations on type (use), so I want to complete that work >>>>>>>>> first >>>>>>>>> and then do the effort of reducing contention and overhead for >>>>>>>>> both >>>>>>>>> type and regular annotations and also fixing up the behaviour for >>>>>>>>> redefine/retransform class. >>>>>>>>> >>>>>>>>> One other point to consider is that some of the fields in >>>>>>>>> java/lang/reflect/ classes are known by the VM so not all >>>>>>>>> changes in >>>>>>>>> Java-land are actually doable. Glancing over your patches very >>>>>>>>> quickly I don't think you have done anything to upset the VM, but >>>>>>>>> then I am not an expert in this area. >>>>>>>>> >>>>>>>>> Also, with the VM permgen changes we might have to rethink our >>>>>>>>> assumptions in order to reduce total overhead. For example as I >>>>>>>>> understand it previously we could just ship the same pointer into >>>>>>>>> permgen for the annotations arrays, now that isn't possible so we >>>>>>>>> create a new copy of the array for every Field/Method/Constructor >>>>>>>>> instance. Perhaps there is some clever way of eliminating those >>>>>>>>> copies. >>>>>>>>> >>>>>>>>> So while I think your patches generally makes sense, I think >>>>>>>>> it is >>>>>>>>> prudent to delay this for annotations until all our new >>>>>>>>> annotation >>>>>>>>> features are in. >>>>>>>>> >>>>>>>>> cheers >>>>>>>>> /Joel >>>>>>>>> >>>>>>>>> On Dec 10, 2012, at 7:18 AM, David Holmes >>>>>>>>> >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi Peter, >>>>>>>>>> >>>>>>>>>> Sorry for the delay on this. >>>>>>>>>> >>>>>>>>>> Generally your VolatileData and my ReflectionHelper are doing a >>>>>>>>>> similar job. But I agree with your reasoning that all of the >>>>>>>>>> cached >>>>>>>>>> SoftReferences are likely to be cleared at once, and so a >>>>>>>>>> SoftReference to a helper object with direct references, is more >>>>>>>>>> effective than a direct reference to a helper object with >>>>>>>>>> SoftReferences. My initial stance with this was very >>>>>>>>>> conservative >>>>>>>>>> as the more change that is introduced the more uncertainty >>>>>>>>>> there is >>>>>>>>>> about the impact. >>>>>>>>>> >>>>>>>>>> I say the above primarily because I think, if I am to proceed >>>>>>>>>> with >>>>>>>>>> this, I will need to separate out the general reflection caching >>>>>>>>>> changes from the annotation changes. There are a number of >>>>>>>>>> reasons >>>>>>>>>> for this: >>>>>>>>>> >>>>>>>>>> First, I'm not at all familiar with the implementation of >>>>>>>>>> annotations at the VM or Java level, and the recent changes in >>>>>>>>>> this >>>>>>>>>> area just exacerbate my ignorance of the mechanics. So I don't >>>>>>>>>> feel >>>>>>>>>> qualified to evaluate that aspect. >>>>>>>>>> >>>>>>>>>> Second, the bulk of the reflection caching code is simplified by >>>>>>>>>> the fact that due to current constraints on class >>>>>>>>>> redefinition the >>>>>>>>>> caching is effectively idempotent for >>>>>>>>>> fields/methods/constructors. >>>>>>>>>> But that is not the case for annotations. >>>>>>>>>> >>>>>>>>>> Finally, the use of synchronization with the annotations >>>>>>>>>> method is >>>>>>>>>> perplexing me. I sent Joe a private email on this but I may as >>>>>>>>>> well >>>>>>>>>> raise it here - and I think you have alluded to this in your >>>>>>>>>> earlier emails as well: initAnnotationsIfNecessary() is a >>>>>>>>>> synchronized instance method but I can not find any other >>>>>>>>>> code in >>>>>>>>>> the VM that synchronizes on the Class object's monitor. So if >>>>>>>>>> this >>>>>>>>>> synchronization is trying to establish consistency in the >>>>>>>>>> face of >>>>>>>>>> class redefinition, I do not see where class redefinition is >>>>>>>>>> participating in the synchronization! >>>>>>>>>> >>>>>>>>>> So what I would like to do is take your basic VolatileData >>>>>>>>>> part of >>>>>>>>>> the patch and run with it for JEP-149 purposes, while separating >>>>>>>>>> the annotations issue so they can be dealt with by the >>>>>>>>>> experts in >>>>>>>>>> that particular area. >>>>>>>>>> >>>>>>>>>> I'm sorry it has taken so long to arrive at a fairly negative >>>>>>>>>> position, but I need someone else to take up the annotations >>>>>>>>>> gauntlet and run with it. >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> David >>>>>>>>>> >>>>>> >>>> >> From alexey.utkin at oracle.com Mon Dec 17 10:37:35 2012 From: alexey.utkin at oracle.com (alexey.utkin at oracle.com) Date: Mon, 17 Dec 2012 10:37:35 +0000 Subject: hg: jdk8/tl/jdk: 8004928: TEST_BUG: Reduce dependence of CoreLib tests from the AWT subsystem Message-ID: <20121217103804.29186471CB@hg.openjdk.java.net> Changeset: a02212de8db6 Author: uta Date: 2012-12-17 14:34 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a02212de8db6 8004928: TEST_BUG: Reduce dependence of CoreLib tests from the AWT subsystem Summary: the tests were refactored to drop AWT dependence where it was possible. Reviewed-by: alanb, mchung ! test/java/io/Serializable/resolveProxyClass/NonPublicInterface.java ! test/java/lang/Throwable/LegacyChainedExceptionSerialization.java ! test/java/lang/management/CompilationMXBean/Basic.java ! test/java/lang/reflect/Generics/Probe.java ! test/java/lang/reflect/Proxy/ClassRestrictions.java ! test/java/util/Collections/EmptyIterator.java ! test/java/util/logging/LoggingDeadlock4.java ! test/sun/tools/jrunscript/common.sh From frederic.parain at oracle.com Mon Dec 17 11:27:03 2012 From: frederic.parain at oracle.com (Frederic Parain) Date: Mon, 17 Dec 2012 12:27:03 +0100 Subject: RFR: 7150256: Add back Diagnostic Command JMX API Message-ID: <50CF0187.6080001@oracle.com> Hi, Please review the following change for CR 7150256. This changeset is the JDK side of two parts project. The goal of this feature is to allow remote invocations of Diagnostic Commands via JMX. Diagnostic Commands are actually invoked from the jcmd tool, which is a local tool using the attachAPI. It was not possible to remotely invoke these commands. This changeset creates a new PlatformMBean, remotely accessible via the Platform MBean Server, providing access to Diagnostic Commands too. The set of supported Diagnostic Commands varies with the JVM version, command line options and even some runtime operations. The new PlatformMBean, called DiagnosticCommandsMBean is not statically defined, but computes its content dynamically at runtime. This is why the MBeanInfo returned by this new MBean contains a lot of meta-data describing each supported Diagnostic Command (name, help message, syntax, etc.) Because this feature allows remote invocations, it is important to be able to control who is invoking and what is invoked. Java Permission checks have been introduced before a remote invocation request is forwarded to the JVM. So, each Diagnostic Command can require a Java Permission to be invoked remotely. The name of the required Java Permission is provided in the meta-data in the MBeanInfo. The security configuration is done using a Security Manager and the regular JMX configurations. Some existing Diagnostic Commands have been extended to specify which Java Permission they require. The webrev is here: http://cr.openjdk.java.net/~fparain/7150256/webrev.00/ The second part of this project is the support for this feature in the HotSpot VM, and is tracked by CR 8004095 (separate request for review will be sent for it). Thanks, Fred -- Frederic Parain - Oracle Grenoble Engineering Center - France Phone: +33 4 76 18 81 17 Email: Frederic.Parain at Oracle.com From sean.mullan at oracle.com Mon Dec 17 13:41:22 2012 From: sean.mullan at oracle.com (sean.mullan at oracle.com) Date: Mon, 17 Dec 2012 13:41:22 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20121217134217.4D9A9471D0@hg.openjdk.java.net> Changeset: e4d88a7352c6 Author: mullan Date: 2012-12-17 08:28 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e4d88a7352c6 8004234: Downgrade normative references to ${java.home}/lib/security/krb5.conf Reviewed-by: alanb, weijun ! src/share/classes/javax/security/auth/kerberos/package.html Changeset: 4a21f818ebb1 Author: mullan Date: 2012-12-17 08:30 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4a21f818ebb1 Merge - src/share/classes/sun/awt/TextureSizeConstraining.java - test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshall.java From Alan.Bateman at oracle.com Mon Dec 17 14:16:01 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 17 Dec 2012 14:16:01 +0000 Subject: RFR 8005081: java/util/prefs/PrefsSpi.sh fails on macos-x In-Reply-To: <50CB638D.8040708@oracle.com> References: <50CB638D.8040708@oracle.com> Message-ID: <50CF2921.9090807@oracle.com> On 14/12/2012 17:36, Chris Hegarty wrote: > Strangely, this test passed in my test runs, on all platforms, before > the push with the changes that pass the TESTVMOPTS, 8003890. It has > now been seen to fail on some mac machines. There appears to be an > issue with the use of quotes around TESTVMOPTS. The below change > resolves the failure on the problem machines, and also continues to > pass on all other platforms. I can only guess that sh is a different shell or version. In any case, the change looks fine to me. -Alan From Alan.Bateman at oracle.com Mon Dec 17 15:23:30 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 17 Dec 2012 15:23:30 +0000 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50CBD2BF.90100@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> <50CB33FE.7000605@CoSoCo.de> <50CB9CF5.4090300@oracle.com> <50CBC7D0.9050103@CoSoCo.de> <50CBD110.1080208@oracle.com> <50CBD2BF.90100@oracle.com> Message-ID: <50CF38F2.6040707@oracle.com> On 15/12/2012 01:30, Mandy Chung wrote: > > Having a second thought, it's a new tool and we need to learn its > options anyway. I'd opt for consistency than familiarity and not to > have mixture of Unix-style and GNU-style options. If no objection, I > will change it to --classpath for the initial push. > > Mandy I looked through the webrev and I think it looks very good. I mostly agree with your argument that this is a new tool and that we should be consistent with GNU-style options. So what was the final bid is, is it --classpath or --class-path? I guess it wouldn't do any harm to silently supporting -cp and -classpath as folks used to java* tools will probably use them without thinking. One other thing is that jdk.properties is a bit out of date. That's not important of course as it will eventually go away. -Alan From peter.levart at gmail.com Mon Dec 17 15:36:42 2012 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 17 Dec 2012 16:36:42 +0100 Subject: EnumData space optimization in j.l.Class (JEP-146) Message-ID: <50CF3C0A.8030203@gmail.com> Hi David and others, Here's a patch that eliminates one of two fields in java.lang.Class, related to caching enum constants: http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.enum/webrev.01/index.html It does it by moving one field to a subclass of HashMap, which is referenced by a remaining field that serves two different purposes/stages of caching. These are the results of a micro-benchmark that exercises public API that uses the internal j.l.Class API regarding enum constants: enum MyEnum { ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN } EnumSet.noneOf(MyEnum.class): 300_000_000 loops MyEnum.valueOf(String): 30_000_000 loops * 10 calls for different names ** Original JDK8 code Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp ../out/production/test test.EnumTest reference EnumSet.noneOf(Class): 351610312 340302968 339893333 339774384 339750612 339558414 339547022 339621595 MyEnum.valueOf(String): 935153830 897188742 887541353 960839820 886119463 885818334 885827093 885752461 EnumSet.noneOf(Class): 339552678 339469528 339513757 339451341 339512154 339511634 339664326 339793144 ** patched java.lang.Class Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp ../out/production/test -Xbootclasspath/p:../out/production/jdk test.EnumTest EnumSet.noneOf(Class): 351724931 339286591 305082929 305042885 305058303 305044144 305073463 305049604 MyEnum.valueOf(String): 955032718 908534137 891406394 891506147 891414312 893652469 891412757 891409294 EnumSet.noneOf(Class): 414044087 406904161 406788898 406839824 406765274 406815728 407002576 406779162 The slow-down of about 20% (last line) is presumably a consequence of another in-direction to obtain shared enum constants array when there is already a Map in place. It is still fast though (300M EnumSet instances / 0.4 s). Here's the source of the micro-benchmark: https://raw.github.com/plevart/jdk8-tl/JEP-149.enum/test/src/test/EnumTest.java I don't know what's more important in this occasion. A small space gain (8 or 4 bytes per j.l.Class instance) or a small performance gain (20%). Regards, Peter From daniel.fuchs at oracle.com Mon Dec 17 15:39:54 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Mon, 17 Dec 2012 16:39:54 +0100 Subject: RFR: javax.xml.datatype: Using ServiceLoader to load JAXP datatype factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50C881D8.1090909@oracle.com> References: <50C771A6.7090807@oracle.com> <50C881D8.1090909@oracle.com> Message-ID: <50CF3CCA.6050903@oracle.com> Hi, As pointed out by Paul & Alan, there's no reason to force Class.forName to initialize the class when attempting to load it in FactoryFinder. FactoryFinder should behave like ServiceLoader in this respect. So here is an updated webrev for javax.xml.datatype. I also reported the changes to javax.xml.parsers: -- daniel On 12/12/12 2:08 PM, Daniel Fuchs wrote: > Hi, > > Please find below a refreshed webrev which adds a bit of cleanup > suggested by Paul. > > Instead of casting the result of newInstance() at several places, > we pass the expected base type to newInstance so that the cast > occurs only once. > > > > > -- daniel > > Note: I have applied the same cleanup to the parsers package: > javax.xml.parsers: > > > > > On 12/11/12 6:47 PM, Daniel Fuchs wrote: >> Hi, >> >> Here is a new webrev in the series that addresses using ServiceLoader in >> JAXP for JDK 8. >> >> 7169894: JAXP Plugability Layer: using service loader >> >> This changeset addresses modification in the javax.xml.datatype >> package. >> It is similar to changes proposed for the javax.xml.parsers >> package [1], with a few differences due to the specificities of >> javax.xml.datatype. >> >> Namely: >> >> 1. The documentation that describes the loading mechanism is in the >> class header rather than in the method documentation - which leads >> to some wording changes. >> >> 2. The DatatypeFactory is specified to throw a >> DatatypeConfigurationException - which is a checked exception, >> instead of an Error - as was FactoryConfigurationError >> >> 3. DatatypeConfigurationException allows to wrap >> ServiceConfigurationError directly - so the additional layer >> of RuntimeException is not needed here. >> >> >> >> >> >> -- daniel >> >> [1] javax.xml.parsers: >> >> >> >> > From joel.franck at oracle.com Mon Dec 17 15:41:58 2012 From: joel.franck at oracle.com (=?iso-8859-1?Q?Joel_Borggr=E9n-Franck?=) Date: Mon, 17 Dec 2012 16:41:58 +0100 Subject: RFR: 8004699 : Add type annotation storage to Constructor, Field and Method Message-ID: Here is the first in a series of changes to add type annotation support to reflection. http://cr.openjdk.java.net/~jfranck/8004699/webrev.00/ While this adds overhead all instances of Field, Constructor, and Method we need this change in order to coordinate with the changes going in to HotSpot There is a plan to remove the additional overhead by consolidating all annotation fields, though this will have to wait a bit. cheers /Joel From Alan.Bateman at oracle.com Mon Dec 17 15:47:28 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 17 Dec 2012 15:47:28 +0000 Subject: RFR: 8004699 : Add type annotation storage to Constructor, Field and Method In-Reply-To: References: Message-ID: <50CF3E90.8080802@oracle.com> On 17/12/2012 15:41, Joel Borggr?n-Franck wrote: > Here is the first in a series of changes to add type annotation support to reflection. > > http://cr.openjdk.java.net/~jfranck/8004699/webrev.00/ > > While this adds overhead all instances of Field, Constructor, and Method we need this change in order to coordinate with the changes going in to HotSpot There is a plan to remove the additional overhead by consolidating all annotation fields, though this will have to wait a bit. > > cheers > /Joel I assume this should be typeAnnotations rather than type_annotations so that it's consistent with the existing fields. Have the Hotspot changes been pushed already? -Alan From jonathan.gibbons at oracle.com Mon Dec 17 15:47:49 2012 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Mon, 17 Dec 2012 15:47:49 +0000 Subject: hg: jdk8/tl/langtools: 8004832: Add new doclint package Message-ID: <20121217154752.7E17B471D3@hg.openjdk.java.net> Changeset: 75ab654b5cd5 Author: jjg Date: 2012-12-17 07:47 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/75ab654b5cd5 8004832: Add new doclint package Reviewed-by: mcimadamore ! make/build.properties ! src/share/classes/com/sun/source/util/DocTrees.java ! src/share/classes/com/sun/source/util/JavacTask.java ! src/share/classes/com/sun/source/util/TreePath.java + src/share/classes/com/sun/tools/doclint/Checker.java + src/share/classes/com/sun/tools/doclint/DocLint.java + src/share/classes/com/sun/tools/doclint/Entity.java + src/share/classes/com/sun/tools/doclint/Env.java + src/share/classes/com/sun/tools/doclint/HtmlTag.java + src/share/classes/com/sun/tools/doclint/Messages.java + src/share/classes/com/sun/tools/doclint/resources/doclint.properties ! src/share/classes/com/sun/tools/javac/api/BasicJavacTask.java ! src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java ! src/share/classes/com/sun/tools/javac/api/JavacTrees.java ! src/share/classes/com/sun/tools/javac/main/JavaCompiler.java ! src/share/classes/com/sun/tools/javac/model/JavacTypes.java ! src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java ! src/share/classes/com/sun/tools/javac/resources/compiler.properties ! src/share/classes/com/sun/tools/javac/tree/DCTree.java ! src/share/classes/com/sun/tools/javac/tree/DocPretty.java ! src/share/classes/com/sun/tools/javac/tree/TreeInfo.java + test/tools/doclint/AccessTest.java + test/tools/doclint/AccessTest.package.out + test/tools/doclint/AccessTest.private.out + test/tools/doclint/AccessTest.protected.out + test/tools/doclint/AccessTest.public.out + test/tools/doclint/AccessibilityTest.java + test/tools/doclint/AccessibilityTest.out + test/tools/doclint/DocLintTester.java + test/tools/doclint/EmptyAuthorTest.java + test/tools/doclint/EmptyAuthorTest.out + test/tools/doclint/EmptyExceptionTest.java + test/tools/doclint/EmptyExceptionTest.out + test/tools/doclint/EmptyParamTest.java + test/tools/doclint/EmptyParamTest.out + test/tools/doclint/EmptyReturnTest.java + test/tools/doclint/EmptyReturnTest.out + test/tools/doclint/EmptySerialDataTest.java + test/tools/doclint/EmptySerialDataTest.out + test/tools/doclint/EmptySerialFieldTest.java + test/tools/doclint/EmptySerialFieldTest.out + test/tools/doclint/EmptySinceTest.java + test/tools/doclint/EmptySinceTest.out + test/tools/doclint/EmptyVersionTest.java + test/tools/doclint/EmptyVersionTest.out + test/tools/doclint/HtmlAttrsTest.java + test/tools/doclint/HtmlAttrsTest.out + test/tools/doclint/HtmlTagsTest.java + test/tools/doclint/HtmlTagsTest.out + test/tools/doclint/MissingCommentTest.java + test/tools/doclint/MissingCommentTest.out + test/tools/doclint/MissingParamsTest.java + test/tools/doclint/MissingParamsTest.out + test/tools/doclint/MissingReturnTest.java + test/tools/doclint/MissingReturnTest.out + test/tools/doclint/MissingThrowsTest.java + test/tools/doclint/MissingThrowsTest.out + test/tools/doclint/OptionTest.java + test/tools/doclint/OverridesTest.java + test/tools/doclint/ReferenceTest.java + test/tools/doclint/ReferenceTest.out + test/tools/doclint/RunTest.java + test/tools/doclint/SyntaxTest.java + test/tools/doclint/SyntaxTest.out + test/tools/doclint/SyntheticTest.java + test/tools/doclint/ValidTest.java + test/tools/doclint/tidy/AnchorAlreadyDefined.java + test/tools/doclint/tidy/AnchorAlreadyDefined.out + test/tools/doclint/tidy/BadEnd.java + test/tools/doclint/tidy/BadEnd.out + test/tools/doclint/tidy/InsertImplicit.java + test/tools/doclint/tidy/InsertImplicit.out + test/tools/doclint/tidy/InvalidEntity.java + test/tools/doclint/tidy/InvalidEntity.out + test/tools/doclint/tidy/InvalidName.java + test/tools/doclint/tidy/InvalidName.out + test/tools/doclint/tidy/InvalidTag.java + test/tools/doclint/tidy/InvalidTag.out + test/tools/doclint/tidy/InvalidURI.java + test/tools/doclint/tidy/InvalidURI.out + test/tools/doclint/tidy/MissingGT.java + test/tools/doclint/tidy/MissingGT.out + test/tools/doclint/tidy/MissingTag.java + test/tools/doclint/tidy/MissingTag.out + test/tools/doclint/tidy/NestedTag.java + test/tools/doclint/tidy/NestedTag.out + test/tools/doclint/tidy/ParaInPre.java + test/tools/doclint/tidy/ParaInPre.out + test/tools/doclint/tidy/README.txt + test/tools/doclint/tidy/RepeatedAttr.java + test/tools/doclint/tidy/RepeatedAttr.out + test/tools/doclint/tidy/TextNotAllowed.java + test/tools/doclint/tidy/TextNotAllowed.out + test/tools/doclint/tidy/TrimmingEmptyTag.java + test/tools/doclint/tidy/TrimmingEmptyTag.out + test/tools/doclint/tidy/UnescapedOrUnknownEntity.java + test/tools/doclint/tidy/UnescapedOrUnknownEntity.out + test/tools/doclint/tidy/util/Main.java + test/tools/doclint/tidy/util/tidy.sh + test/tools/javac/diags/examples/NoContent.java From peter.levart at gmail.com Mon Dec 17 16:00:46 2012 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 17 Dec 2012 17:00:46 +0100 Subject: RFR: 8004699 : Add type annotation storage to Constructor, Field and Method In-Reply-To: References: Message-ID: <50CF41AE.7010909@gmail.com> Hi Joel, 82 // This is set by the vm at Method creation 83 private byte[] type_annotations; Wouldn't it be better to initialize this field in the constructor? You could create an overloaded constructor if you wanted to be compatible with previous versions of the VM. Regards, Peter On 12/17/2012 04:41 PM, Joel Borggr?n-Franck wrote: > Here is the first in a series of changes to add type annotation support to reflection. > > http://cr.openjdk.java.net/~jfranck/8004699/webrev.00/ > > While this adds overhead all instances of Field, Constructor, and Method we need this change in order to coordinate with the changes going in to HotSpot There is a plan to remove the additional overhead by consolidating all annotation fields, though this will have to wait a bit. > > cheers > /Joel From dl at cs.oswego.edu Mon Dec 17 16:12:04 2012 From: dl at cs.oswego.edu (Doug Lea) Date: Mon, 17 Dec 2012 11:12:04 -0500 Subject: RRFR 8002356: Add ForkJoin common pool and CountedCompleted In-Reply-To: <8694E88A-40A5-4AC3-8C25-55FA3574D933@oracle.com> References: <50CA07F4.4000908@oracle.com> <8694E88A-40A5-4AC3-8C25-55FA3574D933@oracle.com> Message-ID: <50CF4454.8040403@cs.oswego.edu> On 12/13/12 15:16, Mike Duigou wrote: > Some notes: Thanks! > > - The Object padding (pad10 - pad1d) in WorkQueue and ForkJoinPool is > sensitive to reference size and compressed OOPS. I was surprised to see > Object used rather than long or int. Until we get @Contended, this is black art. Because of how layouts work, you need trailing padding to be refs for anything with at least one ref. > > - how is getCommonPoolParallelism() different from > commonPool().getParallelism() ? Seems redundant. The method exists because of static-init bootstrapping constraints, and is public just because it is handy in other contexts as well; for example, JDK or user code might want to adopt sizings commensurate commonPoolParallelism. As a user of this myself (in ConcurrentHashMap spliterators), I found that I wanted this method, so figured others will too. > > - I would document the effects of shutdown, shutdownNow, awaitTermination, > isTerminating specific to the common pool on getCommonPool() rather than on > the individual methods. The discussion seems out of place on the individual > methods. Everything about the common pool should be consolidated (or > replicated) on getCommonPool() for one-stop-shopping to understand the > characteristics of the common pool. Notes about commonPool are also now top-level javadocs as well as on per-method shutdown etc (where they must be). But given that at least one reader expected them elsewhere, I'll revise: /** * Returns the common pool instance. This pool is statically * constructed; its run state is unaffected by attempts to * {@link @shutdown} or {@link #shutdownNow}. * * @return the common pool instance */ public static ForkJoinPool commonPool() ... > > - ForkJoinTask - "If the current thread is operating in a ForkJoinPool," and > similar phrases. It doesn't say what happens if it isn't. I think that all wording along these lines is now gone? > > - CountedCompleter : "Asuuming" -> "Assuming" Thanks. Already fixed since Chris's last grab. -Doug From Alan.Bateman at oracle.com Mon Dec 17 16:12:52 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 17 Dec 2012 16:12:52 +0000 Subject: RFR: javax.xml.datatype: Using ServiceLoader to load JAXP datatype factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50CF3CCA.6050903@oracle.com> References: <50C771A6.7090807@oracle.com> <50C881D8.1090909@oracle.com> <50CF3CCA.6050903@oracle.com> Message-ID: <50CF4484.1020003@oracle.com> On 17/12/2012 15:39, Daniel Fuchs wrote: > Hi, > > As pointed out by Paul & Alan, there's no reason to force > Class.forName to initialize the class when attempting to > load it in FactoryFinder. > > FactoryFinder should behave like ServiceLoader in this respect. > So here is an updated webrev for javax.xml.datatype. > > > > I also reported the changes to javax.xml.parsers: > > > > > -- daniel > I've looked at both webrevs and this looks very good (thank you for being so careful). -Alan. From Ulf.Zibis at CoSoCo.de Mon Dec 17 16:13:27 2012 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Mon, 17 Dec 2012 17:13:27 +0100 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50CF38F2.6040707@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> <50CB33FE.7000605@CoSoCo.de> <50CB9CF5.4090300@oracle.com> <50CBC7D0.9050103@CoSoCo.de> <50CBD110.1080208@oracle.com> <50CBD2BF.90100@oracle.com> <50CF38F2.6040707@oracle.com> Message-ID: <50CF44A7.8000202@CoSoCo.de> Am 17.12.2012 16:23, schrieb Alan Bateman: > I mostly agree with your argument that this is a new tool and that we should be consistent with > GNU-style options. So what was the final bid is, is it --classpath or --class-path? I guess it > wouldn't do any harm to silently supporting -cp and -classpath as folks used to java* tools will > probably use them without thinking. Thanks for supporting my arguments about "silent familarity" to old style, Alan. As --class(-)path is a frequent and important option, I additionally think, we should have an official short form. If '-cp' doesn't conform with GNU-style, what about '-C' ? -Ulf From maurizio.cimadamore at oracle.com Mon Dec 17 16:27:55 2012 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Mon, 17 Dec 2012 16:27:55 +0000 Subject: hg: jdk8/tl/langtools: 8004099: Bad compiler diagnostic generated when poly expression is passed to non-existent method Message-ID: <20121217162759.0D394471D5@hg.openjdk.java.net> Changeset: f20568328a57 Author: mcimadamore Date: 2012-12-17 16:13 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/f20568328a57 8004099: Bad compiler diagnostic generated when poly expression is passed to non-existent method Summary: Some code paths in resolve do not use methodArguments to correctly format actuals Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/comp/Attr.java ! src/share/classes/com/sun/tools/javac/comp/Resolve.java + test/tools/javac/lambda/BadMethodCall2.java + test/tools/javac/lambda/BadMethodCall2.out From chris.hegarty at oracle.com Mon Dec 17 16:28:02 2012 From: chris.hegarty at oracle.com (chris.hegarty at oracle.com) Date: Mon, 17 Dec 2012 16:28:02 +0000 Subject: hg: jdk8/tl/jdk: 8005081: java/util/prefs/PrefsSpi.sh fails on macos-x Message-ID: <20121217162814.AD0D8471D6@hg.openjdk.java.net> Changeset: bcf79e6f52a0 Author: chegar Date: 2012-12-17 16:27 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/bcf79e6f52a0 8005081: java/util/prefs/PrefsSpi.sh fails on macos-x Reviewed-by: alanb ! test/java/util/prefs/PrefsSpi.sh From jim.gish at oracle.com Mon Dec 17 16:29:44 2012 From: jim.gish at oracle.com (Jim Gish) Date: Mon, 17 Dec 2012 11:29:44 -0500 Subject: RFR: 4247235: (spec str) StringBuffer.insert(int, char[]) specification is inconsistent In-Reply-To: <50CC81FF.3000602@oracle.com> References: <50CBACE7.70701@oracle.com> <50CC81FF.3000602@oracle.com> Message-ID: <50CF4878.9020502@oracle.com> On 12/15/2012 08:58 AM, Alan Bateman wrote: > On 14/12/2012 22:49, Jim Gish wrote: >> Please review >> http://cr.openjdk.java.net/~jgish/Bug4247235-Add-Blanket-Null-Stmt/ >> >> >> This minor spec change (which will require CCC approval), adds >> blanket null-handling statements to both StringBuffer and >> StringBuilder, equivalent to the one already in String. > It looks like most (all?) of the methods defined by StringBuffer and > StringBuilder that can throw NPE already specify it. Are you planning > on removing the @throws from the methods? I left it as is to raise this very point. In a previous proposed change, adding a method somewhere that was explicit about throwing NPE, someone brought up the issue that we should rely on a blanket statement and not clutter the javadoc with @throws NPE. Should we, in fact, be removing these method-specific @throws specs? > > I see that String uses null, the proposed update to > StringBuilder uses null, and the proposed update to > StringBuffer uses {@code null}. We should try to be consistent. I aimed for self-consistency here -- keeping what was already in place. This was intentional to raise the point of whether everything should be brought up to date. Thanks, Jim > > -Alan. -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From jonathan.gibbons at oracle.com Mon Dec 17 16:34:25 2012 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Mon, 17 Dec 2012 16:34:25 +0000 Subject: hg: jdk8/tl: 8005090: Include com.sun.source.doctree in Tree API docs Message-ID: <20121217163426.233EF471D8@hg.openjdk.java.net> Changeset: a0779b1e9a4d Author: jjg Date: 2012-12-17 08:34 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/a0779b1e9a4d 8005090: Include com.sun.source.doctree in Tree API docs Reviewed-by: erikj ! common/makefiles/javadoc/NON_CORE_PKGS.gmk From jonathan.gibbons at oracle.com Mon Dec 17 16:34:56 2012 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Mon, 17 Dec 2012 16:34:56 +0000 Subject: hg: jdk8/tl/jdk: 8005090: Include com.sun.source.doctree in Tree API docs Message-ID: <20121217163508.2BB34471D9@hg.openjdk.java.net> Changeset: 9f1b516cd9cb Author: jjg Date: 2012-12-17 08:34 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/9f1b516cd9cb 8005090: Include com.sun.source.doctree in Tree API docs Reviewed-by: erikj ! make/docs/NON_CORE_PKGS.gmk From joel.franck at oracle.com Mon Dec 17 16:51:54 2012 From: joel.franck at oracle.com (=?iso-8859-1?Q?Joel_Borggr=E9n-Franck?=) Date: Mon, 17 Dec 2012 17:51:54 +0100 Subject: RFR: 8004699 : Add type annotation storage to Constructor, Field and Method In-Reply-To: <50CF3E90.8080802@oracle.com> References: <50CF3E90.8080802@oracle.com> Message-ID: <79541486-1082-4412-BFA0-BFF043B8D8E9@oracle.com> On Dec 17, 2012, at 4:47 PM, Alan Bateman wrote: > On 17/12/2012 15:41, Joel Borggr?n-Franck wrote: >> Here is the first in a series of changes to add type annotation support to reflection. >> >> http://cr.openjdk.java.net/~jfranck/8004699/webrev.00/ >> > I assume this should be typeAnnotations rather than type_annotations so that it's consistent with the existing fields. Doh. However since these fields are not the permanent solution and the overhead to changing naming is large, I would (vert strongly) prefer to keep the (bad) HotSpot naming convention for now. > Have the Hotspot changes been pushed already? > Out for review here: http://mail.openjdk.java.net/pipermail/hotspot-dev/2012-December/007637.html cheers /Joel From jim.gish at oracle.com Mon Dec 17 16:52:52 2012 From: jim.gish at oracle.com (Jim Gish) Date: Mon, 17 Dec 2012 11:52:52 -0500 Subject: RFR: 4247235: (spec str) StringBuffer.insert(int, char[]) specification is inconsistent In-Reply-To: <50CF4878.9020502@oracle.com> References: <50CBACE7.70701@oracle.com> <50CC81FF.3000602@oracle.com> <50CF4878.9020502@oracle.com> Message-ID: <50CF4DE4.4080901@oracle.com> I've created a new bug: https://jbs.oracle.com/bugs/browse/JDK-8005118 - I'll address the consistency issues there, and treat the NPE specs separately. Jim On 12/17/2012 11:29 AM, Jim Gish wrote: > > On 12/15/2012 08:58 AM, Alan Bateman wrote: >> On 14/12/2012 22:49, Jim Gish wrote: >>> Please review >>> http://cr.openjdk.java.net/~jgish/Bug4247235-Add-Blanket-Null-Stmt/ >>> >>> >>> This minor spec change (which will require CCC approval), adds >>> blanket null-handling statements to both StringBuffer and >>> StringBuilder, equivalent to the one already in String. >> It looks like most (all?) of the methods defined by StringBuffer and >> StringBuilder that can throw NPE already specify it. Are you planning >> on removing the @throws from the methods? > I left it as is to raise this very point. In a previous proposed > change, adding a method somewhere that was explicit about throwing > NPE, someone brought up the issue that we should rely on a blanket > statement and not clutter the javadoc with @throws NPE. > > Should we, in fact, be removing these method-specific @throws specs? >> >> I see that String uses null, the proposed update to >> StringBuilder uses null, and the proposed update to >> StringBuffer uses {@code null}. We should try to be consistent. > I aimed for self-consistency here -- keeping what was already in > place. This was intentional to raise the point of whether everything > should be brought up to date. > > Thanks, > Jim > >> >> -Alan. > -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From joel.franck at oracle.com Mon Dec 17 17:06:32 2012 From: joel.franck at oracle.com (=?iso-8859-1?Q?Joel_Borggr=E9n-Franck?=) Date: Mon, 17 Dec 2012 18:06:32 +0100 Subject: RFR: 8004699 : Add type annotation storage to Constructor, Field and Method In-Reply-To: <50CF41AE.7010909@gmail.com> References: <50CF41AE.7010909@gmail.com> Message-ID: On Dec 17, 2012, at 5:00 PM, Peter Levart wrote: > Hi Joel, > > 82 // This is set by the vm at Method creation > 83 private byte[] type_annotations; > > > Wouldn't it be better to initialize this field in the constructor? You could create an overloaded constructor if you wanted to be compatible with previous versions of the VM. > Fields aren't created using a constructor as far as I can see. cheers /Joel From daniel.fuchs at oracle.com Mon Dec 17 17:43:59 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Mon, 17 Dec 2012 18:43:59 +0100 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) Message-ID: <50CF59DF.2040006@oracle.com> Hi, Here is a new webrev in the series that addresses using ServiceLoader in JAXP for JDK 8. 7169894: JAXP Plugability Layer: using service loader This changeset addresses modification in the javax.xml.stream package. It is similar to changes proposed for the javax.xml.parsers package [1], with a few differences due to the specificity of javax.xml.stream. Namely: 1. The XMLXxxxFactory.newInstance methods that takes parameter takes a property name, rather than a class name, and thus calls FactoryFinder.find. 2. One of the deprecated XMLOutputFactory.newInstance method had a bug - it used to return an XMLInputFactory - and was deprecated because of that - so I did preserve the bug. 3. The noarg newFactory() methods were leaking instances of the private FactoryFinder$ConfigurationError - my patch corrects that since it removes FactoryFinder$ConfigurationError. 4. In FactoryFinder.find() the ClassLoader parameter is often ignored, which makes the factories in the stream package behave differently from theirs cousins in the other packages. I believe this was an oversight due to (1). My patch will not fix that - I will instead log this as a separate issue. best regards, -- daniel previous webrevs in the series: [1] javax.xml.parsers: [2] javax.xml.datatype: From jonathan.gibbons at oracle.com Mon Dec 17 18:32:04 2012 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Mon, 17 Dec 2012 18:32:04 +0000 Subject: hg: jdk8/tl/jdk: 8004832: Add new doclint package Message-ID: <20121217183215.6557E471E6@hg.openjdk.java.net> Changeset: bac477d67867 Author: jjg Date: 2012-12-17 10:31 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/bac477d67867 8004832: Add new doclint package Reviewed-by: erikj, ohair ! make/common/Release.gmk ! make/common/internal/Defs-langtools.gmk ! makefiles/CreateJars.gmk From rob.mckenna at oracle.com Mon Dec 17 18:46:50 2012 From: rob.mckenna at oracle.com (Rob McKenna) Date: Mon, 17 Dec 2012 18:46:50 +0000 Subject: RFR: [jdk7u-dev] - 8003898: X11 toolkit can be chosen as the default toolkit Message-ID: <50CF689A.6090905@oracle.com> Hi folks, This review contains: 8003898: X11 toolkit can be chosen as the default toolkit 7162111: TEST_BUG: change tests run in headless mode [macosx] (open) 8004928: TEST_BUG: Reduce dependence of CoreLib tests from the AWT subsystem Unfortunately the last two patches didn't apply cleanly, hence the review request. (the commit comments will be altered appropriately before integration) Webrev at: http://cr.openjdk.java.net/~robm/7162111/webrev.01/ I've just submitted a test job so I'll integrate once I get a review and a clean bill of health from that. -Rob From jonathan.gibbons at oracle.com Mon Dec 17 18:56:12 2012 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Mon, 17 Dec 2012 18:56:12 +0000 Subject: hg: jdk8/tl/langtools: 8004961: rename Plugin.call to Plugin.init Message-ID: <20121217185615.4331E471ED@hg.openjdk.java.net> Changeset: 064e372f273d Author: jjg Date: 2012-12-17 10:55 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/064e372f273d 8004961: rename Plugin.call to Plugin.init Reviewed-by: mcimadamore ! src/share/classes/com/sun/source/util/Plugin.java ! src/share/classes/com/sun/tools/javac/main/Main.java ! test/tools/javac/plugin/showtype/ShowTypePlugin.java ! test/tools/javac/plugin/showtype/Test.java From jim.gish at oracle.com Mon Dec 17 21:11:42 2012 From: jim.gish at oracle.com (Jim Gish) Date: Mon, 17 Dec 2012 16:11:42 -0500 Subject: RFR:8005118 Javadoc styles are inconsistent Message-ID: <50CF8A8E.3060004@oracle.com> Please review the simple fix that makes the String classes more consistent w.r.t. javadoc (specifically usages of , , {@code}, etc.). http://cr.openjdk.java.net/~jgish/Bug8005118-String-spec-consistency/ Thanks, Jim -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From mandy.chung at oracle.com Mon Dec 17 21:26:40 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 17 Dec 2012 13:26:40 -0800 Subject: EnumData space optimization in j.l.Class (JEP-146) In-Reply-To: <50CF3C0A.8030203@gmail.com> References: <50CF3C0A.8030203@gmail.com> Message-ID: <50CF8E10.3050705@oracle.com> On 12/17/12 7:36 AM, Peter Levart wrote: > Hi David and others, > > Here's a patch that eliminates one of two fields in java.lang.Class, > related to caching enum constants: > > http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.enum/webrev.01/index.html > > > It does it by moving one field to a subclass of HashMap, which is > referenced by a remaining field that serves two different > purposes/stages of caching. > Your observation of merging the enumConstants and enumConstantDirectory is a good one. I see that caching of enumConstantDirectory is important as it's used by EnumMap and EnumSet whose performance is critical (specified with constant time operations). I'm unsure about Class.getEnumConstants whether it's performance critical and worths the complexity of your proposed fix (the enumData field of two types). If a class has cached an enumConstantDirectory, Class.getEnumConstants can return a clone of its values(). Anyone knows how Class.getEnumConstants is commonly used and needs to be performant? I suspect it's more typical to obtain the list of enum constants statistically (calling Enum.values()) than reflectively. Mandy > These are the results of a micro-benchmark that exercises public API > that uses the internal j.l.Class API regarding enum constants: > > enum MyEnum { ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN } > EnumSet.noneOf(MyEnum.class): 300_000_000 loops > MyEnum.valueOf(String): 30_000_000 loops * 10 calls for different names > > ** Original JDK8 code > > Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp > ../out/production/test test.EnumTest reference > > EnumSet.noneOf(Class): 351610312 340302968 339893333 339774384 > 339750612 339558414 339547022 339621595 > MyEnum.valueOf(String): 935153830 897188742 887541353 960839820 > 886119463 885818334 885827093 885752461 > EnumSet.noneOf(Class): 339552678 339469528 339513757 339451341 > 339512154 339511634 339664326 339793144 > > ** patched java.lang.Class > > Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp > ../out/production/test -Xbootclasspath/p:../out/production/jdk > test.EnumTest > > EnumSet.noneOf(Class): 351724931 339286591 305082929 305042885 > 305058303 305044144 305073463 305049604 > MyEnum.valueOf(String): 955032718 908534137 891406394 891506147 > 891414312 893652469 891412757 891409294 > EnumSet.noneOf(Class): 414044087 406904161 406788898 406839824 > 406765274 406815728 407002576 406779162 > > The slow-down of about 20% (last line) is presumably a consequence of > another in-direction to obtain shared enum constants array when there > is already a Map in place. It is still fast though (300M EnumSet > instances / 0.4 s). > > Here's the source of the micro-benchmark: > > https://raw.github.com/plevart/jdk8-tl/JEP-149.enum/test/src/test/EnumTest.java > > > I don't know what's more important in this occasion. A small space > gain (8 or 4 bytes per j.l.Class instance) or a small performance gain > (20%). > > Regards, Peter > From peter.levart at gmail.com Mon Dec 17 22:14:51 2012 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 17 Dec 2012 23:14:51 +0100 Subject: EnumData space optimization in j.l.Class (JEP-146) In-Reply-To: <50CF8E10.3050705@oracle.com> References: <50CF3C0A.8030203@gmail.com> <50CF8E10.3050705@oracle.com> Message-ID: <50CF995B.20807@gmail.com> On 12/17/2012 10:26 PM, Mandy Chung wrote: > On 12/17/12 7:36 AM, Peter Levart wrote: >> Hi David and others, >> >> Here's a patch that eliminates one of two fields in java.lang.Class, >> related to caching enum constants: >> >> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.enum/webrev.01/index.html >> >> >> It does it by moving one field to a subclass of HashMap, which is >> referenced by a remaining field that serves two different >> purposes/stages of caching. >> > > Your observation of merging the enumConstants and > enumConstantDirectory is a good one. I see that caching of > enumConstantDirectory is important as it's used by EnumMap and EnumSet > whose performance is critical (specified with constant time > operations). I'm unsure about Class.getEnumConstants whether it's > performance critical and worths the complexity of your proposed fix > (the enumData field of two types). If a class has cached an > enumConstantDirectory, Class.getEnumConstants can return a clone of > its values(). > > Anyone knows how Class.getEnumConstants is commonly used and needs to > be performant? I suspect it's more typical to obtain the list of enum > constants statistically (calling Enum.values()) than reflectively. Hi Mandy, public Class.getEnumConstants() is a reflection mirror of SomeEnum.values(). It returns a defensive copy of the constants array. The primary place for Enum constants is in a private static final $VALUES field, generated by compiler in each Enum subclass. But that I think is not part of specification, so for internal usage (as far as I have managed to find out only in the constructors of EnumSet and EnumMap), the package-private Class.getEnumConstantsShared() is used which obtains a copy of the array by calling SomeEnum.values() and than caches is. The Class.enumConstantDirectory() on the other hand is an internal package-private method that returns a shared/cached Map, which is used internally to implement SomeEnum.valueOf(String) and Enum.valueOf(Class, String) static methods. Both package-private methods must be fast. Regards, Peter > > Mandy > >> These are the results of a micro-benchmark that exercises public API >> that uses the internal j.l.Class API regarding enum constants: >> >> enum MyEnum { ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, >> TEN } >> EnumSet.noneOf(MyEnum.class): 300_000_000 loops >> MyEnum.valueOf(String): 30_000_000 loops * 10 calls for different names >> >> ** Original JDK8 code >> >> Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp >> ../out/production/test test.EnumTest reference >> >> EnumSet.noneOf(Class): 351610312 340302968 339893333 339774384 >> 339750612 339558414 339547022 339621595 >> MyEnum.valueOf(String): 935153830 897188742 887541353 960839820 >> 886119463 885818334 885827093 885752461 >> EnumSet.noneOf(Class): 339552678 339469528 339513757 339451341 >> 339512154 339511634 339664326 339793144 >> >> ** patched java.lang.Class >> >> Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp >> ../out/production/test -Xbootclasspath/p:../out/production/jdk >> test.EnumTest >> >> EnumSet.noneOf(Class): 351724931 339286591 305082929 305042885 >> 305058303 305044144 305073463 305049604 >> MyEnum.valueOf(String): 955032718 908534137 891406394 891506147 >> 891414312 893652469 891412757 891409294 >> EnumSet.noneOf(Class): 414044087 406904161 406788898 406839824 >> 406765274 406815728 407002576 406779162 >> >> The slow-down of about 20% (last line) is presumably a consequence of >> another in-direction to obtain shared enum constants array when there >> is already a Map in place. It is still fast though (300M EnumSet >> instances / 0.4 s). >> >> Here's the source of the micro-benchmark: >> >> https://raw.github.com/plevart/jdk8-tl/JEP-149.enum/test/src/test/EnumTest.java >> >> >> I don't know what's more important in this occasion. A small space >> gain (8 or 4 bytes per j.l.Class instance) or a small performance >> gain (20%). >> >> Regards, Peter >> > From peter.levart at gmail.com Mon Dec 17 22:31:08 2012 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 17 Dec 2012 23:31:08 +0100 Subject: EnumData space optimization in j.l.Class (JEP-146) In-Reply-To: <50CF8E10.3050705@oracle.com> References: <50CF3C0A.8030203@gmail.com> <50CF8E10.3050705@oracle.com> Message-ID: <50CF9D2C.9050806@gmail.com> On 12/17/2012 10:26 PM, Mandy Chung wrote: > On 12/17/12 7:36 AM, Peter Levart wrote: >> Hi David and others, >> >> Here's a patch that eliminates one of two fields in java.lang.Class, >> related to caching enum constants: >> >> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.enum/webrev.01/index.html >> >> >> It does it by moving one field to a subclass of HashMap, which is >> referenced by a remaining field that serves two different >> purposes/stages of caching. >> > > Your observation of merging the enumConstants and > enumConstantDirectory is a good one. I see that caching of > enumConstantDirectory is important as it's used by EnumMap and EnumSet > whose performance is critical (specified with constant time > operations). I'm unsure about Class.getEnumConstants whether it's > performance critical and worths the complexity of your proposed fix > (the enumData field of two types). If a class has cached an > enumConstantDirectory, Class.getEnumConstants can return a clone of > its values(). Hi again, I think that the two-part caching (array-Map) was meant to save the creation of a HashMap if it was not needed and also to provide a shared array of constants for internal usage in order to spare from creating array clones. Peter > > Anyone knows how Class.getEnumConstants is commonly used and needs to > be performant? I suspect it's more typical to obtain the list of enum > constants statistically (calling Enum.values()) than reflectively. > > Mandy > >> These are the results of a micro-benchmark that exercises public API >> that uses the internal j.l.Class API regarding enum constants: >> >> enum MyEnum { ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, >> TEN } >> EnumSet.noneOf(MyEnum.class): 300_000_000 loops >> MyEnum.valueOf(String): 30_000_000 loops * 10 calls for different names >> >> ** Original JDK8 code >> >> Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp >> ../out/production/test test.EnumTest reference >> >> EnumSet.noneOf(Class): 351610312 340302968 339893333 339774384 >> 339750612 339558414 339547022 339621595 >> MyEnum.valueOf(String): 935153830 897188742 887541353 960839820 >> 886119463 885818334 885827093 885752461 >> EnumSet.noneOf(Class): 339552678 339469528 339513757 339451341 >> 339512154 339511634 339664326 339793144 >> >> ** patched java.lang.Class >> >> Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp >> ../out/production/test -Xbootclasspath/p:../out/production/jdk >> test.EnumTest >> >> EnumSet.noneOf(Class): 351724931 339286591 305082929 305042885 >> 305058303 305044144 305073463 305049604 >> MyEnum.valueOf(String): 955032718 908534137 891406394 891506147 >> 891414312 893652469 891412757 891409294 >> EnumSet.noneOf(Class): 414044087 406904161 406788898 406839824 >> 406765274 406815728 407002576 406779162 >> >> The slow-down of about 20% (last line) is presumably a consequence of >> another in-direction to obtain shared enum constants array when there >> is already a Map in place. It is still fast though (300M EnumSet >> instances / 0.4 s). >> >> Here's the source of the micro-benchmark: >> >> https://raw.github.com/plevart/jdk8-tl/JEP-149.enum/test/src/test/EnumTest.java >> >> >> I don't know what's more important in this occasion. A small space >> gain (8 or 4 bytes per j.l.Class instance) or a small performance >> gain (20%). >> >> Regards, Peter >> > From forax at univ-mlv.fr Mon Dec 17 22:39:21 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Mon, 17 Dec 2012 23:39:21 +0100 Subject: EnumData space optimization in j.l.Class (JEP-146) In-Reply-To: <50CF995B.20807@gmail.com> References: <50CF3C0A.8030203@gmail.com> <50CF8E10.3050705@oracle.com> <50CF995B.20807@gmail.com> Message-ID: <50CF9F19.2020609@univ-mlv.fr> On 12/17/2012 11:14 PM, Peter Levart wrote: > On 12/17/2012 10:26 PM, Mandy Chung wrote: >> On 12/17/12 7:36 AM, Peter Levart wrote: >>> Hi David and others, >>> >>> Here's a patch that eliminates one of two fields in java.lang.Class, >>> related to caching enum constants: >>> >>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.enum/webrev.01/index.html >>> >>> >>> It does it by moving one field to a subclass of HashMap, which is >>> referenced by a remaining field that serves two different >>> purposes/stages of caching. >>> >> >> Your observation of merging the enumConstants and >> enumConstantDirectory is a good one. I see that caching of >> enumConstantDirectory is important as it's used by EnumMap and >> EnumSet whose performance is critical (specified with constant time >> operations). I'm unsure about Class.getEnumConstants whether it's >> performance critical and worths the complexity of your proposed fix >> (the enumData field of two types). If a class has cached an >> enumConstantDirectory, Class.getEnumConstants can return a clone of >> its values(). >> >> Anyone knows how Class.getEnumConstants is commonly used and needs to >> be performant? I suspect it's more typical to obtain the list of >> enum constants statistically (calling Enum.values()) than reflectively. > Hi Mandy, > > public Class.getEnumConstants() is a reflection mirror of > SomeEnum.values(). It returns a defensive copy of the constants array. > The primary place for Enum constants is in a private static final > $VALUES field, generated by compiler in each Enum subclass. But that I > think is not part of specification, so for internal usage (as far as I > have managed to find out only in the constructors of EnumSet and > EnumMap), the package-private Class.getEnumConstantsShared() is used > which obtains a copy of the array by calling SomeEnum.values() and > than caches is. > > The Class.enumConstantDirectory() on the other hand is an internal > package-private method that returns a shared/cached Map, > which is used internally to implement SomeEnum.valueOf(String) and > Enum.valueOf(Class, String) static methods. > > Both package-private methods must be fast. > > Regards, Peter for what it worth, I'm the guy behind the patch of bug 6276988 (it was before OpenJDK was setup BTW), http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6276988 and for the little story, I need that patch because I was developing an Eclipse plugin that uses EnumSet to represent the possible completion values. So to answer to Mandy, this application needs really fast EnumSet creation thus really fast getEnumConstantShared() because the EnumSets was created as user types code. Also, Peter, in your getEnumConstantShared(), while the first instanceof is a cheap one, the second is not. I think I prefer either the status quo or to group all exotic fields in a specific object and pay the indirection to that object but not the instanceof checks. cheers, R?mi > >> >> Mandy >> >>> These are the results of a micro-benchmark that exercises public API >>> that uses the internal j.l.Class API regarding enum constants: >>> >>> enum MyEnum { ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, >>> TEN } >>> EnumSet.noneOf(MyEnum.class): 300_000_000 loops >>> MyEnum.valueOf(String): 30_000_000 loops * 10 calls for different names >>> >>> ** Original JDK8 code >>> >>> Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp >>> ../out/production/test test.EnumTest reference >>> >>> EnumSet.noneOf(Class): 351610312 340302968 339893333 339774384 >>> 339750612 339558414 339547022 339621595 >>> MyEnum.valueOf(String): 935153830 897188742 887541353 960839820 >>> 886119463 885818334 885827093 885752461 >>> EnumSet.noneOf(Class): 339552678 339469528 339513757 339451341 >>> 339512154 339511634 339664326 339793144 >>> >>> ** patched java.lang.Class >>> >>> Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp >>> ../out/production/test -Xbootclasspath/p:../out/production/jdk >>> test.EnumTest >>> >>> EnumSet.noneOf(Class): 351724931 339286591 305082929 305042885 >>> 305058303 305044144 305073463 305049604 >>> MyEnum.valueOf(String): 955032718 908534137 891406394 891506147 >>> 891414312 893652469 891412757 891409294 >>> EnumSet.noneOf(Class): 414044087 406904161 406788898 406839824 >>> 406765274 406815728 407002576 406779162 >>> >>> The slow-down of about 20% (last line) is presumably a consequence >>> of another in-direction to obtain shared enum constants array when >>> there is already a Map in place. It is still fast though (300M >>> EnumSet instances / 0.4 s). >>> >>> Here's the source of the micro-benchmark: >>> >>> https://raw.github.com/plevart/jdk8-tl/JEP-149.enum/test/src/test/EnumTest.java >>> >>> >>> I don't know what's more important in this occasion. A small space >>> gain (8 or 4 bytes per j.l.Class instance) or a small performance >>> gain (20%). >>> >>> Regards, Peter >>> >> > From mandy.chung at oracle.com Mon Dec 17 23:21:32 2012 From: mandy.chung at oracle.com (mandy.chung at oracle.com) Date: Mon, 17 Dec 2012 23:21:32 +0000 Subject: hg: jdk8/tl/langtools: 8005137: Rename DocLint.call to DocLint.init which overrides Plugin.init Message-ID: <20121217232134.BBA01471FA@hg.openjdk.java.net> Changeset: ef537bcc825a Author: mchung Date: 2012-12-17 15:19 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/ef537bcc825a 8005137: Rename DocLint.call to DocLint.init which overrides Plugin.init Reviewed-by: darcy, jjh ! src/share/classes/com/sun/tools/doclint/DocLint.java From david.holmes at oracle.com Tue Dec 18 00:50:06 2012 From: david.holmes at oracle.com (David Holmes) Date: Tue, 18 Dec 2012 10:50:06 +1000 Subject: EnumData space optimization in j.l.Class (JEP-146) In-Reply-To: <50CF3C0A.8030203@gmail.com> References: <50CF3C0A.8030203@gmail.com> Message-ID: <50CFBDBE.3070400@oracle.com> Hi Peter, BTW JEP-149 not 146! Sorry I didn't get a chance to respond last night before you continued on this path. I have to say no to this too. First I am just running out of time to get this finalized by M6 - particularly with the Xmas break looming. Second the trade-off here is far less clear. Not only may the performance aspect be more significant (as per Remi's discussion) but the memory saving may not even eventuate depending on alignment. It may be worth doing a new JEP for continued enhancements in this area post JDK 8, or maybe just have a RFE filed. But for now I have to put the brakes on and just run with what we have with the reflection caching changes. Your efforts are very much appreciated - I just wish the timing could have been different. Thanks, David On 18/12/2012 1:36 AM, Peter Levart wrote: > Hi David and others, > > Here's a patch that eliminates one of two fields in java.lang.Class, > related to caching enum constants: > > http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.enum/webrev.01/index.html > > It does it by moving one field to a subclass of HashMap, which is > referenced by a remaining field that serves two different > purposes/stages of caching. > > These are the results of a micro-benchmark that exercises public API > that uses the internal j.l.Class API regarding enum constants: > > enum MyEnum { ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN } > EnumSet.noneOf(MyEnum.class): 300_000_000 loops > MyEnum.valueOf(String): 30_000_000 loops * 10 calls for different names > > ** Original JDK8 code > > Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp > ../out/production/test test.EnumTest reference > > EnumSet.noneOf(Class): 351610312 340302968 339893333 339774384 339750612 > 339558414 339547022 339621595 > MyEnum.valueOf(String): 935153830 897188742 887541353 960839820 > 886119463 885818334 885827093 885752461 > EnumSet.noneOf(Class): 339552678 339469528 339513757 339451341 339512154 > 339511634 339664326 339793144 > > ** patched java.lang.Class > > Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp > ../out/production/test -Xbootclasspath/p:../out/production/jdk test.EnumTest > > EnumSet.noneOf(Class): 351724931 339286591 305082929 305042885 305058303 > 305044144 305073463 305049604 > MyEnum.valueOf(String): 955032718 908534137 891406394 891506147 > 891414312 893652469 891412757 891409294 > EnumSet.noneOf(Class): 414044087 406904161 406788898 406839824 406765274 > 406815728 407002576 406779162 > > The slow-down of about 20% (last line) is presumably a consequence of > another in-direction to obtain shared enum constants array when there is > already a Map in place. It is still fast though (300M EnumSet instances > / 0.4 s). > > Here's the source of the micro-benchmark: > > https://raw.github.com/plevart/jdk8-tl/JEP-149.enum/test/src/test/EnumTest.java > > I don't know what's more important in this occasion. A small space gain > (8 or 4 bytes per j.l.Class instance) or a small performance gain (20%). > > Regards, Peter > From david.holmes at oracle.com Tue Dec 18 01:58:35 2012 From: david.holmes at oracle.com (David Holmes) Date: Tue, 18 Dec 2012 11:58:35 +1000 Subject: RFR: 8004699 : Add type annotation storage to Constructor, Field and Method In-Reply-To: References: <50CF41AE.7010909@gmail.com> Message-ID: <50CFCDCB.1050601@oracle.com> On 18/12/2012 3:06 AM, Joel Borggr?n-Franck wrote: > > On Dec 17, 2012, at 5:00 PM, Peter Levart wrote: > >> Hi Joel, >> >> 82 // This is set by the vm at Method creation >> 83 private byte[] type_annotations; >> >> >> Wouldn't it be better to initialize this field in the constructor? You could create an overloaded constructor if you wanted to be compatible with previous versions of the VM. >> > > Fields aren't created using a constructor as far as I can see. Correct, all the reflection objects are allocated directly by the VM and initialized field by field as needed. No Java level constructor involved. This change is also fine with me, on the proviso that the follow up change to deal with efficiency and the field name is not too far away. Though really I don't think the change of name will be that big a deal anyway. Cheers, David > cheers > /Joel From mandy.chung at oracle.com Tue Dec 18 04:15:56 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 17 Dec 2012 20:15:56 -0800 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50CF44A7.8000202@CoSoCo.de> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> <50CB33FE.7000605@CoSoCo.de> <50CB9CF5.4090300@oracle.com> <50CBC7D0.9050103@CoSoCo.de> <50CBD110.1080208@oracle.com> <50CBD2BF.90100@oracle.com> <50CF38F2.6040707@oracle.com> <50CF44A7.8000202@CoSoCo.de> Message-ID: <50CFEDFC.5060903@oracle.com> On 12/17/12 8:13 AM, Ulf Zibis wrote: > Am 17.12.2012 16:23, schrieb Alan Bateman: >> I mostly agree with your argument that this is a new tool and that we >> should be consistent with GNU-style options. So what was the final >> bid is, is it --classpath or --class-path? I propose --class-path so that it makes it easier to determine -classpath is not supported >> I guess it wouldn't do any harm to silently supporting -cp and >> -classpath as folks used to java* tools will probably use them >> without thinking. > How important to carry the same option -cp and -classpath on j* tools? I do think developers can well adapt to a slight different option when using a new tool. I'm inclined not to mix these styles. In addition, I'd like to see how jdeps will be used after the initial push and people finds --class-path hard to move to. > Thanks for supporting my arguments about "silent familarity" to old > style, Alan. > As --class(-)path is a frequent and important option, I additionally > think, we should have an official short form. If '-cp' doesn't conform > with GNU-style, what about '-C' ? I considered '-C' and it might be confused with 'jar -C' and 'tar -C' option to change the directory. I think '-c' may be okay and it can avoid such confusion and closer to '-cp'. Are you okay with that? I'd like to send a new webrev tomorrow and finalize the review this week. Mandy From mandy.chung at oracle.com Tue Dec 18 06:02:56 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 17 Dec 2012 22:02:56 -0800 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50CF59DF.2040006@oracle.com> References: <50CF59DF.2040006@oracle.com> Message-ID: <50D00710.60703@oracle.com> Hi Daniel, There are currently several different FactoryFinder class in the JAXP implementation and there might be slight difference in each of them. Do you know if it has been looked into whether it's feasible to merge them into a single utility class? I suspect someone might have brought this up in the past. Mandy On 12/17/2012 9:43 AM, Daniel Fuchs wrote: > Hi, > > Here is a new webrev in the series that addresses using ServiceLoader in > JAXP for JDK 8. > > 7169894: JAXP Plugability Layer: using service loader > > This changeset addresses modification in the javax.xml.stream > package. > It is similar to changes proposed for the javax.xml.parsers > package [1], with a few differences due to the specificity of > javax.xml.stream. > > Namely: > > 1. The XMLXxxxFactory.newInstance methods that takes parameter takes > a property name, rather than a class name, and thus calls > FactoryFinder.find. > > 2. One of the deprecated XMLOutputFactory.newInstance method had a > bug - it used to return an XMLInputFactory - and was deprecated > because of that - so I did preserve the bug. > > 3. The noarg newFactory() methods were leaking instances of the > private FactoryFinder$ConfigurationError - my patch corrects > that since it removes FactoryFinder$ConfigurationError. > > 4. In FactoryFinder.find() the ClassLoader parameter is often ignored, > which makes the factories in the stream package behave differently > from theirs cousins in the other packages. I believe this was an > oversight due to (1). > My patch will not fix that - I will instead log this as a separate > issue. > > > > > > best regards, > > -- daniel > > previous webrevs in the series: > > [1] javax.xml.parsers: > > > > [2] javax.xml.datatype: > > From joe.darcy at oracle.com Tue Dec 18 08:25:42 2012 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Tue, 18 Dec 2012 08:25:42 +0000 Subject: hg: jdk8/tl/langtools: 8005046: Provide checking for a default method in javax.lang.model Message-ID: <20121218082544.95F7B47209@hg.openjdk.java.net> Changeset: bc74006c2d8d Author: darcy Date: 2012-12-18 00:24 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/bc74006c2d8d 8005046: Provide checking for a default method in javax.lang.model Reviewed-by: jjg ! src/share/classes/com/sun/tools/javac/code/Symbol.java ! src/share/classes/javax/lang/model/element/ExecutableElement.java + test/tools/javac/processing/model/element/TestExecutableElement.java From huizhe.wang at oracle.com Tue Dec 18 08:47:10 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 18 Dec 2012 00:47:10 -0800 Subject: RFR: (jaxp) 8003261 : static field is public but not final Message-ID: <50D02D8E.4000204@oracle.com> Hi, This is the 2nd of the three [findbug] issues. The field fVersion is simply made final. webrev: http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ Test: No new test needed. Thanks, Joe From chris.hegarty at oracle.com Tue Dec 18 08:53:06 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Tue, 18 Dec 2012 08:53:06 +0000 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <50D02D8E.4000204@oracle.com> References: <50D02D8E.4000204@oracle.com> Message-ID: Looks ok to me Joe. -Chris On 18 Dec 2012, at 08:47, Joe Wang wrote: > Hi, > > This is the 2nd of the three [findbug] issues. The field fVersion is simply made final. > > webrev: > http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ > > Test: > No new test needed. > > Thanks, > Joe From david.holmes at oracle.com Tue Dec 18 08:55:54 2012 From: david.holmes at oracle.com (David Holmes) Date: Tue, 18 Dec 2012 18:55:54 +1000 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <50D02D8E.4000204@oracle.com> References: <50D02D8E.4000204@oracle.com> Message-ID: <50D02F9A.7070402@oracle.com> Joe, On 18/12/2012 6:47 PM, Joe Wang wrote: > Hi, > > This is the 2nd of the three [findbug] issues. The field fVersion is > simply made final. > > webrev: > http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ Obviously it was known that this was a potential problem as we have fImmutableVersion. So fImmutableVersion is now redundant with this fix. I assume changing the public API has the appropriate approvals? David > Test: > No new test needed. > > Thanks, > Joe From paul.sandoz at oracle.com Tue Dec 18 09:01:04 2012 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 18 Dec 2012 10:01:04 +0100 Subject: RFR: javax.xml.datatype: Using ServiceLoader to load JAXP datatype factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50CF3CCA.6050903@oracle.com> References: <50C771A6.7090807@oracle.com> <50C881D8.1090909@oracle.com> <50CF3CCA.6050903@oracle.com> Message-ID: <5C9C2D98-3BCE-45FF-8279-F5880D016DFE@oracle.com> On Dec 17, 2012, at 4:39 PM, Daniel Fuchs wrote: > Hi, > > As pointed out by Paul & Alan, there's no reason to force > Class.forName to initialize the class when attempting to > load it in FactoryFinder. > > FactoryFinder should behave like ServiceLoader in this respect. > So here is an updated webrev for javax.xml.datatype. > > > I also reported the changes to javax.xml.parsers: > > +2 Paul. From paul.sandoz at oracle.com Tue Dec 18 09:03:59 2012 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 18 Dec 2012 10:03:59 +0100 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50CF59DF.2040006@oracle.com> References: <50CF59DF.2040006@oracle.com> Message-ID: <424419D5-C678-4CCD-9E01-25422E191CAC@oracle.com> Looks OK to me. Paul. On Dec 17, 2012, at 6:43 PM, Daniel Fuchs wrote: > Hi, > > Here is a new webrev in the series that addresses using ServiceLoader in > JAXP for JDK 8. > > 7169894: JAXP Plugability Layer: using service loader > > This changeset addresses modification in the javax.xml.stream > package. > It is similar to changes proposed for the javax.xml.parsers > package [1], with a few differences due to the specificity of > javax.xml.stream. > > Namely: > > 1. The XMLXxxxFactory.newInstance methods that takes parameter takes > a property name, rather than a class name, and thus calls > FactoryFinder.find. > > 2. One of the deprecated XMLOutputFactory.newInstance method had a > bug - it used to return an XMLInputFactory - and was deprecated > because of that - so I did preserve the bug. > > 3. The noarg newFactory() methods were leaking instances of the > private FactoryFinder$ConfigurationError - my patch corrects > that since it removes FactoryFinder$ConfigurationError. > > 4. In FactoryFinder.find() the ClassLoader parameter is often ignored, > which makes the factories in the stream package behave differently > from theirs cousins in the other packages. I believe this was an > oversight due to (1). > My patch will not fix that - I will instead log this as a separate > issue. > > > > > best regards, > > -- daniel > > previous webrevs in the series: > > [1] javax.xml.parsers: > > > [2] javax.xml.datatype: > From paul.sandoz at oracle.com Tue Dec 18 09:09:47 2012 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Tue, 18 Dec 2012 10:09:47 +0100 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D00710.60703@oracle.com> References: <50CF59DF.2040006@oracle.com> <50D00710.60703@oracle.com> Message-ID: <29ED0E07-C501-478A-B8D0-60AC4C23DC4A@oracle.com> On Dec 18, 2012, at 7:02 AM, Mandy Chung wrote: > Hi Daniel, > > There are currently several different FactoryFinder class in the JAXP implementation and there might be slight difference in each of them. Do you know if it has been looked into whether it's feasible to merge them into a single utility class? I suspect someone might have brought this up in the past. > You suspect right :-) Those FactoryFinder classes are package private, probably a artefact of JAXP having multiple distribution channels, and there were subtle differences between them but perhaps less so now? IMHO such unification could be considered as a later fix as i think getting the SL and CL functionality correct is a higher priority. Paul. From Alan.Bateman at oracle.com Tue Dec 18 09:13:39 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 18 Dec 2012 09:13:39 +0000 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <50D02F9A.7070402@oracle.com> References: <50D02D8E.4000204@oracle.com> <50D02F9A.7070402@oracle.com> Message-ID: <50D033C3.2050006@oracle.com> On 18/12/2012 08:55, David Holmes wrote: > Joe, > > On 18/12/2012 6:47 PM, Joe Wang wrote: >> Hi, >> >> This is the 2nd of the three [findbug] issues. The field fVersion is >> simply made final. >> >> webrev: >> http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ > > Obviously it was known that this was a potential problem as we have > fImmutableVersion. So fImmutableVersion is now redundant with this fix. > > I assume changing the public API has the appropriate approvals? This is com.sun.org.apache.xerces.internal.impl, so JDK implementation/internal, not supported, etc. -Alan. From peter.levart at gmail.com Tue Dec 18 09:18:47 2012 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 18 Dec 2012 10:18:47 +0100 Subject: EnumData space optimization in j.l.Class (JEP-146) In-Reply-To: <50CF9F19.2020609@univ-mlv.fr> References: <50CF3C0A.8030203@gmail.com> <50CF8E10.3050705@oracle.com> <50CF995B.20807@gmail.com> <50CF9F19.2020609@univ-mlv.fr> Message-ID: <50D034F7.7080609@gmail.com> On 12/17/2012 11:39 PM, Remi Forax wrote: > On 12/17/2012 11:14 PM, Peter Levart wrote: >> On 12/17/2012 10:26 PM, Mandy Chung wrote: >>> On 12/17/12 7:36 AM, Peter Levart wrote: >>>> Hi David and others, >>>> >>>> Here's a patch that eliminates one of two fields in >>>> java.lang.Class, related to caching enum constants: >>>> >>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.enum/webrev.01/index.html >>>> >>>> >>>> It does it by moving one field to a subclass of HashMap, which is >>>> referenced by a remaining field that serves two different >>>> purposes/stages of caching. >>>> >>> >>> Your observation of merging the enumConstants and >>> enumConstantDirectory is a good one. I see that caching of >>> enumConstantDirectory is important as it's used by EnumMap and >>> EnumSet whose performance is critical (specified with constant time >>> operations). I'm unsure about Class.getEnumConstants whether it's >>> performance critical and worths the complexity of your proposed fix >>> (the enumData field of two types). If a class has cached an >>> enumConstantDirectory, Class.getEnumConstants can return a clone of >>> its values(). >>> >>> Anyone knows how Class.getEnumConstants is commonly used and needs >>> to be performant? I suspect it's more typical to obtain the list of >>> enum constants statistically (calling Enum.values()) than reflectively. >> Hi Mandy, >> >> public Class.getEnumConstants() is a reflection mirror of >> SomeEnum.values(). It returns a defensive copy of the constants >> array. The primary place for Enum constants is in a private static >> final $VALUES field, generated by compiler in each Enum subclass. But >> that I think is not part of specification, so for internal usage (as >> far as I have managed to find out only in the constructors of EnumSet >> and EnumMap), the package-private Class.getEnumConstantsShared() is >> used which obtains a copy of the array by calling SomeEnum.values() >> and than caches is. >> >> The Class.enumConstantDirectory() on the other hand is an internal >> package-private method that returns a shared/cached Map, >> which is used internally to implement SomeEnum.valueOf(String) and >> Enum.valueOf(Class, String) static methods. >> >> Both package-private methods must be fast. >> >> Regards, Peter > > for what it worth, I'm the guy behind the patch of bug 6276988 (it was > before OpenJDK was setup BTW), > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6276988 > and for the little story, I need that patch because I was developing > an Eclipse plugin that uses EnumSet to represent the possible > completion values. > So to answer to Mandy, this application needs really fast EnumSet > creation thus really fast getEnumConstantShared() because the EnumSets > was created as user types code. Hi R?mi, is 600M EnumSets / sec good enough for a fast typist? > > Also, Peter, in your getEnumConstantShared(), while the first > instanceof is a cheap one, the second is not. > I think I prefer either the status quo or to group all exotic fields > in a specific object and pay the indirection to that object but not > the instanceof checks. This patch is on hold now, so no worries ;-) But I'd like to discuss it's performance aspect further, because it's interesting. The same two-stage-caching approach could be used to squeeze the 3 fields that are left to cache annotations into one. I tried a variant where the second check was "else if (enumData != null)" instead of "else if (enumData instanceof Enum[])" because that's the invariant. To my surprise, the micro-benchmark showed no differences. I also tried to re-order the ifs with different variations of instanceof vs. != null checks. And the presented variant seems to be the best (having the same performance as the variant where the second check is != null), but I have chosen this variant because it is easier to understand. The surprising part is also the comparison of results in the first line of EnumSet.noneOf(Class) measurements that shows a little performance increase (10%) compared to the original code. The performance increase might be due to the fact that original code executes two volatile reads of the same field (this can be improved) whereas the patch only does one volatile read. But the results also show that there's no decrease in speed if there's no indirection in spite of the fact that the code does at least one instanceof check no matter how the compiler manages to reorder it. I thought It might be fair to compare the performance of interpreted mode too. Perhaps the instanceof checks are not so fast in the interpreted mode. So here it is: *** Original JDK8 code Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -Xint -cp ../out/production/test test.EnumTest reference EnumSet.noneOf(Class): 202088722 201933106 202181088 201664653 201261067 201305820 202299656 201439518 MyEnum.valueOf(String): 184241499 179307134 179289265 179092376 179079423 178963942 179005498 178971665 EnumSet.noneOf(Class): 201450845 201488075 201247787 201696777 201546327 201431311 203371175 201693493 *** Patched code Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -Xint -cp ../out/production/test -Xbootclasspath/p:../out/production/jdk test.EnumTest EnumSet.noneOf(Class): 211831223 210830127 211460330 210753843 211091717 211055566 211582679 208887087 MyEnum.valueOf(String): 191420289 186842232 186712513 186791632 186765074 186766574 187003334 186756508 EnumSet.noneOf(Class): 201084554 200767426 200900559 201425971 201106758 201031393 201839016 201115387 I had to divide the number of loops by 1000. The performance aspects of patch are clearly "lost in the sea of interpreter cycles"... I think that grouping all exotic fields for different caching aspects into a specific object is not that good idea, because it increases the chances that this object will be allocated, but not entirely populated. The tricks like the one presented do not increase the space used even in the worst-case scenarios. Regards, Peter > > cheers, > R?mi > >> >>> >>> Mandy >>> >>>> These are the results of a micro-benchmark that exercises public >>>> API that uses the internal j.l.Class API regarding enum constants: >>>> >>>> enum MyEnum { ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, >>>> TEN } >>>> EnumSet.noneOf(MyEnum.class): 300_000_000 loops >>>> MyEnum.valueOf(String): 30_000_000 loops * 10 calls for different >>>> names >>>> >>>> ** Original JDK8 code >>>> >>>> Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp >>>> ../out/production/test test.EnumTest reference >>>> >>>> EnumSet.noneOf(Class): 351610312 340302968 339893333 >>>> 339774384 339750612 339558414 339547022 339621595 >>>> MyEnum.valueOf(String): 935153830 897188742 887541353 >>>> 960839820 886119463 885818334 885827093 885752461 >>>> EnumSet.noneOf(Class): 339552678 339469528 339513757 >>>> 339451341 339512154 339511634 339664326 339793144 >>>> >>>> ** patched java.lang.Class >>>> >>>> Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp >>>> ../out/production/test -Xbootclasspath/p:../out/production/jdk >>>> test.EnumTest >>>> >>>> EnumSet.noneOf(Class): 351724931 339286591 305082929 >>>> 305042885 305058303 305044144 305073463 305049604 >>>> MyEnum.valueOf(String): 955032718 908534137 891406394 >>>> 891506147 891414312 893652469 891412757 891409294 >>>> EnumSet.noneOf(Class): 414044087 406904161 406788898 >>>> 406839824 406765274 406815728 407002576 406779162 >>>> >>>> The slow-down of about 20% (last line) is presumably a consequence >>>> of another in-direction to obtain shared enum constants array when >>>> there is already a Map in place. It is still fast though (300M >>>> EnumSet instances / 0.4 s). >>>> >>>> Here's the source of the micro-benchmark: >>>> >>>> https://raw.github.com/plevart/jdk8-tl/JEP-149.enum/test/src/test/EnumTest.java >>>> >>>> >>>> I don't know what's more important in this occasion. A small space >>>> gain (8 or 4 bytes per j.l.Class instance) or a small performance >>>> gain (20%). >>>> >>>> Regards, Peter >>>> >>> >> > From peter.levart at gmail.com Tue Dec 18 09:24:23 2012 From: peter.levart at gmail.com (Peter Levart) Date: Tue, 18 Dec 2012 10:24:23 +0100 Subject: EnumData space optimization in j.l.Class (JEP-149) In-Reply-To: <50CFBDBE.3070400@oracle.com> References: <50CF3C0A.8030203@gmail.com> <50CFBDBE.3070400@oracle.com> Message-ID: <50D03647.4080100@gmail.com> On 12/18/2012 01:50 AM, David Holmes wrote: > Hi Peter, > > BTW JEP-149 not 146! Sorry, my bad ;-( > > Sorry I didn't get a chance to respond last night before you continued > on this path. I have to say no to this too. First I am just running > out of time to get this finalized by M6 - particularly with the Xmas > break looming. > > Second the trade-off here is far less clear. Not only may the > performance aspect be more significant (as per Remi's discussion) but > the memory saving may not even eventuate depending on alignment. > > It may be worth doing a new JEP for continued enhancements in this > area post JDK 8, or maybe just have a RFE filed. But for now I have to > put the brakes on and just run with what we have with the reflection > caching changes. > > Your efforts are very much appreciated - I just wish the timing could > have been different. Does M6 mean that no more such enhancement will be accepted before release of JDK8? I guess annotations are a different category because there is a lot of new stuff coming in that will need to be optimized as well. Regards, Peter > > Thanks, > David > > On 18/12/2012 1:36 AM, Peter Levart wrote: >> Hi David and others, >> >> Here's a patch that eliminates one of two fields in java.lang.Class, >> related to caching enum constants: >> >> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.enum/webrev.01/index.html >> >> >> It does it by moving one field to a subclass of HashMap, which is >> referenced by a remaining field that serves two different >> purposes/stages of caching. >> >> These are the results of a micro-benchmark that exercises public API >> that uses the internal j.l.Class API regarding enum constants: >> >> enum MyEnum { ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, >> TEN } >> EnumSet.noneOf(MyEnum.class): 300_000_000 loops >> MyEnum.valueOf(String): 30_000_000 loops * 10 calls for different names >> >> ** Original JDK8 code >> >> Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp >> ../out/production/test test.EnumTest reference >> >> EnumSet.noneOf(Class): 351610312 340302968 339893333 339774384 339750612 >> 339558414 339547022 339621595 >> MyEnum.valueOf(String): 935153830 897188742 887541353 960839820 >> 886119463 885818334 885827093 885752461 >> EnumSet.noneOf(Class): 339552678 339469528 339513757 339451341 339512154 >> 339511634 339664326 339793144 >> >> ** patched java.lang.Class >> >> Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp >> ../out/production/test -Xbootclasspath/p:../out/production/jdk >> test.EnumTest >> >> EnumSet.noneOf(Class): 351724931 339286591 305082929 305042885 305058303 >> 305044144 305073463 305049604 >> MyEnum.valueOf(String): 955032718 908534137 891406394 891506147 >> 891414312 893652469 891412757 891409294 >> EnumSet.noneOf(Class): 414044087 406904161 406788898 406839824 406765274 >> 406815728 407002576 406779162 >> >> The slow-down of about 20% (last line) is presumably a consequence of >> another in-direction to obtain shared enum constants array when there is >> already a Map in place. It is still fast though (300M EnumSet instances >> / 0.4 s). >> >> Here's the source of the micro-benchmark: >> >> https://raw.github.com/plevart/jdk8-tl/JEP-149.enum/test/src/test/EnumTest.java >> >> >> I don't know what's more important in this occasion. A small space gain >> (8 or 4 bytes per j.l.Class instance) or a small performance gain (20%). >> >> Regards, Peter >> From fredrik.ohrstrom at oracle.com Tue Dec 18 09:29:51 2012 From: fredrik.ohrstrom at oracle.com (fredrik.ohrstrom at oracle.com) Date: Tue, 18 Dec 2012 09:29:51 +0000 Subject: hg: jdk8/tl/langtools: 8004657: Add hooks to javac to enable reporting dependency information. Message-ID: <20121218092954.2CEDB47212@hg.openjdk.java.net> Changeset: 92fcf299cd09 Author: ohrstrom Date: 2012-12-18 10:23 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/92fcf299cd09 8004657: Add hooks to javac to enable reporting dependency information. Reviewed-by: jjg, mcimadamore ! src/share/classes/com/sun/tools/javac/api/JavacTool.java ! src/share/classes/com/sun/tools/javac/comp/Resolve.java ! src/share/classes/com/sun/tools/javac/main/JavaCompiler.java From david.holmes at oracle.com Tue Dec 18 09:36:50 2012 From: david.holmes at oracle.com (David Holmes) Date: Tue, 18 Dec 2012 19:36:50 +1000 Subject: EnumData space optimization in j.l.Class (JEP-149) In-Reply-To: <50D03647.4080100@gmail.com> References: <50CF3C0A.8030203@gmail.com> <50CFBDBE.3070400@oracle.com> <50D03647.4080100@gmail.com> Message-ID: <50D03932.6050402@oracle.com> On 18/12/2012 7:24 PM, Peter Levart wrote: > On 12/18/2012 01:50 AM, David Holmes wrote: >> Hi Peter, >> >> BTW JEP-149 not 146! > Sorry, my bad ;-( > >> >> Sorry I didn't get a chance to respond last night before you continued >> on this path. I have to say no to this too. First I am just running >> out of time to get this finalized by M6 - particularly with the Xmas >> break looming. >> >> Second the trade-off here is far less clear. Not only may the >> performance aspect be more significant (as per Remi's discussion) but >> the memory saving may not even eventuate depending on alignment. >> >> It may be worth doing a new JEP for continued enhancements in this >> area post JDK 8, or maybe just have a RFE filed. But for now I have to >> put the brakes on and just run with what we have with the reflection >> caching changes. >> >> Your efforts are very much appreciated - I just wish the timing could >> have been different. > > Does M6 mean that no more such enhancement will be accepted before > release of JDK8? I guess annotations are a different category because > there is a lot of new stuff coming in that will need to be optimized as > well. M6 is the "feature complete" milestone. There may be some features that are known to not be complete by that time - I can't say if annotations will be one or not. Obviously this doesn't mean everything is 100% finalized and bug free, but the essence of the feature has to be there. MY understanding of this is that I have to have the "final form" of JEP-149 finished by then. This includes basic testing and performance measurements - and so I need a stable "target". Whether there is room for further adjustments after M6 I really can't say. Thanks, David > Regards, Peter > >> >> Thanks, >> David >> >> On 18/12/2012 1:36 AM, Peter Levart wrote: >>> Hi David and others, >>> >>> Here's a patch that eliminates one of two fields in java.lang.Class, >>> related to caching enum constants: >>> >>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.enum/webrev.01/index.html >>> >>> >>> It does it by moving one field to a subclass of HashMap, which is >>> referenced by a remaining field that serves two different >>> purposes/stages of caching. >>> >>> These are the results of a micro-benchmark that exercises public API >>> that uses the internal j.l.Class API regarding enum constants: >>> >>> enum MyEnum { ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, >>> TEN } >>> EnumSet.noneOf(MyEnum.class): 300_000_000 loops >>> MyEnum.valueOf(String): 30_000_000 loops * 10 calls for different names >>> >>> ** Original JDK8 code >>> >>> Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp >>> ../out/production/test test.EnumTest reference >>> >>> EnumSet.noneOf(Class): 351610312 340302968 339893333 339774384 339750612 >>> 339558414 339547022 339621595 >>> MyEnum.valueOf(String): 935153830 897188742 887541353 960839820 >>> 886119463 885818334 885827093 885752461 >>> EnumSet.noneOf(Class): 339552678 339469528 339513757 339451341 339512154 >>> 339511634 339664326 339793144 >>> >>> ** patched java.lang.Class >>> >>> Executing: /home/peter/Apps64/jdk1.8.0-jdk8-tl/bin/java -Xmx4G -cp >>> ../out/production/test -Xbootclasspath/p:../out/production/jdk >>> test.EnumTest >>> >>> EnumSet.noneOf(Class): 351724931 339286591 305082929 305042885 305058303 >>> 305044144 305073463 305049604 >>> MyEnum.valueOf(String): 955032718 908534137 891406394 891506147 >>> 891414312 893652469 891412757 891409294 >>> EnumSet.noneOf(Class): 414044087 406904161 406788898 406839824 406765274 >>> 406815728 407002576 406779162 >>> >>> The slow-down of about 20% (last line) is presumably a consequence of >>> another in-direction to obtain shared enum constants array when there is >>> already a Map in place. It is still fast though (300M EnumSet instances >>> / 0.4 s). >>> >>> Here's the source of the micro-benchmark: >>> >>> https://raw.github.com/plevart/jdk8-tl/JEP-149.enum/test/src/test/EnumTest.java >>> >>> >>> I don't know what's more important in this occasion. A small space gain >>> (8 or 4 bytes per j.l.Class instance) or a small performance gain (20%). >>> >>> Regards, Peter >>> > From joel.franck at oracle.com Tue Dec 18 09:47:03 2012 From: joel.franck at oracle.com (=?ISO-8859-1?Q?Joel_Borggr=E9n-Franck?=) Date: Tue, 18 Dec 2012 10:47:03 +0100 Subject: RFR: 8004699 : Add type annotation storage to Constructor, Field and Method In-Reply-To: <50CFCDCB.1050601@oracle.com> References: <50CF41AE.7010909@gmail.com> <50CFCDCB.1050601@oracle.com> Message-ID: <50D03B97.7050100@oracle.com> On 12/18/2012 02:58 AM, David Holmes wrote: > On 18/12/2012 3:06 AM, Joel Borggr?n-Franck wrote: >> >> On Dec 17, 2012, at 5:00 PM, Peter Levart wrote: >> >>> Hi Joel, >>> >>> 82 // This is set by the vm at Method creation >>> 83 private byte[] type_annotations; >>> >>> >>> Wouldn't it be better to initialize this field in the constructor? >>> You could create an overloaded constructor if you wanted to be >>> compatible with previous versions of the VM. >>> >> >> Fields aren't created using a constructor as far as I can see. > > Correct, all the reflection objects are allocated directly by the VM and > initialized field by field as needed. No Java level constructor involved. > > This change is also fine with me, on the proviso that the follow up > change to deal with efficiency and the field name is not too far away. > Though really I don't think the change of name will be that big a deal > anyway. > Thanks for the review David. I expect to continue working on this (up to) and after M6 and fix issues like the space overhead. You are right in that just renaming the fields is a couple of lines in HotSpot and a 3 lines in JDK. However I am not comfortable doing that rename without running all the tests again and that takes close to 24 hours and involves a lot of manual steps (until vm and jdk changes sync up and I can automate the testing). This close to M6 and with a rewrite coming anyway I would rather spend that time on writing the parser for these byte arrays :) cheers /Joel From Alan.Bateman at oracle.com Tue Dec 18 09:52:05 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 18 Dec 2012 09:52:05 +0000 Subject: RFR: 8004699 : Add type annotation storage to Constructor, Field and Method In-Reply-To: <79541486-1082-4412-BFA0-BFF043B8D8E9@oracle.com> References: <50CF3E90.8080802@oracle.com> <79541486-1082-4412-BFA0-BFF043B8D8E9@oracle.com> Message-ID: <50D03CC5.9060001@oracle.com> On 17/12/2012 16:51, Joel Borggr?n-Franck wrote: > On Dec 17, 2012, at 4:47 PM, Alan Bateman wrote: > >> On 17/12/2012 15:41, Joel Borggr?n-Franck wrote: >>> Here is the first in a series of changes to add type annotation support to reflection. >>> >>> http://cr.openjdk.java.net/~jfranck/8004699/webrev.00/ >>> >> I assume this should be typeAnnotations rather than type_annotations so that it's consistent with the existing fields. > Doh. However since these fields are not the permanent solution and the overhead to changing naming is large, I would (vert strongly) prefer to keep the (bad) HotSpot naming convention for now. > As the hotspot changes are still in review then I think it would be best to just rename the fields now, even if its not the final solution. -Alan. From joel.franck at oracle.com Tue Dec 18 11:45:34 2012 From: joel.franck at oracle.com (=?ISO-8859-1?Q?Joel_Borggr=E9n-Franck?=) Date: Tue, 18 Dec 2012 12:45:34 +0100 Subject: RFR: 8004699 : Add type annotation storage to Constructor, Field and Method In-Reply-To: References: Message-ID: <50D0575E.2060505@oracle.com> On 12/17/2012 04:41 PM, Joel Borggr?n-Franck wrote: > Here is the first in a series of changes to add type annotation support to reflection. > > http://cr.openjdk.java.net/~jfranck/8004699/webrev.00/ > > While this adds overhead all instances of Field, Constructor, and Method we need this change in order to coordinate with the changes going in to HotSpot There is a plan to remove the additional overhead by consolidating all annotation fields, though this will have to wait a bit. > New webrev after renaming the fields: cr.openjdk.java.net/~jfranck/8004699/webrev.01/ I'll post matching HotSpot changes to hs-dev later today. cheers /Joel From Alan.Bateman at oracle.com Tue Dec 18 11:55:57 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 18 Dec 2012 11:55:57 +0000 Subject: RFR: 8004699 : Add type annotation storage to Constructor, Field and Method In-Reply-To: <50D0575E.2060505@oracle.com> References: <50D0575E.2060505@oracle.com> Message-ID: <50D059CD.7040107@oracle.com> On 18/12/2012 11:45, Joel Borggr?n-Franck wrote: > > New webrev after renaming the fields: > cr.openjdk.java.net/~jfranck/8004699/webrev.01/ > > I'll post matching HotSpot changes to hs-dev later today. Thanks for the rename, looks fine to me. -Alan From Lance.Andersen at oracle.com Tue Dec 18 12:07:27 2012 From: Lance.Andersen at oracle.com (Lance Andersen) Date: Tue, 18 Dec 2012 07:07:27 -0500 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <50D02D8E.4000204@oracle.com> References: <50D02D8E.4000204@oracle.com> Message-ID: +1 -- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com Sent from my iPhone On Dec 18, 2012, at 3:47 AM, Joe Wang wrote: > Hi, > > This is the 2nd of the three [findbug] issues. The field fVersion is simply made final. > > webrev: > http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ > > Test: > No new test needed. > > Thanks, > Joe From Alan.Bateman at oracle.com Tue Dec 18 14:17:12 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 18 Dec 2012 14:17:12 +0000 Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present In-Reply-To: <50CB422E.2080402@oracle.com> References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com> <50C27AC1.2050600@oracle.com> <50C27DBA.3050808@oracle.com> <50C61B4B.1080901@oracle.com> <50C72618.5000407@oracle.com> <7706A692-773E-4282-8B2C-9B2D85FD49A5@oracle.com> <50C85DFE.5010300@oracle.com> <50CA4C9D.50101@oracle.com> <50CB422E.2080402@oracle.com> Message-ID: <50D07AE8.4050408@oracle.com> I've refreshed the webrev here to take in another change from Joe to the root element handling in PropertiesDefaultHandler. http://cr.openjdk.java.net/~alanb/8004371/webrev.03/ I'd like to get this into jdk8/tl in the next few days if possible. On tests on then I've expanded LoadAndStoreXML to include a directory of invalid XML documents (those that should cause InvalidProperitesFormatException to be thrown) so that improves the test coverage a bit. Joe has several other tests in the works so I've suggested to him that he does a follow-up change in the coming weeks with those tests. -Alan. From Alan.Bateman at oracle.com Tue Dec 18 15:00:24 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 18 Dec 2012 15:00:24 +0000 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50CF59DF.2040006@oracle.com> References: <50CF59DF.2040006@oracle.com> Message-ID: <50D08508.3040903@oracle.com> I looked through this installment and aside from an aside from an alignment issue at lines 101-102 in XMLEventFactory.java then it looks good to me. Also thank you again for being so careful as you work through each of these areas. -Alan From Lance.Andersen at oracle.com Tue Dec 18 15:54:12 2012 From: Lance.Andersen at oracle.com (Lance Andersen - Oracle) Date: Tue, 18 Dec 2012 10:54:12 -0500 Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present In-Reply-To: <50D07AE8.4050408@oracle.com> References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com> <50C27AC1.2050600@oracle.com> <50C27DBA.3050808@oracle.com> <50C61B4B.1080901@oracle.com> <50C72618.5000407@oracle.com> <7706A692-773E-4282-8B2C-9B2D85FD49A5@oracle.com> <50C85DFE.5010300@oracle.com> <50CA4C9D.50101@oracle.com> <50CB422E.2080402@oracle.com> <50D07AE8.4050408@oracle.com> Message-ID: I went through this and the changes look OK On Dec 18, 2012, at 9:17 AM, Alan Bateman wrote: > > I've refreshed the webrev here to take in another change from Joe to the root element handling in PropertiesDefaultHandler. > > http://cr.openjdk.java.net/~alanb/8004371/webrev.03/ > > I'd like to get this into jdk8/tl in the next few days if possible. > > On tests on then I've expanded LoadAndStoreXML to include a directory of invalid XML documents (those that should cause InvalidProperitesFormatException to be thrown) so that improves the test coverage a bit. Joe has several other tests in the works so I've suggested to him that he does a follow-up change in the coming weeks with those tests. > > -Alan. > -------------- next part -------------- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From daniel.fuchs at oracle.com Tue Dec 18 16:39:41 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 18 Dec 2012 17:39:41 +0100 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D08508.3040903@oracle.com> References: <50CF59DF.2040006@oracle.com> <50D08508.3040903@oracle.com> Message-ID: <50D09C4D.9030404@oracle.com> Hi, Thanks for the review. I updated the webrev to keep track of your suggested change. -- daniel On 12/18/12 4:00 PM, Alan Bateman wrote: > > I looked through this installment and aside from an aside from an > alignment issue at lines 101-102 in XMLEventFactory.java then it looks > good to me. > > Also thank you again for being so careful as you work through each of > these areas. > > -Alan From daniel.fuchs at oracle.com Tue Dec 18 16:42:38 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 18 Dec 2012 17:42:38 +0100 Subject: RFR: javax.xml.transform: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) Message-ID: <50D09CFE.6000303@oracle.com> Hi, Here is a new webrev in the series that addresses using ServiceLoader in JAXP for JDK 8. 7169894: JAXP Plugability Layer: using service loader This changeset addresses modification in the javax.xml.transform package. It is similar to changes proposed for the javax.xml.parsers package [1], with only a few differences due to the specificity of javax.xml.transform. best regards, -- daniel previous webrevs in the series: [1] javax.xml.parsers: [2] javax.xml.datatype: [3] javax.xml.stream From Ulf.Zibis at CoSoCo.de Tue Dec 18 17:06:14 2012 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Tue, 18 Dec 2012 18:06:14 +0100 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50CFEDFC.5060903@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> <50CB33FE.7000605@CoSoCo.de> <50CB9CF5.4090300@oracle.com> <50CBC7D0.9050103@CoSoCo.de> <50CBD110.1080208@oracle.com> <50CBD2BF.90100@oracle.com> <50CF38F2.6040707@oracle.com> <50CF44A7.8000202@CoSoCo.de> <50CFEDFC.5060903@oracle.com> Message-ID: <50D0A286.3040309@CoSoCo.de> Am 18.12.2012 05:15, schrieb Mandy Chung: > On 12/17/12 8:13 AM, Ulf Zibis wrote: >> Am 17.12.2012 16:23, schrieb Alan Bateman: >>> I mostly agree with your argument that this is a new tool and that we should be consistent with >>> GNU-style options. So what was the final bid is, is it --classpath or --class-path? > > I propose --class-path so that it makes it easier to determine -classpath is not supported I have some objections against --class-path and vote for --classpath. Reasons: - -classpath is easier to type in - -classpath matches better with environment variable CLASSPATH - I'm not sure if the term "classpath" is really wrong in english grammar. Looking into the docs, term "classpath" is in use, but less than "class path": http://docs.oracle.com/javase/6/docs/technotes/tools/windows/javac.html http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html http://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.html - people are familiar with "classpath" - there are similar options/terms that then also need to be changed, if some day we would adopt all other existing tools to GNU-style. E.g. --boot-class-path IMO looks bad and could semantically be interpreted as "boot the class path" or "path of the boot class". - the '-' separator usage in GNU commands and options I only know, where a verb has to be separated from a subject, e.g. "update-grub", but maybe there are contradictory examples. ...And there are examples, where even verbs are not separated from subjects, e.g. "grub-mkconfig", which should be "grub-mk-config" according the rule. What about allowing (maybe define for preferred usage) GNU/UNIX path separators even on Windows? E.g. java --classpath=C/java/jre6/lib/rt.jar ... - This would make java again more platform independent. - The mixure of UNIX and/or GNU-style options with Windows path syntax looks ugly to me. Additionally we also have a 3rd style in use, e.g. "java mypackage.MyClass". >>> I guess it wouldn't do any harm to silently supporting -cp and -classpath as folks used to java* >>> tools will probably use them without thinking. >> > How important to carry the same option -cp and -classpath on j* tools? I do think developers can > well adapt to a slight different option when using a new tool. I'm inclined not to mix these > styles. In addition, I'd like to see how jdeps will be used after the initial push and people > finds --class-path hard to move to. My vote: silently support old style with space as separator and document this as a side note on: http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jdeps.html > >> Thanks for supporting my arguments about "silent familarity" to old style, Alan. >> As --class(-)path is a frequent and important option, I additionally think, we should have an >> official short form. If '-cp' doesn't conform with GNU-style, what about '-C' ? > > I considered '-C' and it might be confused with 'jar -C' and 'tar -C' option to change the > directory. I think '-c' may be okay and it can avoid such confusion and closer to '-cp'. Are > you okay with that? I agree! "-C" was from my non-reflected guess, that '-c' would be yet occupied, as you didn't consider a short form from the beginning. Thanks for your closer look. -Ulf From huizhe.wang at oracle.com Tue Dec 18 17:16:31 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 18 Dec 2012 09:16:31 -0800 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: References: <50D02D8E.4000204@oracle.com> Message-ID: <50D0A4EF.2090806@oracle.com> Thanks Chris! On 12/18/2012 12:53 AM, Chris Hegarty wrote: > Looks ok to me Joe. > > -Chris > > On 18 Dec 2012, at 08:47, Joe Wang wrote: > >> Hi, >> >> This is the 2nd of the three [findbug] issues. The field fVersion is simply made final. >> >> webrev: >> http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ >> >> Test: >> No new test needed. >> >> Thanks, >> Joe From huizhe.wang at oracle.com Tue Dec 18 17:21:42 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 18 Dec 2012 09:21:42 -0800 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <50D02F9A.7070402@oracle.com> References: <50D02D8E.4000204@oracle.com> <50D02F9A.7070402@oracle.com> Message-ID: <50D0A626.3010607@oracle.com> On 12/18/2012 12:55 AM, David Holmes wrote: > Joe, > > On 18/12/2012 6:47 PM, Joe Wang wrote: >> Hi, >> >> This is the 2nd of the three [findbug] issues. The field fVersion is >> simply made final. >> >> webrev: >> http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ > > Obviously it was known that this was a potential problem as we have > fImmutableVersion. So fImmutableVersion is now redundant with this fix. > > I assume changing the public API has the appropriate approvals? This is Xerces implementation specific, used internally in Xerces' build system, although users may also use it to show the version of the implementation. For JDK/JAXP, it is not considered a public API. Joe > > David > >> Test: >> No new test needed. >> >> Thanks, >> Joe From huizhe.wang at oracle.com Tue Dec 18 17:29:58 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 18 Dec 2012 09:29:58 -0800 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D09C4D.9030404@oracle.com> References: <50CF59DF.2040006@oracle.com> <50D08508.3040903@oracle.com> <50D09C4D.9030404@oracle.com> Message-ID: <50D0A816.7010201@oracle.com> Hi Daniel, The call: T provider = findServiceProvider(type) in static T find(Class type, String factoryId, ClassLoader cl, String fallbackClassName) ignored factoryId, and assumed it's the same as type.getName(). I looked back I had the same bug in my original patch. -Joe On 12/18/2012 8:39 AM, Daniel Fuchs wrote: > Hi, > > Thanks for the review. > I updated the webrev to keep track of your suggested change. > > > > -- daniel > > On 12/18/12 4:00 PM, Alan Bateman wrote: >> >> I looked through this installment and aside from an aside from an >> alignment issue at lines 101-102 in XMLEventFactory.java then it looks >> good to me. >> >> Also thank you again for being so careful as you work through each of >> these areas. >> >> -Alan > From tom.hawtin at oracle.com Tue Dec 18 17:49:44 2012 From: tom.hawtin at oracle.com (Tom Hawtin) Date: Tue, 18 Dec 2012 17:49:44 +0000 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <50D02D8E.4000204@oracle.com> References: <50D02D8E.4000204@oracle.com> Message-ID: <50D0ACB8.5010503@oracle.com> Not that it's particularly important, but it's /possible/ clients are relying on the non-compile time constant nature of this field causing it not to be inlined into client class files, rather than the ability to switch the version string. So it may be a good idea to add the final, but make it a non-compile time constant. We can also remove the duplication. public static final String fVersion = getVersion(); Tom On 18/12/2012 08:47, Joe Wang wrote: > Hi, > > This is the 2nd of the three [findbug] issues. The field fVersion is > simply made final. > > webrev: > http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ > > Test: > No new test needed. > > Thanks, > Joe From daniel.fuchs at oracle.com Tue Dec 18 18:00:41 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 18 Dec 2012 19:00:41 +0100 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D0A816.7010201@oracle.com> References: <50CF59DF.2040006@oracle.com> <50D08508.3040903@oracle.com> <50D09C4D.9030404@oracle.com> <50D0A816.7010201@oracle.com> Message-ID: <50D0AF49.5030505@oracle.com> On 12/18/12 6:29 PM, Joe Wang wrote: > Hi Daniel, > > The call: T provider = findServiceProvider(type) in static T > find(Class type, String factoryId, ClassLoader cl, String > fallbackClassName) ignored factoryId, and assumed it's the same as > type.getName(). I looked back I had the same bug in my original patch. I don't think that's a bug in the new code - but rather possibly a bug in the old code ;-). There's no way you can pass a property name to the ServiceLoader. The JAR Specification says: "A service provider identifies itself by placing a provider-configuration file in the resource directory META-INF/services. The file's name should consist of the fully-qualified name of the abstract service class." So I think the current code is correct in ignoring factoryId - because according to the spec the file name should be the same as the abstract class name. -- daniel > > -Joe > > On 12/18/2012 8:39 AM, Daniel Fuchs wrote: >> Hi, >> >> Thanks for the review. >> I updated the webrev to keep track of your suggested change. >> >> >> >> -- daniel >> >> On 12/18/12 4:00 PM, Alan Bateman wrote: >>> >>> I looked through this installment and aside from an aside from an >>> alignment issue at lines 101-102 in XMLEventFactory.java then it looks >>> good to me. >>> >>> Also thank you again for being so careful as you work through each of >>> these areas. >>> >>> -Alan >> From martinrb at google.com Tue Dec 18 18:04:25 2012 From: martinrb at google.com (martinrb at google.com) Date: Tue, 18 Dec 2012 18:04:25 +0000 Subject: hg: jdk8/tl/jdk: 8004863: Infinite Loop in KeepAliveStream Message-ID: <20121218180436.864A647228@hg.openjdk.java.net> Changeset: 0fabdf676395 Author: martin Date: 2012-12-17 18:39 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0fabdf676395 8004863: Infinite Loop in KeepAliveStream Reviewed-by: chegar ! src/share/classes/sun/net/www/http/KeepAliveStream.java + test/sun/net/www/http/KeepAliveStream/InfiniteLoop.java From huizhe.wang at oracle.com Tue Dec 18 18:38:45 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 18 Dec 2012 10:38:45 -0800 Subject: RFR: javax.xml.transform: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D09CFE.6000303@oracle.com> References: <50D09CFE.6000303@oracle.com> Message-ID: <50D0B835.8010609@oracle.com> Hi Daniel, Looks great! I see you've added many verifications. One minor note, creationMethod is used in place of the object instance for the creationMethod.invoke call, although it's ignored for a static method anyways. Is there a reason for doing that? -Joe On 12/18/2012 8:42 AM, Daniel Fuchs wrote: > Hi, > > Here is a new webrev in the series that addresses using ServiceLoader in > JAXP for JDK 8. > > 7169894: JAXP Plugability Layer: using service loader > > This changeset addresses modification in the javax.xml.transform > package. > It is similar to changes proposed for the javax.xml.parsers > package [1], with only a few differences due to the specificity of > javax.xml.transform. > > > > > > best regards, > > -- daniel > > previous webrevs in the series: > > [1] javax.xml.parsers: > > > > [2] javax.xml.datatype: > > > > [3] javax.xml.stream > > From forax at univ-mlv.fr Tue Dec 18 18:50:16 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Tue, 18 Dec 2012 19:50:16 +0100 Subject: EnumData space optimization in j.l.Class (JEP-146) In-Reply-To: <50D034F7.7080609@gmail.com> References: <50CF3C0A.8030203@gmail.com> <50CF8E10.3050705@oracle.com> <50CF995B.20807@gmail.com> <50CF9F19.2020609@univ-mlv.fr> <50D034F7.7080609@gmail.com> Message-ID: <50D0BAE8.8070609@univ-mlv.fr> On 12/18/2012 10:18 AM, Peter Levart wrote: > On 12/17/2012 11:39 PM, Remi Forax wrote: >> On 12/17/2012 11:14 PM, Peter Levart wrote: >>> On 12/17/2012 10:26 PM, Mandy Chung wrote: >>>> On 12/17/12 7:36 AM, Peter Levart wrote: >>>>> Hi David and others, >>>>> >>>>> Here's a patch that eliminates one of two fields in >>>>> java.lang.Class, related to caching enum constants: >>>>> >>>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.enum/webrev.01/index.html >>>>> >>>>> >>>>> It does it by moving one field to a subclass of HashMap, which is >>>>> referenced by a remaining field that serves two different >>>>> purposes/stages of caching. >>>>> >>>> >>>> Your observation of merging the enumConstants and >>>> enumConstantDirectory is a good one. I see that caching of >>>> enumConstantDirectory is important as it's used by EnumMap and >>>> EnumSet whose performance is critical (specified with constant time >>>> operations). I'm unsure about Class.getEnumConstants whether it's >>>> performance critical and worths the complexity of your proposed fix >>>> (the enumData field of two types). If a class has cached an >>>> enumConstantDirectory, Class.getEnumConstants can return a clone of >>>> its values(). >>>> >>>> Anyone knows how Class.getEnumConstants is commonly used and needs >>>> to be performant? I suspect it's more typical to obtain the list >>>> of enum constants statistically (calling Enum.values()) than >>>> reflectively. >>> Hi Mandy, >>> >>> public Class.getEnumConstants() is a reflection mirror of >>> SomeEnum.values(). It returns a defensive copy of the constants >>> array. The primary place for Enum constants is in a private static >>> final $VALUES field, generated by compiler in each Enum subclass. >>> But that I think is not part of specification, so for internal usage >>> (as far as I have managed to find out only in the constructors of >>> EnumSet and EnumMap), the package-private >>> Class.getEnumConstantsShared() is used which obtains a copy of the >>> array by calling SomeEnum.values() and than caches is. >>> >>> The Class.enumConstantDirectory() on the other hand is an internal >>> package-private method that returns a shared/cached Map, >>> which is used internally to implement SomeEnum.valueOf(String) and >>> Enum.valueOf(Class, String) static methods. >>> >>> Both package-private methods must be fast. >>> >>> Regards, Peter >> >> for what it worth, I'm the guy behind the patch of bug 6276988 (it >> was before OpenJDK was setup BTW), >> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6276988 >> and for the little story, I need that patch because I was developing >> an Eclipse plugin that uses EnumSet to represent the possible >> completion values. >> So to answer to Mandy, this application needs really fast EnumSet >> creation thus really fast getEnumConstantShared() because the >> EnumSets was created as user types code. > Hi R?mi, > > is 600M EnumSets / sec good enough for a fast typist? The eclipse plugin uses is a LR parser (a GLR exactly) which has the stupid property that it can change the whole parse tree if you just add one character. Also i'm maybe wrong but, if you test with several different 'enum classes', you should see a slowdown. R?mi From huizhe.wang at oracle.com Tue Dec 18 19:00:52 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 18 Dec 2012 11:00:52 -0800 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D0AF49.5030505@oracle.com> References: <50CF59DF.2040006@oracle.com> <50D08508.3040903@oracle.com> <50D09C4D.9030404@oracle.com> <50D0A816.7010201@oracle.com> <50D0AF49.5030505@oracle.com> Message-ID: <50D0BD64.2090502@oracle.com> On 12/18/2012 10:00 AM, Daniel Fuchs wrote: > On 12/18/12 6:29 PM, Joe Wang wrote: >> Hi Daniel, >> >> The call: T provider = findServiceProvider(type) in static T >> find(Class type, String factoryId, ClassLoader cl, String >> fallbackClassName) ignored factoryId, and assumed it's the same as >> type.getName(). I looked back I had the same bug in my original patch. > > I don't think that's a bug in the new code - but rather possibly a > bug in the old code ;-). The old code did not have the problem since it's reading "META-INF/services/" + factoryId directly. > There's no way you can pass a property name to the ServiceLoader. True. That's why it looked a bit awkward since 'factoryId' is not passed in as did before, as in findJarServiceProvider(factoryId). > > The JAR Specification says: > > "A service provider identifies itself by placing a > provider-configuration file in the resource directory > META-INF/services. The file's name should consist of the > fully-qualified name of the abstract service class." > > So I think the current code is correct in ignoring factoryId - because > according to the spec the file name should be the same as the > abstract class name. So the StAX API implied that factoryId could be anything, but that would violate the JAR specification. In other words, it would only work as intended if the factoryId is specified as a System Property, or in stax.properties or jaxp.properties. I would think we should return an error if factoryId != type.getName() before the call "findServiceProvider(type)". -Joe > > > -- daniel > >> >> -Joe >> >> On 12/18/2012 8:39 AM, Daniel Fuchs wrote: >>> Hi, >>> >>> Thanks for the review. >>> I updated the webrev to keep track of your suggested change. >>> >>> >>> >>> >>> -- daniel >>> >>> On 12/18/12 4:00 PM, Alan Bateman wrote: >>>> >>>> I looked through this installment and aside from an aside from an >>>> alignment issue at lines 101-102 in XMLEventFactory.java then it looks >>>> good to me. >>>> >>>> Also thank you again for being so careful as you work through each of >>>> these areas. >>>> >>>> -Alan >>> > From mandy.chung at oracle.com Tue Dec 18 19:04:15 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 18 Dec 2012 11:04:15 -0800 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <29ED0E07-C501-478A-B8D0-60AC4C23DC4A@oracle.com> References: <50CF59DF.2040006@oracle.com> <50D00710.60703@oracle.com> <29ED0E07-C501-478A-B8D0-60AC4C23DC4A@oracle.com> Message-ID: <50D0BE2F.2070208@oracle.com> On 12/18/12 1:09 AM, Paul Sandoz wrote: > On Dec 18, 2012, at 7:02 AM, Mandy Chung wrote: > >> Hi Daniel, >> >> There are currently several different FactoryFinder class in the JAXP implementation and there might be slight difference in each of them. Do you know if it has been looked into whether it's feasible to merge them into a single utility class? I suspect someone might have brought this up in the past. >> > You suspect right :-) > > Those FactoryFinder classes are package private, probably a artefact of JAXP having multiple distribution channels, and there were subtle differences between them but perhaps less so now? > > IMHO such unification could be considered as a later fix as i think getting the SL and CL functionality correct is a higher priority. Agree and such unification can be done separately. > http://cr.openjdk.java.net/~dfuchs/JDK-7169894/javax.xml.stream/webrev.01/ Daniel - I reviewed the change and also the latest webrev for parser/stream. They look good to me. Thanks Mandy From mandy.chung at oracle.com Tue Dec 18 19:38:58 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 18 Dec 2012 11:38:58 -0800 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50D0A286.3040309@CoSoCo.de> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> <50CB33FE.7000605@CoSoCo.de> <50CB9CF5.4090300@oracle.com> <50CBC7D0.9050103@CoSoCo.de> <50CBD110.1080208@oracle.com> <50CBD2BF.90100@oracle.com> <50CF38F2.6040707@oracle.com> <50CF44A7.8000202@CoSoCo.de> <50CFEDFC.5060903@oracle.com> <50D0A286.3040309@CoSoCo.de> Message-ID: <50D0C652.3080500@oracle.com> On 12/18/12 9:06 AM, Ulf Zibis wrote: > Am 18.12.2012 05:15, schrieb Mandy Chung: >> On 12/17/12 8:13 AM, Ulf Zibis wrote: >>> Am 17.12.2012 16:23, schrieb Alan Bateman: >>>> I mostly agree with your argument that this is a new tool and that >>>> we should be consistent with GNU-style options. So what was the >>>> final bid is, is it --classpath or --class-path? >> >> I propose --class-path so that it makes it easier to determine >> -classpath is not supported > > I have some objections against --class-path and vote for --classpath. I'm happy with "--classpath" and "-c" is the short form. > .... > > What about allowing (maybe define for preferred usage) GNU/UNIX path > separators even on Windows? E.g. > java --classpath=C/java/jre6/lib/rt.jar ... > - This would make java again more platform independent. > - The mixure of UNIX and/or GNU-style options with Windows path syntax > looks ugly to me. > I don't like dealing with Windows paths either. One use case we expect that one may take the -classpath option that may have a long list of paths from the script for launching the application and pass it to jdeps. That means jdeps would have to support both Windows paths as well as Unix paths. It's a reasonable enhancement that we can consider later. I'd really like to get this out in the next few days. > Additionally we also have a 3rd style in use, e.g. "java > mypackage.MyClass". > > >>>> I guess it wouldn't do any harm to silently supporting -cp and >>>> -classpath as folks used to java* tools will probably use them >>>> without thinking. >>> >> How important to carry the same option -cp and -classpath on j* >> tools? I do think developers can well adapt to a slight different >> option when using a new tool. I'm inclined not to mix these styles. >> In addition, I'd like to see how jdeps will be used after the initial >> push and people finds --class-path hard to move to. > > My vote: > silently support old style with space as separator and document this > as a side note on: > http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jdeps.html > You meant http://docs.oracle.com/javase/8/docs/technotes/tools/windows/jdeps.html :-) We have an agreement on --classpath. It's helpful to get developers to play with jdeps and we can then improve it once we get feedback. I'll leave the old style options out in this patch as I'm inclined not to support both old style and GNU-style. >> >>> Thanks for supporting my arguments about "silent familarity" to old >>> style, Alan. >>> As --class(-)path is a frequent and important option, I additionally >>> think, we should have an official short form. If '-cp' doesn't >>> conform with GNU-style, what about '-C' ? >> >> I considered '-C' and it might be confused with 'jar -C' and 'tar -C' >> option to change the directory. I think '-c' may be okay and it can >> avoid such confusion and closer to '-cp'. Are you okay with that? > > I agree! "-C" was from my non-reflected guess, that '-c' would be yet > occupied, as you didn't consider a short form from the beginning. > Thanks for your closer look. > I missed to mention the short form in my previous reply but I did consider it :) Thanks for all the feedback. Really appreciated. Mandy From mandy.chung at oracle.com Tue Dec 18 20:06:08 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 18 Dec 2012 12:06:08 -0800 Subject: RFR: javax.xml.transform: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D09CFE.6000303@oracle.com> References: <50D09CFE.6000303@oracle.com> Message-ID: <50D0CCB0.2060703@oracle.com> On 12/18/12 8:42 AM, Daniel Fuchs wrote: > Hi, > > Here is a new webrev in the series that addresses using ServiceLoader in > JAXP for JDK 8. > > 7169894: JAXP Plugability Layer: using service loader > > This changeset addresses modification in the javax.xml.transform > package. > It is similar to changes proposed for the javax.xml.parsers > package [1], with only a few differences due to the specificity of > javax.xml.transform. > > > > > In FactoryFinder.newInstanceNoServiceLoader method, L223, 226 - NoSuchMethodException will be thrown if such method doesn't exist. creationMethod will not be null. L236 - this change is not needed, right? The method is a static no-arg method. You passed an additional argument creationMethod as the first parameter although it's harmless as it's ignored. A minor comment: 151 static T newInstance(Class type, String className, ClassLoader cl, boolean doFallback) 152 throws TransformerFactoryConfigurationError 153 { 154 return newInstance(type, className, cl, doFallback, false, false); 155 } The FactoryFinder.newInstance method 4-argument version is only called by TransformerFactory.newInstance(String factoryClassName, ClassLoader classLoader). Perhaps you can clean this up TransformerFactory to call the Factory.newInstance method 6-argument version. Thanks Mandy From joe.darcy at oracle.com Tue Dec 18 20:43:08 2012 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 18 Dec 2012 12:43:08 -0800 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection Message-ID: <50D0D55C.5040900@oracle.com> Hello, Please review these changes to add core reflection support to recognize default methods: 8005042 Add Method.isDefault to core reflection http://cr.openjdk.java.net/~darcy/8005042.0/ Thanks, -Joe From forax at univ-mlv.fr Tue Dec 18 21:09:18 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Tue, 18 Dec 2012 22:09:18 +0100 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D0D55C.5040900@oracle.com> References: <50D0D55C.5040900@oracle.com> Message-ID: <50D0DB7E.9000601@univ-mlv.fr> On 12/18/2012 09:43 PM, Joe Darcy wrote: > Hello, > > Please review these changes to add core reflection support to > recognize default methods: > > 8005042 Add Method.isDefault to core reflection > http://cr.openjdk.java.net/~darcy/8005042.0/ > > Thanks, > > -Joe > Looks good. R?mi From Alan.Bateman at oracle.com Tue Dec 18 21:12:26 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Tue, 18 Dec 2012 21:12:26 +0000 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D0D55C.5040900@oracle.com> References: <50D0D55C.5040900@oracle.com> Message-ID: <50D0DC3A.6020707@oracle.com> On 18/12/2012 20:43, Joe Darcy wrote: > Hello, > > Please review these changes to add core reflection support to > recognize default methods: > > 8005042 Add Method.isDefault to core reflection > http://cr.openjdk.java.net/~darcy/8005042.0/ > > Thanks, > > -Joe > This looks okay to me except that I would probably have gone for something like "Tells if this method is a default method as defined by the JLS" and keep the description for @return short. -Alan. From mike.duigou at oracle.com Tue Dec 18 21:17:33 2012 From: mike.duigou at oracle.com (Mike Duigou) Date: Tue, 18 Dec 2012 13:17:33 -0800 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D0D55C.5040900@oracle.com> References: <50D0D55C.5040900@oracle.com> Message-ID: <360158E7-2F7A-491A-A20E-AE705622C363@oracle.com> Looks good to me. Will a JLS reference be added in when defined? It seems kind of odd to mention JLS and not provide a ref. Nice use of annotations in the test. I will steal this technique and can think of tests where I should have used it. Mike On Dec 18 2012, at 12:43 , Joe Darcy wrote: > Hello, > > Please review these changes to add core reflection support to recognize default methods: > > 8005042 Add Method.isDefault to core reflection > http://cr.openjdk.java.net/~darcy/8005042.0/ > > Thanks, > > -Joe > From jim.gish at oracle.com Tue Dec 18 21:20:24 2012 From: jim.gish at oracle.com (Jim Gish) Date: Tue, 18 Dec 2012 16:20:24 -0500 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D0D55C.5040900@oracle.com> References: <50D0D55C.5040900@oracle.com> Message-ID: <50D0DE18.8050905@oracle.com> Code looks good, Joe. There is just one grammatical nit with the comment: * A default method is a non-abstract method, that is a method with 512 * a body, declared in an interface type. "that is" should have a comment after it. Thanks, Jim On 12/18/2012 03:43 PM, Joe Darcy wrote: > Hello, > > Please review these changes to add core reflection support to > recognize default methods: > > 8005042 Add Method.isDefault to core reflection > http://cr.openjdk.java.net/~darcy/8005042.0/ > > Thanks, > > -Joe > -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From mandy.chung at oracle.com Tue Dec 18 21:21:03 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 18 Dec 2012 13:21:03 -0800 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D0D55C.5040900@oracle.com> References: <50D0D55C.5040900@oracle.com> Message-ID: <50D0DE3F.6060604@oracle.com> On 12/18/12 12:43 PM, Joe Darcy wrote: > Hello, > > Please review these changes to add core reflection support to > recognize default methods: > > 8005042 Add Method.isDefault to core reflection > http://cr.openjdk.java.net/~darcy/8005042.0/ > Looks good to me. For the test: 56 System.err.printf("ERROR: On %s expected isDefualt of ''%s''; got ''%s''.\n", 57 method.toString(), expected, actual); A typo 'isDefualt' -> 'isDefault'. This uses two single-quote characters to wrap the expected and actual value - is it intentional? I was wondering that you meant to use one singe-quote character. Mandy From jim.gish at oracle.com Tue Dec 18 21:29:16 2012 From: jim.gish at oracle.com (Jim Gish) Date: Tue, 18 Dec 2012 16:29:16 -0500 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D0DE18.8050905@oracle.com> References: <50D0D55C.5040900@oracle.com> <50D0DE18.8050905@oracle.com> Message-ID: <50D0E02C.70102@oracle.com> Excuse me, a "comma". On 12/18/2012 04:20 PM, Jim Gish wrote: > Code looks good, Joe. There is just one grammatical nit with the comment: > > * A default method is a non-abstract method, that is a method with > 512 * a body, declared in an interface type. > > > "that is" should have a comment after it. > > Thanks, > Jim > > On 12/18/2012 03:43 PM, Joe Darcy wrote: >> Hello, >> >> Please review these changes to add core reflection support to >> recognize default methods: >> >> 8005042 Add Method.isDefault to core reflection >> http://cr.openjdk.java.net/~darcy/8005042.0/ >> >> Thanks, >> >> -Joe >> > > -- > Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 > Oracle Java Platform Group | Core Libraries Team > 35 Network Drive > Burlington, MA 01803 > jim.gish at oracle.com -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From daniel.fuchs at oracle.com Tue Dec 18 22:02:06 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 18 Dec 2012 23:02:06 +0100 Subject: RFR: javax.xml.transform: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D0CCB0.2060703@oracle.com> References: <50D09CFE.6000303@oracle.com> <50D0CCB0.2060703@oracle.com> Message-ID: <50D0E7DE.4020903@oracle.com> On 12/18/12 9:06 PM, Mandy Chung wrote: > In FactoryFinder.newInstanceNoServiceLoader method, L223, 226 - > NoSuchMethodException will be thrown if such method doesn't exist. > creationMethod will not be null. Thanks - yes - you're right of course - no need to check for null... > L236 - this change is not needed, right? The method is a static > no-arg method. You passed an additional argument creationMethod as the > first parameter although it's harmless as it's ignored. Oops - my bad. That's a mistake - I did too many successive changes - should be creationMethod.invoke(null) of course. And my tests didn't even catch it! > > A minor comment: > 151 static T newInstance(Class type, String className, ClassLoader cl, boolean doFallback) > 152 throws TransformerFactoryConfigurationError > 153 { > 154 return newInstance(type, className, cl, doFallback, false, false); > 155 } > > The FactoryFinder.newInstance method 4-argument version is only called by > TransformerFactory.newInstance(String factoryClassName, ClassLoader classLoader). > Perhaps you can clean this up TransformerFactory to call the Factory.newInstance > method 6-argument version. 3 successive boolean parameters... I hate that ;-) Yes I think I can do this cleanup... Thanks Mandy, -- daniel > > Thanks > Mandy From daniel.fuchs at oracle.com Tue Dec 18 22:04:56 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 18 Dec 2012 23:04:56 +0100 Subject: RFR: javax.xml.transform: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D0B835.8010609@oracle.com> References: <50D09CFE.6000303@oracle.com> <50D0B835.8010609@oracle.com> Message-ID: <50D0E888.3030801@oracle.com> On 12/18/12 7:38 PM, Joe Wang wrote: > Hi Daniel, > > Looks great! I see you've added many verifications. > > One minor note, creationMethod is used in place of the object > instance for the creationMethod.invoke call, although it's ignored for > a static method anyways. Is there a reason for doing that? Yes sorry about that - it's my mistake. I had wrapped that call in a previous version then decided to revert to the original code but I obviously did it too fast! Thanks for catching it - the tests didn't! -- daniel > > -Joe > > On 12/18/2012 8:42 AM, Daniel Fuchs wrote: >> Hi, >> >> Here is a new webrev in the series that addresses using ServiceLoader in >> JAXP for JDK 8. >> >> 7169894: JAXP Plugability Layer: using service loader >> >> This changeset addresses modification in the javax.xml.transform >> package. >> It is similar to changes proposed for the javax.xml.parsers >> package [1], with only a few differences due to the specificity of >> javax.xml.transform. >> >> >> >> >> >> best regards, >> >> -- daniel >> >> previous webrevs in the series: >> >> [1] javax.xml.parsers: >> >> >> >> [2] javax.xml.datatype: >> >> >> >> [3] javax.xml.stream >> >> From maurizio.cimadamore at oracle.com Tue Dec 18 22:17:22 2012 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Tue, 18 Dec 2012 22:17:22 +0000 Subject: hg: jdk8/tl/langtools: 8005193: New regression test test/tools/javac/lambda/BadMethodCall2.java fails Message-ID: <20121218221725.5F42E47235@hg.openjdk.java.net> Changeset: 250f0acf880c Author: mcimadamore Date: 2012-12-18 22:16 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/250f0acf880c 8005193: New regression test test/tools/javac/lambda/BadMethodCall2.java fails Summary: Bad golden file in negative test Reviewed-by: jjh ! test/tools/javac/lambda/BadMethodCall2.out From daniel.fuchs at oracle.com Tue Dec 18 22:23:49 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Tue, 18 Dec 2012 23:23:49 +0100 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D0BD64.2090502@oracle.com> References: <50CF59DF.2040006@oracle.com> <50D08508.3040903@oracle.com> <50D09C4D.9030404@oracle.com> <50D0A816.7010201@oracle.com> <50D0AF49.5030505@oracle.com> <50D0BD64.2090502@oracle.com> Message-ID: <50D0ECF5.3020205@oracle.com> On 12/18/12 8:00 PM, Joe Wang wrote: > > > On 12/18/2012 10:00 AM, Daniel Fuchs wrote: >> On 12/18/12 6:29 PM, Joe Wang wrote: >>> Hi Daniel, >>> >>> The call: T provider = findServiceProvider(type) in static T >>> find(Class type, String factoryId, ClassLoader cl, String >>> fallbackClassName) ignored factoryId, and assumed it's the same as >>> type.getName(). I looked back I had the same bug in my original patch. >> >> I don't think that's a bug in the new code - but rather possibly a >> bug in the old code ;-). > > The old code did not have the problem since it's reading > "META-INF/services/" + factoryId directly. > >> There's no way you can pass a property name to the ServiceLoader. > > True. That's why it looked a bit awkward since 'factoryId' is not > passed in as did before, as in findJarServiceProvider(factoryId). > >> >> The JAR Specification says: >> >> "A service provider identifies itself by placing a >> provider-configuration file in the resource directory >> META-INF/services. The file's name should consist of the >> fully-qualified name of the abstract service class." >> >> So I think the current code is correct in ignoring factoryId - because >> according to the spec the file name should be the same as the >> abstract class name. > > So the StAX API implied that factoryId could be anything, but that > would violate the JAR specification. In other words, it would only > work as intended if the factoryId is specified as a System Property, > or in stax.properties or jaxp.properties. > > I would think we should return an error if factoryId != type.getName() > before the call "findServiceProvider(type)". In fact I toyed with the idea of skipping the call to findServiceProvider(type) when factoryId != type.getName(). I am not sure whether we should return an error or the skip directly to returning the default implementation. I mean - if a user tried to load the factory specified by foo.bar, and foo.bar is not defined, shouldn't we return the default implementation? I think that's what was happening before... But if we return the default implementation - shouldn't any Service Provider loadable through ServiceLoader take precedence? When the parameter is a classname - then the meaning is clear. Either you can load the class or you can't. When it's a factoryId - and the doc says "it is the same as a System property" - then shouldn't the code behave as if it were a System property? -- daniel > > -Joe > >> >> >> -- daniel >> >>> >>> -Joe >>> >>> On 12/18/2012 8:39 AM, Daniel Fuchs wrote: >>>> Hi, >>>> >>>> Thanks for the review. >>>> I updated the webrev to keep track of your suggested change. >>>> >>>> >>>> >>>> >>>> -- daniel >>>> >>>> On 12/18/12 4:00 PM, Alan Bateman wrote: >>>>> >>>>> I looked through this installment and aside from an aside from an >>>>> alignment issue at lines 101-102 in XMLEventFactory.java then it >>>>> looks >>>>> good to me. >>>>> >>>>> Also thank you again for being so careful as you work through each of >>>>> these areas. >>>>> >>>>> -Alan >>>> >> From joe.darcy at oracle.com Tue Dec 18 22:31:30 2012 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 18 Dec 2012 14:31:30 -0800 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <360158E7-2F7A-491A-A20E-AE705622C363@oracle.com> References: <50D0D55C.5040900@oracle.com> <360158E7-2F7A-491A-A20E-AE705622C363@oracle.com> Message-ID: <50D0EEC2.4010305@oracle.com> Hello, On 12/18/2012 01:17 PM, Mike Duigou wrote: > Looks good to me. Will a JLS reference be added in when defined? It seems kind of odd to mention JLS and not provide a ref. Yes; once there is a particular JLS section available to reference, this documentation should be updated to reference it :-) > > Nice use of annotations in the test. I will steal this technique and can think of tests where I should have used it. Thanks; this is a very helpful technique, especially for all tests ranging over different language constructs. You can go further by *generating* the sources with annotations and running a little checker over the results. Thanks, -Joe > > Mike > > > On Dec 18 2012, at 12:43 , Joe Darcy wrote: > >> Hello, >> >> Please review these changes to add core reflection support to recognize default methods: >> >> 8005042 Add Method.isDefault to core reflection >> http://cr.openjdk.java.net/~darcy/8005042.0/ >> >> Thanks, >> >> -Joe >> From joe.darcy at oracle.com Tue Dec 18 22:32:58 2012 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 18 Dec 2012 14:32:58 -0800 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D0DE3F.6060604@oracle.com> References: <50D0D55C.5040900@oracle.com> <50D0DE3F.6060604@oracle.com> Message-ID: <50D0EF1A.4080303@oracle.com> Mandy and Jim, I'll correct the typos before I push. Thanks for the careful review, -Joe On 12/18/2012 01:21 PM, Mandy Chung wrote: > On 12/18/12 12:43 PM, Joe Darcy wrote: >> Hello, >> >> Please review these changes to add core reflection support to >> recognize default methods: >> >> 8005042 Add Method.isDefault to core reflection >> http://cr.openjdk.java.net/~darcy/8005042.0/ >> > > Looks good to me. > > For the test: > 56 System.err.printf("ERROR: On %s expected isDefualt of ''%s''; got ''%s''.\n", > 57 method.toString(), expected, actual); > > A typo 'isDefualt' -> 'isDefault'. This uses two single-quote > characters to wrap the expected and actual value - is it intentional? > I was wondering that you meant to use one singe-quote character. > > Mandy > From david.holmes at oracle.com Tue Dec 18 22:39:14 2012 From: david.holmes at oracle.com (David Holmes) Date: Wed, 19 Dec 2012 08:39:14 +1000 Subject: RFR: 8004699 : Add type annotation storage to Constructor, Field and Method In-Reply-To: <50D059CD.7040107@oracle.com> References: <50D0575E.2060505@oracle.com> <50D059CD.7040107@oracle.com> Message-ID: <50D0F092.80007@oracle.com> +1 Thanks, David On 18/12/2012 9:55 PM, Alan Bateman wrote: > On 18/12/2012 11:45, Joel Borggr?n-Franck wrote: >> >> New webrev after renaming the fields: >> cr.openjdk.java.net/~jfranck/8004699/webrev.01/ >> >> I'll post matching HotSpot changes to hs-dev later today. > Thanks for the rename, looks fine to me. > > -Alan From lowasser at google.com Tue Dec 18 22:40:04 2012 From: lowasser at google.com (Louis Wasserman) Date: Tue, 18 Dec 2012 14:40:04 -0800 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D0EF1A.4080303@oracle.com> References: <50D0D55C.5040900@oracle.com> <50D0DE3F.6060604@oracle.com> <50D0EF1A.4080303@oracle.com> Message-ID: It's not 100% obvious to me whether this refers to a default implementation in an interface, a class which inherits that default implementation and does not override it, or both. Is that worth clarifying in the doc, rather than forcing readers to check the JLS citation? On Tue, Dec 18, 2012 at 2:32 PM, Joe Darcy wrote: > Mandy and Jim, > > I'll correct the typos before I push. > > Thanks for the careful review, > > -Joe > > > On 12/18/2012 01:21 PM, Mandy Chung wrote: > >> On 12/18/12 12:43 PM, Joe Darcy wrote: >> >>> Hello, >>> >>> Please review these changes to add core reflection support to recognize >>> default methods: >>> >>> 8005042 Add Method.isDefault to core reflection >>> http://cr.openjdk.java.net/~**darcy/8005042.0/ >>> >>> >> Looks good to me. >> >> For the test: >> 56 System.err.printf("ERROR: On %s expected isDefualt of ''%s''; got >> ''%s''.\n", >> 57 method.toString(), expected, actual); >> >> A typo 'isDefualt' -> 'isDefault'. This uses two single-quote characters >> to wrap the expected and actual value - is it intentional? I was wondering >> that you meant to use one singe-quote character. >> >> Mandy >> >> > -- Louis Wasserman From joe.darcy at oracle.com Tue Dec 18 22:44:43 2012 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Tue, 18 Dec 2012 22:44:43 +0000 Subject: hg: jdk8/tl/jdk: 8005042: Add Method.isDefault to core reflection Message-ID: <20121218224503.D996C47238@hg.openjdk.java.net> Changeset: 0a1398021c7c Author: darcy Date: 2012-12-18 14:44 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0a1398021c7c 8005042: Add Method.isDefault to core reflection Reviewed-by: alanb, forax, mduigou, jgish, mchung ! src/share/classes/java/lang/reflect/Method.java + test/java/lang/reflect/Method/IsDefaultTest.java From joe.darcy at oracle.com Tue Dec 18 22:50:26 2012 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Tue, 18 Dec 2012 22:50:26 +0000 Subject: hg: jdk8/tl/jdk: 8004699: Add type annotation storage to Constructor, Field and Method Message-ID: <20121218225038.108464723B@hg.openjdk.java.net> Changeset: 6d977f61af5e Author: darcy Date: 2012-12-18 14:49 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6d977f61af5e 8004699: Add type annotation storage to Constructor, Field and Method Reviewed-by: darcy, dholmes Contributed-by: joel.franck at oracle.com ! src/share/classes/java/lang/reflect/Constructor.java ! src/share/classes/java/lang/reflect/Field.java ! src/share/classes/java/lang/reflect/Method.java From huizhe.wang at oracle.com Tue Dec 18 23:10:59 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 18 Dec 2012 15:10:59 -0800 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D0ECF5.3020205@oracle.com> References: <50CF59DF.2040006@oracle.com> <50D08508.3040903@oracle.com> <50D09C4D.9030404@oracle.com> <50D0A816.7010201@oracle.com> <50D0AF49.5030505@oracle.com> <50D0BD64.2090502@oracle.com> <50D0ECF5.3020205@oracle.com> Message-ID: <50D0F803.9070208@oracle.com> On 12/18/2012 2:23 PM, Daniel Fuchs wrote: > On 12/18/12 8:00 PM, Joe Wang wrote: >> >> >> On 12/18/2012 10:00 AM, Daniel Fuchs wrote: >>> On 12/18/12 6:29 PM, Joe Wang wrote: >>>> Hi Daniel, >>>> >>>> The call: T provider = findServiceProvider(type) in static T >>>> find(Class type, String factoryId, ClassLoader cl, String >>>> fallbackClassName) ignored factoryId, and assumed it's the same as >>>> type.getName(). I looked back I had the same bug in my original patch. >>> >>> I don't think that's a bug in the new code - but rather possibly a >>> bug in the old code ;-). >> >> The old code did not have the problem since it's reading >> "META-INF/services/" + factoryId directly. >> >>> There's no way you can pass a property name to the ServiceLoader. >> >> True. That's why it looked a bit awkward since 'factoryId' is not >> passed in as did before, as in findJarServiceProvider(factoryId). >> >>> >>> The JAR Specification says: >>> >>> "A service provider identifies itself by placing a >>> provider-configuration file in the resource directory >>> META-INF/services. The file's name should consist of the >>> fully-qualified name of the abstract service class." >>> >>> So I think the current code is correct in ignoring factoryId - because >>> according to the spec the file name should be the same as the >>> abstract class name. >> >> So the StAX API implied that factoryId could be anything, but that >> would violate the JAR specification. In other words, it would only >> work as intended if the factoryId is specified as a System Property, >> or in stax.properties or jaxp.properties. >> >> I would think we should return an error if factoryId != >> type.getName() before the call "findServiceProvider(type)". > > In fact I toyed with the idea of skipping the call to > findServiceProvider(type) when factoryId != type.getName(). > I am not sure whether we should return an error or the skip directly > to returning the default implementation. > > I mean - if a user tried to load the factory specified by foo.bar, and > foo.bar is not defined, shouldn't we return > the default implementation? I think that's what was happening before... It's different. If 'foo.bar' is specified but not found, it indicates a configuration error. If the factory falls back to an impl by the default factory id, it would serve to hide the error. Note that newInstance/newFactory with a factoryId parameter do not fall back to the default implementation. -Joe > > But if we return the default implementation - shouldn't any Service > Provider loadable through ServiceLoader take > precedence? > > When the parameter is a classname - then the meaning is clear. Either > you can load the class or you can't. > When it's a factoryId - and the doc says "it is the same as a System > property" - then shouldn't the code > behave as if it were a System property? > > -- daniel > >> >> -Joe >> >>> >>> >>> -- daniel >>> >>>> >>>> -Joe >>>> >>>> On 12/18/2012 8:39 AM, Daniel Fuchs wrote: >>>>> Hi, >>>>> >>>>> Thanks for the review. >>>>> I updated the webrev to keep track of your suggested change. >>>>> >>>>> >>>>> >>>>> >>>>> -- daniel >>>>> >>>>> On 12/18/12 4:00 PM, Alan Bateman wrote: >>>>>> >>>>>> I looked through this installment and aside from an aside from an >>>>>> alignment issue at lines 101-102 in XMLEventFactory.java then it >>>>>> looks >>>>>> good to me. >>>>>> >>>>>> Also thank you again for being so careful as you work through >>>>>> each of >>>>>> these areas. >>>>>> >>>>>> -Alan >>>>> >>> > From mandy.chung at oracle.com Tue Dec 18 23:12:39 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 18 Dec 2012 15:12:39 -0800 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50D0C652.3080500@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> <50CB33FE.7000605@CoSoCo.de> <50CB9CF5.4090300@oracle.com> <50CBC7D0.9050103@CoSoCo.de> <50CBD110.1080208@oracle.com> <50CBD2BF.90100@oracle.com> <50CF38F2.6040707@oracle.com> <50CF44A7.8000202@CoSoCo.de> <50CFEDFC.5060903@oracle.com> <50D0A286.3040309@CoSoCo.de> <50D0C652.3080500@oracle.com> Message-ID: <50D0F867.80100@oracle.com> Alan, Ulf, I updated the jdeps CLI per the discussion we had. $ jdeps --help Usage: jdeps where can be a pathname to a .class file, a directory, a JAR file, or a fully-qualified classname or wildcard "*". Possible options include: -s --summary Print dependency summary only -v --verbose Print additional information -V --verbose-level= Print package-level or class-level dependencies Valid levels are: "package" and "class" -c --classpath= Specify where to find class files -p --package= Restrict analysis to classes in this package (may be given multiple times) -e --regex= Restrict analysis to packages matching pattern (-p and -e are exclusive) -P --profile Show profile or the file containing a package -R --recursive Recursively traverse all dependencies --version Version information Updated webrev: http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.06/ jdeps only support GNU-style options. I added java.util.function and com.sun.source.doctree in the jdk.properties. I'll replace it to use the proper javac API to work with profiles next. I caught a typo 'com.sunsource.doctree' (missing dot) in NON_CORE_PKGS.gmk and I fix that in this patch. We can enhance the tool after the initial push. I'd like to get it in jdk8 soon so that developers can try it out and give feedback. Thanks Mandy From david.holmes at oracle.com Tue Dec 18 23:43:15 2012 From: david.holmes at oracle.com (David Holmes) Date: Wed, 19 Dec 2012 09:43:15 +1000 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <50D0ACB8.5010503@oracle.com> References: <50D02D8E.4000204@oracle.com> <50D0ACB8.5010503@oracle.com> Message-ID: <50D0FF93.8080701@oracle.com> On 19/12/2012 3:49 AM, Tom Hawtin wrote: > Not that it's particularly important, but it's /possible/ clients are > relying on the non-compile time constant nature of this field causing it > not to be inlined into client class files, rather than the ability to > switch the version string. So it may be a good idea to add the final, > but make it a non-compile time constant. We can also remove the > duplication. I think that is an excellent point Tom. We should avoid turning the static field into a compile-time constant. And get rid of the unnecessary fImmutableVersion which everyone keeps overlooking. David > > public static final String fVersion = getVersion(); > > Tom > > On 18/12/2012 08:47, Joe Wang wrote: >> Hi, >> >> This is the 2nd of the three [findbug] issues. The field fVersion is >> simply made final. >> >> webrev: >> http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ >> >> Test: >> No new test needed. >> >> Thanks, >> Joe > From david.holmes at oracle.com Tue Dec 18 23:59:12 2012 From: david.holmes at oracle.com (David Holmes) Date: Wed, 19 Dec 2012 09:59:12 +1000 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D0E02C.70102@oracle.com> References: <50D0D55C.5040900@oracle.com> <50D0DE18.8050905@oracle.com> <50D0E02C.70102@oracle.com> Message-ID: <50D10350.70304@oracle.com> On 19/12/2012 7:29 AM, Jim Gish wrote: > Excuse me, a "comma". > > On 12/18/2012 04:20 PM, Jim Gish wrote: >> Code looks good, Joe. There is just one grammatical nit with the comment: >> >> * A default method is a non-abstract method, that is a method with >> 512 * a body, declared in an interface type. Actually I think it would be more correct to parenthesize this as it is an aside comment: "A default method is a non-abstract method (that is, a method with a body) declared in an interface type." But the JLS reference should go here rather than on the @return: "A default method (JLS XXX) is a non-abstract method (that is, a method with a body) declared in an interface type." David ----- > >> >> "that is" should have a comment after it. >> >> Thanks, >> Jim >> >> On 12/18/2012 03:43 PM, Joe Darcy wrote: >>> Hello, >>> >>> Please review these changes to add core reflection support to >>> recognize default methods: >>> >>> 8005042 Add Method.isDefault to core reflection >>> http://cr.openjdk.java.net/~darcy/8005042.0/ >>> >>> Thanks, >>> >>> -Joe >>> >> >> -- >> Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 >> Oracle Java Platform Group | Core Libraries Team >> 35 Network Drive >> Burlington, MA 01803 >> jim.gish at oracle.com > From david.holmes at oracle.com Wed Dec 19 00:12:08 2012 From: david.holmes at oracle.com (David Holmes) Date: Wed, 19 Dec 2012 10:12:08 +1000 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: References: <50D0D55C.5040900@oracle.com> <50D0DE3F.6060604@oracle.com> <50D0EF1A.4080303@oracle.com> Message-ID: <50D10658.7010200@oracle.com> On 19/12/2012 8:40 AM, Louis Wasserman wrote: > It's not 100% obvious to me whether this refers to a default implementation > in an interface, a class which inherits that default implementation and > does not override it, or both. Is that worth clarifying in the doc, rather > than forcing readers to check the JLS citation? The issue is where you obtained this Method reference from: - from the Interface? then it is a default method - from a class implementing the interface but not redefining the method? then it is a default method - from a class implementing the interface and redefining the method? then it is NOT a default method. David ----- > > > On Tue, Dec 18, 2012 at 2:32 PM, Joe Darcy wrote: > >> Mandy and Jim, >> >> I'll correct the typos before I push. >> >> Thanks for the careful review, >> >> -Joe >> >> >> On 12/18/2012 01:21 PM, Mandy Chung wrote: >> >>> On 12/18/12 12:43 PM, Joe Darcy wrote: >>> >>>> Hello, >>>> >>>> Please review these changes to add core reflection support to recognize >>>> default methods: >>>> >>>> 8005042 Add Method.isDefault to core reflection >>>> http://cr.openjdk.java.net/~**darcy/8005042.0/ >>>> >>>> >>> Looks good to me. >>> >>> For the test: >>> 56 System.err.printf("ERROR: On %s expected isDefualt of ''%s''; got >>> ''%s''.\n", >>> 57 method.toString(), expected, actual); >>> >>> A typo 'isDefualt' -> 'isDefault'. This uses two single-quote characters >>> to wrap the expected and actual value - is it intentional? I was wondering >>> that you meant to use one singe-quote character. >>> >>> Mandy >>> >>> >> > > From joe.darcy at oracle.com Wed Dec 19 00:16:19 2012 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 18 Dec 2012 16:16:19 -0800 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D10658.7010200@oracle.com> References: <50D0D55C.5040900@oracle.com> <50D0DE3F.6060604@oracle.com> <50D0EF1A.4080303@oracle.com> <50D10658.7010200@oracle.com> Message-ID: <50D10753.6060700@oracle.com> On 12/18/2012 04:12 PM, David Holmes wrote: > On 19/12/2012 8:40 AM, Louis Wasserman wrote: >> It's not 100% obvious to me whether this refers to a default >> implementation >> in an interface, a class which inherits that default implementation and >> does not override it, or both. Is that worth clarifying in the doc, >> rather >> than forcing readers to check the JLS citation? > > The issue is where you obtained this Method reference from: > > - from the Interface? then it is a default method > - from a class implementing the interface but not redefining the > method? then it is a default method Actually, that is *now* how HotSpot represents this case in core reflection at the moment. HotSpot uses a new method object to represent the default method woven into an implementing class. The class file and/or runtime representation of default methods may change before we're done; one reason to get the isDefault methods in core reflection and javax.lang.model now is to ease exploring alternatives. -Joe > - from a class implementing the interface and redefining the method? > then it is NOT a default method. > > David > ----- > >> >> >> On Tue, Dec 18, 2012 at 2:32 PM, Joe Darcy wrote: >> >>> Mandy and Jim, >>> >>> I'll correct the typos before I push. >>> >>> Thanks for the careful review, >>> >>> -Joe >>> >>> >>> On 12/18/2012 01:21 PM, Mandy Chung wrote: >>> >>>> On 12/18/12 12:43 PM, Joe Darcy wrote: >>>> >>>>> Hello, >>>>> >>>>> Please review these changes to add core reflection support to >>>>> recognize >>>>> default methods: >>>>> >>>>> 8005042 Add Method.isDefault to core reflection >>>>> http://cr.openjdk.java.net/~**darcy/8005042.0/ >>>>> >>>>> >>>>> >>>> Looks good to me. >>>> >>>> For the test: >>>> 56 System.err.printf("ERROR: On %s expected isDefualt of >>>> ''%s''; got >>>> ''%s''.\n", >>>> 57 method.toString(), expected, actual); >>>> >>>> A typo 'isDefualt' -> 'isDefault'. This uses two single-quote >>>> characters >>>> to wrap the expected and actual value - is it intentional? I was >>>> wondering >>>> that you meant to use one singe-quote character. >>>> >>>> Mandy >>>> >>>> >>> >> >> From lowasser at google.com Wed Dec 19 00:15:58 2012 From: lowasser at google.com (Louis Wasserman) Date: Tue, 18 Dec 2012 16:15:58 -0800 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D10658.7010200@oracle.com> References: <50D0D55C.5040900@oracle.com> <50D0DE3F.6060604@oracle.com> <50D0EF1A.4080303@oracle.com> <50D10658.7010200@oracle.com> Message-ID: Could we say that, in so many words, in the Javadoc? On Tue, Dec 18, 2012 at 4:12 PM, David Holmes wrote: > On 19/12/2012 8:40 AM, Louis Wasserman wrote: > >> It's not 100% obvious to me whether this refers to a default >> implementation >> in an interface, a class which inherits that default implementation and >> does not override it, or both. Is that worth clarifying in the doc, >> rather >> than forcing readers to check the JLS citation? >> > > The issue is where you obtained this Method reference from: > > - from the Interface? then it is a default method > - from a class implementing the interface but not redefining the method? > then it is a default method > - from a class implementing the interface and redefining the method? then > it is NOT a default method. > > David > ----- > > >> >> On Tue, Dec 18, 2012 at 2:32 PM, Joe Darcy wrote: >> >> Mandy and Jim, >>> >>> I'll correct the typos before I push. >>> >>> Thanks for the careful review, >>> >>> -Joe >>> >>> >>> On 12/18/2012 01:21 PM, Mandy Chung wrote: >>> >>> On 12/18/12 12:43 PM, Joe Darcy wrote: >>>> >>>> Hello, >>>>> >>>>> Please review these changes to add core reflection support to recognize >>>>> default methods: >>>>> >>>>> 8005042 Add Method.isDefault to core reflection >>>>> http://cr.openjdk.java.net/~****darcy/8005042.0/ >>>>> >>>>> > >>>>> >>>>> >>>>> Looks good to me. >>>> >>>> For the test: >>>> 56 System.err.printf("ERROR: On %s expected isDefualt of ''%s''; >>>> got >>>> ''%s''.\n", >>>> 57 method.toString(), expected, actual); >>>> >>>> A typo 'isDefualt' -> 'isDefault'. This uses two single-quote >>>> characters >>>> to wrap the expected and actual value - is it intentional? I was >>>> wondering >>>> that you meant to use one singe-quote character. >>>> >>>> Mandy >>>> >>>> >>>> >>> >> >> -- Louis Wasserman From david.holmes at oracle.com Wed Dec 19 00:20:49 2012 From: david.holmes at oracle.com (David Holmes) Date: Wed, 19 Dec 2012 10:20:49 +1000 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D10753.6060700@oracle.com> References: <50D0D55C.5040900@oracle.com> <50D0DE3F.6060604@oracle.com> <50D0EF1A.4080303@oracle.com> <50D10658.7010200@oracle.com> <50D10753.6060700@oracle.com> Message-ID: <50D10861.3000202@oracle.com> On 19/12/2012 10:16 AM, Joe Darcy wrote: > On 12/18/2012 04:12 PM, David Holmes wrote: >> On 19/12/2012 8:40 AM, Louis Wasserman wrote: >>> It's not 100% obvious to me whether this refers to a default >>> implementation >>> in an interface, a class which inherits that default implementation and >>> does not override it, or both. Is that worth clarifying in the doc, >>> rather >>> than forcing readers to check the JLS citation? >> >> The issue is where you obtained this Method reference from: >> >> - from the Interface? then it is a default method >> - from a class implementing the interface but not redefining the >> method? then it is a default method > > Actually, that is *now* how HotSpot represents this case in core > reflection at the moment. HotSpot uses a new method object to represent > the default method woven into an implementing class. *now* -> *not* ?? It may be a new Method object but getDeclaringClass() should give the interface class NOT the concrete class. That is currently the case for abstract interface methods. I hope it is the same for default methods! David ----- > The class file and/or runtime representation of default methods may > change before we're done; one reason to get the isDefault methods in > core reflection and javax.lang.model now is to ease exploring alternatives. > > -Joe > >> - from a class implementing the interface and redefining the method? >> then it is NOT a default method. >> >> David >> ----- >> >>> >>> >>> On Tue, Dec 18, 2012 at 2:32 PM, Joe Darcy wrote: >>> >>>> Mandy and Jim, >>>> >>>> I'll correct the typos before I push. >>>> >>>> Thanks for the careful review, >>>> >>>> -Joe >>>> >>>> >>>> On 12/18/2012 01:21 PM, Mandy Chung wrote: >>>> >>>>> On 12/18/12 12:43 PM, Joe Darcy wrote: >>>>> >>>>>> Hello, >>>>>> >>>>>> Please review these changes to add core reflection support to >>>>>> recognize >>>>>> default methods: >>>>>> >>>>>> 8005042 Add Method.isDefault to core reflection >>>>>> http://cr.openjdk.java.net/~**darcy/8005042.0/ >>>>>> >>>>>> >>>>>> >>>>> Looks good to me. >>>>> >>>>> For the test: >>>>> 56 System.err.printf("ERROR: On %s expected isDefualt of ''%s''; got >>>>> ''%s''.\n", >>>>> 57 method.toString(), expected, actual); >>>>> >>>>> A typo 'isDefualt' -> 'isDefault'. This uses two single-quote >>>>> characters >>>>> to wrap the expected and actual value - is it intentional? I was >>>>> wondering >>>>> that you meant to use one singe-quote character. >>>>> >>>>> Mandy >>>>> >>>>> >>>> >>> >>> > From joe.darcy at oracle.com Wed Dec 19 00:24:59 2012 From: joe.darcy at oracle.com (Joe Darcy) Date: Tue, 18 Dec 2012 16:24:59 -0800 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D10861.3000202@oracle.com> References: <50D0D55C.5040900@oracle.com> <50D0DE3F.6060604@oracle.com> <50D0EF1A.4080303@oracle.com> <50D10658.7010200@oracle.com> <50D10753.6060700@oracle.com> <50D10861.3000202@oracle.com> Message-ID: <50D1095B.4090805@oracle.com> On 12/18/2012 04:20 PM, David Holmes wrote: > On 19/12/2012 10:16 AM, Joe Darcy wrote: >> On 12/18/2012 04:12 PM, David Holmes wrote: >>> On 19/12/2012 8:40 AM, Louis Wasserman wrote: >>>> It's not 100% obvious to me whether this refers to a default >>>> implementation >>>> in an interface, a class which inherits that default implementation >>>> and >>>> does not override it, or both. Is that worth clarifying in the doc, >>>> rather >>>> than forcing readers to check the JLS citation? >>> >>> The issue is where you obtained this Method reference from: >>> >>> - from the Interface? then it is a default method >>> - from a class implementing the interface but not redefining the >>> method? then it is a default method >> >> Actually, that is *now* how HotSpot represents this case in core >> reflection at the moment. HotSpot uses a new method object to represent >> the default method woven into an implementing class. > > *now* -> *not* ?? Correct. > > It may be a new Method object but getDeclaringClass() should give the > interface class NOT the concrete class. That is currently the case for > abstract interface methods. I hope it is the same for default methods! It is not at the moment, which is a bit surprising. -Joe From mandy.chung at oracle.com Wed Dec 19 00:27:45 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Tue, 18 Dec 2012 16:27:45 -0800 Subject: 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present In-Reply-To: <50D07AE8.4050408@oracle.com> References: <50BF994B.5020308@oracle.com> <50C2459F.6080102@oracle.com> <50C27AC1.2050600@oracle.com> <50C27DBA.3050808@oracle.com> <50C61B4B.1080901@oracle.com> <50C72618.5000407@oracle.com> <7706A692-773E-4282-8B2C-9B2D85FD49A5@oracle.com> <50C85DFE.5010300@oracle.com> <50CA4C9D.50101@oracle.com> <50CB422E.2080402@oracle.com> <50D07AE8.4050408@oracle.com> Message-ID: <50D10A01.4020703@oracle.com> On 12/18/12 6:17 AM, Alan Bateman wrote: > > I've refreshed the webrev here to take in another change from Joe to > the root element handling in PropertiesDefaultHandler. > > http://cr.openjdk.java.net/~alanb/8004371/webrev.03/ > > I'd like to get this into jdk8/tl in the next few days if possible. > > On tests on then I've expanded LoadAndStoreXML to include a directory > of invalid XML documents (those that should cause > InvalidProperitesFormatException to be thrown) so that improves the > test coverage a bit. Joe has several other tests in the works so I've > suggested to him that he does a follow-up change in the coming weeks > with those tests. > Looks okay to me. It's good that you have expanded the test to improve the coverage testing invalid XML documents. Looking forward to the additional tests Joe will be adding in the coming weeks. Mandy From david.holmes at oracle.com Wed Dec 19 00:35:15 2012 From: david.holmes at oracle.com (David Holmes) Date: Wed, 19 Dec 2012 10:35:15 +1000 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D1095B.4090805@oracle.com> References: <50D0D55C.5040900@oracle.com> <50D0DE3F.6060604@oracle.com> <50D0EF1A.4080303@oracle.com> <50D10658.7010200@oracle.com> <50D10753.6060700@oracle.com> <50D10861.3000202@oracle.com> <50D1095B.4090805@oracle.com> Message-ID: <50D10BC3.3020504@oracle.com> On 19/12/2012 10:24 AM, Joe Darcy wrote: > On 12/18/2012 04:20 PM, David Holmes wrote: >> On 19/12/2012 10:16 AM, Joe Darcy wrote: >>> On 12/18/2012 04:12 PM, David Holmes wrote: >>>> On 19/12/2012 8:40 AM, Louis Wasserman wrote: >>>>> It's not 100% obvious to me whether this refers to a default >>>>> implementation >>>>> in an interface, a class which inherits that default implementation >>>>> and does not override it, or both. Is that worth clarifying in the doc, >>>>> rather than forcing readers to check the JLS citation? >>>> >>>> The issue is where you obtained this Method reference from: >>>> >>>> - from the Interface? then it is a default method >>>> - from a class implementing the interface but not redefining the >>>> method? then it is a default method >>> >>> Actually, that is *now* how HotSpot represents this case in core >>> reflection at the moment. HotSpot uses a new method object to represent >>> the default method woven into an implementing class. >> >> *now* -> *not* ?? > > Correct. > >> >> It may be a new Method object but getDeclaringClass() should give the >> interface class NOT the concrete class. That is currently the case for >> abstract interface methods. I hope it is the same for default methods! > > It is not at the moment, which is a bit surprising. Very surprising! I'd call that a major bug. David ----- > -Joe From huizhe.wang at oracle.com Wed Dec 19 01:51:42 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 18 Dec 2012 17:51:42 -0800 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <50D0ACB8.5010503@oracle.com> References: <50D02D8E.4000204@oracle.com> <50D0ACB8.5010503@oracle.com> Message-ID: <50D11DAE.4090808@oracle.com> Thanks Tom. I changed it as you suggested. I did initially remove the string and have main print out getVersion() instead, but I reverted it with a 2nd thought same as you, that it's /possible/ someone might be using it :) New webrev is here: http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ Joe On 12/18/2012 9:49 AM, Tom Hawtin wrote: > Not that it's particularly important, but it's /possible/ clients are > relying on the non-compile time constant nature of this field causing > it not to be inlined into client class files, rather than the ability > to switch the version string. So it may be a good idea to add the > final, but make it a non-compile time constant. We can also remove the > duplication. > > public static final String fVersion = getVersion(); > > Tom > > On 18/12/2012 08:47, Joe Wang wrote: >> Hi, >> >> This is the 2nd of the three [findbug] issues. The field fVersion is >> simply made final. >> >> webrev: >> http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ >> >> Test: >> No new test needed. >> >> Thanks, >> Joe > From Lance.Andersen at oracle.com Wed Dec 19 02:16:49 2012 From: Lance.Andersen at oracle.com (Lance Andersen) Date: Tue, 18 Dec 2012 21:16:49 -0500 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <50D11DAE.4090808@oracle.com> References: <50D02D8E.4000204@oracle.com> <50D0ACB8.5010503@oracle.com> <50D11DAE.4090808@oracle.com> Message-ID: <00B9608C-23CE-4676-90C3-89FA9C471878@oracle.com> +1 -- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com Sent from my iPhone On Dec 18, 2012, at 8:51 PM, Joe Wang wrote: > Thanks Tom. I changed it as you suggested. > > I did initially remove the string and have main print out getVersion() instead, but I reverted it with a 2nd thought same as you, that it's /possible/ someone might be using it :) > > New webrev is here: > http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ > > Joe > > On 12/18/2012 9:49 AM, Tom Hawtin wrote: >> Not that it's particularly important, but it's /possible/ clients are relying on the non-compile time constant nature of this field causing it not to be inlined into client class files, rather than the ability to switch the version string. So it may be a good idea to add the final, but make it a non-compile time constant. We can also remove the duplication. >> >> public static final String fVersion = getVersion(); >> >> Tom >> >> On 18/12/2012 08:47, Joe Wang wrote: >>> Hi, >>> >>> This is the 2nd of the three [findbug] issues. The field fVersion is >>> simply made final. >>> >>> webrev: >>> http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ >>> >>> Test: >>> No new test needed. >>> >>> Thanks, >>> Joe >> From huizhe.wang at oracle.com Wed Dec 19 02:21:36 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 18 Dec 2012 18:21:36 -0800 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <50D0FF93.8080701@oracle.com> References: <50D02D8E.4000204@oracle.com> <50D0ACB8.5010503@oracle.com> <50D0FF93.8080701@oracle.com> Message-ID: <50D124B0.2070501@oracle.com> On 12/18/2012 3:43 PM, David Holmes wrote: > On 19/12/2012 3:49 AM, Tom Hawtin wrote: >> Not that it's particularly important, but it's /possible/ clients are >> relying on the non-compile time constant nature of this field causing it >> not to be inlined into client class files, rather than the ability to >> switch the version string. So it may be a good idea to add the final, >> but make it a non-compile time constant. We can also remove the >> duplication. > > I think that is an excellent point Tom. We should avoid turning the > static field into a compile-time constant. > > And get rid of the unnecessary fImmutableVersion which everyone keeps > overlooking. With the following change, at least there's no duplicate literal version strings anymore. Or did you mean we should get rid of fImmutableVersionand have getVresion return a liberal string? Joe > > David > >> >> public static final String fVersion = getVersion(); >> >> Tom >> >> On 18/12/2012 08:47, Joe Wang wrote: >>> Hi, >>> >>> This is the 2nd of the three [findbug] issues. The field fVersion is >>> simply made final. >>> >>> webrev: >>> http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ >>> >>> Test: >>> No new test needed. >>> >>> Thanks, >>> Joe >> From huizhe.wang at oracle.com Wed Dec 19 02:22:02 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 18 Dec 2012 18:22:02 -0800 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <00B9608C-23CE-4676-90C3-89FA9C471878@oracle.com> References: <50D02D8E.4000204@oracle.com> <50D0ACB8.5010503@oracle.com> <50D11DAE.4090808@oracle.com> <00B9608C-23CE-4676-90C3-89FA9C471878@oracle.com> Message-ID: <50D124CA.9080001@oracle.com> Thanks :) On 12/18/2012 6:16 PM, Lance Andersen wrote: > +1 > > -- > > Lance > Andersen| Principal Member of Technical Staff | +1.781.442.2037 > > Oracle Java Engineering > 1 Network Drive > Burlington, MA 01803 > Lance.Andersen at oracle.com > > Sent from my iPhone > > On Dec 18, 2012, at 8:51 PM, Joe Wang > wrote: > >> Thanks Tom. I changed it as you suggested. >> >> I did initially remove the string and have main print out >> getVersion() instead, but I reverted it with a 2nd thought same as >> you, that it's /possible/ someone might be using it :) >> >> New webrev is here: >> http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ >> >> >> Joe >> >> On 12/18/2012 9:49 AM, Tom Hawtin wrote: >>> Not that it's particularly important, but it's /possible/ clients >>> are relying on the non-compile time constant nature of this field >>> causing it not to be inlined into client class files, rather than >>> the ability to switch the version string. So it may be a good idea >>> to add the final, but make it a non-compile time constant. We can >>> also remove the duplication. >>> >>> public static final String fVersion = getVersion(); >>> >>> Tom >>> >>> On 18/12/2012 08:47, Joe Wang wrote: >>>> Hi, >>>> >>>> This is the 2nd of the three [findbug] issues. The field fVersion is >>>> simply made final. >>>> >>>> webrev: >>>> http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ >>>> >>>> >>>> Test: >>>> No new test needed. >>>> >>>> Thanks, >>>> Joe >>> From david.holmes at oracle.com Wed Dec 19 03:08:39 2012 From: david.holmes at oracle.com (David Holmes) Date: Wed, 19 Dec 2012 13:08:39 +1000 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <50D124B0.2070501@oracle.com> References: <50D02D8E.4000204@oracle.com> <50D0ACB8.5010503@oracle.com> <50D0FF93.8080701@oracle.com> <50D124B0.2070501@oracle.com> Message-ID: <50D12FB7.9060904@oracle.com> On 19/12/2012 12:21 PM, Joe Wang wrote: > On 12/18/2012 3:43 PM, David Holmes wrote: >> On 19/12/2012 3:49 AM, Tom Hawtin wrote: >>> Not that it's particularly important, but it's /possible/ clients are >>> relying on the non-compile time constant nature of this field causing it >>> not to be inlined into client class files, rather than the ability to >>> switch the version string. So it may be a good idea to add the final, >>> but make it a non-compile time constant. We can also remove the >>> duplication. >> >> I think that is an excellent point Tom. We should avoid turning the >> static field into a compile-time constant. >> >> And get rid of the unnecessary fImmutableVersion which everyone keeps >> overlooking. > > With the following change, at least there's no duplicate literal version > strings anymore. Or did you mean we should get rid of > fImmutableVersionand have getVresion return a liberal string? I did mean to get rid of the fImmutableVersion field. But it's no big deal. David > Joe > >> >> David >> >>> >>> public static final String fVersion = getVersion(); >>> >>> Tom >>> >>> On 18/12/2012 08:47, Joe Wang wrote: >>>> Hi, >>>> >>>> This is the 2nd of the three [findbug] issues. The field fVersion is >>>> simply made final. >>>> >>>> webrev: >>>> http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ >>>> >>>> Test: >>>> No new test needed. >>>> >>>> Thanks, >>>> Joe >>> From lana.steuck at oracle.com Wed Dec 19 03:17:21 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Wed, 19 Dec 2012 03:17:21 +0000 Subject: hg: jdk8/tl: 2 new changesets Message-ID: <20121219031722.0C8BC47258@hg.openjdk.java.net> Changeset: e08b0096058f Author: lana Date: 2012-12-14 11:22 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/e08b0096058f Merge Changeset: 68a81db3ceb1 Author: lana Date: 2012-12-18 17:42 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/68a81db3ceb1 Merge From lana.steuck at oracle.com Wed Dec 19 03:17:31 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Wed, 19 Dec 2012 03:17:31 +0000 Subject: hg: jdk8/tl/langtools: 2 new changesets Message-ID: <20121219031740.E4E3547259@hg.openjdk.java.net> Changeset: d7360bf35ee1 Author: lana Date: 2012-12-14 13:15 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/d7360bf35ee1 Merge Changeset: 573b38691a74 Author: lana Date: 2012-12-18 18:15 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/573b38691a74 Merge From lana.steuck at oracle.com Wed Dec 19 03:17:59 2012 From: lana.steuck at oracle.com (lana.steuck at oracle.com) Date: Wed, 19 Dec 2012 03:17:59 +0000 Subject: hg: jdk8/tl/jdk: 8 new changesets Message-ID: <20121219032112.8E53F4725C@hg.openjdk.java.net> Changeset: e8b54ae97344 Author: jviswana Date: 2012-12-12 13:28 +0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e8b54ae97344 8004316: Printer - tempfile having incorrect extension Reviewed-by: bae, jgodinez ! src/solaris/classes/sun/print/UnixPrintJob.java Changeset: fd9e6b4c8488 Author: lana Date: 2012-12-14 11:21 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/fd9e6b4c8488 Merge Changeset: c69424f78060 Author: serb Date: 2012-12-11 19:45 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c69424f78060 7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame Summary: The new implementation of EmbeddedFrame to support SWT_AWT Bridge Reviewed-by: anthony, serb, leonidr Contributed-by: Petr Pchelko ! src/macosx/classes/sun/lwawt/LWToolkit.java ! src/macosx/classes/sun/lwawt/LWWindowPeer.java ! src/macosx/classes/sun/lwawt/PlatformWindow.java ! src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java ! src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java ! src/macosx/classes/sun/lwawt/macosx/CPlatformView.java ! src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java ! src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java + src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java + src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java ! src/macosx/classes/sun/lwawt/macosx/CWrapper.java ! src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java ! src/macosx/native/sun/awt/AWTSurfaceLayers.m ! src/macosx/native/sun/awt/AWTView.m ! src/macosx/native/sun/awt/AWTWindow.m ! src/macosx/native/sun/awt/CCursorManager.m ! src/macosx/native/sun/awt/CWrapper.m ! src/macosx/native/sun/awt/awt.m ! src/macosx/native/sun/java2d/opengl/CGLLayer.m ! src/macosx/native/sun/osxapp/ThreadUtilities.h ! src/macosx/native/sun/osxapp/ThreadUtilities.m Changeset: e016ad35a764 Author: kshefov Date: 2012-12-13 15:14 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e016ad35a764 7132385: [macosx] IconifyTest of RepaintManager could use some delay Reviewed-by: serb, alexsch + test/javax/swing/RepaintManager/IconifyTest/IconifyTest.java Changeset: 71e03e17c183 Author: kshefov Date: 2012-12-14 13:32 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/71e03e17c183 6757986: javax/swing/JInternalFrame/5066752/bug5066752.java needs correction Reviewed-by: serb, alexsch + test/javax/swing/JInternalFrame/5066752/bug5066752.java Changeset: 9fc7460ca3ac Author: lana Date: 2012-12-14 11:22 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/9fc7460ca3ac Merge Changeset: de6b54a60d60 Author: lana Date: 2012-12-14 13:14 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/de6b54a60d60 Merge ! makefiles/CompileNativeLibraries.gmk - src/share/lib/security/java.security - test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshall.java Changeset: e515956879cd Author: lana Date: 2012-12-18 18:14 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e515956879cd Merge From Ulf.Zibis at CoSoCo.de Wed Dec 19 03:38:11 2012 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Wed, 19 Dec 2012 04:38:11 +0100 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50D0C652.3080500@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> <50CB33FE.7000605@CoSoCo.de> <50CB9CF5.4090300@oracle.com> <50CBC7D0.9050103@CoSoCo.de> <50CBD110.1080208@oracle.com> <50CBD2BF.90100@oracle.com> <50CF38F2.6040707@oracle.com> <50CF44A7.8000202@CoSoCo.de> <50CFEDFC.5060903@oracle.com> <50D0A286.3040309@CoSoCo.de> <50D0C652.3080500@oracle.com> Message-ID: <50D136A3.3020909@CoSoCo.de> Am 18.12.2012 20:38, schrieb Mandy Chung: > I don't like dealing with Windows paths either. > > One use case we expect that one may take the -classpath option that may have a long list of paths > from the script for launching the application and pass it to jdeps. That means jdeps would have > to support both Windows paths as well as Unix paths. It's a reasonable enhancement that we can > consider later. I'd really like to get this out in the next few days. Yes, was just an additional thought. > You meant http://docs.oracle.com/javase/8/docs/technotes/tools/windows/jdeps.html :-) Correct :-) -Ulf From huizhe.wang at oracle.com Wed Dec 19 04:13:25 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Tue, 18 Dec 2012 20:13:25 -0800 Subject: RFR: (jaxp) 8003261 : static field is public but not final In-Reply-To: <50D12FB7.9060904@oracle.com> References: <50D02D8E.4000204@oracle.com> <50D0ACB8.5010503@oracle.com> <50D0FF93.8080701@oracle.com> <50D124B0.2070501@oracle.com> <50D12FB7.9060904@oracle.com> Message-ID: <50D13EE5.1080208@oracle.com> On 12/18/2012 7:08 PM, David Holmes wrote: > On 19/12/2012 12:21 PM, Joe Wang wrote: >> On 12/18/2012 3:43 PM, David Holmes wrote: >>> On 19/12/2012 3:49 AM, Tom Hawtin wrote: >>>> Not that it's particularly important, but it's /possible/ clients are >>>> relying on the non-compile time constant nature of this field >>>> causing it >>>> not to be inlined into client class files, rather than the ability to >>>> switch the version string. So it may be a good idea to add the final, >>>> but make it a non-compile time constant. We can also remove the >>>> duplication. >>> >>> I think that is an excellent point Tom. We should avoid turning the >>> static field into a compile-time constant. >>> >>> And get rid of the unnecessary fImmutableVersion which everyone keeps >>> overlooking. >> >> With the following change, at least there's no duplicate literal version >> strings anymore. Or did you mean we should get rid of >> fImmutableVersionand have getVresion return a liberal string? > > I did mean to get rid of the fImmutableVersion field. But it's no big > deal. Ok, thanks. Joe > > David > > >> Joe >> >>> >>> David >>> >>>> >>>> public static final String fVersion = getVersion(); >>>> >>>> Tom >>>> >>>> On 18/12/2012 08:47, Joe Wang wrote: >>>>> Hi, >>>>> >>>>> This is the 2nd of the three [findbug] issues. The field fVersion is >>>>> simply made final. >>>>> >>>>> webrev: >>>>> http://cr.openjdk.java.net/~joehw/jdk8/8003261/webrev/ >>>>> >>>>> Test: >>>>> No new test needed. >>>>> >>>>> Thanks, >>>>> Joe >>>> From huizhe.wang at oracle.com Wed Dec 19 05:08:38 2012 From: huizhe.wang at oracle.com (huizhe.wang at oracle.com) Date: Wed, 19 Dec 2012 05:08:38 +0000 Subject: hg: jdk8/tl/jaxp: 8003261: static field is public but not final Message-ID: <20121219050843.538F84726A@hg.openjdk.java.net> Changeset: 15b32367b23c Author: joehw Date: 2012-12-18 21:11 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/15b32367b23c 8003261: static field is public but not final Summary: add final to fVersion field, and make it a non-compile time constant. Reviewed-by: hawtin, lancea, dholmes, chegar ! src/com/sun/org/apache/xerces/internal/impl/Version.java From alexey.utkin at oracle.com Wed Dec 19 08:26:53 2012 From: alexey.utkin at oracle.com (Alexey Utkin) Date: Wed, 19 Dec 2012 12:26:53 +0400 Subject: RFR: [jdk7u-dev] - 8003898: X11 toolkit can be chosen as the default toolkit In-Reply-To: <50CF689A.6090905@oracle.com> References: <50CF689A.6090905@oracle.com> Message-ID: <50D17A4D.9000402@oracle.com> Looks good for me. On 17.12.2012 22:46, Rob McKenna wrote: > Hi folks, > > This review contains: > > 8003898: X11 toolkit can be chosen as the default toolkit > 7162111: TEST_BUG: change tests run in headless mode [macosx] (open) > 8004928: TEST_BUG: Reduce dependence of CoreLib tests from the AWT > subsystem > > Unfortunately the last two patches didn't apply cleanly, hence the > review request. (the commit comments will be altered appropriately > before integration) > > Webrev at: > > http://cr.openjdk.java.net/~robm/7162111/webrev.01/ > > > I've just submitted a test job so I'll integrate once I get a review > and a clean bill of health from that. > > -Rob From Alan.Bateman at oracle.com Wed Dec 19 08:32:06 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 19 Dec 2012 08:32:06 +0000 Subject: RFR: [jdk7u-dev] - 8003898: X11 toolkit can be chosen as the default toolkit In-Reply-To: <50CF689A.6090905@oracle.com> References: <50CF689A.6090905@oracle.com> Message-ID: <50D17B86.2050005@oracle.com> On 17/12/2012 18:46, Rob McKenna wrote: > Hi folks, > > This review contains: > > 8003898: X11 toolkit can be chosen as the default toolkit > 7162111: TEST_BUG: change tests run in headless mode [macosx] (open) > 8004928: TEST_BUG: Reduce dependence of CoreLib tests from the AWT > subsystem > > Unfortunately the last two patches didn't apply cleanly, hence the > review request. (the commit comments will be altered appropriately > before integration) > > Webrev at: > > http://cr.openjdk.java.net/~robm/7162111/webrev.01/ > 8003898 is important to get into jdk7u, but I don't think 7162111 or 8004928 is really needed there. -Alan From peter.levart at gmail.com Wed Dec 19 09:01:19 2012 From: peter.levart at gmail.com (Peter Levart) Date: Wed, 19 Dec 2012 10:01:19 +0100 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D10BC3.3020504@oracle.com> References: <50D0D55C.5040900@oracle.com> <50D0DE3F.6060604@oracle.com> <50D0EF1A.4080303@oracle.com> <50D10658.7010200@oracle.com> <50D10753.6060700@oracle.com> <50D10861.3000202@oracle.com> <50D1095B.4090805@oracle.com> <50D10BC3.3020504@oracle.com> Message-ID: <50D1825F.6090608@gmail.com> On 12/19/2012 01:35 AM, David Holmes wrote: > On 19/12/2012 10:24 AM, Joe Darcy wrote: >> On 12/18/2012 04:20 PM, David Holmes wrote: >>> On 19/12/2012 10:16 AM, Joe Darcy wrote: >>>> On 12/18/2012 04:12 PM, David Holmes wrote: >>>>> On 19/12/2012 8:40 AM, Louis Wasserman wrote: >>>>>> It's not 100% obvious to me whether this refers to a default >>>>>> implementation >>>>>> in an interface, a class which inherits that default implementation >>>>>> and does not override it, or both. Is that worth clarifying in >>>>>> the doc, >>>>>> rather than forcing readers to check the JLS citation? >>>>> >>>>> The issue is where you obtained this Method reference from: >>>>> >>>>> - from the Interface? then it is a default method >>>>> - from a class implementing the interface but not redefining the >>>>> method? then it is a default method >>>> >>>> Actually, that is *now* how HotSpot represents this case in core >>>> reflection at the moment. HotSpot uses a new method object to >>>> represent >>>> the default method woven into an implementing class. >>> >>> *now* -> *not* ?? >> >> Correct. >> >>> >>> It may be a new Method object but getDeclaringClass() should give the >>> interface class NOT the concrete class. That is currently the case for >>> abstract interface methods. I hope it is the same for default methods! >> >> It is not at the moment, which is a bit surprising. > > Very surprising! I'd call that a major bug. Not only default methods, also abstract interface methods show-up in the implementing class's declared methods. For example the following test: public class DefaultMethodsTest { public interface I { void i(); default void d() { } } public abstract static class S { public abstract void a(); public void s() { } } public abstract static class C extends S implements I { public void c() { } } public static void main(String[] args) { for (Method m : C.class.getDeclaredMethods()) System.out.println(m.getName()); } } prints: c i d Regards, Peter > > David > ----- > > >> -Joe From peter.levart at gmail.com Wed Dec 19 09:19:54 2012 From: peter.levart at gmail.com (Peter Levart) Date: Wed, 19 Dec 2012 10:19:54 +0100 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D1825F.6090608@gmail.com> References: <50D0D55C.5040900@oracle.com> <50D0DE3F.6060604@oracle.com> <50D0EF1A.4080303@oracle.com> <50D10658.7010200@oracle.com> <50D10753.6060700@oracle.com> <50D10861.3000202@oracle.com> <50D1095B.4090805@oracle.com> <50D10BC3.3020504@oracle.com> <50D1825F.6090608@gmail.com> Message-ID: <50D186BA.9050700@gmail.com> On 12/19/2012 10:01 AM, Peter Levart wrote: > On 12/19/2012 01:35 AM, David Holmes wrote: >> On 19/12/2012 10:24 AM, Joe Darcy wrote: >>> On 12/18/2012 04:20 PM, David Holmes wrote: >>>> On 19/12/2012 10:16 AM, Joe Darcy wrote: >>>>> On 12/18/2012 04:12 PM, David Holmes wrote: >>>>>> On 19/12/2012 8:40 AM, Louis Wasserman wrote: >>>>>>> It's not 100% obvious to me whether this refers to a default >>>>>>> implementation >>>>>>> in an interface, a class which inherits that default implementation >>>>>>> and does not override it, or both. Is that worth clarifying in >>>>>>> the doc, >>>>>>> rather than forcing readers to check the JLS citation? >>>>>> >>>>>> The issue is where you obtained this Method reference from: >>>>>> >>>>>> - from the Interface? then it is a default method >>>>>> - from a class implementing the interface but not redefining the >>>>>> method? then it is a default method >>>>> >>>>> Actually, that is *now* how HotSpot represents this case in core >>>>> reflection at the moment. HotSpot uses a new method object to >>>>> represent >>>>> the default method woven into an implementing class. >>>> >>>> *now* -> *not* ?? >>> >>> Correct. >>> >>>> >>>> It may be a new Method object but getDeclaringClass() should give the >>>> interface class NOT the concrete class. That is currently the case for >>>> abstract interface methods. I hope it is the same for default methods! >>> >>> It is not at the moment, which is a bit surprising. >> >> Very surprising! I'd call that a major bug. > > Not only default methods, also abstract interface methods show-up in > the implementing class's declared methods. For example the following > test: > > public class DefaultMethodsTest { > public interface I { > void i(); > default void d() { } > } > > public abstract static class S { > public abstract void a(); > public void s() { } > } > > public abstract static class C extends S implements I { > public void c() { } > } > > public static void main(String[] args) { > for (Method m : C.class.getDeclaredMethods()) > System.out.println(m.getName()); > } > } > > > prints: > > c > i > d > ...but only if there *is* a default method in interface. The following test: public class DefaultMethodsTest { public interface I { void i(); // default void d() { } } public abstract static class S { public abstract void a(); public void s() { } } public abstract static class C extends S implements I { public void c() { } } public static void main(String[] args) { for (Method m : C.class.getDeclaredMethods()) System.out.println(m.getName()); } } prints only: c > > Regards, Peter > >> >> David >> ----- >> >> >>> -Joe > From peter.levart at gmail.com Wed Dec 19 09:34:36 2012 From: peter.levart at gmail.com (Peter Levart) Date: Wed, 19 Dec 2012 10:34:36 +0100 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D1825F.6090608@gmail.com> References: <50D0D55C.5040900@oracle.com> <50D0DE3F.6060604@oracle.com> <50D0EF1A.4080303@oracle.com> <50D10658.7010200@oracle.com> <50D10753.6060700@oracle.com> <50D10861.3000202@oracle.com> <50D1095B.4090805@oracle.com> <50D10BC3.3020504@oracle.com> <50D1825F.6090608@gmail.com> Message-ID: <50D18A2C.3080700@gmail.com> Hi Joe, I think that besides this bug, also the Class.privateGetPublicMethods() will need to be revised. Currently it suppresses any methods from direct interfaces that either: - have a non-abstract method with same signature in a superclass - have an abstract or non-abstract method with same signature in this class Now because of the class-always-wins rule, an abstract method from a superclass that is declared in a class (not interface) also has to suppress any default method coming from any direct interface, don't you think? Regards, Peter On 12/19/2012 10:01 AM, Peter Levart wrote: > On 12/19/2012 01:35 AM, David Holmes wrote: >> On 19/12/2012 10:24 AM, Joe Darcy wrote: >>> On 12/18/2012 04:20 PM, David Holmes wrote: >>>> On 19/12/2012 10:16 AM, Joe Darcy wrote: >>>>> On 12/18/2012 04:12 PM, David Holmes wrote: >>>>>> On 19/12/2012 8:40 AM, Louis Wasserman wrote: >>>>>>> It's not 100% obvious to me whether this refers to a default >>>>>>> implementation >>>>>>> in an interface, a class which inherits that default implementation >>>>>>> and does not override it, or both. Is that worth clarifying in >>>>>>> the doc, >>>>>>> rather than forcing readers to check the JLS citation? >>>>>> >>>>>> The issue is where you obtained this Method reference from: >>>>>> >>>>>> - from the Interface? then it is a default method >>>>>> - from a class implementing the interface but not redefining the >>>>>> method? then it is a default method >>>>> >>>>> Actually, that is *now* how HotSpot represents this case in core >>>>> reflection at the moment. HotSpot uses a new method object to >>>>> represent >>>>> the default method woven into an implementing class. >>>> >>>> *now* -> *not* ?? >>> >>> Correct. >>> >>>> >>>> It may be a new Method object but getDeclaringClass() should give the >>>> interface class NOT the concrete class. That is currently the case for >>>> abstract interface methods. I hope it is the same for default methods! >>> >>> It is not at the moment, which is a bit surprising. >> >> Very surprising! I'd call that a major bug. > > Not only default methods, also abstract interface methods show-up in > the implementing class's declared methods. For example the following > test: > > public class DefaultMethodsTest { > public interface I { > void i(); > default void d() { } > } > > public abstract static class S { > public abstract void a(); > public void s() { } > } > > public abstract static class C extends S implements I { > public void c() { } > } > > public static void main(String[] args) { > for (Method m : C.class.getDeclaredMethods()) > System.out.println(m.getName()); > } > } > > > prints: > > c > i > d > > > Regards, Peter > >> >> David >> ----- >> >> >>> -Joe > From daniel.fuchs at oracle.com Wed Dec 19 09:45:36 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Wed, 19 Dec 2012 10:45:36 +0100 Subject: RFR: javax.xml.stream: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D0F803.9070208@oracle.com> References: <50CF59DF.2040006@oracle.com> <50D08508.3040903@oracle.com> <50D09C4D.9030404@oracle.com> <50D0A816.7010201@oracle.com> <50D0AF49.5030505@oracle.com> <50D0BD64.2090502@oracle.com> <50D0ECF5.3020205@oracle.com> <50D0F803.9070208@oracle.com> Message-ID: <50D18CC0.3080308@oracle.com> On 12/19/12 12:10 AM, Joe Wang wrote: > It's different. If 'foo.bar' is specified but not found, it indicates > a configuration error. If the factory falls back to an impl by the > default factory id, it would serve to hide the error. Yes - I fully agree with that. > Note that newInstance/newFactory with a factoryId parameter do not > fall back to the default implementation. Ahh! Yes I missed that. When called from newInstance with a factoryId parameter the fallbackClassname parameter is null... So should we still call ServiceLoader when fallbackClassname is null and factoryId is type.getName()? It would be more backward compatible - since previously it was looking in the jars and found (valid) providers registered with that name. On the other hand we could alter the spec to say that if no property with the factoryId name is found - then no fallback loading is perform (either on ServiceLoader or system-default implementation) and an error is thrown. -- daniel From jonathan.gibbons at oracle.com Wed Dec 19 11:35:36 2012 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Wed, 19 Dec 2012 11:35:36 +0000 Subject: hg: jdk8/tl/langtools: 8004833: Integrate doclint support into javac Message-ID: <20121219113546.777424727F@hg.openjdk.java.net> Changeset: 67b01d295cd2 Author: jjg Date: 2012-12-19 11:29 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/67b01d295cd2 8004833: Integrate doclint support into javac Reviewed-by: mcimadamore ! src/share/classes/com/sun/tools/javac/main/Main.java ! src/share/classes/com/sun/tools/javac/main/Option.java ! src/share/classes/com/sun/tools/javac/resources/javac.properties + test/tools/javac/doclint/DocLintTest.java From peter.levart at gmail.com Wed Dec 19 12:13:40 2012 From: peter.levart at gmail.com (Peter Levart) Date: Wed, 19 Dec 2012 13:13:40 +0100 Subject: JDK 8 code review request for 8005042 Add Method.isDefault to core reflection In-Reply-To: <50D18A2C.3080700@gmail.com> References: <50D0D55C.5040900@oracle.com> <50D0DE3F.6060604@oracle.com> <50D0EF1A.4080303@oracle.com> <50D10658.7010200@oracle.com> <50D10753.6060700@oracle.com> <50D10861.3000202@oracle.com> <50D1095B.4090805@oracle.com> <50D10BC3.3020504@oracle.com> <50D1825F.6090608@gmail.com> <50D18A2C.3080700@gmail.com> Message-ID: <50D1AF74.2050800@gmail.com> Hi Joe, Also, now studying the logic of Class.privateGetPublicMethods(), I don't quite get the reasoning behind current implementation regardless of default interface methods. The javadoc for Class.getMethods() is not very precise about what happens with multiple public methods with same signature coming from superclass and interfaces. Take for example the following program: public class MethodsTest { public interface I { void m(); } public interface J { void m(); } public abstract static class S implements I, J { public abstract void m(); } public abstract static class C extends S { } public abstract static class D extends S implements I, J { } static String toString(Class clazz, Method[] methods) { StringBuilder sb = new StringBuilder(clazz.getSimpleName()).append(":"); for (Method m : methods) { if (m.getDeclaringClass() != Object.class) { sb.append(" ") .append(m.getDeclaringClass().getSimpleName()) .append(".") .append(m.getName()); } } return sb.toString(); } public static void main(String[] args) { System.out.println("\ndeclaredMethods:\n"); System.out.println(toString(I.class, I.class.getDeclaredMethods())); System.out.println(toString(J.class, J.class.getDeclaredMethods())); System.out.println(toString(S.class, S.class.getDeclaredMethods())); System.out.println(toString(C.class, C.class.getDeclaredMethods())); System.out.println(toString(D.class, D.class.getDeclaredMethods())); System.out.println("\nmethods:\n"); System.out.println(toString(I.class, I.class.getMethods())); System.out.println(toString(J.class, J.class.getMethods())); System.out.println(toString(S.class, S.class.getMethods())); System.out.println(toString(C.class, C.class.getMethods())); System.out.println(toString(D.class, D.class.getMethods())); } } which prints: declaredMethods: I: I.m J: J.m S: S.m C: D: methods: I: I.m J: J.m S: S.m C: S.m D: S.m I.m J.m So current logic is such that abstract methods on this Class knock-out interface (abstract) methods, but abstract methods on superclass don't. In particular, I don't understand the reasoning behind the difference of results of C.class.getMethods() and D.class.getMethods(). I think that the consistent logic would be to play the class-always-wins rule for abstract methods too and always knock-out any interface methods (abstract or default) that have the same signature as a method, coming from a superclass.privateGetPublicMethods() and which is declared in a class (not interface) regardless of whether it is abstract or not. Such logic would still be in line with the search logic specified by Class.getMethod(name, parameterTypes). Regards, Peter On 12/19/2012 10:34 AM, Peter Levart wrote: > Hi Joe, > > I think that besides this bug, also the > Class.privateGetPublicMethods() will need to be revised. Currently it > suppresses any methods from direct interfaces that either: > - have a non-abstract method with same signature in a superclass > - have an abstract or non-abstract method with same signature in this > class > > Now because of the class-always-wins rule, an abstract method from a > superclass that is declared in a class (not interface) also has to > suppress any default method coming from any direct interface, don't > you think? > > Regards, Peter > > On 12/19/2012 10:01 AM, Peter Levart wrote: >> On 12/19/2012 01:35 AM, David Holmes wrote: >>> On 19/12/2012 10:24 AM, Joe Darcy wrote: >>>> On 12/18/2012 04:20 PM, David Holmes wrote: >>>>> On 19/12/2012 10:16 AM, Joe Darcy wrote: >>>>>> On 12/18/2012 04:12 PM, David Holmes wrote: >>>>>>> On 19/12/2012 8:40 AM, Louis Wasserman wrote: >>>>>>>> It's not 100% obvious to me whether this refers to a default >>>>>>>> implementation >>>>>>>> in an interface, a class which inherits that default >>>>>>>> implementation >>>>>>>> and does not override it, or both. Is that worth clarifying in >>>>>>>> the doc, >>>>>>>> rather than forcing readers to check the JLS citation? >>>>>>> >>>>>>> The issue is where you obtained this Method reference from: >>>>>>> >>>>>>> - from the Interface? then it is a default method >>>>>>> - from a class implementing the interface but not redefining the >>>>>>> method? then it is a default method >>>>>> >>>>>> Actually, that is *now* how HotSpot represents this case in core >>>>>> reflection at the moment. HotSpot uses a new method object to >>>>>> represent >>>>>> the default method woven into an implementing class. >>>>> >>>>> *now* -> *not* ?? >>>> >>>> Correct. >>>> >>>>> >>>>> It may be a new Method object but getDeclaringClass() should give the >>>>> interface class NOT the concrete class. That is currently the case >>>>> for >>>>> abstract interface methods. I hope it is the same for default >>>>> methods! >>>> >>>> It is not at the moment, which is a bit surprising. >>> >>> Very surprising! I'd call that a major bug. >> >> Not only default methods, also abstract interface methods show-up in >> the implementing class's declared methods. For example the following >> test: >> >> public class DefaultMethodsTest { >> public interface I { >> void i(); >> default void d() { } >> } >> >> public abstract static class S { >> public abstract void a(); >> public void s() { } >> } >> >> public abstract static class C extends S implements I { >> public void c() { } >> } >> >> public static void main(String[] args) { >> for (Method m : C.class.getDeclaredMethods()) >> System.out.println(m.getName()); >> } >> } >> >> >> prints: >> >> c >> i >> d >> >> >> Regards, Peter >> >>> >>> David >>> ----- >>> >>> >>>> -Joe >> > From dl at cs.oswego.edu Wed Dec 19 14:07:55 2012 From: dl at cs.oswego.edu (Doug Lea) Date: Wed, 19 Dec 2012 09:07:55 -0500 Subject: RFR 7175464 problems Message-ID: <50D1CA3B.90206@cs.oswego.edu> I ran some of our j.u.c tck tests on lambda builds. Our tests included some for TreeMap because it was updated via jsr166 when NavigableMaps were introduced. I noticed a failure due to: 7175464 : entrySetView field is never updated in NavigableSubMap http://cr.openjdk.java.net/~mduigou/7175464/0/webrev/ Sorry I hadn't paid attention to this when first posted. The failure is pasted below, and shows one reason that entrySetViews were not by default cached. testDescendingSerialization(TreeSubSetTest)junit.framework.AssertionFailedError: expected:<[-1, -2, -3, -4, -5]> but was:<[-1, -2, -3, -4, -5]> at TreeSubSetTest.testDescendingSerialization(TreeSubSetTest.java:981) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at JSR166TestCase.runTest(JSR166TestCase.java:132) at JSR166TestCase.main(JSR166TestCase.java:160) Test code is at: http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/test/tck/TreeSubSetTest.java?view=log From daniel.fuchs at oracle.com Wed Dec 19 14:34:37 2012 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Wed, 19 Dec 2012 15:34:37 +0100 Subject: RFR: javax.xml.transform: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D0E7DE.4020903@oracle.com> References: <50D09CFE.6000303@oracle.com> <50D0CCB0.2060703@oracle.com> <50D0E7DE.4020903@oracle.com> Message-ID: <50D1D07D.1010600@oracle.com> Hi, Please find below an updated webrev for the javax.xml.transform package, taking into account Mandy's & Joe's comments - namely: 1. Fixed call to creationMethod.invoke. 2. Got rid of the 4 args FactoryFinder.newInstance method. 3. Got rid of the useBSClsLoader which was always passed as 'false'. (thanks Mandy!) -- daniel On 12/18/12 11:02 PM, Daniel Fuchs wrote: > On 12/18/12 9:06 PM, Mandy Chung wrote: >> In FactoryFinder.newInstanceNoServiceLoader method, L223, 226 - >> NoSuchMethodException will be thrown if such method doesn't exist. >> creationMethod will not be null. > Thanks - yes - you're right of course - no need to check for null... >> L236 - this change is not needed, right? The method is a static >> no-arg method. You passed an additional argument creationMethod as the >> first parameter although it's harmless as it's ignored. > Oops - my bad. That's a mistake - I did too many successive changes - > should be creationMethod.invoke(null) of course. > And my tests didn't even catch it! >> >> A minor comment: >> 151 static T newInstance(Class type, String className, >> ClassLoader cl, boolean doFallback) >> 152 throws TransformerFactoryConfigurationError >> 153 { >> 154 return newInstance(type, className, cl, doFallback, >> false, false); >> 155 } >> >> The FactoryFinder.newInstance method 4-argument version is only called by >> TransformerFactory.newInstance(String factoryClassName, ClassLoader >> classLoader). >> Perhaps you can clean this up TransformerFactory to call the >> Factory.newInstance >> method 6-argument version. > 3 successive boolean parameters... I hate that ;-) Yes I think I can do > this cleanup... > > Thanks Mandy, > > -- daniel > >> >> Thanks >> Mandy > From alan.bateman at oracle.com Wed Dec 19 15:02:49 2012 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Wed, 19 Dec 2012 15:02:49 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20121219150313.2B43C47287@hg.openjdk.java.net> Changeset: 3fd3bcc8bd42 Author: joehw Date: 2012-12-19 12:09 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/3fd3bcc8bd42 8004371: (props) Properties.loadFromXML needs small footprint XML parser as fallback when JAXP is not present Reviewed-by: alanb, mchung, psandoz + src/share/classes/jdk/internal/org/xml/sax/Attributes.java + src/share/classes/jdk/internal/org/xml/sax/ContentHandler.java + src/share/classes/jdk/internal/org/xml/sax/DTDHandler.java + src/share/classes/jdk/internal/org/xml/sax/EntityResolver.java + src/share/classes/jdk/internal/org/xml/sax/ErrorHandler.java + src/share/classes/jdk/internal/org/xml/sax/InputSource.java + src/share/classes/jdk/internal/org/xml/sax/Locator.java + src/share/classes/jdk/internal/org/xml/sax/SAXException.java + src/share/classes/jdk/internal/org/xml/sax/SAXNotRecognizedException.java + src/share/classes/jdk/internal/org/xml/sax/SAXNotSupportedException.java + src/share/classes/jdk/internal/org/xml/sax/SAXParseException.java + src/share/classes/jdk/internal/org/xml/sax/XMLReader.java + src/share/classes/jdk/internal/org/xml/sax/helpers/DefaultHandler.java + src/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java + src/share/classes/jdk/internal/util/xml/SAXParser.java + src/share/classes/jdk/internal/util/xml/XMLStreamException.java + src/share/classes/jdk/internal/util/xml/XMLStreamWriter.java + src/share/classes/jdk/internal/util/xml/impl/Attrs.java + src/share/classes/jdk/internal/util/xml/impl/Input.java + src/share/classes/jdk/internal/util/xml/impl/Pair.java + src/share/classes/jdk/internal/util/xml/impl/Parser.java + src/share/classes/jdk/internal/util/xml/impl/ParserSAX.java + src/share/classes/jdk/internal/util/xml/impl/ReaderUTF16.java + src/share/classes/jdk/internal/util/xml/impl/ReaderUTF8.java + src/share/classes/jdk/internal/util/xml/impl/SAXParserImpl.java + src/share/classes/jdk/internal/util/xml/impl/XMLStreamWriterImpl.java + src/share/classes/jdk/internal/util/xml/impl/XMLWriter.java Changeset: cf15abdcdf88 Author: alanb Date: 2012-12-19 14:53 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/cf15abdcdf88 8005248: (props) Integrate small footprint parser into Properties Reviewed-by: joehw, mchung, psandoz, erikj ! make/jdk/Makefile - make/jdk/asm/Makefile ! src/share/classes/java/util/Properties.java + src/share/classes/jdk/internal/util/xml/BasicXmlPropertiesProvider.java ! test/java/util/Properties/LoadAndStoreXML.java + test/java/util/Properties/invalidxml/BadCase.xml + test/java/util/Properties/invalidxml/BadDocType.xml.excluded + test/java/util/Properties/invalidxml/NoClosingTag.xml + test/java/util/Properties/invalidxml/NoDocType.xml.excluded + test/java/util/Properties/invalidxml/NoRoot.xml + test/java/util/Properties/invalidxml/NotQuoted.xml + test/java/util/Properties/invalidxml/README.txt From jonathan.gibbons at oracle.com Wed Dec 19 17:09:26 2012 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Wed, 19 Dec 2012 17:09:26 +0000 Subject: hg: jdk8/tl/langtools: 8005098: Provide isSynthesized() information on Attribute.Compound Message-ID: <20121219170928.A9A404728F@hg.openjdk.java.net> Changeset: f72c9c5aeaef Author: jfranck Date: 2012-12-16 11:09 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/f72c9c5aeaef 8005098: Provide isSynthesized() information on Attribute.Compound Reviewed-by: jjg ! make/build.properties ! src/share/classes/com/sun/tools/javac/code/Attribute.java ! src/share/classes/com/sun/tools/javac/code/Symbol.java ! src/share/classes/com/sun/tools/javac/comp/Annotate.java ! src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java ! src/share/classes/com/sun/tools/javac/tree/TreeMaker.java ! src/share/classes/com/sun/tools/javadoc/PackageDocImpl.java ! src/share/classes/com/sun/tools/javadoc/ParameterImpl.java ! src/share/classes/com/sun/tools/javadoc/ProgramElementDocImpl.java From Alan.Bateman at oracle.com Wed Dec 19 17:19:41 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 19 Dec 2012 17:19:41 +0000 Subject: Review request: 8003562: Provide a command-line tool to find static dependencies In-Reply-To: <50D0F867.80100@oracle.com> References: <50B54A2C.1040907@oracle.com> <50BFF69E.1040805@oracle.com> <50C265D8.3050107@oracle.com> <50C5B9B2.2050705@oracle.com> <50CA6DA1.1070004@oracle.com> <50CA8BB1.1030502@oracle.com> <50CB03D1.5030400@CoSoCo.de> <50CB33FE.7000605@CoSoCo.de> <50CB9CF5.4090300@oracle.com> <50CBC7D0.9050103@CoSoCo.de> <50CBD110.1080208@oracle.com> <50CBD2BF.90100@oracle.com> <50CF38F2.6040707@oracle.com> <50CF44A7.8000202@CoSoCo.de> <50CFEDFC.5060903@oracle.com> <50D0A286.3040309@CoSoCo.de> <50D0C652.3080500@oracle.com> <50D0F867.80100@oracle.com> Message-ID: <50D1F72D.3080107@oracle.com> On 18/12/2012 23:12, Mandy Chung wrote: > : > > We can enhance the tool after the initial push. I'd like to get it > in jdk8 soon so that developers can try it out and give feedback. Thanks for the update, I think it looks very good. I agree we should get this in so that people can try it out and send feedback. -Alan From jviswana at linux.vnet.ibm.com Wed Dec 19 17:33:50 2012 From: jviswana at linux.vnet.ibm.com (jayashree viswanathan) Date: Wed, 19 Dec 2012 23:03:50 +0530 Subject: Review Request : Java exe doesn't process args ending Back slash In-Reply-To: <50D1F3D7.20608@linux.vnet.ibm.com> References: <50D1F3D7.20608@linux.vnet.ibm.com> Message-ID: <50D1FA7E.8040609@linux.vnet.ibm.com> Hi All, Java.exe doesn't seems to process arguments ending with back slashes well , in windows only . I have added test scenario and changeset in the below webrev . http://cr.openjdk.java.net/~jviswana/7188114/webrev.01/ This seems to be introduced after the bug fix for 7188114 has be made into jdk8 . Thanks and Regards, Jayashree Viswanathan From aleksey.shipilev at oracle.com Wed Dec 19 17:48:20 2012 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Wed, 19 Dec 2012 21:48:20 +0400 Subject: java.nio.*Buffer read/write atomicity Message-ID: <50D1FDE4.2020708@oracle.com> Hi guys, I wanted to cross-check what's the expected behavior of Buffers with respect to atomicity? Don't confuse the atomic operations (a la j.u.c.atomic.*) and the read/write atomicity. Here's the concrete example, should the assert always be true? ByteBuffer buf = ByteBuffer.allocate(100); (publish $buf to both threads properly) (start both threads) Thread 1: buf.putInt(0, 42); // at position 0 Thread 2: int i = buf.getInt(0); // at position 0 Assert.assertTrue( (i == 0) || (i == 42) ) Javadoc is silent about that, except for noting Buffers are not supposed to be used from the multiple threads without synchronization. I would anyway advocate to follow the atomicity behavior of plain fields and arrays, and make these reads/writes atomic under the race. The apparent reason for at least BB to fail to be atomic is that we read/write larger values byte-by-byte. Luckily, it appears to be easy to fix (for a given endianness, we can just throw in the Unsafe call). Before going out and submitting the RFE, I wanted to crosscheck if somebody has strong feelings about this. Thanks, Aleksey. From kumar.x.srinivasan at oracle.com Wed Dec 19 18:37:20 2012 From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan) Date: Wed, 19 Dec 2012 10:37:20 -0800 Subject: Review Request : Java exe doesn't process args ending Back slash In-Reply-To: <50D1FA7E.8040609@linux.vnet.ibm.com> References: <50D1F3D7.20608@linux.vnet.ibm.com> <50D1FA7E.8040609@linux.vnet.ibm.com> Message-ID: <50D20960.8080300@oracle.com> Hello Jayashree, a. you are referencing a bug which has already been fixed, is there a new one for this ? b. with regards to the fix, I don't quite understand the issue, could you please provide a use case ? c. your regression test does not seem to be accurate it behaves the same with or without your fix, also you will need to provide a C++ test case in cmdtoargs.c as well see the bottom of that file. Thanks Kumar > > > Hi All, > > Java.exe doesn't seems to process arguments ending with back slashes > well , in windows only . > > I have added test scenario and changeset in the below webrev . > > http://cr.openjdk.java.net/~jviswana/7188114/webrev.01/ > > This seems to be introduced after the bug fix for 7188114 has be made > into jdk8 . > > Thanks and Regards, > Jayashree Viswanathan > > > > From mandy.chung at oracle.com Wed Dec 19 18:43:21 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 19 Dec 2012 10:43:21 -0800 Subject: RFR: javax.xml.transform: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D1D07D.1010600@oracle.com> References: <50D09CFE.6000303@oracle.com> <50D0CCB0.2060703@oracle.com> <50D0E7DE.4020903@oracle.com> <50D1D07D.1010600@oracle.com> Message-ID: <50D20AC9.2000407@oracle.com> On 12/19/2012 6:34 AM, Daniel Fuchs wrote: > > > Thanks for the update and it looks much better. FactoryFinder L214-215: this will swallow the new TransformerFactoryConfigurationError thrown at L210. Maybe you can explicitly catch CCE that rethrow TFCE. Nit: L189-190 needs some indentation and probably better to merge them in one line. Mandy From Alan.Bateman at oracle.com Wed Dec 19 18:45:22 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 19 Dec 2012 18:45:22 +0000 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: <50D1FDE4.2020708@oracle.com> References: <50D1FDE4.2020708@oracle.com> Message-ID: <50D20B42.8050903@oracle.com> On 19/12/2012 17:48, Aleksey Shipilev wrote: > Hi guys, > > I wanted to cross-check what's the expected behavior of Buffers with > respect to atomicity? Don't confuse the atomic operations (a la > j.u.c.atomic.*) and the read/write atomicity. Here's the concrete > example, should the assert always be true? > > ByteBuffer buf = ByteBuffer.allocate(100); > (publish $buf to both threads properly) > (start both threads) > > Thread 1: > buf.putInt(0, 42); // at position 0 > > Thread 2: > int i = buf.getInt(0); // at position 0 > Assert.assertTrue( (i == 0) || (i == 42) ) > > Javadoc is silent about that, except for noting Buffers are not supposed > to be used from the multiple threads without synchronization. I would > anyway advocate to follow the atomicity behavior of plain fields and > arrays, and make these reads/writes atomic under the race. > > The apparent reason for at least BB to fail to be atomic is that we > read/write larger values byte-by-byte. Luckily, it appears to be easy to > fix (for a given endianness, we can just throw in the Unsafe call). > Before going out and submitting the RFE, I wanted to crosscheck if > somebody has strong feelings about this. > On memory model rules then there is is an outstanding bug to update the buffer spec with at least minimal properties. Doug might remember the discussion with Dave Dice about this a few years ago. I've always meant to do it but it never got to the top of the list. That aside, I'm not aware of any discussion about the atomicity issue that you are concerned about now. As buffers are accessed directly in native code and by system calls then I think you would be limited to only specifying the put and get methods. -Alan. From huizhe.wang at oracle.com Wed Dec 19 18:56:28 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Wed, 19 Dec 2012 10:56:28 -0800 Subject: RFR: javax.xml.transform: Using ServiceLoader to load JAXP stream factories (7169894: JAXP Plugability Layer: using service loader) In-Reply-To: <50D1D07D.1010600@oracle.com> References: <50D09CFE.6000303@oracle.com> <50D0CCB0.2060703@oracle.com> <50D0E7DE.4020903@oracle.com> <50D1D07D.1010600@oracle.com> Message-ID: <50D20DDC.8040109@oracle.com> On 12/19/2012 6:34 AM, Daniel Fuchs wrote: > Hi, > > Please find below an updated webrev for the javax.xml.transform > package, taking into account Mandy's & Joe's comments - namely: > > 1. Fixed call to creationMethod.invoke. > > 2. Got rid of the 4 args FactoryFinder.newInstance method. > > 3. Got rid of the useBSClsLoader which was always passed as 'false'. > (thanks Mandy!) I agree with the change. Just to clarify, the only case where useBSClsLoader could be 'true' was in the old findJarServiceProvider method. There might be subtle things the ServiceLoader does that could be different from the findJarServiceProvider process. In both processes, ContextClassLoader is used first, then the old process would try the classloader of the finder class which is the bootclassloader. The ServiceLoader spec says: The ServiceLoader.load(service) is equivalent to ServiceLoader.load(service, Thread.currentThread().getContextClassLoader()) where "loader - The class loader to be used to load provider-configuration files and provider classes, or null if the system class loader (or, failing that, the bootstrap class loader) is to be used " So we need to make sure it works fine when ContextClassLoader is null, or ContextClassLoader's parent is not the app class loader. I think we have regression tests for the scenarios. Since you've run them, I don't see there's any problem. -Joe > > > > > > -- daniel > > On 12/18/12 11:02 PM, Daniel Fuchs wrote: >> On 12/18/12 9:06 PM, Mandy Chung wrote: >>> In FactoryFinder.newInstanceNoServiceLoader method, L223, 226 - >>> NoSuchMethodException will be thrown if such method doesn't exist. >>> creationMethod will not be null. >> Thanks - yes - you're right of course - no need to check for null... >>> L236 - this change is not needed, right? The method is a static >>> no-arg method. You passed an additional argument creationMethod as the >>> first parameter although it's harmless as it's ignored. >> Oops - my bad. That's a mistake - I did too many successive changes - >> should be creationMethod.invoke(null) of course. >> And my tests didn't even catch it! >>> >>> A minor comment: >>> 151 static T newInstance(Class type, String className, >>> ClassLoader cl, boolean doFallback) >>> 152 throws TransformerFactoryConfigurationError >>> 153 { >>> 154 return newInstance(type, className, cl, doFallback, >>> false, false); >>> 155 } >>> >>> The FactoryFinder.newInstance method 4-argument version is only >>> called by >>> TransformerFactory.newInstance(String factoryClassName, ClassLoader >>> classLoader). >>> Perhaps you can clean this up TransformerFactory to call the >>> Factory.newInstance >>> method 6-argument version. >> 3 successive boolean parameters... I hate that ;-) Yes I think I can do >> this cleanup... >> >> Thanks Mandy, >> >> -- daniel >> >>> >>> Thanks >>> Mandy >> > From aleksey.shipilev at oracle.com Wed Dec 19 18:56:34 2012 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Wed, 19 Dec 2012 22:56:34 +0400 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: <50D20B42.8050903@oracle.com> References: <50D1FDE4.2020708@oracle.com> <50D20B42.8050903@oracle.com> Message-ID: <50D20DE2.3070701@oracle.com> On 12/19/2012 10:45 PM, Alan Bateman wrote: > On memory model rules then there is is an outstanding bug to update the > buffer spec with at least minimal properties. Doug might remember the > discussion with Dave Dice about this a few years ago. I've always meant > to do it but it never got to the top of the list. Aha, thanks, Alan. Does anyone has the CR number handy? Searching through bugtrack has a lots of false hits. > That aside, I'm not aware of any discussion about the atomicity issue > that you are concerned about now. As buffers are accessed directly in > native code and by system calls then I think you would be limited to > only specifying the put and get methods. I don't think there are problems with full-width ops in non-BB implementations. The problematic area seems to be ByteBuffer allocated on heap. Direct ByteBuffer seems to be atomic. -Aleksey. From Alan.Bateman at oracle.com Wed Dec 19 19:02:36 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 19 Dec 2012 19:02:36 +0000 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: <50D20DE2.3070701@oracle.com> References: <50D1FDE4.2020708@oracle.com> <50D20B42.8050903@oracle.com> <50D20DE2.3070701@oracle.com> Message-ID: <50D20F4C.8030304@oracle.com> On 19/12/2012 18:56, Aleksey Shipilev wrote: > On 12/19/2012 10:45 PM, Alan Bateman wrote: >> On memory model rules then there is is an outstanding bug to update the >> buffer spec with at least minimal properties. Doug might remember the >> discussion with Dave Dice about this a few years ago. I've always meant >> to do it but it never got to the top of the list. > Aha, thanks, Alan. Does anyone has the CR number handy? Searching > through bugtrack has a lots of false hits. 6476827 >> That aside, I'm not aware of any discussion about the atomicity issue >> that you are concerned about now. As buffers are accessed directly in >> native code and by system calls then I think you would be limited to >> only specifying the put and get methods. > I don't think there are problems with full-width ops in non-BB > implementations. The problematic area seems to be ByteBuffer allocated > on heap. Direct ByteBuffer seems to be atomic. > I don't think we can make assumptions about the access to direct buffers because it's it may not go through the Buffer API. -Alan. From joe.darcy at oracle.com Wed Dec 19 19:19:20 2012 From: joe.darcy at oracle.com (Joe Darcy) Date: Wed, 19 Dec 2012 11:19:20 -0800 Subject: JDK 8 review request for 8005097 Tie isSynthetic javadoc to the JLS Message-ID: <50D21338.4090905@oracle.com> Hello, It has come to my attention recently that the various isSynthetic methods in core reflection cite the Java Language Specification, but do not reference a particular section. To remedy this, I've prepared a small patch to add "@jls" tags which cite the section in question: http://cr.openjdk.java.net/~darcy/8005097.0/ Inline patch file below. Thanks, -Joe --- old/src/share/classes/java/lang/Class.java 2012-12-19 11:11:40.000000000 -0800 +++ new/src/share/classes/java/lang/Class.java 2012-12-19 11:11:39.000000000 -0800 @@ -506,6 +506,7 @@ * returns {@code false} otherwise. * @return {@code true} if and only if this class is a synthetic class as * defined by the Java Language Specification. + * @jls 13.1 The Form of a Binary * @since 1.5 */ public boolean isSynthetic() { --- old/src/share/classes/java/lang/reflect/Constructor.java 2012-12-19 11:11:40.000000000 -0800 +++ new/src/share/classes/java/lang/reflect/Constructor.java 2012-12-19 11:11:40.000000000 -0800 @@ -411,6 +411,7 @@ /** * {@inheritDoc} + * @jls 13.1 The Form of a Binary * @since 1.5 */ @Override --- old/src/share/classes/java/lang/reflect/Executable.java 2012-12-19 11:11:40.000000000 -0800 +++ new/src/share/classes/java/lang/reflect/Executable.java 2012-12-19 11:11:40.000000000 -0800 @@ -324,6 +324,7 @@ * @return true if and only if this executable is a synthetic * construct as defined by * The Java™ Language Specification. + * @jls 13.1 The Form of a Binary */ public boolean isSynthetic() { return Modifier.isSynthetic(getModifiers()); --- old/src/share/classes/java/lang/reflect/Member.java 2012-12-19 11:11:41.000000000 -0800 +++ new/src/share/classes/java/lang/reflect/Member.java 2012-12-19 11:11:41.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2012, 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 @@ -87,6 +87,7 @@ * * @return true if and only if this member was introduced by * the compiler. + * @jls 13.1 The Form of a Binary * @since 1.5 */ public boolean isSynthetic(); --- old/src/share/classes/java/lang/reflect/Method.java 2012-12-19 11:11:41.000000000 -0800 +++ new/src/share/classes/java/lang/reflect/Method.java 2012-12-19 11:11:41.000000000 -0800 @@ -500,6 +500,7 @@ /** * {@inheritDoc} + * @jls 13.1 The Form of a Binary * @since 1.5 */ @Override From mike.duigou at oracle.com Wed Dec 19 19:38:45 2012 From: mike.duigou at oracle.com (Mike Duigou) Date: Wed, 19 Dec 2012 11:38:45 -0800 Subject: JDK 8 review request for 8005097 Tie isSynthetic javadoc to the JLS In-Reply-To: <50D21338.4090905@oracle.com> References: <50D21338.4090905@oracle.com> Message-ID: <26B97B6B-518C-4AC0-AD95-3AF1D6BEF82C@oracle.com> Thank you for adding these links. They look fine. Mike On Dec 19 2012, at 11:19 , Joe Darcy wrote: > Hello, > > It has come to my attention recently that the various isSynthetic methods in core reflection cite the Java Language Specification, but do not reference a particular section. To remedy this, I've prepared a small patch to add "@jls" tags which cite the section in question: > > http://cr.openjdk.java.net/~darcy/8005097.0/ > > Inline patch file below. > > Thanks, > > -Joe > > --- old/src/share/classes/java/lang/Class.java 2012-12-19 11:11:40.000000000 -0800 > +++ new/src/share/classes/java/lang/Class.java 2012-12-19 11:11:39.000000000 -0800 > @@ -506,6 +506,7 @@ > * returns {@code false} otherwise. > * @return {@code true} if and only if this class is a synthetic class as > * defined by the Java Language Specification. > + * @jls 13.1 The Form of a Binary > * @since 1.5 > */ > public boolean isSynthetic() { > --- old/src/share/classes/java/lang/reflect/Constructor.java 2012-12-19 11:11:40.000000000 -0800 > +++ new/src/share/classes/java/lang/reflect/Constructor.java 2012-12-19 11:11:40.000000000 -0800 > @@ -411,6 +411,7 @@ > > /** > * {@inheritDoc} > + * @jls 13.1 The Form of a Binary > * @since 1.5 > */ > @Override > --- old/src/share/classes/java/lang/reflect/Executable.java 2012-12-19 11:11:40.000000000 -0800 > +++ new/src/share/classes/java/lang/reflect/Executable.java 2012-12-19 11:11:40.000000000 -0800 > @@ -324,6 +324,7 @@ > * @return true if and only if this executable is a synthetic > * construct as defined by > * The Java™ Language Specification. > + * @jls 13.1 The Form of a Binary > */ > public boolean isSynthetic() { > return Modifier.isSynthetic(getModifiers()); > --- old/src/share/classes/java/lang/reflect/Member.java 2012-12-19 11:11:41.000000000 -0800 > +++ new/src/share/classes/java/lang/reflect/Member.java 2012-12-19 11:11:41.000000000 -0800 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 1996, 2012, 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 > @@ -87,6 +87,7 @@ > * > * @return true if and only if this member was introduced by > * the compiler. > + * @jls 13.1 The Form of a Binary > * @since 1.5 > */ > public boolean isSynthetic(); > --- old/src/share/classes/java/lang/reflect/Method.java 2012-12-19 11:11:41.000000000 -0800 > +++ new/src/share/classes/java/lang/reflect/Method.java 2012-12-19 11:11:41.000000000 -0800 > @@ -500,6 +500,7 @@ > > /** > * {@inheritDoc} > + * @jls 13.1 The Form of a Binary > * @since 1.5 > */ > @Override From joe.darcy at oracle.com Wed Dec 19 19:54:06 2012 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Wed, 19 Dec 2012 19:54:06 +0000 Subject: hg: jdk8/tl/jdk: 8005097: Tie isSynthetic javadoc to the JLS Message-ID: <20121219195417.F0A1D47295@hg.openjdk.java.net> Changeset: 1f9c19741285 Author: darcy Date: 2012-12-19 11:53 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/1f9c19741285 8005097: Tie isSynthetic javadoc to the JLS Reviewed-by: mduigou ! src/share/classes/java/lang/Class.java ! src/share/classes/java/lang/reflect/Constructor.java ! src/share/classes/java/lang/reflect/Executable.java ! src/share/classes/java/lang/reflect/Member.java ! src/share/classes/java/lang/reflect/Method.java From david.holmes at oracle.com Wed Dec 19 20:37:46 2012 From: david.holmes at oracle.com (David Holmes) Date: Thu, 20 Dec 2012 06:37:46 +1000 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: <50D1FDE4.2020708@oracle.com> References: <50D1FDE4.2020708@oracle.com> Message-ID: <50D2259A.4080806@oracle.com> Aleksey, If multiple threads have to synchronize access to the buffer then the reads/writes do not need to be atomic. Atomicity is only needed when data races are allowed. David On 20/12/2012 3:48 AM, Aleksey Shipilev wrote: > Hi guys, > > I wanted to cross-check what's the expected behavior of Buffers with > respect to atomicity? Don't confuse the atomic operations (a la > j.u.c.atomic.*) and the read/write atomicity. Here's the concrete > example, should the assert always be true? > > ByteBuffer buf = ByteBuffer.allocate(100); > (publish $buf to both threads properly) > (start both threads) > > Thread 1: > buf.putInt(0, 42); // at position 0 > > Thread 2: > int i = buf.getInt(0); // at position 0 > Assert.assertTrue( (i == 0) || (i == 42) ) > > Javadoc is silent about that, except for noting Buffers are not supposed > to be used from the multiple threads without synchronization. I would > anyway advocate to follow the atomicity behavior of plain fields and > arrays, and make these reads/writes atomic under the race. > > The apparent reason for at least BB to fail to be atomic is that we > read/write larger values byte-by-byte. Luckily, it appears to be easy to > fix (for a given endianness, we can just throw in the Unsafe call). > Before going out and submitting the RFE, I wanted to crosscheck if > somebody has strong feelings about this. > > Thanks, > Aleksey. From eric.mccorkle at oracle.com Wed Dec 19 22:43:43 2012 From: eric.mccorkle at oracle.com (Eric McCorkle) Date: Wed, 19 Dec 2012 17:43:43 -0500 Subject: Review request:Updated JDK-8004728 Implement core reflection API for parameter reflection Message-ID: <50D2431F.6030006@oracle.com> Hello, Please review the implementation of the core reflection API for method parameter reflection. This changeset introduces a new class, Parameter, which represents information about method parameters. It introduces a new method into Executable which returns an array of the parameters for the method or constructor represented by the Executable. This is part of a larger set of changes which implement portions of the method parameter reflection functionality in hotspot and javac. The open webrev is here: http://cr.openjdk.java.net/~jgish/~emccorkl/webrev/JDK-8004729/ The feature request is here: http://bugs.sun.com/view_bug.do?bug_id=8004729 The latest version of the spec can be found here: http://cr.openjdk.java.net/~abuckley/8misc.pdf Thanks, Eric From zhong.j.yu at gmail.com Wed Dec 19 23:23:07 2012 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Wed, 19 Dec 2012 17:23:07 -0600 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: <50D1FDE4.2020708@oracle.com> References: <50D1FDE4.2020708@oracle.com> Message-ID: Users are unlikely to expect multi-byte atomicity on a ByteBuffer. However they are more likely to expect int-width atomicity on an IntBuffer view of a ByteBuffer; such atomicity is unfortunately not guaranteed either. Zhong Yu On Wed, Dec 19, 2012 at 11:48 AM, Aleksey Shipilev wrote: > Hi guys, > > I wanted to cross-check what's the expected behavior of Buffers with > respect to atomicity? Don't confuse the atomic operations (a la > j.u.c.atomic.*) and the read/write atomicity. Here's the concrete > example, should the assert always be true? > > ByteBuffer buf = ByteBuffer.allocate(100); > (publish $buf to both threads properly) > (start both threads) > > Thread 1: > buf.putInt(0, 42); // at position 0 > > Thread 2: > int i = buf.getInt(0); // at position 0 > Assert.assertTrue( (i == 0) || (i == 42) ) > > Javadoc is silent about that, except for noting Buffers are not supposed > to be used from the multiple threads without synchronization. I would > anyway advocate to follow the atomicity behavior of plain fields and > arrays, and make these reads/writes atomic under the race. > > The apparent reason for at least BB to fail to be atomic is that we > read/write larger values byte-by-byte. Luckily, it appears to be easy to > fix (for a given endianness, we can just throw in the Unsafe call). > Before going out and submitting the RFE, I wanted to crosscheck if > somebody has strong feelings about this. > > Thanks, > Aleksey. From peter.levart at gmail.com Wed Dec 19 23:47:40 2012 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 20 Dec 2012 00:47:40 +0100 Subject: Review request:Updated JDK-8004728 Implement core reflection API for parameter reflection In-Reply-To: <50D2431F.6030006@oracle.com> References: <50D2431F.6030006@oracle.com> Message-ID: <50D2521C.7080103@gmail.com> Hi Eric, in Executable.java: 292 private Parameter[] privateGetParameters() { 293 if (null != parameters) 294 return parameters.get(); If/when SoftReference is cleared,privateGetParameters will be returning null forever. Also Executable objects are already SoftReferenced from the Class. Do we need another level of SoftReferencing? 279 public Parameter[] getParameters() { 280 // TODO: This may eventually need to be guarded by security 281 // mechanisms similar to those in Field, Method, etc. 282 Parameter[] raw = privateGetParameters(); 283 Parameter[] out = new Parameter[raw.length]; 284 // Need to copy the cached array to prevent users from messing 285 // with it 286 for (int i = 0; i < raw.length; i++) { 287 out[i] = new Parameter(raw[i]); 288 } 289 return out; 290 } together with the copy constructor in Parameter.java: 48 Parameter(Parameter p) { 49 this.name = p.name; 50 this.modifiers = p.modifiers; 51 this.executable = p.executable; 52 this.index = p.index; 53 } If I see right, then Parameter is an immutable object. You need not copy the Parameter objects when copying the array. Just do a shallow copy with Arrays.copy. I assume native Executable.getParameters0() is constructing Parameter objects with a reference to "this" Executable. Since one already has access to "this" Executable (which is mutable), The Parameter objects that hold a back reference are not exposing any shared mutable state. And if they were, you would have to make a copy of Executable in the copy-constructor of the Parameter - not just reference the original one. I think there is some unnecessary copying and caching of annotation arrays going on in Parameter.java. You could base the annotations code on a cache that is already established in the package-private Executable.sharedGetParameterAnnotations() which returns a shared array of arrays of parameter annotations. Also why do you cache entire arrays for Parameter.getType() and Parameter.getParameterizedType() when only a single element is needed? Besides, there's no need to cache anything since there's already a cache of that on the Executable level. You just need to expose it via package-private abstract methods on Executable implemented in Method/Constructor. Regards, Peter On 12/19/2012 11:43 PM, Eric McCorkle wrote: > Hello, > > Please review the implementation of the core reflection API for method > parameter reflection. This changeset introduces a new class, Parameter, > which represents information about method parameters. It introduces a > new method into Executable which returns an array of the parameters for > the method or constructor represented by the Executable. > > This is part of a larger set of changes which implement portions of the > method parameter reflection functionality in hotspot and javac. > > > The open webrev is here: > http://cr.openjdk.java.net/~jgish/~emccorkl/webrev/JDK-8004729/ > > > The feature request is here: > http://bugs.sun.com/view_bug.do?bug_id=8004729 > > > The latest version of the spec can be found here: > http://cr.openjdk.java.net/~abuckley/8misc.pdf > > Thanks, > Eric From zhong.j.yu at gmail.com Thu Dec 20 00:04:35 2012 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Wed, 19 Dec 2012 18:04:35 -0600 Subject: Review request:Updated JDK-8004728 Implement core reflection API for parameter reflection In-Reply-To: <50D2521C.7080103@gmail.com> References: <50D2431F.6030006@oracle.com> <50D2521C.7080103@gmail.com> Message-ID: On Wed, Dec 19, 2012 at 5:47 PM, Peter Levart wrote: > 279 public Parameter[] getParameters() { > 280 // TODO: This may eventually need to be guarded by security > 281 // mechanisms similar to those in Field, Method, etc. > 282 Parameter[] raw = privateGetParameters(); > 283 Parameter[] out = new Parameter[raw.length]; > 284 // Need to copy the cached array to prevent users from messing > 285 // with it > 286 for (int i = 0; i < raw.length; i++) { > 287 out[i] = new Parameter(raw[i]); > 288 } > 289 return out; > 290 } > > together with the copy constructor in Parameter.java: > > 48 Parameter(Parameter p) { > 49 this.name = p.name; > 50 this.modifiers = p.modifiers; > 51 this.executable = p.executable; > 52 this.index = p.index; > 53 } > > If I see right, then Parameter is an immutable object. You need not copy the > Parameter objects when copying the array. Just do a shallow copy with > Arrays.copy. (off topic, sorry) A question that I've been wondering : why do JDK methods return arrays, instead of something like List? To avoid dependencies among JDK packages? Then how about an interface java.lang.Sequence? It would be very useful for user applications as well. Zhong Yu From vitalyd at gmail.com Thu Dec 20 00:21:45 2012 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Wed, 19 Dec 2012 19:21:45 -0500 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: References: <50D1FDE4.2020708@oracle.com> Message-ID: I'm with David on this one - since BB specifically says that it's not threadsafe I don't see why there would be any expectation of atomicity. Same goes for IntBuffer or LongBuffer. Vitaly Sent from my phone On Dec 19, 2012 6:23 PM, "Zhong Yu" wrote: > Users are unlikely to expect multi-byte atomicity on a ByteBuffer. > > However they are more likely to expect int-width atomicity on an > IntBuffer view of a ByteBuffer; such atomicity is unfortunately not > guaranteed either. > > Zhong Yu > > On Wed, Dec 19, 2012 at 11:48 AM, Aleksey Shipilev > wrote: > > Hi guys, > > > > I wanted to cross-check what's the expected behavior of Buffers with > > respect to atomicity? Don't confuse the atomic operations (a la > > j.u.c.atomic.*) and the read/write atomicity. Here's the concrete > > example, should the assert always be true? > > > > ByteBuffer buf = ByteBuffer.allocate(100); > > (publish $buf to both threads properly) > > (start both threads) > > > > Thread 1: > > buf.putInt(0, 42); // at position 0 > > > > Thread 2: > > int i = buf.getInt(0); // at position 0 > > Assert.assertTrue( (i == 0) || (i == 42) ) > > > > Javadoc is silent about that, except for noting Buffers are not supposed > > to be used from the multiple threads without synchronization. I would > > anyway advocate to follow the atomicity behavior of plain fields and > > arrays, and make these reads/writes atomic under the race. > > > > The apparent reason for at least BB to fail to be atomic is that we > > read/write larger values byte-by-byte. Luckily, it appears to be easy to > > fix (for a given endianness, we can just throw in the Unsafe call). > > Before going out and submitting the RFE, I wanted to crosscheck if > > somebody has strong feelings about this. > > > > Thanks, > > Aleksey. > From stuart.marks at oracle.com Thu Dec 20 01:11:14 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Wed, 19 Dec 2012 17:11:14 -0800 Subject: RFR: 8005290: remove -showversion from RMI test library subprocess mechanism Message-ID: <50D265B2.8060103@oracle.com> Hi all, Please review the fix [1] for bug 8005290 [2]. [1] http://cr.openjdk.java.net/~smarks/reviews/8005290/webrev.0/ [2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8005290 I just filed this bug, so it hasn't made it to the public website yet. The salient text from the bug report is as follows: ------------------------------------------------------------ The RMI test library (jdk/test/java/rmi/testlibrary) has a convenience API (the JavaVM class) for launching a JVM subprocess. When starting the subprocess, it adds the -showversion option to the JVM command line and waits for the version output to arrive from the subprocess before returning to the caller. This is intended to avoid race conditions where the test might try to contact the subprocess before it's fully initialized. It turns out this doesn't really work and it's also unnecessary. The reason it doesn't really work is that the version string is emitted when the JVM subprocess has mostly started up, but it hasn't yet executed any user code. Even after the version string has been emitted, the caller may still have to wait and retry before successfully contacting a service exported by the subprocess. The current code returns after two seconds, even if the version string hasn't been received from the subprocess. So the caller has to wait and potentially retry anyway. Since the callers have to do this anyway, having the library wait for the version string isn't helpful. Other library code (e.g., RMID) starts the subprocess and waits until a particular RMI service is ready, so the -showversion mechanism is redundant in that case. Finally, many tests start the subprocess and wait until it finishes, so they don't need the -showversion mechanism either. Finally, the -showversion mechanism adds a lot of complexity, as it has to interpose between the subprocess output stream and the caller, so we're better off just removing it. All RMI tests continue to pass even with this mechanism removed. ------------------------------------------------------------ This is basically just test cleanup (no library code changes) to clear the way for future test enhancements to improve performance and reliability. Thanks, s'marks From rob.mckenna at oracle.com Thu Dec 20 02:28:14 2012 From: rob.mckenna at oracle.com (Rob McKenna) Date: Thu, 20 Dec 2012 02:28:14 +0000 Subject: Request for Review: 5049299: (process) Use posix_spawn, not fork, on S10 to avoid swap exhaustion In-Reply-To: <50B82C94.90109@oracle.com> References: <50AE98B1.2040200@oracle.com> <50B81A8D.2040403@oracle.com> <50B82C94.90109@oracle.com> Message-ID: <50D277BE.8060705@oracle.com> Hi folks, Thanks for the feedback so far. I've uploaded a new webrev to: http://cr.openjdk.java.net/~robm/5049299/webrev.02/ I've made the following headline changes: - Initial effort to get this stuff into the new build-infra. Hoping build-infra can steer me in the right direction. (note to build infra reviewers: see links below) - Source thats shared between jspawnhelper.c and UNIXProcess_md.c now resides in childproc.h/c. This results in cleaner changes to the makefiles. - jspawnhelper moved to /lib/ on solaris (ipc necessitate the use of a separate jspawnhelper for each arch) and just /lib on macosx. The following links to earlier threads are well worth reading for additional context: http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012417.html http://mail.openjdk.java.net/pipermail/core-libs-dev/2009-June/001747.html -Rob On 30/11/12 03:48, Rob McKenna wrote: > Hi David, > > On 30/11/12 02:31, David Holmes wrote: >> Hi Rob, >> >> This is only a superficial scan. >> >> The changes in java/java/makefile look pretty horrible. What are all >> those -R entries? > Library search paths. Currently jprochelper is linked to libjava. I'm > hoping to either cut their number (by altering jprochelpers home) or > get rid of them altogether (by avoiding linking at all) in the next > draft, they are indeed ungainly. >> >> We will need equivalent changes for the new build system before this >> is pushed. >> > Indeed. >> Is the spawn use BSD specific (as per UnixProcess.java.BSD) or Apple >> specific (as per __APPLE_ in UNIXProcess_md.c) ? >> > Eesh, thanks, it applies to both platforms. >> Are the UnixProcess.java files similar enough that we could use a >> single template and generate the per-OS variants? >> > Before this change .bsd & .linux were identical (iirc) unfortunately, > no longer. Solaris has differences. When you say "generate the per-OS > variants" how do you mean? I'd like to keep it as straightforward as > possible from a sustaining perspective. (personally I'd like to just > extend a base class and try to get away from the makefiles as much as > possible - we can discuss this in 8000975 which I'll revisit once I > get through this) >> In UNIXProcess_md.c: >> >> 209 #ifdef _CS_PATH >> 210 char *pathbuf; >> 211 size_t n; >> 212 n = confstr(_CS_PATH,NULL,(size_t) 0); >> 213 pathbuf = malloc(n); >> 214 if (pathbuf == NULL) >> 215 abort(); >> 216 confstr(_CS_PATH, pathbuf, n); >> 217 return pathbuf; >> 218 #else >> >> what is _CS_PATH and why are we calling abort()? !!!! >> > As per Martins comments I'm going to separate this into another > change. See: > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2009-May/001686.html > > and > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012456.html > > > for context. I'll look to fall back to the previous code if the > pathbuf malloc fails. >> What is all the xx_ naming ?? >> > I believe Michael was using it to denote shared calls. (functions > called from both jprochelper and within UNIXProcess_md.c). I presumed > it was placeholder text actually, in any case it may go away in the > next iteration as per previous comments. If not, I'm happy to replace > it with whatever gets it past codereview. > > -Rob > >> David >> ----- >> >> >> On 23/11/2012 7:27 AM, Rob McKenna wrote: >>> Hi folks, >>> >>> Looking for a review for the webrev below, which also resolves: >>> >>> 7175692: (process) Process.exec should use posix_spawn [macosx] >>> >>> For additional context and a brief description it would be well worth >>> looking at the following thread started by Michael McMahon, who did the >>> brunt of the work for this fix: >>> >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2009-May/thread.html#1644 >>> >>> >>> >>> Basically the fix aims to swap fork for posix_spawn as the default >>> process launch mechanism on Solaris and Mac OSX in order to avoid swap >>> exhaustion issues encountered with fork()/exec(). It also offers a flag >>> (java.lang.useFork) to allow a user to revert to the old behaviour. >>> >>> I'm having trouble seeing the wood for the trees at this point so I'm >>> anticipating plenty of feedback. In particular I'd appreciate some >>> discussion on: >>> >>> - The binary launcher name & property name may need some work. A more >>> general property ("java.lang.launchMechanism") to allow a user to >>> specify a particular call was mooted too. It may be more future proof >>> and I'm completely open to that. (e.g. >>> launchMechanism=spawn|fork|vfork|clone - we would obviously ignore >>> inapplicable values on a per-platform basis) >>> - I'd like a more robust way of checking that someone isn't trying to >>> use jprochelper outside of the context for which it is meant. >>> - The decision around which call to use getting moved to the java level >>> and away from the native preprocessor. >>> >>> The webrev is at: >>> >>> http://cr.openjdk.java.net/~robm/5049299/webrev.01/ >>> >>> >>> Thanks a lot, >>> >>> -Rob >>> > From mike.duigou at oracle.com Thu Dec 20 03:04:07 2012 From: mike.duigou at oracle.com (Mike Duigou) Date: Wed, 19 Dec 2012 19:04:07 -0800 Subject: RFR : CR8004015 : Add parent interfaces and default methods to basic functional interfaces In-Reply-To: <50CE9D22.7060108@oracle.com> References: <99DC2763-ED44-42CA-90F3-04AD07B2846D@oracle.com> <50CAC719.7090308@oracle.com> <0A9D8113-780C-4BA7-9380-AAD53A0DAA58@oracle.com> <50CE9D22.7060108@oracle.com> Message-ID: <417F6F27-0175-4A7E-B2E6-9DCCE590D812@oracle.com> On Dec 16 2012, at 20:18 , David Holmes wrote: > On 15/12/2012 4:58 AM, Mike Duigou wrote: >> >> On Dec 13 2012, at 22:28 , David Holmes wrote: >> >>>> I have added @throws NPE for a number of the default methods. We won't be including @throws NPE in all cases where null is disallowed because when the @throws NPE is declared the API is required to throw NPE in that circumstance. So for cases where the NPE is "naturally" thrown or that aren't performance sensitive we will likely add @throws NPE declarations but for performance sensitive methods we won't be adding explicit null checks to match a @throws NPE specification. There's a tradeoff here in some cases. Please feel free to quibble about specific cases as they occur. :-) >>> >>> That doesn't make sense to me. The throwing of the NPE is intended to be part of the specification not an implementation choice. Further @param foo non-null, is just as binding on implementations as @throws NPE if foo is null. ??? >> >> An "@param foo non-null" by itself is not considered normative because it doesn't document what happens when null is passed. So it ends up being advisory only. An "@throws NPE" is considered normative and the implementation must throw in all circumstances described. > > Aside: that is an interesting interpretation but from whence does it come? From the TCK/JCK team. In communications with them to clarify the specification > It is non-normative by definition because it is incomplete? Yes. If a constraint is specified then it is only testable to the extent that the outcome of is also described. > Or is it just non-normative because it is an @param tag? No. > >> (Please bear with the step-by-step nature of the following sample, it's incremental pace is not meant to be insulting--it's a write-up for a general FAQ). If I have a method: > > But once you add the @throws the advisory of the @param is redundant. Hence to me it is an either/or situation. It does seem redundant to me but not entirely useless. I would prefer to not have to check the @throws declaration to know what the valid range is for a parameter. My tendency is to always try to consolidate all information about something in one place and if that's not practical then allow for some duplication. An example recently was information about the ForkJoin common pool. I prefer to see all the characteristics of the common pool described on the documentation for commonPool() method rather than disparately on shutdown(), etc. The advantage being that collecting it into one place allows be to completely understand (OK, within limits) the characteristics of common pool. Without the consolidation I may not even be able to find all of the documentation which references the common pool. There does seem to be some value though to duplicating the information to other places where it might be relevant. It's perhaps worthwhile to note in shutdown() that it is ignored for the common pool. > Further the advisory, being advisory, is useless in my opinion, so not something to use regardless. The advisories do still represent good advice for what to pass. Mike From martinrb at google.com Thu Dec 20 04:04:29 2012 From: martinrb at google.com (Martin Buchholz) Date: Wed, 19 Dec 2012 20:04:29 -0800 Subject: Request for Review: 5049299: (process) Use posix_spawn, not fork, on S10 to avoid swap exhaustion In-Reply-To: <50D277BE.8060705@oracle.com> References: <50AE98B1.2040200@oracle.com> <50B81A8D.2040403@oracle.com> <50B82C94.90109@oracle.com> <50D277BE.8060705@oracle.com> Message-ID: Thanks for this. I agree with the strategy. I'm hoping build folks and macosx folks also take a look at this hairy change. +LINKFLAG = +ifeq ($(ARCH_DATA_MODEL), 64) +LINKFLAG = -m64 +endif It looks wrong to be specifying toolchain-specific flags here. Also, -m64 is logically a compiler flag, i.e. belongs in a variable with a name like CFLAGS. --- ifeq ($(OPENJDK_TARGET_OS), solaris) - ifeq ($(OPENJDK_TARGET_CPU_BITS), 32) - BUILD_JEXEC := 1 - endif + ifeq ($(OPENJDK_TARGET_CPU_BITS), 32) + BUILD_JEXEC := 1 + endif endif Why mess with jexec? --- + String s = System.getProperty("java.lang.useFork"); "java.lang.Process.useFork" is a better name. Also, useFork suggests it's a binary choice. Wouldn't it be better to have the system property "java.lang.Process.spawn.mechanism" with values fork, vfork, posix_spawn, clone --- + enum LaunchMechanism { + CLONE(1), FORK(2), + VFORK(3), SPAWN(4); I would rename SPAWN to POSIX_SPAWN. The enum can be moved to a unix-flavor-independent file. --- + helperpath = javahome + "/lib/" + osarch + "/jspawnhelper"; There ought to be a standard way to get the "libarchdir" --- Of course, WhyCantJohnnyExec should have been WhyJohnnyCantExec This is your chance to correct my mistake! --- Sometimes I see __APPLE__ sometimes I see _ALLBSD_SOURCE. Hopefully such things will be removed later when the new build system is obligatory. --- + /* Initialize xx_parentPathv[] */ It's not called xx_anything any more. --- + shutItDown(); How about renaming to usageError() ? --- + r = sscanf (argv[argc-1], "%d:%d", &fdin, &fdout); How about checking for argc == 2 ? Martin On Wed, Dec 19, 2012 at 6:28 PM, Rob McKenna wrote: > Hi folks, > > Thanks for the feedback so far. I've uploaded a new webrev to: > > http://cr.openjdk.java.net/~**robm/5049299/webrev.02/< > http://cr.openjdk.java.net/%**7Erobm/5049299/webrev.02/ > > > > I've made the following headline changes: > > - Initial effort to get this stuff into the new build-infra. Hoping > build-infra can steer me in the right direction. (note to build infra > reviewers: see links below) > > - Source thats shared between jspawnhelper.c and UNIXProcess_md.c now > resides in childproc.h/c. This results in cleaner changes to the makefiles. > > - jspawnhelper moved to /lib/ on solaris (ipc necessitate > the use of a separate jspawnhelper for each arch) and just /lib on macosx. > > The following links to earlier threads are well worth reading for > additional context: > > http://mail.openjdk.java.net/**pipermail/core-libs-dev/2012-** > November/012417.html > http://mail.openjdk.java.net/**pipermail/core-libs-dev/2009-** > June/001747.html > > -Rob > > > On 30/11/12 03:48, Rob McKenna wrote: > >> Hi David, >> >> On 30/11/12 02:31, David Holmes wrote: >> >>> Hi Rob, >>> >>> This is only a superficial scan. >>> >>> The changes in java/java/makefile look pretty horrible. What are all >>> those -R entries? >>> >> Library search paths. Currently jprochelper is linked to libjava. I'm >> hoping to either cut their number (by altering jprochelpers home) or get >> rid of them altogether (by avoiding linking at all) in the next draft, they >> are indeed ungainly. >> >>> >>> We will need equivalent changes for the new build system before this is >>> pushed. >>> >>> Indeed. >> >>> Is the spawn use BSD specific (as per UnixProcess.java.BSD) or Apple >>> specific (as per __APPLE_ in UNIXProcess_md.c) ? >>> >>> Eesh, thanks, it applies to both platforms. >> >>> Are the UnixProcess.java files similar enough that we could use a single >>> template and generate the per-OS variants? >>> >>> Before this change .bsd & .linux were identical (iirc) unfortunately, >> no longer. Solaris has differences. When you say "generate the per-OS >> variants" how do you mean? I'd like to keep it as straightforward as >> possible from a sustaining perspective. (personally I'd like to just extend >> a base class and try to get away from the makefiles as much as possible - >> we can discuss this in 8000975 which I'll revisit once I get through this) >> >>> In UNIXProcess_md.c: >>> >>> 209 #ifdef _CS_PATH >>> 210 char *pathbuf; >>> 211 size_t n; >>> 212 n = confstr(_CS_PATH,NULL,(size_t) 0); >>> 213 pathbuf = malloc(n); >>> 214 if (pathbuf == NULL) >>> 215 abort(); >>> 216 confstr(_CS_PATH, pathbuf, n); >>> 217 return pathbuf; >>> 218 #else >>> >>> what is _CS_PATH and why are we calling abort()? !!!! >>> >>> As per Martins comments I'm going to separate this into another change. >> See: >> >> http://mail.openjdk.java.net/**pipermail/core-libs-dev/2009-** >> May/001686.html >> >> and >> >> http://mail.openjdk.java.net/**pipermail/core-libs-dev/2012-** >> November/012456.html >> >> for context. I'll look to fall back to the previous code if the pathbuf >> malloc fails. >> >>> What is all the xx_ naming ?? >>> >>> I believe Michael was using it to denote shared calls. (functions >> called from both jprochelper and within UNIXProcess_md.c). I presumed it >> was placeholder text actually, in any case it may go away in the next >> iteration as per previous comments. If not, I'm happy to replace it with >> whatever gets it past codereview. >> >> -Rob >> >> David >>> ----- >>> >>> >>> On 23/11/2012 7:27 AM, Rob McKenna wrote: >>> >>>> Hi folks, >>>> >>>> Looking for a review for the webrev below, which also resolves: >>>> >>>> 7175692: (process) Process.exec should use posix_spawn [macosx] >>>> >>>> For additional context and a brief description it would be well worth >>>> looking at the following thread started by Michael McMahon, who did the >>>> brunt of the work for this fix: >>>> >>>> http://mail.openjdk.java.net/**pipermail/core-libs-dev/2009-** >>>> May/thread.html#1644 >>>> >>>> >>>> Basically the fix aims to swap fork for posix_spawn as the default >>>> process launch mechanism on Solaris and Mac OSX in order to avoid swap >>>> exhaustion issues encountered with fork()/exec(). It also offers a flag >>>> (java.lang.useFork) to allow a user to revert to the old behaviour. >>>> >>>> I'm having trouble seeing the wood for the trees at this point so I'm >>>> anticipating plenty of feedback. In particular I'd appreciate some >>>> discussion on: >>>> >>>> - The binary launcher name & property name may need some work. A more >>>> general property ("java.lang.launchMechanism") to allow a user to >>>> specify a particular call was mooted too. It may be more future proof >>>> and I'm completely open to that. (e.g. >>>> launchMechanism=spawn|fork|**vfork|clone - we would obviously ignore >>>> inapplicable values on a per-platform basis) >>>> - I'd like a more robust way of checking that someone isn't trying to >>>> use jprochelper outside of the context for which it is meant. >>>> - The decision around which call to use getting moved to the java level >>>> and away from the native preprocessor. >>>> >>>> The webrev is at: >>>> >>>> http://cr.openjdk.java.net/~**robm/5049299/webrev.01/ >>>> >>>> > >>>> >>>> Thanks a lot, >>>> >>>> -Rob >>>> >>>> >> > From martinrb at google.com Thu Dec 20 04:32:45 2012 From: martinrb at google.com (Martin Buchholz) Date: Wed, 19 Dec 2012 20:32:45 -0800 Subject: Request for Review: 5049299: (process) Use posix_spawn, not fork, on S10 to avoid swap exhaustion In-Reply-To: References: <50AE98B1.2040200@oracle.com> <50B81A8D.2040403@oracle.com> <50B82C94.90109@oracle.com> <50D277BE.8060705@oracle.com> Message-ID: + res = readFully (fdin, &magic, sizeof(magic)); + if (res != 4 || magic != magicNumber()) { s/4/sizeof(magic)/ --- +extern int errno; Delete. --- +#define ALLOC(X,Y) { \ + void *mptr; \ + mptr = malloc (Y); \ + if (mptr == 0) { \ + error (fdout, ERR_MALLOC); \ + } \ + X = mptr; \ +} It's traditional to define such a thing as a real function instead of a macro, often with the name xmalloc. Compare with static void* xmalloc(JNIEnv *env, size_t size) { void *p = malloc(size); if (p == NULL) JNU_ThrowOutOfMemoryError(env, NULL); return p; } #define NEW(type, n) ((type *) xmalloc(env, (n) * sizeof(type))) From peter.levart at gmail.com Thu Dec 20 06:47:00 2012 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 20 Dec 2012 07:47:00 +0100 Subject: Review request:Updated JDK-8004728 Implement core reflection API for parameter reflection In-Reply-To: <50D2A33C.6050405@oracle.com> References: <50D2431F.6030006@oracle.com> <50D2521C.7080103@gmail.com> <50D2A33C.6050405@oracle.com> Message-ID: <50D2B464.4030109@gmail.com> On 12/20/2012 06:33 AM, Eric McCorkle wrote: > On 12/19/12 18:47, Peter Levart wrote: >> >Hi Eric, >> > >> >in Executable.java: >> > >> > 292 private Parameter[] privateGetParameters() { >> > 293 if (null != parameters) >> > 294 return parameters.get(); >> > >> > >> >If/when SoftReference is cleared,privateGetParameters will be returning >> >null forever. Also Executable objects are already SoftReferenced from >> >the Class. Do we need another level of SoftReferencing? > I'd say not. I'll take that bit out. > Hi again, Eric, To be exact: only 'root' Executable objects are SoftReferenced from the Class. The copies that are exposed to user are not referenced at all (by reflection library). So as long as internal JDK code is not calling any new Parameter returning methods on 'root' Executable instances, they will never materialize any Parameter objects. The user only has to be aware that the Executable instance he/she has got hold on has a direct reference to any Parameter instances and vice versa. There is already a precedent for that: annotations are directly referenced from Field/Method/Constructor and they may have direct references to various Class instances. Although the specification does not specify it, a nice addition to the API would be the following method on Executable: Parameter getParameter(String parameterName); ...since parameter names are unique, aren't they? Parameter instances would have to be cached in a Map though. Regards, Peter From peter.levart at gmail.com Thu Dec 20 06:51:16 2012 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 20 Dec 2012 07:51:16 +0100 Subject: Review request:Updated JDK-8004728 Implement core reflection API for parameter reflection In-Reply-To: References: <50D2431F.6030006@oracle.com> <50D2521C.7080103@gmail.com> Message-ID: <50D2B564.1050207@gmail.com> On 12/20/2012 01:04 AM, Zhong Yu wrote: > On Wed, Dec 19, 2012 at 5:47 PM, Peter Levart wrote: >> 279 public Parameter[] getParameters() { >> 280 // TODO: This may eventually need to be guarded by security >> 281 // mechanisms similar to those in Field, Method, etc. >> 282 Parameter[] raw = privateGetParameters(); >> 283 Parameter[] out = new Parameter[raw.length]; >> 284 // Need to copy the cached array to prevent users from messing >> 285 // with it >> 286 for (int i = 0; i < raw.length; i++) { >> 287 out[i] = new Parameter(raw[i]); >> 288 } >> 289 return out; >> 290 } >> >> together with the copy constructor in Parameter.java: >> >> 48 Parameter(Parameter p) { >> 49 this.name = p.name; >> 50 this.modifiers = p.modifiers; >> 51 this.executable = p.executable; >> 52 this.index = p.index; >> 53 } >> >> If I see right, then Parameter is an immutable object. You need not copy the >> Parameter objects when copying the array. Just do a shallow copy with >> Arrays.copy. > (off topic, sorry) > A question that I've been wondering : why do JDK methods return > arrays, instead of something like List? To avoid dependencies among > JDK packages? Then how about an interface java.lang.Sequence? It > would be very useful for user applications as well. I guess because those methods were there before the java.util.List/Map times. Methods added later are perhaps just following the old style... Regards, Peter > > Zhong Yu From peter.levart at gmail.com Thu Dec 20 08:09:36 2012 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 20 Dec 2012 09:09:36 +0100 Subject: Review request:Updated JDK-8004728 Implement core reflection API for parameter reflection In-Reply-To: <50D2431F.6030006@oracle.com> References: <50D2431F.6030006@oracle.com> Message-ID: <50D2C7C0.6060900@gmail.com> Hi Eric and others, I'd also like to rise an internal design concern regarding construction of Parameter objects. Currently raw reflection data for Executable objects is obtained from the VM atomically - the whole Method or Constructor is fully constructed with all necessary information in one go. That's true also for parameter types and parameter annotations. New Parameter API is now "pulling" lazily some additional information from the VM (parameter names and modifiers). How does this play together with class re-definitions/re-transformations? Is it possible that a class re-definition changes parameter names? Can it change parameter annotations? Imagine one has a reference to a Method, that has since it's construction already been re-defined in the VM (for example a parameter name and annotation has changed). When asking for annotations on the re-defined parameter, you will get annotations that were actual at the time the Method was constructed, but when asked for the parameters and their names, you will get the already redefined names. I think that the more correct implementation would construct Method/Constructor objects in the VM with all the necessary information (parameter names and modifiers) already present in the Executable objects. This information could be conveniently packed and only unpacked and expanded on user's request - like annotations. Regards, Peter On 12/19/2012 11:43 PM, Eric McCorkle wrote: > Hello, > > Please review the implementation of the core reflection API for method > parameter reflection. This changeset introduces a new class, Parameter, > which represents information about method parameters. It introduces a > new method into Executable which returns an array of the parameters for > the method or constructor represented by the Executable. > > This is part of a larger set of changes which implement portions of the > method parameter reflection functionality in hotspot and javac. > > > The open webrev is here: > http://cr.openjdk.java.net/~jgish/~emccorkl/webrev/JDK-8004729/ > > > The feature request is here: > http://bugs.sun.com/view_bug.do?bug_id=8004729 > > > The latest version of the spec can be found here: > http://cr.openjdk.java.net/~abuckley/8misc.pdf > > Thanks, > Eric From erik.joelsson at oracle.com Thu Dec 20 09:33:00 2012 From: erik.joelsson at oracle.com (Erik Joelsson) Date: Thu, 20 Dec 2012 10:33:00 +0100 Subject: Request for Review: 5049299: (process) Use posix_spawn, not fork, on S10 to avoid swap exhaustion In-Reply-To: <50D277BE.8060705@oracle.com> References: <50AE98B1.2040200@oracle.com> <50B81A8D.2040403@oracle.com> <50B82C94.90109@oracle.com> <50D277BE.8060705@oracle.com> Message-ID: <50D2DB4C.9060303@oracle.com> Hello, Nice to see a good attempt at getting the new build in order. While this looks like it works, I have a few comments: In makefiles/CompileLaunchers.gmk * OPENJDK_TARGET_CPU_LIBDIR is empty on macosx, so you can safely use the same definition of BUILD_JSPAWNHELPER_DST_DIR for all platforms. * For macosx BUILD_JSPAWNHELPER := 1 is set twice. I would remove this variable and just put the ifneq logic directly around the macro call since it's easily expressible with just one ifneq. Also, reusing the same variable as the namespace for the macro call can be a bit confusing. * The -m64 flag should already be present in LDFLAGS_JDKEXE on solaris. Does it really need to be set on macosx? * Since this executable is dependent on an object file from libjava, I would like that dependency to be expressed explicitly so that a relink is properly triggered on change. This could be achieved by adding the following after the macro call: $(BUILD_JSPAWNHELPER): $(LINK_JSPAWNHELPER_OBJECTS) * Finally, since BUILD_JSPAWNHELPER_SRC and BUILD_JSPAWNHELPER_DST_DIR are only used once, I would inline them into the macro call. At least I find it easier to read that way. /Erik On 2012-12-20 03:28, Rob McKenna wrote: > Hi folks, > > Thanks for the feedback so far. I've uploaded a new webrev to: > > http://cr.openjdk.java.net/~robm/5049299/webrev.02/ > > > I've made the following headline changes: > > - Initial effort to get this stuff into the new build-infra. Hoping > build-infra can steer me in the right direction. (note to build infra > reviewers: see links below) > > - Source thats shared between jspawnhelper.c and UNIXProcess_md.c now > resides in childproc.h/c. This results in cleaner changes to the > makefiles. > > - jspawnhelper moved to /lib/ on solaris (ipc > necessitate the use of a separate jspawnhelper for each arch) and just > /lib on macosx. > > The following links to earlier threads are well worth reading for > additional context: > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012417.html > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2009-June/001747.html > > > -Rob > > On 30/11/12 03:48, Rob McKenna wrote: >> Hi David, >> >> On 30/11/12 02:31, David Holmes wrote: >>> Hi Rob, >>> >>> This is only a superficial scan. >>> >>> The changes in java/java/makefile look pretty horrible. What are all >>> those -R entries? >> Library search paths. Currently jprochelper is linked to libjava. I'm >> hoping to either cut their number (by altering jprochelpers home) or >> get rid of them altogether (by avoiding linking at all) in the next >> draft, they are indeed ungainly. >>> >>> We will need equivalent changes for the new build system before this >>> is pushed. >>> >> Indeed. >>> Is the spawn use BSD specific (as per UnixProcess.java.BSD) or Apple >>> specific (as per __APPLE_ in UNIXProcess_md.c) ? >>> >> Eesh, thanks, it applies to both platforms. >>> Are the UnixProcess.java files similar enough that we could use a >>> single template and generate the per-OS variants? >>> >> Before this change .bsd & .linux were identical (iirc) unfortunately, >> no longer. Solaris has differences. When you say "generate the >> per-OS variants" how do you mean? I'd like to keep it as >> straightforward as possible from a sustaining perspective. >> (personally I'd like to just extend a base class and try to get away >> from the makefiles as much as possible - we can discuss this in >> 8000975 which I'll revisit once I get through this) >>> In UNIXProcess_md.c: >>> >>> 209 #ifdef _CS_PATH >>> 210 char *pathbuf; >>> 211 size_t n; >>> 212 n = confstr(_CS_PATH,NULL,(size_t) 0); >>> 213 pathbuf = malloc(n); >>> 214 if (pathbuf == NULL) >>> 215 abort(); >>> 216 confstr(_CS_PATH, pathbuf, n); >>> 217 return pathbuf; >>> 218 #else >>> >>> what is _CS_PATH and why are we calling abort()? !!!! >>> >> As per Martins comments I'm going to separate this into another >> change. See: >> >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2009-May/001686.html >> >> >> and >> >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012456.html >> >> >> for context. I'll look to fall back to the previous code if the >> pathbuf malloc fails. >>> What is all the xx_ naming ?? >>> >> I believe Michael was using it to denote shared calls. (functions >> called from both jprochelper and within UNIXProcess_md.c). I presumed >> it was placeholder text actually, in any case it may go away in the >> next iteration as per previous comments. If not, I'm happy to replace >> it with whatever gets it past codereview. >> >> -Rob >> >>> David >>> ----- >>> >>> >>> On 23/11/2012 7:27 AM, Rob McKenna wrote: >>>> Hi folks, >>>> >>>> Looking for a review for the webrev below, which also resolves: >>>> >>>> 7175692: (process) Process.exec should use posix_spawn [macosx] >>>> >>>> For additional context and a brief description it would be well worth >>>> looking at the following thread started by Michael McMahon, who did >>>> the >>>> brunt of the work for this fix: >>>> >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2009-May/thread.html#1644 >>>> >>>> >>>> >>>> Basically the fix aims to swap fork for posix_spawn as the default >>>> process launch mechanism on Solaris and Mac OSX in order to avoid swap >>>> exhaustion issues encountered with fork()/exec(). It also offers a >>>> flag >>>> (java.lang.useFork) to allow a user to revert to the old behaviour. >>>> >>>> I'm having trouble seeing the wood for the trees at this point so I'm >>>> anticipating plenty of feedback. In particular I'd appreciate some >>>> discussion on: >>>> >>>> - The binary launcher name & property name may need some work. A more >>>> general property ("java.lang.launchMechanism") to allow a user to >>>> specify a particular call was mooted too. It may be more future proof >>>> and I'm completely open to that. (e.g. >>>> launchMechanism=spawn|fork|vfork|clone - we would obviously ignore >>>> inapplicable values on a per-platform basis) >>>> - I'd like a more robust way of checking that someone isn't trying to >>>> use jprochelper outside of the context for which it is meant. >>>> - The decision around which call to use getting moved to the java >>>> level >>>> and away from the native preprocessor. >>>> >>>> The webrev is at: >>>> >>>> http://cr.openjdk.java.net/~robm/5049299/webrev.01/ >>>> >>>> >>>> Thanks a lot, >>>> >>>> -Rob >>>> >> > From aleksey.shipilev at oracle.com Thu Dec 20 11:43:08 2012 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Thu, 20 Dec 2012 15:43:08 +0400 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: References: <50D1FDE4.2020708@oracle.com> Message-ID: <50D2F9CC.6030109@oracle.com> Thanks for all the inputs. I think I need to get off to concurrency-interest to ask what the general public expectations are, to see whether we need to spec this more accurately. Even though spec is explicit now about using Buffers with synchronization, there is also a "reasonable behavior", that we would certainly like to take into the consideration. Here's the link for the discussion: http://cs.oswego.edu/pipermail/concurrency-interest/2012-December/010390.html -Aleksey. On 12/20/2012 04:21 AM, Vitaly Davidovich wrote: > I'm with David on this one - since BB specifically says that it's not > threadsafe I don't see why there would be any expectation of atomicity. > Same goes for IntBuffer or LongBuffer. > > Vitaly > > Sent from my phone > > On Dec 19, 2012 6:23 PM, "Zhong Yu" > wrote: > > Users are unlikely to expect multi-byte atomicity on a ByteBuffer. > > However they are more likely to expect int-width atomicity on an > IntBuffer view of a ByteBuffer; such atomicity is unfortunately not > guaranteed either. > > Zhong Yu > > On Wed, Dec 19, 2012 at 11:48 AM, Aleksey Shipilev > > > wrote: > > Hi guys, > > > > I wanted to cross-check what's the expected behavior of Buffers with > > respect to atomicity? Don't confuse the atomic operations (a la > > j.u.c.atomic.*) and the read/write atomicity. Here's the concrete > > example, should the assert always be true? > > > > ByteBuffer buf = ByteBuffer.allocate(100); > > (publish $buf to both threads properly) > > (start both threads) > > > > Thread 1: > > buf.putInt(0, 42); // at position 0 > > > > Thread 2: > > int i = buf.getInt(0); // at position 0 > > Assert.assertTrue( (i == 0) || (i == 42) ) > > > > Javadoc is silent about that, except for noting Buffers are not > supposed > > to be used from the multiple threads without synchronization. I would > > anyway advocate to follow the atomicity behavior of plain fields and > > arrays, and make these reads/writes atomic under the race. > > > > The apparent reason for at least BB to fail to be atomic is that we > > read/write larger values byte-by-byte. Luckily, it appears to be > easy to > > fix (for a given endianness, we can just throw in the Unsafe call). > > Before going out and submitting the RFE, I wanted to crosscheck if > > somebody has strong feelings about this. > > > > Thanks, > > Aleksey. > From dmitry.samersoff at oracle.com Thu Dec 20 12:03:29 2012 From: dmitry.samersoff at oracle.com (dmitry.samersoff at oracle.com) Date: Thu, 20 Dec 2012 12:03:29 +0000 Subject: hg: jdk8/tl/jdk: 6783290: MBeanInfo/MBeanFeatureInfo has inconsistent readObject/writeObject Message-ID: <20121220120403.14270472CB@hg.openjdk.java.net> Changeset: b600d490dc57 Author: dsamersoff Date: 2012-12-20 16:02 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/b600d490dc57 6783290: MBeanInfo/MBeanFeatureInfo has inconsistent readObject/writeObject Summary: call readObject in all cases Reviewed-by: emcmanus Contributed-by: jaroslav.bachorik at oracle.com ! src/share/classes/javax/management/MBeanFeatureInfo.java ! src/share/classes/javax/management/MBeanInfo.java From dmitry.samersoff at oracle.com Thu Dec 20 13:06:16 2012 From: dmitry.samersoff at oracle.com (dmitry.samersoff at oracle.com) Date: Thu, 20 Dec 2012 13:06:16 +0000 Subject: hg: jdk8/tl/jdk: 6937053: RMI unmarshalling errors in ClientNotifForwarder cause silent failure Message-ID: <20121220130642.D07B0472CD@hg.openjdk.java.net> Changeset: e43f90d5af11 Author: dsamersoff Date: 2012-12-20 16:56 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e43f90d5af11 6937053: RMI unmarshalling errors in ClientNotifForwarder cause silent failure Summary: the catch block in the fetchNotifs() method is extended to expect UnmarshalException Reviewed-by: emcmanus Contributed-by: jaroslav.bachorik at oracle.com ! src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java From dmitry.samersoff at oracle.com Thu Dec 20 13:26:33 2012 From: dmitry.samersoff at oracle.com (dmitry.samersoff at oracle.com) Date: Thu, 20 Dec 2012 13:26:33 +0000 Subject: hg: jdk8/tl/jdk: 7009998: JMX synchronization during connection restart is faulty Message-ID: <20121220132645.201C0472CE@hg.openjdk.java.net> Changeset: 3f014bc09297 Author: dsamersoff Date: 2012-12-20 17:24 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/3f014bc09297 7009998: JMX synchronization during connection restart is faulty Summary: add a return statement after the re-connecting has finished and the state is CONNECTED Reviewed-by: sjiang Contributed-by: jaroslav.bachorik at oracle.com ! make/netbeans/jmx/build.properties ! src/share/classes/com/sun/jmx/remote/internal/ClientCommunicatorAdmin.java From joel.franck at oracle.com Thu Dec 20 13:45:52 2012 From: joel.franck at oracle.com (=?ISO-8859-1?Q?Joel_Borggr=E9n-Franck?=) Date: Thu, 20 Dec 2012 14:45:52 +0100 Subject: Review request:Updated JDK-8004728 Implement core reflection API for parameter reflection In-Reply-To: <50D2C7C0.6060900@gmail.com> References: <50D2431F.6030006@oracle.com> <50D2C7C0.6060900@gmail.com> Message-ID: <50D31690.1080501@oracle.com> Hi Peter, Eric and and others, Thanks for your comments, On 12/20/2012 09:09 AM, Peter Levart wrote: > Hi Eric and others, > > I'd also like to rise an internal design concern regarding construction > of Parameter objects. Currently raw reflection data for Executable > objects is obtained from the VM atomically - the whole Method or > Constructor is fully constructed with all necessary information in one > go. That's true also for parameter types and parameter annotations. New > Parameter API is now "pulling" lazily some additional information from > the VM (parameter names and modifiers). How does this play together with > class re-definitions/re-transformations? Is it possible that a class > re-definition changes parameter names? Can it change parameter annotations? > > Imagine one has a reference to a Method, that has since it's > construction already been re-defined in the VM (for example a parameter > name and annotation has changed). When asking for annotations on the > re-defined parameter, you will get annotations that were actual at the > time the Method was constructed, but when asked for the parameters and > their names, you will get the already redefined names. > > I think that the more correct implementation would construct > Method/Constructor objects in the VM with all the necessary information > (parameter names and modifiers) already present in the Executable > objects. This information could be conveniently packed and only unpacked > and expanded on user's request - like annotations. > I would like to go the opposite way with Executable, Method, Field and Parameter, like the caches work on Class instances in your patch. Reflective Objects should be created with non-initialized caches of metadata. When someone wants to look at the metatdata we should check the redefine count on Class, and update the caches if necessary. There is already infrastructure for this in the VM for the old annotations byte[] on Field, Method and Constructor. I am unclear if the parameter name is part of the signature, this is significant because (IIRC) signaturs can not change in redefine, but parameter annotations should be able to change. cheers /Joel From chris.hegarty at oracle.com Thu Dec 20 13:46:19 2012 From: chris.hegarty at oracle.com (chris.hegarty at oracle.com) Date: Thu, 20 Dec 2012 13:46:19 +0000 Subject: hg: jdk8/tl/jdk: 8002356: Add ForkJoin common pool and CountedCompleter Message-ID: <20121220134631.0AC22472CF@hg.openjdk.java.net> Changeset: d01a810798e0 Author: dl Date: 2012-12-20 13:44 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d01a810798e0 8002356: Add ForkJoin common pool and CountedCompleter Reviewed-by: chegar, mduigou ! make/java/java/FILES_java.gmk + src/share/classes/java/util/concurrent/CountedCompleter.java ! src/share/classes/java/util/concurrent/ForkJoinPool.java ! src/share/classes/java/util/concurrent/ForkJoinTask.java ! src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java From Alan.Bateman at oracle.com Thu Dec 20 14:01:19 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 20 Dec 2012 14:01:19 +0000 Subject: hg: jdk8/tl/jdk: 8004863: Infinite Loop in KeepAliveStream In-Reply-To: <20121218180436.864A647228@hg.openjdk.java.net> References: <20121218180436.864A647228@hg.openjdk.java.net> Message-ID: <50D31A2F.5040206@oracle.com> On 18/12/2012 18:04, martinrb at google.com wrote: > Changeset: 0fabdf676395 > Author: martin > Date: 2012-12-17 18:39 -0800 > URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0fabdf676395 > > 8004863: Infinite Loop in KeepAliveStream > Reviewed-by: chegar > > ! src/share/classes/sun/net/www/http/KeepAliveStream.java > + test/sun/net/www/http/KeepAliveStream/InfiniteLoop.java > Good to see you back! One little nit, this change is in area where warnings are fatal so if KeepAliveStream isn't compiled implicitly early in the build then the cast added in this change is fatal, see: ../../../../src/share/classes/sun/net/www/http/KeepAliveStream.java:86: warning: [cast] redundant cast to long do {} while ((nskip = (long) (expected - count)) > 0L ^ error: warnings found and -Werror specified 1 error 1 warning We should probably whack it while it is fresh. -Alan. From chris.hegarty at oracle.com Thu Dec 20 14:15:48 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 20 Dec 2012 14:15:48 +0000 Subject: hg: jdk8/tl/jdk: 8004863: Infinite Loop in KeepAliveStream In-Reply-To: <50D31A2F.5040206@oracle.com> References: <20121218180436.864A647228@hg.openjdk.java.net> <50D31A2F.5040206@oracle.com> Message-ID: <50D31D94.8040003@oracle.com> On 20/12/2012 14:01, Alan Bateman wrote: > > ../../../../src/share/classes/sun/net/www/http/KeepAliveStream.java:86: > warning: [cast] redundant cast to long > do {} while ((nskip = (long) (expected - count)) > 0L I can't help but feel responsible for this, since I reviewed the change. I filed 8005306: "Redundant cast warning in KeepAliveStream.java", to track the issue, and a proposed patch is below. hg diff KeepAliveStream.java diff -r e515956879cd src/share/classes/sun/net/www/http/KeepAliveStream.java --- a/src/share/classes/sun/net/www/http/KeepAliveStream.java Tue Dec 18 18:14:50 2012 -0800 +++ b/src/share/classes/sun/net/www/http/KeepAliveStream.java Thu Dec 20 14:13:17 2012 +0000 @@ -83,7 +83,7 @@ class KeepAliveStream extends MeteredStr if (expected > count) { long nskip = expected - count; if (nskip <= available()) { - do {} while ((nskip = (long) (expected - count)) > 0L + do {} while ((nskip = (expected - count)) > 0L && skip(Math.min(nskip, available())) > 0L); } else if (expected <= KeepAliveStreamCleaner.MAX_DATA_REMAINING && !hurried) { //put this KeepAliveStream on the queue so that the data remaining -Chris. From Alan.Bateman at oracle.com Thu Dec 20 14:34:58 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 20 Dec 2012 14:34:58 +0000 Subject: hg: jdk8/tl/jdk: 8004863: Infinite Loop in KeepAliveStream In-Reply-To: <50D31D94.8040003@oracle.com> References: <20121218180436.864A647228@hg.openjdk.java.net> <50D31A2F.5040206@oracle.com> <50D31D94.8040003@oracle.com> Message-ID: <50D32212.5080507@oracle.com> On 20/12/2012 14:15, Chris Hegarty wrote: > On 20/12/2012 14:01, Alan Bateman wrote: >> >> ../../../../src/share/classes/sun/net/www/http/KeepAliveStream.java:86: >> warning: [cast] redundant cast to long >> do {} while ((nskip = (long) (expected - count)) >> > 0L > > I can't help but feel responsible for this, since I reviewed the > change. I filed 8005306: "Redundant cast warning in > KeepAliveStream.java", to track the issue, and a proposed patch is below. > > hg diff KeepAliveStream.java > diff -r e515956879cd > src/share/classes/sun/net/www/http/KeepAliveStream.java > --- a/src/share/classes/sun/net/www/http/KeepAliveStream.java Tue > Dec 18 18:14:50 2012 -0800 > +++ b/src/share/classes/sun/net/www/http/KeepAliveStream.java Thu > Dec 20 14:13:17 2012 +0000 > @@ -83,7 +83,7 @@ class KeepAliveStream extends MeteredStr > if (expected > count) { > long nskip = expected - count; > if (nskip <= available()) { > - do {} while ((nskip = (long) (expected - count)) > > 0L > + do {} while ((nskip = (expected - count)) > 0L > && skip(Math.min(nskip, available())) > 0L); > } else if (expected <= > KeepAliveStreamCleaner.MAX_DATA_REMAINING && !hurried) { > //put this KeepAliveStream on the queue so that > the data remaining > > -Chris. Thanks Chris, looks fine to me. -Alan. From peter.levart at gmail.com Thu Dec 20 14:41:56 2012 From: peter.levart at gmail.com (Peter Levart) Date: Thu, 20 Dec 2012 15:41:56 +0100 Subject: Review request:Updated JDK-8004728 Implement core reflection API for parameter reflection In-Reply-To: <50D31690.1080501@oracle.com> References: <50D2431F.6030006@oracle.com> <50D2C7C0.6060900@gmail.com> <50D31690.1080501@oracle.com> Message-ID: <50D323B4.2020103@gmail.com> On 12/20/2012 02:45 PM, Joel Borggr?n-Franck wrote: > Hi Peter, Eric and and others, > > Thanks for your comments, > > On 12/20/2012 09:09 AM, Peter Levart wrote: >> Hi Eric and others, >> >> I'd also like to rise an internal design concern regarding construction >> of Parameter objects. Currently raw reflection data for Executable >> objects is obtained from the VM atomically - the whole Method or >> Constructor is fully constructed with all necessary information in one >> go. That's true also for parameter types and parameter annotations. New >> Parameter API is now "pulling" lazily some additional information from >> the VM (parameter names and modifiers). How does this play together with >> class re-definitions/re-transformations? Is it possible that a class >> re-definition changes parameter names? Can it change parameter >> annotations? >> >> Imagine one has a reference to a Method, that has since it's >> construction already been re-defined in the VM (for example a parameter >> name and annotation has changed). When asking for annotations on the >> re-defined parameter, you will get annotations that were actual at the >> time the Method was constructed, but when asked for the parameters and >> their names, you will get the already redefined names. >> >> I think that the more correct implementation would construct >> Method/Constructor objects in the VM with all the necessary information >> (parameter names and modifiers) already present in the Executable >> objects. This information could be conveniently packed and only unpacked >> and expanded on user's request - like annotations. >> > > I would like to go the opposite way with Executable, Method, Field and > Parameter, like the caches work on Class instances in your patch. > > Reflective Objects should be created with non-initialized caches of > metadata. When someone wants to look at the metatdata we should check > the redefine count on Class, and update the caches if necessary. There > is already infrastructure for this in the VM for the old annotations > byte[] on Field, Method and Constructor. That's good. So if someone has got a hold on a Method/Field/Constructor instance for a long time (for example some framework that caches reflective object itself), he/she/it will see annotations change between consecutive calls to the instance if they are re-defined. Regards, Peter > > I am unclear if the parameter name is part of the signature, this is > significant because (IIRC) signaturs can not change in redefine, but > parameter annotations should be able to change. > > cheers > /Joel From chris.hegarty at oracle.com Thu Dec 20 15:05:28 2012 From: chris.hegarty at oracle.com (chris.hegarty at oracle.com) Date: Thu, 20 Dec 2012 15:05:28 +0000 Subject: hg: jdk8/tl/jdk: 8005306: Redundant cast warning in KeepAliveStream.java Message-ID: <20121220150550.BC332472D3@hg.openjdk.java.net> Changeset: 31d2f9995d6c Author: chegar Date: 2012-12-20 15:04 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/31d2f9995d6c 8005306: Redundant cast warning in KeepAliveStream.java Reviewed-by: alanb ! src/share/classes/sun/net/www/http/KeepAliveStream.java From dmitry.samersoff at oracle.com Thu Dec 20 16:16:46 2012 From: dmitry.samersoff at oracle.com (dmitry.samersoff at oracle.com) Date: Thu, 20 Dec 2012 16:16:46 +0000 Subject: hg: jdk8/tl/jdk: 8005309: Missed tests for 6783290,6937053,7009998 Message-ID: <20121220161707.A434F472DC@hg.openjdk.java.net> Changeset: c1a55ee9618e Author: dsamersoff Date: 2012-12-20 20:12 +0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c1a55ee9618e 8005309: Missed tests for 6783290,6937053,7009998 Summary: Missed tests for 6783290,6937053,7009998 Reviewed-by: sjiang, emcmanus Contributed-by: jaroslav.bachorik at oracle.com + test/com/sun/jmx/remote/CCAdminReconnectTest.java + test/com/sun/jmx/remote/NotificationMarshalVersions/Client/Client.java + test/com/sun/jmx/remote/NotificationMarshalVersions/Client/ConfigKey.java + test/com/sun/jmx/remote/NotificationMarshalVersions/Client/TestNotification.java + test/com/sun/jmx/remote/NotificationMarshalVersions/Server/ConfigKey.java + test/com/sun/jmx/remote/NotificationMarshalVersions/Server/Server.java + test/com/sun/jmx/remote/NotificationMarshalVersions/Server/Ste.java + test/com/sun/jmx/remote/NotificationMarshalVersions/Server/SteMBean.java + test/com/sun/jmx/remote/NotificationMarshalVersions/Server/TestNotification.java + test/com/sun/jmx/remote/NotificationMarshalVersions/TestSerializationMismatch.sh + test/javax/management/MBeanInfo/SerializationTest1.java From Dmitry.Degrave at oracle.com Thu Dec 20 16:21:51 2012 From: Dmitry.Degrave at oracle.com (Dmeetry Degrave) Date: Thu, 20 Dec 2012 20:21:51 +0400 Subject: RFR: 7199858: Marshal exception is wrong Message-ID: <50D33B1F.7090504@oracle.com> Hi, I'm looking for a code review for a corba fix for 7 and 8, which is identical to fix went to earlier releases. A wrong "IOP00810247: (MARSHAL) Default union branch not expected" exception is thrown for discriminated unions with no matching discriminator and no default cases, while Section "7.11.2.2 Discriminated Unions" [*] says it's legal to use a union without default case and without covering all possible cases: *** 7.11.2.2 Discriminated Unions It is not required that all possible values of the union discriminator be listed in the . The value of a union is the value of the discriminator together with one of the following: * If the discriminator value was explicitly listed in a case statement, the value of the element associated with that case statement; * If a default case label was specified, the value of the element associated with the default case label; * No additional value. *** The fix is as simple as an elimination of the exception. Everything else is in a consistent state and the exception was just wrong. There is a test case which is attached to the bug though it requires a CORBA env setup. Fix was verified by Cu. webrev : http://cr.openjdk.java.net/~dmeetry/7199858/webrev.0/ bug: http://bugs.sun.com/view_bug.do?bug_id=7199858 [*] spec: http://www.omg.org/spec/CORBA/3.2/Interfaces/PDF/ thanks, dmeetry From joel.franck at oracle.com Thu Dec 20 16:29:58 2012 From: joel.franck at oracle.com (=?ISO-8859-1?Q?Joel_Borggr=E9n-Franck?=) Date: Thu, 20 Dec 2012 17:29:58 +0100 Subject: Review request:Updated JDK-8004728 Implement core reflection API for parameter reflection In-Reply-To: <50D323B4.2020103@gmail.com> References: <50D2431F.6030006@oracle.com> <50D2C7C0.6060900@gmail.com> <50D31690.1080501@oracle.com> <50D323B4.2020103@gmail.com> Message-ID: <50D33D06.2040606@oracle.com> On 12/20/2012 03:41 PM, Peter Levart wrote: > On 12/20/2012 02:45 PM, Joel Borggr?n-Franck wrote: >> Reflective Objects should be created with non-initialized caches of >> metadata. When someone wants to look at the metatdata we should check >> the redefine count on Class, and update the caches if necessary. There >> is already infrastructure for this in the VM for the old annotations >> byte[] on Field, Method and Constructor. > That's good. So if someone has got a hold on a Method/Field/Constructor > instance for a long time (for example some framework that caches > reflective object itself), he/she/it will see annotations change between > consecutive calls to the instance if they are re-defined. > > Regards, Peter Personally I don't like this, but that seems to be the way this is intended to work. See: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6422536 cheers /Joel From jim.gish at oracle.com Thu Dec 20 16:32:15 2012 From: jim.gish at oracle.com (Jim Gish) Date: Thu, 20 Dec 2012 11:32:15 -0500 Subject: RFR: 8005290: remove -showversion from RMI test library subprocess mechanism In-Reply-To: <50D265B2.8060103@oracle.com> References: <50D265B2.8060103@oracle.com> Message-ID: <50D33D8F.9050905@oracle.com> Hi Stuart, Looks good to me. Thanks, Jim On 12/19/2012 08:11 PM, Stuart Marks wrote: > Hi all, > > Please review the fix [1] for bug 8005290 [2]. > > [1] http://cr.openjdk.java.net/~smarks/reviews/8005290/webrev.0/ > > [2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8005290 > > I just filed this bug, so it hasn't made it to the public website yet. > The salient text from the bug report is as follows: > > ------------------------------------------------------------ > The RMI test library (jdk/test/java/rmi/testlibrary) has a convenience > API (the JavaVM class) for launching a JVM subprocess. When starting > the subprocess, it adds the -showversion option to the JVM command > line and waits for the version output to arrive from the subprocess > before returning to the caller. This is intended to avoid race > conditions where the test might try to contact the subprocess before > it's fully initialized. > > It turns out this doesn't really work and it's also unnecessary. > > The reason it doesn't really work is that the version string is > emitted when the JVM subprocess has mostly started up, but it hasn't > yet executed any user code. Even after the version string has been > emitted, the caller may still have to wait and retry before > successfully contacting a service exported by the subprocess. The > current code returns after two seconds, even if the version string > hasn't been received from the subprocess. So the caller has to wait > and potentially retry anyway. Since the callers have to do this > anyway, having the library wait for the version string isn't helpful. > > Other library code (e.g., RMID) starts the subprocess and waits until > a particular RMI service is ready, so the -showversion mechanism is > redundant in that case. Finally, many tests start the subprocess and > wait until it finishes, so they don't need the -showversion mechanism > either. > > Finally, the -showversion mechanism adds a lot of complexity, as it > has to interpose between the subprocess output stream and the caller, > so we're better off just removing it. All RMI tests continue to pass > even with this mechanism removed. > ------------------------------------------------------------ > > This is basically just test cleanup (no library code changes) to clear > the way for future test enhancements to improve performance and > reliability. > > Thanks, > > s'marks -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From chris.hegarty at oracle.com Thu Dec 20 16:48:19 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 20 Dec 2012 16:48:19 +0000 Subject: RFR: 8005290: remove -showversion from RMI test library subprocess mechanism In-Reply-To: <50D265B2.8060103@oracle.com> References: <50D265B2.8060103@oracle.com> Message-ID: <50D34153.8030004@oracle.com> From my limited knowledge of this, it look ok to me. -Chris. On 20/12/2012 01:11, Stuart Marks wrote: > Hi all, > > Please review the fix [1] for bug 8005290 [2]. > > [1] http://cr.openjdk.java.net/~smarks/reviews/8005290/webrev.0/ > > [2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8005290 > > I just filed this bug, so it hasn't made it to the public website yet. > The salient text from the bug report is as follows: > > ------------------------------------------------------------ > The RMI test library (jdk/test/java/rmi/testlibrary) has a convenience > API (the JavaVM class) for launching a JVM subprocess. When starting the > subprocess, it adds the -showversion option to the JVM command line and > waits for the version output to arrive from the subprocess before > returning to the caller. This is intended to avoid race conditions where > the test might try to contact the subprocess before it's fully initialized. > > It turns out this doesn't really work and it's also unnecessary. > > The reason it doesn't really work is that the version string is emitted > when the JVM subprocess has mostly started up, but it hasn't yet > executed any user code. Even after the version string has been emitted, > the caller may still have to wait and retry before successfully > contacting a service exported by the subprocess. The current code > returns after two seconds, even if the version string hasn't been > received from the subprocess. So the caller has to wait and potentially > retry anyway. Since the callers have to do this anyway, having the > library wait for the version string isn't helpful. > > Other library code (e.g., RMID) starts the subprocess and waits until a > particular RMI service is ready, so the -showversion mechanism is > redundant in that case. Finally, many tests start the subprocess and > wait until it finishes, so they don't need the -showversion mechanism > either. > > Finally, the -showversion mechanism adds a lot of complexity, as it has > to interpose between the subprocess output stream and the caller, so > we're better off just removing it. All RMI tests continue to pass even > with this mechanism removed. > ------------------------------------------------------------ > > This is basically just test cleanup (no library code changes) to clear > the way for future test enhancements to improve performance and > reliability. > > Thanks, > > s'marks From mark.reinhold at oracle.com Thu Dec 20 17:11:34 2012 From: mark.reinhold at oracle.com (mark.reinhold at oracle.com) Date: Thu, 20 Dec 2012 09:11:34 -0800 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: david.holmes@oracle.com; Thu, 20 Dec 2012 06:37:46 +1000; <50D2259A.4080806@oracle.com> Message-ID: <20121220171134.E89FA9FA@eggemoggin.niobe.net> 2012/12/19 12:37 -0800, david.holmes at oracle.com: > If multiple threads have to synchronize access to the buffer then the > reads/writes do not need to be atomic. Atomicity is only needed when > data races are allowed. Correct. Byte buffers, especially the direct variety, are all about performance. Making operations upon them atomic is not a problem that needs to be solved. - Mark From aleksey.shipilev at oracle.com Thu Dec 20 17:18:32 2012 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Thu, 20 Dec 2012 21:18:32 +0400 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: <20121220171134.E89FA9FA@eggemoggin.niobe.net> References: <20121220171134.E89FA9FA@eggemoggin.niobe.net> Message-ID: <50D34868.5030207@oracle.com> On 12/20/2012 09:11 PM, mark.reinhold at oracle.com wrote: > 2012/12/19 12:37 -0800, david.holmes at oracle.com: >> If multiple threads have to synchronize access to the buffer then the >> reads/writes do not need to be atomic. Atomicity is only needed when >> data races are allowed. > > Correct. > > Byte buffers, especially the direct variety, are all about performance. > Making operations upon them atomic is not a problem that needs to be > solved. I would say that you can have the read/write atomicity for heap ByteBuffers without the compromises in performance (i.e. like direct ByteBuffer does with full-width reads/writes) -- basically prune out the Java code which breaks ints into the series of bytes, and cram in Unsafe.putInt() against backing array. This is not about making the CAS updates, it is about making reads and writes appear indivisible. Seems to be a good thing even if unspec'ed. -Aleksey. From chris.hegarty at oracle.com Thu Dec 20 17:31:06 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 20 Dec 2012 17:31:06 +0000 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 Message-ID: <50D34B5A.8050103@oracle.com> This is a review request for the addition of utility methods to java.util.Arrays that provide sorting of arrays in parallel, JEP 103 [1]. Webrev: http://cr.openjdk.java.net/~chegar/8003981/ver.00/ Current sorting implementations provided by the Java Collections Framework (Collections.sort and Arrays.sort) all perform the sorting operation sequentially in the calling thread. This enhancement will offer the same set of sorting operations currently provided by the Arrays class, but with a parallel implementation that utilizes the Fork/Join framework. These new API?s are still synchronous with regard to the calling thread as it will not proceed past the sorting operation until the parallel sort is complete. The actual sorting API this proposal adds will leverage the ForkJoinPool.commonPool (default Fork/Join pool defined as part of JEP 155). The sorting algorithm is that used in Doug Lea?s ParallelArray implementation. This work was originally done over in the lambda/lambda repo by David Holmes, and is now being cleaned up and brought into jdk8. Open issues/differences from version in lambda: 1) Is is necessary for MIN_ARRAY_SORT_GRAN to be in the public API? It is an implementation detail (easy to remove). 2) The use of FJP.commonPool is an implementation detail, not part of the spec. Should not be a problem, just worth pointing out, as it differs from what is in lambda/lambda. -Chris. [1] http://openjdk.java.net/jeps/103 From Ulf.Zibis at CoSoCo.de Thu Dec 20 17:49:34 2012 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Thu, 20 Dec 2012 18:49:34 +0100 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: <50D34868.5030207@oracle.com> References: <20121220171134.E89FA9FA@eggemoggin.niobe.net> <50D34868.5030207@oracle.com> Message-ID: <50D34FAE.1050009@CoSoCo.de> Am 20.12.2012 18:18, schrieb Aleksey Shipilev: > On 12/20/2012 09:11 PM, mark.reinhold at oracle.com wrote: >> 2012/12/19 12:37 -0800, david.holmes at oracle.com: >>> If multiple threads have to synchronize access to the buffer then the >>> reads/writes do not need to be atomic. Atomicity is only needed when >>> data races are allowed. >> Correct. >> >> Byte buffers, especially the direct variety, are all about performance. >> Making operations upon them atomic is not a problem that needs to be >> solved. > I would say that you can have the read/write atomicity for heap > ByteBuffers without the compromises in performance (i.e. like direct > ByteBuffer does with full-width reads/writes) -- basically prune out the > Java code which breaks ints into the series of bytes, and cram in > Unsafe.putInt() against backing array. I believe, it would enhance performance too. Also intrinsifying could be interesting. Here is a similar request: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6914113 -Ulf From vitalyd at gmail.com Thu Dec 20 17:49:41 2012 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Thu, 20 Dec 2012 12:49:41 -0500 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: <50D34868.5030207@oracle.com> References: <20121220171134.E89FA9FA@eggemoggin.niobe.net> <50D34868.5030207@oracle.com> Message-ID: Aleksey, Just curious - what's the driver for this? Suppose it did have full width writes/reads - you still shouldn't use it in a data racey way since it's not spec'd to be threadsafe and you can only observe torn reads/writes if you access it without synchronization. As others have suggested, I think the right approach would be to create a threadsafe version that's documented to be as such. Just my $.02 Sent from my phone On Dec 20, 2012 12:19 PM, "Aleksey Shipilev" wrote: > On 12/20/2012 09:11 PM, mark.reinhold at oracle.com wrote: > > 2012/12/19 12:37 -0800, david.holmes at oracle.com: > >> If multiple threads have to synchronize access to the buffer then the > >> reads/writes do not need to be atomic. Atomicity is only needed when > >> data races are allowed. > > > > Correct. > > > > Byte buffers, especially the direct variety, are all about performance. > > Making operations upon them atomic is not a problem that needs to be > > solved. > > I would say that you can have the read/write atomicity for heap > ByteBuffers without the compromises in performance (i.e. like direct > ByteBuffer does with full-width reads/writes) -- basically prune out the > Java code which breaks ints into the series of bytes, and cram in > Unsafe.putInt() against backing array. > > This is not about making the CAS updates, it is about making reads and > writes appear indivisible. Seems to be a good thing even if unspec'ed. > > -Aleksey. > From aleksey.shipilev at oracle.com Thu Dec 20 17:54:41 2012 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Thu, 20 Dec 2012 21:54:41 +0400 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: References: <20121220171134.E89FA9FA@eggemoggin.niobe.net> <50D34868.5030207@oracle.com> Message-ID: <50D350E1.8020101@oracle.com> On 12/20/2012 09:49 PM, Vitaly Davidovich wrote: > Just curious - what's the driver for this? Suppose it did have full > width writes/reads - you still shouldn't use it in a data racey way > since it's not spec'd to be threadsafe and you can only observe torn > reads/writes if you access it without synchronization. The driver is the infamous "principle of least astonishment", aided by my purism. Java is remarkable in the way it deals with races, trying to surprise the least when something breaks. I think the change that brings in more consistency without sacrificing maintainability and/or performance is the change we endorse, right? -Aleksey. From vitalyd at gmail.com Thu Dec 20 18:03:07 2012 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Thu, 20 Dec 2012 13:03:07 -0500 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: <50D350E1.8020101@oracle.com> References: <20121220171134.E89FA9FA@eggemoggin.niobe.net> <50D34868.5030207@oracle.com> <50D350E1.8020101@oracle.com> Message-ID: But why would there be astonishment/surprise here if it says it's not threadsafe? I guess that's the part I'm having trouble understanding. Sent from my phone On Dec 20, 2012 12:54 PM, "Aleksey Shipilev" wrote: > On 12/20/2012 09:49 PM, Vitaly Davidovich wrote: > > Just curious - what's the driver for this? Suppose it did have full > > width writes/reads - you still shouldn't use it in a data racey way > > since it's not spec'd to be threadsafe and you can only observe torn > > reads/writes if you access it without synchronization. > > The driver is the infamous "principle of least astonishment", aided by > my purism. Java is remarkable in the way it deals with races, trying to > surprise the least when something breaks. I think the change that brings > in more consistency without sacrificing maintainability and/or > performance is the change we endorse, right? > > -Aleksey. > From jonathan.gibbons at oracle.com Thu Dec 20 18:09:39 2012 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Thu, 20 Dec 2012 18:09:39 +0000 Subject: hg: jdk8/tl/langtools: 8005307: fix missing @bug tags Message-ID: <20121220180944.2AD75472ED@hg.openjdk.java.net> Changeset: a22f23fb7abf Author: jjg Date: 2012-12-20 17:59 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/a22f23fb7abf 8005307: fix missing @bug tags Reviewed-by: jjh ! test/tools/doclint/AccessTest.java ! test/tools/doclint/AccessTest.package.out ! test/tools/doclint/AccessTest.private.out ! test/tools/doclint/AccessTest.protected.out ! test/tools/doclint/AccessTest.public.out ! test/tools/doclint/AccessibilityTest.java ! test/tools/doclint/AccessibilityTest.out ! test/tools/doclint/EmptyAuthorTest.java ! test/tools/doclint/EmptyAuthorTest.out ! test/tools/doclint/EmptyExceptionTest.java ! test/tools/doclint/EmptyExceptionTest.out ! test/tools/doclint/EmptyParamTest.java ! test/tools/doclint/EmptyParamTest.out ! test/tools/doclint/EmptyReturnTest.java ! test/tools/doclint/EmptyReturnTest.out ! test/tools/doclint/EmptySerialDataTest.java ! test/tools/doclint/EmptySerialDataTest.out ! test/tools/doclint/EmptySerialFieldTest.java ! test/tools/doclint/EmptySerialFieldTest.out ! test/tools/doclint/EmptySinceTest.java ! test/tools/doclint/EmptySinceTest.out ! test/tools/doclint/EmptyVersionTest.java ! test/tools/doclint/EmptyVersionTest.out ! test/tools/doclint/HtmlAttrsTest.java ! test/tools/doclint/HtmlAttrsTest.out ! test/tools/doclint/HtmlTagsTest.java ! test/tools/doclint/HtmlTagsTest.out ! test/tools/doclint/MissingParamsTest.java ! test/tools/doclint/MissingParamsTest.out ! test/tools/doclint/MissingReturnTest.java ! test/tools/doclint/MissingReturnTest.out ! test/tools/doclint/MissingThrowsTest.java ! test/tools/doclint/MissingThrowsTest.out ! test/tools/doclint/OptionTest.java ! test/tools/doclint/OverridesTest.java ! test/tools/doclint/ReferenceTest.java ! test/tools/doclint/ReferenceTest.out ! test/tools/doclint/RunTest.java ! test/tools/doclint/SyntaxTest.java ! test/tools/doclint/SyntaxTest.out ! test/tools/doclint/SyntheticTest.java ! test/tools/doclint/ValidTest.java ! test/tools/doclint/tidy/AnchorAlreadyDefined.java ! test/tools/doclint/tidy/AnchorAlreadyDefined.out ! test/tools/doclint/tidy/BadEnd.java ! test/tools/doclint/tidy/BadEnd.out ! test/tools/doclint/tidy/InsertImplicit.java ! test/tools/doclint/tidy/InsertImplicit.out ! test/tools/doclint/tidy/InvalidEntity.java ! test/tools/doclint/tidy/InvalidEntity.out ! test/tools/doclint/tidy/InvalidName.java ! test/tools/doclint/tidy/InvalidName.out ! test/tools/doclint/tidy/InvalidTag.java ! test/tools/doclint/tidy/InvalidTag.out ! test/tools/doclint/tidy/InvalidURI.java ! test/tools/doclint/tidy/InvalidURI.out ! test/tools/doclint/tidy/MissingGT.java ! test/tools/doclint/tidy/MissingGT.out ! test/tools/doclint/tidy/MissingTag.java ! test/tools/doclint/tidy/MissingTag.out ! test/tools/doclint/tidy/NestedTag.java ! test/tools/doclint/tidy/NestedTag.out ! test/tools/doclint/tidy/ParaInPre.java ! test/tools/doclint/tidy/ParaInPre.out ! test/tools/doclint/tidy/RepeatedAttr.java ! test/tools/doclint/tidy/RepeatedAttr.out ! test/tools/doclint/tidy/TextNotAllowed.java ! test/tools/doclint/tidy/TextNotAllowed.out ! test/tools/doclint/tidy/TrimmingEmptyTag.java ! test/tools/doclint/tidy/TrimmingEmptyTag.out ! test/tools/doclint/tidy/UnescapedOrUnknownEntity.java ! test/tools/doclint/tidy/UnescapedOrUnknownEntity.out From aleksey.shipilev at oracle.com Thu Dec 20 18:22:35 2012 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Thu, 20 Dec 2012 22:22:35 +0400 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: References: <20121220171134.E89FA9FA@eggemoggin.niobe.net> <50D34868.5030207@oracle.com> <50D350E1.8020101@oracle.com> Message-ID: <50D3576B.3070803@oracle.com> The astonishment comes from this: a. racy Unsafe.putInt(...) to byte[] is atomic* b. racy direct ByteBuffer.putInt(...) is atomic* c. racy heap ByteBuffer.putInt(...) is NOT! d. racy heap ByteBuffer.asIntBuffer().put(...) is NOT atomic again! So then, the hacky code over the byte arrays appears more consistent than public API, without any solid reason for that? Granted, we can always put our fingers in our ears and sing "la-la-la, you were never guaranteed that", but I would say this is surprising inconsistency. And by the way direct ByteBuffers (inadvertently) deal with that, it's obvious we can do the same for heap ByteBuffers. I feel dumb for having to explain this, I should have probably publish the CR with the change and advocate it helps performance, fixing the atomicity issue under the cover. The atomicity does not have to be spec'ed, but I would certainly vote for it for the equivalent implementation. Sorry for mudding the quiet waters. -Aleksey. (*) subject to underlying hardware memory model, alignment, etc. On 12/20/2012 10:03 PM, Vitaly Davidovich wrote: > But why would there be astonishment/surprise here if it says it's not > threadsafe? I guess that's the part I'm having trouble understanding. > > Sent from my phone > > On Dec 20, 2012 12:54 PM, "Aleksey Shipilev" > > wrote: > > On 12/20/2012 09:49 PM, Vitaly Davidovich wrote: > > Just curious - what's the driver for this? Suppose it did have full > > width writes/reads - you still shouldn't use it in a data racey way > > since it's not spec'd to be threadsafe and you can only observe torn > > reads/writes if you access it without synchronization. > > The driver is the infamous "principle of least astonishment", aided by > my purism. Java is remarkable in the way it deals with races, trying to > surprise the least when something breaks. I think the change that brings > in more consistency without sacrificing maintainability and/or > performance is the change we endorse, right? > > -Aleksey. > From darryl.mocek at oracle.com Thu Dec 20 18:36:49 2012 From: darryl.mocek at oracle.com (Darryl Mocek) Date: Thu, 20 Dec 2012 10:36:49 -0800 Subject: RFR: 8005290: remove -showversion from RMI test library subprocess mechanism In-Reply-To: <50D265B2.8060103@oracle.com> References: <50D265B2.8060103@oracle.com> Message-ID: <50D35AC1.4050505@oracle.com> Hi Stuart, the changes look fine to me. The only comments I have are to remove the java.util.Properties import from JavaVM and possibly to use explicit imports instead of * imports in JavaVM and StreamPipe. Darryl On 12/19/2012 05:11 PM, Stuart Marks wrote: > Hi all, > > Please review the fix [1] for bug 8005290 [2]. > > [1] http://cr.openjdk.java.net/~smarks/reviews/8005290/webrev.0/ > > [2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8005290 > > I just filed this bug, so it hasn't made it to the public website yet. > The salient text from the bug report is as follows: > > ------------------------------------------------------------ > The RMI test library (jdk/test/java/rmi/testlibrary) has a convenience > API (the JavaVM class) for launching a JVM subprocess. When starting > the subprocess, it adds the -showversion option to the JVM command > line and waits for the version output to arrive from the subprocess > before returning to the caller. This is intended to avoid race > conditions where the test might try to contact the subprocess before > it's fully initialized. > > It turns out this doesn't really work and it's also unnecessary. > > The reason it doesn't really work is that the version string is > emitted when the JVM subprocess has mostly started up, but it hasn't > yet executed any user code. Even after the version string has been > emitted, the caller may still have to wait and retry before > successfully contacting a service exported by the subprocess. The > current code returns after two seconds, even if the version string > hasn't been received from the subprocess. So the caller has to wait > and potentially retry anyway. Since the callers have to do this > anyway, having the library wait for the version string isn't helpful. > > Other library code (e.g., RMID) starts the subprocess and waits until > a particular RMI service is ready, so the -showversion mechanism is > redundant in that case. Finally, many tests start the subprocess and > wait until it finishes, so they don't need the -showversion mechanism > either. > > Finally, the -showversion mechanism adds a lot of complexity, as it > has to interpose between the subprocess output stream and the caller, > so we're better off just removing it. All RMI tests continue to pass > even with this mechanism removed. > ------------------------------------------------------------ > > This is basically just test cleanup (no library code changes) to clear > the way for future test enhancements to improve performance and > reliability. > > Thanks, > > s'marks From brent.christian at oracle.com Thu Dec 20 18:52:28 2012 From: brent.christian at oracle.com (Brent Christian) Date: Thu, 20 Dec 2012 10:52:28 -0800 Subject: RFR : 8003228 : (props) sun.jnu.encoding should be set to UTF-8 [macosx] Message-ID: <50D35E6C.8060205@oracle.com> Hi, I've prepared a JDK 8 fix for 8003228 [1]. The webrev is here: http://cr.openjdk.java.net/~bchristi/8003228/webrev.00/ JPRT passes on all platforms (with the exception of two known bugs[2]). There was some recent discussion related to this - see [3]. Thanks, -Brent [1] http://bugs.sun.com/view_bug.do?bug_id=8003228 [2] 8005195 (Doclint tests on Windows), 8004544 (FDSeparateCompilationTest timeout) [3] http://mail.openjdk.java.net/pipermail/macosx-port-dev/2012-November/005124.html From aleksey.shipilev at oracle.com Thu Dec 20 19:03:32 2012 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Thu, 20 Dec 2012 23:03:32 +0400 Subject: RFR (XS): CR 8004330: Add missing Unsafe entry points for addAndGet() family Message-ID: <50D36104.8000701@oracle.com> Hi, Sorry for cross-list posting, but this change affects both HS and JDK. This simple change is missing from recently committed CR 7023898. While the VM support is there in Hotspot, no methods are exposed in Unsafe to actually make use of those intrinsics. This is the webrev fixing that: http://cr.openjdk.java.net/~shade/8004330/webrev.00/ It turns out the getAndSet intrinsics HotSpot are overloaded, which had deluged both Doug and me in the previous patch. These namings are inconsistent with other Unsafe intrinsic naming convention, so this change fixes that as well. Testing: - Built and tested in Linux x86_64 - java-concurrency-torture [1] atomicity tests are passed for AtomicIntegerV8 [2] and AtomicLongV8 [3] making use of those intrinsics on Linux x86_64 - running the java-concurrency-torture tests "-XX:+PrintInlining | grep Unsafe" tells all intrinsics have been successfully inlined - no other testing is expected for this trivial change. I would need a sponsor to push this. Thanks for your patience and reviews! Contributors: - dl: original patch, testing - shade: due diligence, messing with reviews, tests, and rebuilds -Aleksey. [1] https://github.com/shipilev/java-concurrency-torture/ [2] https://github.com/shipilev/java-concurrency-torture/blob/master/src/main/java/org/openjdk/concurrent/torture/tests/atomics/integer/AtomicIntegerV8PairwiseTests.java [3] https://github.com/shipilev/java-concurrency-torture/blob/master/src/main/java/org/openjdk/concurrent/torture/tests/atomics/longs/AtomicLongV8PairwiseTests.java From vitalyd at gmail.com Thu Dec 20 19:29:48 2012 From: vitalyd at gmail.com (Vitaly Davidovich) Date: Thu, 20 Dec 2012 14:29:48 -0500 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: <50D3576B.3070803@oracle.com> References: <20121220171134.E89FA9FA@eggemoggin.niobe.net> <50D34868.5030207@oracle.com> <50D350E1.8020101@oracle.com> <50D3576B.3070803@oracle.com> Message-ID: In the name of performance, go for it. :) Vitaly Sent from my phone On Dec 20, 2012 1:22 PM, "Aleksey Shipilev" wrote: > The astonishment comes from this: > a. racy Unsafe.putInt(...) to byte[] is atomic* > b. racy direct ByteBuffer.putInt(...) is atomic* > c. racy heap ByteBuffer.putInt(...) is NOT! > d. racy heap ByteBuffer.asIntBuffer().put(...) is NOT atomic again! > > So then, the hacky code over the byte arrays appears more consistent > than public API, without any solid reason for that? Granted, we can > always put our fingers in our ears and sing "la-la-la, you were never > guaranteed that", but I would say this is surprising inconsistency. And > by the way direct ByteBuffers (inadvertently) deal with that, it's > obvious we can do the same for heap ByteBuffers. > > I feel dumb for having to explain this, I should have probably publish > the CR with the change and advocate it helps performance, fixing the > atomicity issue under the cover. The atomicity does not have to be > spec'ed, but I would certainly vote for it for the equivalent > implementation. > > Sorry for mudding the quiet waters. > > -Aleksey. > > (*) subject to underlying hardware memory model, alignment, etc. > > On 12/20/2012 10:03 PM, Vitaly Davidovich wrote: > > But why would there be astonishment/surprise here if it says it's not > > threadsafe? I guess that's the part I'm having trouble understanding. > > > > Sent from my phone > > > > On Dec 20, 2012 12:54 PM, "Aleksey Shipilev" > > > > wrote: > > > > On 12/20/2012 09:49 PM, Vitaly Davidovich wrote: > > > Just curious - what's the driver for this? Suppose it did have full > > > width writes/reads - you still shouldn't use it in a data racey way > > > since it's not spec'd to be threadsafe and you can only observe > torn > > > reads/writes if you access it without synchronization. > > > > The driver is the infamous "principle of least astonishment", aided > by > > my purism. Java is remarkable in the way it deals with races, trying > to > > surprise the least when something breaks. I think the change that > brings > > in more consistency without sacrificing maintainability and/or > > performance is the change we endorse, right? > > > > -Aleksey. > > > > From Alan.Bateman at oracle.com Thu Dec 20 20:01:35 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 20 Dec 2012 20:01:35 +0000 Subject: 8005281: (props) loadFromXML/storeToXML with small parser is not thread safe Message-ID: <50D36E9F.4080400@oracle.com> The small footprint XML parser that we pushed yesterday for use with Properties isn't thread safe but the properties provider assumes that it is. I should have spotted this before pushing the changes. The change to fix it is trivial and I've added a basher test that duplicates it almost immediately. The webrev is here: http://cr.openjdk.java.net/~alanb/8005281/webrev/ Thanks, Alan. From mandy.chung at oracle.com Thu Dec 20 20:21:00 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 20 Dec 2012 12:21:00 -0800 Subject: 8005281: (props) loadFromXML/storeToXML with small parser is not thread safe In-Reply-To: <50D36E9F.4080400@oracle.com> References: <50D36E9F.4080400@oracle.com> Message-ID: <50D3732C.3000104@oracle.com> On 12/20/12 12:01 PM, Alan Bateman wrote: > > The small footprint XML parser that we pushed yesterday for use with > Properties isn't thread safe but the properties provider assumes that > it is. I should have spotted this before pushing the changes. The > change to fix it is trivial and I've added a basher test that > duplicates it almost immediately. The webrev is here: > > http://cr.openjdk.java.net/~alanb/8005281/webrev/ I missed it too - sorry for not catching it. Thumbs up. Mandy From alan.bateman at oracle.com Thu Dec 20 20:32:45 2012 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Thu, 20 Dec 2012 20:32:45 +0000 Subject: hg: jdk8/tl/jdk: 8001048: JSR-160: Allow IIOP transport to be optional Message-ID: <20121220203306.F0171472FD@hg.openjdk.java.net> Changeset: edb71a37fcb7 Author: alanb Date: 2012-12-20 20:29 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/edb71a37fcb7 8001048: JSR-160: Allow IIOP transport to be optional Reviewed-by: dsamersoff, dfuchs, mchung ! src/share/classes/com/sun/jmx/remote/internal/IIOPHelper.java ! src/share/classes/javax/management/remote/JMXConnectorFactory.java ! src/share/classes/javax/management/remote/JMXConnectorServerFactory.java ! src/share/classes/javax/management/remote/rmi/RMIConnector.java ! src/share/classes/javax/management/remote/rmi/RMIConnectorServer.java ! src/share/classes/javax/management/remote/rmi/package.html ! test/javax/management/remote/mandatory/connection/AddressableTest.java ! test/javax/management/remote/mandatory/connection/CloseableTest.java ! test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java ! test/javax/management/remote/mandatory/connection/IIOPURLTest.java ! test/javax/management/remote/mandatory/connection/IdleTimeoutTest.java ! test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java ! test/javax/management/remote/mandatory/connectorServer/SetMBeanServerForwarder.java ! test/javax/management/remote/mandatory/loading/MissingClassTest.java ! test/javax/management/remote/mandatory/provider/ProviderTest.java ! test/javax/management/remote/mandatory/serverError/JMXServerErrorTest.java From alan.bateman at oracle.com Thu Dec 20 20:46:20 2012 From: alan.bateman at oracle.com (alan.bateman at oracle.com) Date: Thu, 20 Dec 2012 20:46:20 +0000 Subject: hg: jdk8/tl/jdk: 8005281: (props) loadFromXML/storeToXML with small parser is not thread safe Message-ID: <20121220204631.7E4FF472FE@hg.openjdk.java.net> Changeset: eeda18683ddc Author: alanb Date: 2012-12-20 20:40 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/eeda18683ddc 8005281: (props) loadFromXML/storeToXML with small parser is not thread safe Reviewed-by: mchung ! src/share/classes/jdk/internal/util/xml/BasicXmlPropertiesProvider.java + test/java/util/Properties/ConcurrentLoadAndStoreXML.java From Ulf.Zibis at CoSoCo.de Thu Dec 20 21:06:38 2012 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Thu, 20 Dec 2012 22:06:38 +0100 Subject: Fwd: Re: Review request: 8003562: Provide a command-line tool to find static dependenciesh In-Reply-To: <50D337B0.2090504@oracle.com> References: <50D0F867.80100@oracle.com> <50D337B0.2090504@oracle.com> Message-ID: <50D37DDE.6040905@CoSoCo.de> Hi Mandy, I had much to do, guessed, all would be all-right. I first had problems to find my proposed changes from 2012-12-15 in your code. Now I found it. You did it even better Just an additional nit in JDepsTask: 511 if (o.hasArg) { 512 String arg = null; 513 if (name.startsWith("--") && name.indexOf('=') > 0) { 514 arg = name.substring(name.indexOf('=')+1, name.length()); 515 } else { 516 arg = rest.hasNext() ? rest.next() : "-"; 517 } 518 if (arg.startsWith("-")) { 519 throw new BadArgs("err.missing.arg", name).showUsage(true); 520 } else { 521 o.process(this, name, arg); 522 } 523 } else { 524 o.process(this, name, null); 525 } Could just be: 511 String param = null; 512 if (o.hasArg) { 513 if (name.startsWith("--") && name.indexOf('=') > 0) { 514 param = name.substring(name.indexOf('=')+1, name.length()); 515 } else if (!rest.hasNext() || (param = rest.next()).startsWith("-")) { 516 throw new BadArgs("err.missing.param", name).showUsage(true); 517 } 518 } 519 o.process(this, name, param); This additionally would allow negative values for the outlined option. (to avoid confusion with the upper loop, better rename arg-->param) You do not like for loops? : 492 boolean acceptOption = true; 493 while (iter.hasNext()) { 494 String arg = iter.next(); 495 if (arg.startsWith("-") && acceptOption) { Could be: 492 boolean acceptOption = true; 493 for (String arg; iter.hasNext(); arg = iter.next()) { 494 if (acceptOption && arg.startsWith("-")) { // swap order for better performance Additionally while loops tend to JIT-compile bad, see: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6932855 *Not* a nit: You do not handle a missing option parameter for the outlined form. So I think, you better handle existence and validity (e.g. wrong leading '-') or parameters by process(this, name, param) and just code: 513 o.process(this, name, (name.startsWith("--") && name.indexOf('=') > 0) 514 ? name.substring(name.indexOf('=')+1, name.length()); 515 : o.hasArg && rest.hasNext() ? rest.next() : null); This additionally would allow negative values for both option forms. As the algorithm now is very short, it could be easily inlined in the calling method About the options an additional thought: -v --verbose Print additional information -V --verbose-level= Print package-level or class-level dependencies Valid levels are: "package" and "class" 1. I think, --verbose-level= is too verbose, why not just --verbose= or maybe alternatively: -l --level= Print package-level or class-level dependencies. -D --dependency-level= Print package-level or class-level dependencies. 2. It's not clear if -v/--verbose without parameter means one of the others with which default. 3. I more would like only 1 verbose option, something like: -v --verbose= Print additional information; optional valid level dependencies: "package" and "class" 4. Couldn't you use lower-case -r for --recursive ? -Ulf Am 20.12.2012 17:07, schrieb Mandy Chung: > Ulf, > > Thanks for all the feedback. Just to double check - are you ok with the new webrev? > > Mandy > > -------- Original Message -------- > Subject: Re: Review request: 8003562: Provide a command-line tool to find static dependencies > Date: Tue, 18 Dec 2012 15:12:39 -0800 > From: Mandy Chung > To: Ulf Zibis , Alan Bateman > CC: core-libs-dev at openjdk.java.net, compiler-dev at openjdk.java.net > > > > Alan, Ulf, > > I updated the jdeps CLI per the discussion we had. > > $ jdeps --help > Usage: jdeps > where can be a pathname to a .class file, a directory, a JAR file, > or a fully-qualified classname or wildcard "*". Possible options include: > -s --summary Print dependency summary only > -v --verbose Print additional information > -V --verbose-level= Print package-level or > class-level dependencies > Valid levels are: "package" and > "class" > -c --classpath= Specify where to find class files > -p --package= Restrict analysis to classes in > this package > (may be given multiple times) > -e --regex= Restrict analysis to packages > matching pattern > (-p and -e are exclusive) > -P --profile Show profile or the file > containing a package > -R --recursive Recursively traverse all > dependencies > --version Version information > > Updated webrev: > http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.06/ > > jdeps only support GNU-style options. I added java.util.function > and com.sun.source.doctree in the jdk.properties. I'll replace > it to use the proper javac API to work with profiles next. I > caught a typo 'com.sunsource.doctree' (missing dot) in NON_CORE_PKGS.gmk > and I fix that in this patch. > > We can enhance the tool after the initial push. I'd like to get it > in jdk8 soon so that developers can try it out and give feedback. > > Thanks > Mandy From mandy.chung at oracle.com Thu Dec 20 21:46:08 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 20 Dec 2012 13:46:08 -0800 Subject: Fwd: Re: Review request: 8003562: Provide a command-line tool to find static dependenciesh In-Reply-To: <50D37DDE.6040905@CoSoCo.de> References: <50D0F867.80100@oracle.com> <50D337B0.2090504@oracle.com> <50D37DDE.6040905@CoSoCo.de> Message-ID: <50D38720.3020408@oracle.com> On 12/20/12 1:06 PM, Ulf Zibis wrote: > Hi Mandy, > > I had much to do, guessed, all would be all-right. > > I first had problems to find my proposed changes from 2012-12-15 in > your code. > Now I found it. You did it even better > > Just an additional nit in JDepsTask: > 511 if (o.hasArg) { > 512 String arg = null; > 513 if (name.startsWith("--") && > name.indexOf('=') > 0) { > 514 arg = name.substring(name.indexOf('=')+1, > name.length()); > 515 } else { > 516 arg = rest.hasNext() ? rest.next() : "-"; > 517 } > 518 if (arg.startsWith("-")) { > 519 throw new BadArgs("err.missing.arg", > name).showUsage(true); > 520 } else { > 521 o.process(this, name, arg); > 522 } > 523 } else { > 524 o.process(this, name, null); > 525 } > > Could just be: > 511 String param = null; > 512 if (o.hasArg) { > 513 if (name.startsWith("--") && > name.indexOf('=') > 0) { > 514 param = > name.substring(name.indexOf('=')+1, name.length()); > 515 } else if (!rest.hasNext() || (param = > rest.next()).startsWith("-")) { > 516 throw new BadArgs("err.missing.param", > name).showUsage(true); > 517 } > 518 } > 519 o.process(this, name, param); > This additionally would allow negative values for the outlined option. > (to avoid confusion with the upper loop, better rename arg-->param) I can fix this. I tend not to inline the assignment in a long statement with multiple-evaluation for readability. For this case, I like your suggestion to be concise while readable. > > You do not like for loops? : I like for-loop :) What you suggested last time and below has a bug > 492 boolean acceptOption = true; > 493 while (iter.hasNext()) { > 494 String arg = iter.next(); > 495 if (arg.startsWith("-") && acceptOption) { > Could be: > 492 boolean acceptOption = true; > 493 for (String arg; iter.hasNext(); arg = iter.next()) { arg is initialized after the first iteration. I could do for (; iter.hasNext() && ((arg = iter.next()) != null);) { ... } but I don't see how it's much prettier than the while-loop above (2-line into 1-line). I considered to use foreach and move away from Iterator. > 494 if (acceptOption && arg.startsWith("-")) { // swap > order for better performance > Additionally while loops tend to JIT-compile bad, see: > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6932855 > OK. > *Not* a nit: > You do not handle a missing option parameter for the outlined form. do you have an example what it doesn't handle? If it's missing, the first given file will be used as the option parameter. It validates the option parameter for the case we can. There are cases we can't (e.g. classpath). > So I think, you better handle existence and validity (e.g. wrong > leading '-') or parameters by process(this, name, param) and just code: > 513 o.process(this, name, (name.startsWith("--") && > name.indexOf('=') > 0) > 514 ? name.substring(name.indexOf('=')+1, > name.length()); > 515 : o.hasArg && rest.hasNext() ? > rest.next() : null); > This additionally would allow negative values for both option forms. > As the algorithm now is very short, it could be easily inlined in the > calling method > I may be missing the problem you try to point out. And this is harder to read for me :) > > About the options an additional thought: > -v --verbose Print additional information > -V --verbose-level= Print package-level or > class-level dependencies > Valid levels are: "package" and > "class" I somewhat agree with this but I'd like to get this out for people to try and get feedback. We can refine the options after the first push. I expect the tool will evolve and the options may be revised too. For example there are some additional information we can enhance the tool to print out (e.g. there is a suggestion to include the method/field reference count from one class to another that will be a useful hint to indicate how interconnected a class depends on the other). Mandy > 1. I think, --verbose-level= is too verbose, why not just > --verbose= or maybe alternatively: > -l --level= Print package-level or class-level > dependencies. > -D --dependency-level= Print package-level or > class-level dependencies. > 2. It's not clear if -v/--verbose without parameter means one of the > others with which default. > 3. I more would like only 1 verbose option, something like: > -v --verbose= Print additional information; optional > valid level dependencies: > "package" and "class" > > 4. Couldn't you use lower-case -r for --recursive ? > > -Ulf > > > Am 20.12.2012 17:07, schrieb Mandy Chung: >> Ulf, >> >> Thanks for all the feedback. Just to double check - are you ok with >> the new webrev? >> >> Mandy >> >> -------- Original Message -------- >> Subject: Re: Review request: 8003562: Provide a command-line tool to >> find static dependencies >> Date: Tue, 18 Dec 2012 15:12:39 -0800 >> From: Mandy Chung >> To: Ulf Zibis , Alan Bateman >> >> CC: core-libs-dev at openjdk.java.net, compiler-dev at openjdk.java.net >> >> >> >> Alan, Ulf, >> >> I updated the jdeps CLI per the discussion we had. >> >> $ jdeps --help >> Usage: jdeps >> where can be a pathname to a .class file, a directory, a JAR file, >> or a fully-qualified classname or wildcard "*". Possible options include: >> -s --summary Print dependency summary only >> -v --verbose Print additional information >> -V --verbose-level= Print package-level or >> class-level dependencies >> Valid levels are: "package" and >> "class" >> -c --classpath= Specify where to find class files >> -p --package= Restrict analysis to classes in >> this package >> (may be given multiple times) >> -e --regex= Restrict analysis to packages >> matching pattern >> (-p and -e are exclusive) >> -P --profile Show profile or the file >> containing a package >> -R --recursive Recursively traverse all >> dependencies >> --version Version information >> >> Updated webrev: >> http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.06/ >> >> jdeps only support GNU-style options. I added java.util.function >> and com.sun.source.doctree in the jdk.properties. I'll replace >> it to use the proper javac API to work with profiles next. I >> caught a typo 'com.sunsource.doctree' (missing dot) in NON_CORE_PKGS.gmk >> and I fix that in this patch. >> >> We can enhance the tool after the initial push. I'd like to get it >> in jdk8 soon so that developers can try it out and give feedback. >> >> Thanks >> Mandy > From stuart.marks at oracle.com Thu Dec 20 22:11:46 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Thu, 20 Dec 2012 14:11:46 -0800 Subject: RFR: [jdk7u-dev] - 8003898: X11 toolkit can be chosen as the default toolkit In-Reply-To: <50D17B86.2050005@oracle.com> References: <50CF689A.6090905@oracle.com> <50D17B86.2050005@oracle.com> Message-ID: <50D38D22.8030807@oracle.com> On 12/19/12 12:32 AM, Alan Bateman wrote: > On 17/12/2012 18:46, Rob McKenna wrote: >> Hi folks, >> >> This review contains: >> >> 8003898: X11 toolkit can be chosen as the default toolkit >> 7162111: TEST_BUG: change tests run in headless mode [macosx] (open) >> 8004928: TEST_BUG: Reduce dependence of CoreLib tests from the AWT subsystem >> >> Unfortunately the last two patches didn't apply cleanly, hence the review >> request. (the commit comments will be altered appropriately before integration) >> >> Webrev at: >> >> http://cr.openjdk.java.net/~robm/7162111/webrev.01/ >> > 8003898 is important to get into jdk7u, but I don't think 7162111 or 8004928 is > really needed there. Isn't 7162111 important to avoid hangs/failures when running the tests on the Mac? Plus it removes tests from the problem list so we get better test coverage in 7u. s'marks From brent.christian at oracle.com Thu Dec 20 22:20:04 2012 From: brent.christian at oracle.com (Brent Christian) Date: Thu, 20 Dec 2012 14:20:04 -0800 Subject: RFR : 8003228 : (props) sun.jnu.encoding should be set to UTF-8 [macosx] In-Reply-To: <50D35E6C.8060205@oracle.com> References: <50D35E6C.8060205@oracle.com> Message-ID: <50D38F14.5050100@oracle.com> Forgot a regtest - now included w/ v.01: http://cr.openjdk.java.net/~bchristi/8003228/webrev.01/ Thanks, -Brent On 12/20/12 10:52 AM, Brent Christian wrote: > Hi, > > I've prepared a JDK 8 fix for 8003228 [1]. The webrev is here: > http://cr.openjdk.java.net/~bchristi/8003228/webrev.00/ > > JPRT passes on all platforms (with the exception of two known bugs[2]). > > There was some recent discussion related to this - see [3]. > > Thanks, > -Brent > > [1] http://bugs.sun.com/view_bug.do?bug_id=8003228 > > [2] 8005195 (Doclint tests on Windows), 8004544 > (FDSeparateCompilationTest timeout) > > [3] > http://mail.openjdk.java.net/pipermail/macosx-port-dev/2012-November/005124.html > > From david.holmes at oracle.com Fri Dec 21 00:44:35 2012 From: david.holmes at oracle.com (David Holmes) Date: Fri, 21 Dec 2012 10:44:35 +1000 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: <50D3576B.3070803@oracle.com> References: <20121220171134.E89FA9FA@eggemoggin.niobe.net> <50D34868.5030207@oracle.com> <50D350E1.8020101@oracle.com> <50D3576B.3070803@oracle.com> Message-ID: <50D3B0F3.7030509@oracle.com> On 21/12/2012 4:22 AM, Aleksey Shipilev wrote: > The astonishment comes from this: > a. racy Unsafe.putInt(...) to byte[] is atomic* > b. racy direct ByteBuffer.putInt(...) is atomic* > c. racy heap ByteBuffer.putInt(...) is NOT! > d. racy heap ByteBuffer.asIntBuffer().put(...) is NOT atomic again! The only thing I find astonishing here is that anyone would spend time analysing how different non-thread-safe data structures behave in the face of data races. Seriously I think you are in a very small crowd :) Even the c-i discussion was all over the field with very little actual discussion of atomicity as such. If there are performance issues that can be addressed here, or you can generally make this "better", then fine. But atomicity is not a problem here and the last thing we want is to encourage people to use these classes in racy contexts because they now think it is "safe" because of atomic accesses. David ---- > So then, the hacky code over the byte arrays appears more consistent > than public API, without any solid reason for that? Granted, we can > always put our fingers in our ears and sing "la-la-la, you were never > guaranteed that", but I would say this is surprising inconsistency. And > by the way direct ByteBuffers (inadvertently) deal with that, it's > obvious we can do the same for heap ByteBuffers. > > I feel dumb for having to explain this, I should have probably publish > the CR with the change and advocate it helps performance, fixing the > atomicity issue under the cover. The atomicity does not have to be > spec'ed, but I would certainly vote for it for the equivalent > implementation. > > Sorry for mudding the quiet waters. > > -Aleksey. > > (*) subject to underlying hardware memory model, alignment, etc. > > On 12/20/2012 10:03 PM, Vitaly Davidovich wrote: >> But why would there be astonishment/surprise here if it says it's not >> threadsafe? I guess that's the part I'm having trouble understanding. >> >> Sent from my phone >> >> On Dec 20, 2012 12:54 PM, "Aleksey Shipilev" >> > wrote: >> >> On 12/20/2012 09:49 PM, Vitaly Davidovich wrote: >> > Just curious - what's the driver for this? Suppose it did have full >> > width writes/reads - you still shouldn't use it in a data racey way >> > since it's not spec'd to be threadsafe and you can only observe torn >> > reads/writes if you access it without synchronization. >> >> The driver is the infamous "principle of least astonishment", aided by >> my purism. Java is remarkable in the way it deals with races, trying to >> surprise the least when something breaks. I think the change that brings >> in more consistency without sacrificing maintainability and/or >> performance is the change we endorse, right? >> >> -Aleksey. >> > From mike.duigou at oracle.com Fri Dec 21 01:41:14 2012 From: mike.duigou at oracle.com (Mike Duigou) Date: Thu, 20 Dec 2012 17:41:14 -0800 Subject: RFR: CR#8004561 : Additional Functional Interfaces and Updates Message-ID: Hello all; Here are some additional functional interfaces for review. The additions fill in holes for primitive types and for two operand "Bi" operations. http://cr.openjdk.java.net/~mduigou/8004561/0/webrev/ http://cr.openjdk.java.net/~mduigou/8004561/0/specdiff/java/util/function/package-summary.html Additionally, this patch contains naming updates on the existing functional interfaces following 335 EG review. It does not include the interface specializations and default methods previously proposed in CR#8004015. That proposal has been withdrawn. It turned out that user errors involving unexpected boxing were just too common for the value provided. Mike From david.holmes at oracle.com Fri Dec 21 01:49:59 2012 From: david.holmes at oracle.com (David Holmes) Date: Fri, 21 Dec 2012 11:49:59 +1000 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 In-Reply-To: <50D34B5A.8050103@oracle.com> References: <50D34B5A.8050103@oracle.com> Message-ID: <50D3C047.6060103@oracle.com> Hi Chris, The specdiff is missing the Object variants for some reason. Otherwise this looks pretty much as I remember it. :) There is an open question as to whether MIN_ARRAY_SORT_GRAN should be configurable/overridable. Thanks, David On 21/12/2012 3:31 AM, Chris Hegarty wrote: > This is a review request for the addition of utility methods to > java.util.Arrays that provide sorting of arrays in parallel, JEP 103 [1]. > > Webrev: > http://cr.openjdk.java.net/~chegar/8003981/ver.00/ > > Current sorting implementations provided by the Java Collections > Framework (Collections.sort and Arrays.sort) all perform the sorting > operation sequentially in the calling thread. This enhancement will > offer the same set of sorting operations currently provided by the > Arrays class, but with a parallel implementation that utilizes the > Fork/Join framework. These new API?s are still synchronous with regard > to the calling thread as it will not proceed past the sorting operation > until the parallel sort is complete. > > The actual sorting API this proposal adds will leverage the > ForkJoinPool.commonPool (default Fork/Join pool defined as part of JEP > 155). The sorting algorithm is that used in Doug Lea?s ParallelArray > implementation. > > This work was originally done over in the lambda/lambda repo by David > Holmes, and is now being cleaned up and brought into jdk8. > > Open issues/differences from version in lambda: > 1) Is is necessary for MIN_ARRAY_SORT_GRAN to be in the public API? > It is an implementation detail (easy to remove). > 2) The use of FJP.commonPool is an implementation detail, not > part of the spec. Should not be a problem, just worth pointing > out, as it differs from what is in lambda/lambda. > > -Chris. > > [1] http://openjdk.java.net/jeps/103 From david.dehaven at oracle.com Fri Dec 21 03:17:57 2012 From: david.dehaven at oracle.com (David DeHaven) Date: Thu, 20 Dec 2012 19:17:57 -0800 Subject: RFR 8004547: Extend JavaFX launcher support... Message-ID: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> Request for review for extending the launcher support to allow the JavaFX runtime to fully support all of it's launch features, including preloaders, classpath, etc.. Webrev: http://cr.openjdk.java.net/~ddehaven/8004547/webrev.1/ Corresponding JavaFX JIRA issue that these changes depend on: http://javafx-jira.kenai.com/browse/RT-26751 This should be the final step in adding launcher support for JavaFX applications. These changes should allow any future changes to be done entirely in the JavaFX runtime. The changes for RT-26751 are in this weeks promotion of JavaFX, so should be available in next weeks JRE build (I think.. I'm never sure about promotion timing..). -DrD- From david.holmes at oracle.com Fri Dec 21 05:27:06 2012 From: david.holmes at oracle.com (David Holmes) Date: Fri, 21 Dec 2012 15:27:06 +1000 Subject: Final Profiles update to jdk8-b69 In-Reply-To: <50C9BAAE.5030309@oracle.com> References: <50BC0678.1040300@oracle.com> <50BEDADE.40301@oracle.com> <50C9BAAE.5030309@oracle.com> Message-ID: <50D3F32A.7010306@oracle.com> FYI the Profiles forest has been updated to the jdk8-b69 level (the tags are missing but it is b69). This is the last sync-up of the Profiles forest with jdk8/jdk8. We are preparing to integrate the Profiles changes with mainline using the jdk8/build forest. Request for reviews will be issued shortly. David From stuart.marks at oracle.com Fri Dec 21 05:41:54 2012 From: stuart.marks at oracle.com (stuart.marks at oracle.com) Date: Fri, 21 Dec 2012 05:41:54 +0000 Subject: hg: jdk8/tl/jdk: 8005290: remove -showversion from RMI test library subprocess mechanism Message-ID: <20121221054214.825BB47326@hg.openjdk.java.net> Changeset: 60adb69bf043 Author: smarks Date: 2012-12-20 20:11 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/60adb69bf043 8005290: remove -showversion from RMI test library subprocess mechanism Reviewed-by: jgish, chegar, dmocek ! test/java/rmi/testlibrary/JavaVM.java ! test/java/rmi/testlibrary/StreamPipe.java ! test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java From david.holmes at oracle.com Fri Dec 21 06:18:17 2012 From: david.holmes at oracle.com (David Holmes) Date: Fri, 21 Dec 2012 16:18:17 +1000 Subject: Request for Review: Java SE 8 Compact Profiles Message-ID: <50D3FF29.6010005@oracle.com> The Java SE 8 Compact Profiles: http://openjdk.java.net/jeps/161 provides for subsetting of the Java SE 8 platform. While the specification covers the platform, we are only providing a reference implementation on Linux x86 at this time. This work is covered by a number of CRs due to there being a need for a number of CC requests to modifying existing specifications 8004265: Add build support for Compact Profiles 8004502: Compact Profiles contents 8003255: (profiles) Update JAR file specification to support profiles 8003256: (profiles) Add support for profile identification 8004931: add/removePropertyChangeListener should not exist in subset Profiles of Java SE The changes primarily involve the build, as you would imagine, the compact profiles define: - which files (binaries, jars, native libs) are in a JRE (profile-includes.txt) - which packages/classes are in rt.jar/resources.jar (profile-rtjar-includes.txt) But there are additional source changes: - to support reporting the profile name as part of version information - to test the versioning and tool changes and also changes to java, javac and jar so that you can indicate which profile you are targeting, and have javac make sure you don't use an API that won't be present; and which profile you need to run (listed in your executable jar) so the launcher can reject it if it isn't the right profile. The launcher and jar changes are included in this webrev, while the javac changes are being integrated separately (plus some related javadoc changes). Only the new build system is supported for building profiles. webrevs: top-level repo: http://cr.openjdk.java.net/~dholmes/8004265/webrev.top/ The main change is to simply add profiles and profiles-only as top level make targets (similar to images). There is also a change to remove the hardcoded version information (though this may be handled by a separate CR). jdk repo: http://cr.openjdk.java.net/~dholmes/8004265/webrev.jdk/ The overall build changes expand on the pre-existing definitions whereby a JRE is a JDK with things take out. So a compact JRE is then a JRE with additional things taken out. There are three compact profiles (compact1 being the smallest) and a full JRE. For internal build purposes these are referred to as PROFILE_1 etc, with a full JRE being represented by PROFILE_4 when needed. The specification for profiles indicates what is included in each profile, but the build rules then invert this to obtain a set of exclusions for each profile: the exclusions of a given profile is the set of inclusions of all larger profiles and the JRE (and of course the JDK). Please note I only expect build folks to look at build changes and core-libs to look at src/test changes (all of which have been developed by Alan Bateman) and there is no need to cross-post your responses. Like many I am about to head for Xmas break but I will continue to monitor email and deal with changes as needed. This is needed for M6 and we need to be ready to push in early January. Thanks, David Holmes From henry.jen at oracle.com Fri Dec 21 06:28:08 2012 From: henry.jen at oracle.com (Henry Jen) Date: Thu, 20 Dec 2012 22:28:08 -0800 Subject: RFR: JDK-8005263: Logging APIs takes Supplier for message Message-ID: <50D40178.3060604@oracle.com> Hi, This patch adds a couple APIs to java.util.logging.Logger so that construction of log messages only occurs when it is actually to be logged by using Supplier instead of String. Since the idea is to avoid unnecessary construction of log messages, thus APIs imply formatting are not provided. Thus all forms of logrb and log with Parameters are not included. log with Throwable are named to be logEx or logpEx to avoid null ambiguous as it seems like it's quite common usage with logger.log(level, null, thrown) Specdiff and webrev can be found at following, http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/specdiff/diff.html http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/webrev/ Cheers, Henry From stuart.marks at oracle.com Fri Dec 21 06:33:46 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Thu, 20 Dec 2012 22:33:46 -0800 Subject: RFR: 8005290: remove -showversion from RMI test library subprocess mechanism In-Reply-To: <50D35AC1.4050505@oracle.com> References: <50D265B2.8060103@oracle.com> <50D35AC1.4050505@oracle.com> Message-ID: <50D402CA.7000100@oracle.com> Ah, good suggestion. I've cleaned up the imports in JavaVM.java and StreamPipe.java. s'marks On 12/20/12 10:36 AM, Darryl Mocek wrote: > Hi Stuart, > > the changes look fine to me. The only comments I have are to remove the > java.util.Properties import from JavaVM and possibly to use explicit imports > instead of * imports in JavaVM and StreamPipe. > > Darryl > > On 12/19/2012 05:11 PM, Stuart Marks wrote: >> Hi all, >> >> Please review the fix [1] for bug 8005290 [2]. >> >> [1] http://cr.openjdk.java.net/~smarks/reviews/8005290/webrev.0/ >> >> [2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8005290 >> >> I just filed this bug, so it hasn't made it to the public website yet. The >> salient text from the bug report is as follows: >> >> ------------------------------------------------------------ >> The RMI test library (jdk/test/java/rmi/testlibrary) has a convenience API >> (the JavaVM class) for launching a JVM subprocess. When starting the >> subprocess, it adds the -showversion option to the JVM command line and waits >> for the version output to arrive from the subprocess before returning to the >> caller. This is intended to avoid race conditions where the test might try to >> contact the subprocess before it's fully initialized. >> >> It turns out this doesn't really work and it's also unnecessary. >> >> The reason it doesn't really work is that the version string is emitted when >> the JVM subprocess has mostly started up, but it hasn't yet executed any user >> code. Even after the version string has been emitted, the caller may still >> have to wait and retry before successfully contacting a service exported by >> the subprocess. The current code returns after two seconds, even if the >> version string hasn't been received from the subprocess. So the caller has to >> wait and potentially retry anyway. Since the callers have to do this anyway, >> having the library wait for the version string isn't helpful. >> >> Other library code (e.g., RMID) starts the subprocess and waits until a >> particular RMI service is ready, so the -showversion mechanism is redundant >> in that case. Finally, many tests start the subprocess and wait until it >> finishes, so they don't need the -showversion mechanism either. >> >> Finally, the -showversion mechanism adds a lot of complexity, as it has to >> interpose between the subprocess output stream and the caller, so we're >> better off just removing it. All RMI tests continue to pass even with this >> mechanism removed. >> ------------------------------------------------------------ >> >> This is basically just test cleanup (no library code changes) to clear the >> way for future test enhancements to improve performance and reliability. >> >> Thanks, >> >> s'marks > From mandy.chung at oracle.com Fri Dec 21 06:50:35 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 20 Dec 2012 22:50:35 -0800 Subject: RFR 8004547: Extend JavaFX launcher support... In-Reply-To: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> References: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> Message-ID: <50D406BB.7050100@oracle.com> Hi David, On 12/20/2012 7:17 PM, David DeHaven wrote: > Request for review for extending the launcher support to allow the JavaFX runtime to fully support all of it's launch features, including preloaders, classpath, etc.. > > Webrev: > http://cr.openjdk.java.net/~ddehaven/8004547/webrev.1/ FXHelper.canLauncherFXAppJar launches a JAR with JavaFX-Application-Class. In the current version (before this fix), a FX JAR whose manifest can have a Main-Class entry that specifies the JavaFX application class that extends javafx.application.Application. Is that case no longer supported? Other than that, looks good. Minor comment: FXHelper.canLaunchFXAppJarand canLaunchFXAppClass - when they are called, we don't know if it's a FX class but I interpreted the canLaunchFXAppxxx method name that the given class is known to be an FX app but checking if it's launchable. Would it be better to rename to isFXAppxxx? Perhaps it's appropriate to call if (FXHelper.isFxAppJar(..)) { FXHelper.loadJavaFXLauncher(); return FXHelper.class; } Mandy From huizhe.wang at oracle.com Fri Dec 21 08:37:03 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Fri, 21 Dec 2012 00:37:03 -0800 Subject: RFR 8005281: (props) loadFromXML with small XML parser provider does not detect bad DOCTYPE Message-ID: <50D41FAF.8070702@oracle.com> The cause of the LoadAndStoreXML test failure appeared to be that of 8005281 that Alan just fixed. Before the 8005281 patch, I was able to get the tests to pass when I isolated the relevant tests (that is, copy LoadAndStoreXML and remove other test cases). After the 8005281 patch, LoadAndStoreXML passed in its original form. I've also added a few more invalid xml files, plus international characters to testLoadAndStore. Webrev: http://cr.openjdk.java.net/~joehw/jdk8/8005280/webrev/ Thanks, Joe From peter.levart at gmail.com Fri Dec 21 09:04:09 2012 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 21 Dec 2012 10:04:09 +0100 Subject: RFR: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50D40178.3060604@oracle.com> References: <50D40178.3060604@oracle.com> Message-ID: <50D42609.10200@gmail.com> Hi Henry, Have you considered reversing the positions of Supplier and Throwable arguments in methods that take both? For example instead of: 695 public void logEx(Level level, Supplier msgSupplier, Throwable thrown) { the following: 695 public void logEx(Level level,Throwable thrown, Supplier msgSupplier) { If one chooses this form (taking Throwable and Supplier) it might be because there is some code in the lambda expression that is turned into Suppier that spans multiple lines. Better compact multi-line formatting is possible if lambda is last argument: logger.logEx( Level.WARN, () -> { StringBuilder sb = new StringBuilder(); for (Foo foo : foos) { sb.append(sb.length() == 0 ? "[" : ","); sb.append(foo); } if (sb.length() > 0) sb.append("]"); return sb.toString(); }, exception ); vs. logger.logEx(Level.WARN, exception, () -> { StringBuilder sb = new StringBuilder(); for (Foo foo : foos) { sb.append(sb.length() == 0 ? "[" : ","); sb.append(foo); } if (sb.length() > 0) sb.append("]"); return sb.toString(); }); It might be (haven't checked) that you don't need another name for a method (logEx) in that case too. Regards, Peter On 12/21/2012 07:28 AM, Henry Jen wrote: > Hi, > > This patch adds a couple APIs to java.util.logging.Logger so that > construction of log messages only occurs when it is actually to be > logged by using Supplier instead of String. > > Since the idea is to avoid unnecessary construction of log messages, > thus APIs imply formatting are not provided. Thus all forms of logrb and > log with Parameters are not included. > > log with Throwable are named to be logEx or logpEx to avoid null > ambiguous as it seems like it's quite common usage with > > logger.log(level, null, thrown) > > Specdiff and webrev can be found at following, > > http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/specdiff/diff.html > http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/webrev/ > > Cheers, > Henry From Alan.Bateman at oracle.com Fri Dec 21 09:22:44 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 21 Dec 2012 09:22:44 +0000 Subject: RFR: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50D40178.3060604@oracle.com> References: <50D40178.3060604@oracle.com> Message-ID: <50D42A64.3050804@oracle.com> On 21/12/2012 06:28, Henry Jen wrote: > Hi, > > This patch adds a couple APIs to java.util.logging.Logger so that > construction of log messages only occurs when it is actually to be > logged by using Supplier instead of String. > > Since the idea is to avoid unnecessary construction of log messages, > thus APIs imply formatting are not provided. Thus all forms of logrb and > log with Parameters are not included. > > log with Throwable are named to be logEx or logpEx to avoid null > ambiguous as it seems like it's quite common usage with > > logger.log(level, null, thrown) > > Specdiff and webrev can be found at following, > > http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/specdiff/diff.html > http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/webrev/ > > Cheers, > Henry Henry - just a quick comment on the class description. I think it would be better not to include the sentence "Since 1.8 ..." as it that will quickly become a historical note. It would be much better (in my view) to just highlight the methods with something like "Several of the methods take a Supplier function ..." and make the potential performance benefit of using these methods clear. -Alan. From zhouyx at linux.vnet.ibm.com Fri Dec 21 09:40:42 2012 From: zhouyx at linux.vnet.ibm.com (Sean Chou) Date: Fri, 21 Dec 2012 17:40:42 +0800 Subject: PPC Linux 64 needs -fsigned-char option for gcc Message-ID: Hello, We found -fsigned-char is added to ppc platform, but not added to ppc64 platform. As they are different platforms, I think it is needed for ppc64 as well. Currently I just added one line modification as follow, but there may be more places to modify. If some one can give some comments, I can make a complete webrev. The buggy scenario we found needs closed code to reproduce, so it is not reproduced with current openjdk build on ppc linux from AIX porting project. I tested with ibmjdk, the patch works. I found CFLAGS_REQUIRED_ppc is from changeset http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/54d8193f177b . Is it enough to add ppc64 option for places ppc appears in that patch? ///////////////////////// the patch //////////////////////// diff --git a/make/common/Defs-linux.gmk b/make/common/Defs-linux.gmk --- a/make/common/Defs-linux.gmk +++ b/make/common/Defs-linux.gmk @@ -196,6 +196,7 @@ LDFLAGS_COMMON_sparc += -m32 -mcpu=v9 CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN +CFLAGS_REQUIRED_ppc64 += -fsigned-char -D_BIG_ENDIAN ifeq ($(ZERO_BUILD), true) CFLAGS_REQUIRED = $(ZERO_ARCHFLAG) ifeq ($(ZERO_ENDIANNESS), little) -- Best Regards, Sean Chou From Alan.Bateman at oracle.com Fri Dec 21 10:18:03 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 21 Dec 2012 10:18:03 +0000 Subject: PPC Linux 64 needs -fsigned-char option for gcc In-Reply-To: References: Message-ID: <50D4375B.1000207@oracle.com> On 21/12/2012 09:40, Sean Chou wrote: > Hello, > > We found -fsigned-char is added to ppc platform, but not added to ppc64 > platform. As they are different platforms, I think it is needed for ppc64 > as well. Currently I just added one line modification as follow, but there > may be more places to modify. If some one can give some comments, I can > make a complete webrev. > > The buggy scenario we found needs closed code to reproduce, so it is not > reproduced with current openjdk build on ppc linux from AIX porting > project. I tested with ibmjdk, the patch works. > > I found CFLAGS_REQUIRED_ppc is from changeset > http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/54d8193f177b . Is it enough > to add ppc64 option for places ppc appears in that patch? > > ///////////////////////// the patch //////////////////////// > > diff --git a/make/common/Defs-linux.gmk b/make/common/Defs-linux.gmk > --- a/make/common/Defs-linux.gmk > +++ b/make/common/Defs-linux.gmk > @@ -196,6 +196,7 @@ > LDFLAGS_COMMON_sparc += -m32 -mcpu=v9 > CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN > CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN > +CFLAGS_REQUIRED_ppc64 += -fsigned-char -D_BIG_ENDIAN > ifeq ($(ZERO_BUILD), true) > CFLAGS_REQUIRED = $(ZERO_ARCHFLAG) > ifeq ($(ZERO_ENDIANNESS), little) > You should probably bring this to build-dev to discuss. If the linux-ppc64 port is a jdk8 port then you should probably be looking at the new build and we should be cutting over soon. -Alan From chris.hegarty at oracle.com Fri Dec 21 10:31:22 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 21 Dec 2012 10:31:22 +0000 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 In-Reply-To: <50D3C047.6060103@oracle.com> References: <50D34B5A.8050103@oracle.com> <50D3C047.6060103@oracle.com> Message-ID: <50D43A7A.2070209@oracle.com> On 12/21/2012 01:49 AM, David Holmes wrote: > Hi Chris, > > The specdiff is missing the Object variants for some reason. Sorry, I should have noticed this. There was an old version of specdiff in my environment. I regenerated the specdiff ( it's all there ), and updated the original specdiff link. > Otherwise this looks pretty much as I remember it. :) Good to hear that! > There is an open question as to whether MIN_ARRAY_SORT_GRAN should be > configurable/overridable. My opinion, for what it's worth, is to keep this out of the API. It seems like very advanced use, and not for the masses. It may just confuse the average developer, thinking that they need to thinker with it in some way. It is also worth noting ( if I read the code correctly ), that the threshold is not configurable in Doug's ParallelArray either. Has there been calls for it to be? (I'm not sure) If needs be, then maybe a system property could be defined to initialize the threshold value, but I would like to hear justification for such a property. -Chris. > > Thanks, > David > > On 21/12/2012 3:31 AM, Chris Hegarty wrote: >> This is a review request for the addition of utility methods to >> java.util.Arrays that provide sorting of arrays in parallel, JEP 103 [1]. >> >> Webrev: >> http://cr.openjdk.java.net/~chegar/8003981/ver.00/ >> >> Current sorting implementations provided by the Java Collections >> Framework (Collections.sort and Arrays.sort) all perform the sorting >> operation sequentially in the calling thread. This enhancement will >> offer the same set of sorting operations currently provided by the >> Arrays class, but with a parallel implementation that utilizes the >> Fork/Join framework. These new API?s are still synchronous with regard >> to the calling thread as it will not proceed past the sorting operation >> until the parallel sort is complete. >> >> The actual sorting API this proposal adds will leverage the >> ForkJoinPool.commonPool (default Fork/Join pool defined as part of JEP >> 155). The sorting algorithm is that used in Doug Lea?s ParallelArray >> implementation. >> >> This work was originally done over in the lambda/lambda repo by David >> Holmes, and is now being cleaned up and brought into jdk8. >> >> Open issues/differences from version in lambda: >> 1) Is is necessary for MIN_ARRAY_SORT_GRAN to be in the public API? >> It is an implementation detail (easy to remove). >> 2) The use of FJP.commonPool is an implementation detail, not >> part of the spec. Should not be a problem, just worth pointing >> out, as it differs from what is in lambda/lambda. >> >> -Chris. >> >> [1] http://openjdk.java.net/jeps/103 From volker.simonis at gmail.com Fri Dec 21 10:48:32 2012 From: volker.simonis at gmail.com (Volker Simonis) Date: Fri, 21 Dec 2012 11:48:32 +0100 Subject: PPC Linux 64 needs -fsigned-char option for gcc In-Reply-To: References: Message-ID: Hi Sean, honestly speaking, I wasn't aware of this problem until now and I just checked that we currently don't use this option, neither internally nor in our port. I found the following nice explanation of the issue: http://www.network-theory.co.uk/docs/gccintro/gccintro_71.html It seems that you only get problems if your programs relies on the fact that 'char' is either unsigned or signed. I suppose that the current OpenJDK doesn't rely on such assumptions (which is good) because we didn't saw any of them until now. If I understand you right, you add some closed code the the JDK which has problems because it makes such assumptions. Is that right? If yes, you should probably first fix that code in the way described in the referenced document. Wouldn't that be possible? Regarding your patch: I suppose you took it against an original JDK and not our port, because in our port we already have the following lines (at least in http://hg.openjdk.java.net/ppc-aix-port/jdk7u//jdk because we haven't started to work on jdk8 until now) CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN CFLAGS_REQUIRED_ppc64 += -m64 LDFLAGS_COMMON_ppc64 += -m64 -L/lib64 -Wl,-melf64ppc Notice that we don't set '-D_BIG_ENDIAN' because it is the default. Didn't you observed your problems with jdk7 on Linux/PPC? I think we should patch JDK7 first if this is really necessary. Regards, Volker On Fri, Dec 21, 2012 at 10:40 AM, Sean Chou wrote: > Hello, > > We found -fsigned-char is added to ppc platform, but not added to ppc64 > platform. As they are different platforms, I think it is needed for ppc64 > as well. Currently I just added one line modification as follow, but there > may be more places to modify. If some one can give some comments, I can > make a complete webrev. > > The buggy scenario we found needs closed code to reproduce, so it is not > reproduced with current openjdk build on ppc linux from AIX porting > project. I tested with ibmjdk, the patch works. > > I found CFLAGS_REQUIRED_ppc is from changeset > http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/54d8193f177b . Is it enough > to add ppc64 option for places ppc appears in that patch? > > ///////////////////////// the patch //////////////////////// > > diff --git a/make/common/Defs-linux.gmk b/make/common/Defs-linux.gmk > --- a/make/common/Defs-linux.gmk > +++ b/make/common/Defs-linux.gmk > @@ -196,6 +196,7 @@ > LDFLAGS_COMMON_sparc += -m32 -mcpu=v9 > CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN > CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN > +CFLAGS_REQUIRED_ppc64 += -fsigned-char -D_BIG_ENDIAN > ifeq ($(ZERO_BUILD), true) > CFLAGS_REQUIRED = $(ZERO_ARCHFLAG) > ifeq ($(ZERO_ENDIANNESS), little) > > > -- > > Best Regards, > Sean Chou > From paul.sandoz at oracle.com Fri Dec 21 11:01:50 2012 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 21 Dec 2012 12:01:50 +0100 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 In-Reply-To: <50D43A7A.2070209@oracle.com> References: <50D34B5A.8050103@oracle.com> <50D3C047.6060103@oracle.com> <50D43A7A.2070209@oracle.com> Message-ID: On Dec 21, 2012, at 11:31 AM, Chris Hegarty wrote: > On 12/21/2012 01:49 AM, David Holmes wrote: >> Hi Chris, >> >> The specdiff is missing the Object variants for some reason. > > Sorry, I should have noticed this. There was an old version of specdiff in my environment. I regenerated the specdiff ( it's all there ), and updated the original specdiff link. > >> Otherwise this looks pretty much as I remember it. :) > > Good to hear that! > >> There is an open question as to whether MIN_ARRAY_SORT_GRAN should be >> configurable/overridable. > > My opinion, for what it's worth, is to keep this out of the API. +1 to keep it out of the public API. It's the type of configurable thing that is useful for testing purposes but i don't think we should expose users to the black art of selecting the best threshold to switch from divide and conquer to sequential evaluation. Paul. From forax at univ-mlv.fr Fri Dec 21 11:19:26 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Fri, 21 Dec 2012 12:19:26 +0100 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 In-Reply-To: <50D34B5A.8050103@oracle.com> References: <50D34B5A.8050103@oracle.com> Message-ID: <50D445BE.3020205@univ-mlv.fr> On 12/20/2012 06:31 PM, Chris Hegarty wrote: > This is a review request for the addition of utility methods to > java.util.Arrays that provide sorting of arrays in parallel, JEP 103 [1]. > > Webrev: > http://cr.openjdk.java.net/~chegar/8003981/ver.00/ > > Current sorting implementations provided by the Java Collections > Framework (Collections.sort and Arrays.sort) all perform the sorting > operation sequentially in the calling thread. This enhancement will > offer the same set of sorting operations currently provided by the > Arrays class, but with a parallel implementation that utilizes the > Fork/Join framework. These new API?s are still synchronous with regard > to the calling thread as it will not proceed past the sorting > operation until the parallel sort is complete. > > The actual sorting API this proposal adds will leverage the > ForkJoinPool.commonPool (default Fork/Join pool defined as part of JEP > 155). The sorting algorithm is that used in Doug Lea?s ParallelArray > implementation. > > This work was originally done over in the lambda/lambda repo by David > Holmes, and is now being cleaned up and brought into jdk8. > > Open issues/differences from version in lambda: > 1) Is is necessary for MIN_ARRAY_SORT_GRAN to be in the public API? > It is an implementation detail (easy to remove). > 2) The use of FJP.commonPool is an implementation detail, not > part of the spec. Should not be a problem, just worth pointing > out, as it differs from what is in lambda/lambda. > > -Chris. > > [1] http://openjdk.java.net/jeps/103 Hi Chris, in Arrays.parallelSort(TYPE[] a, int fromIndex, int toIndex), there is no need to have the two supplementary local variable origin and fence, ws is not a great better name (workspaceArray?), I had to read the code of ArraySortHelpers to understand. ArraySortHelpers should be renamed to ArrayParallelSortHelpers. In ArraySortHelpers, all Sorter, Merger, etc. should declare only one field by line, currently, the formatting of the fields is weird. In all Sorter, instead of calling Arrays.sort(), you should call DualPivotQuicksort.sort to avoid unnecessary range checks. In compute() of Sorter and Merger, you should copy a and w in local variables (a = this.a) to help the VM to figure out that they never changed, it will also reduce the bytecode size. In Sorter.compute, n should be loaded in a local field, int l = origin; int g = gran; int n = this.n; In Merger.compute, the sequence of inits before the second while should be: int l = lo; int lFence = l + nleft; // instead of lo + nleft int r = ro; int rFence = r + nright; // instead of ro + nright int k = wo; it should not changed the performance but it's more inline with the coding style of the rest of the code IMO. cheers, R?mi From Alan.Bateman at oracle.com Fri Dec 21 11:23:37 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 21 Dec 2012 11:23:37 +0000 Subject: RFR: [jdk7u-dev] - 8003898: X11 toolkit can be chosen as the default toolkit In-Reply-To: <50D38D22.8030807@oracle.com> References: <50CF689A.6090905@oracle.com> <50D17B86.2050005@oracle.com> <50D38D22.8030807@oracle.com> Message-ID: <50D446B9.9010207@oracle.com> On 20/12/2012 22:11, Stuart Marks wrote: > > Isn't 7162111 important to avoid hangs/failures when running the tests > on the Mac? Plus it removes tests from the problem list so we get > better test coverage in 7u. 8003898 is the change to not select the XToolkit and I think is the most important to backport as that is seems to be what has been caussing tests that use AWT to hang on Macs, at least when using ssh. Once that it is then there's a bunch of tests that can be removed from the exclude list, this is what 7162111 is about. As 8 and 7u have slightly different exclude lists then it might not hg import cleanly (which I think is what Rob was saying) so he might have to manually figure out the exact list of tests to liberate. -Alan. From Alan.Bateman at oracle.com Fri Dec 21 12:05:49 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 21 Dec 2012 12:05:49 +0000 Subject: RFR 8005281: (props) loadFromXML with small XML parser provider does not detect bad DOCTYPE In-Reply-To: <50D41FAF.8070702@oracle.com> References: <50D41FAF.8070702@oracle.com> Message-ID: <50D4509D.6090508@oracle.com> On 21/12/2012 08:37, Joe Wang wrote: > The cause of the LoadAndStoreXML test failure appeared to be that of > 8005281 that Alan just fixed. Before the 8005281 patch, I was able to > get the tests to pass when I isolated the relevant tests (that is, > copy LoadAndStoreXML and remove other test cases). After the 8005281 > patch, LoadAndStoreXML passed in its original form. > > I've also added a few more invalid xml files, plus international > characters to testLoadAndStore. > > Webrev: > http://cr.openjdk.java.net/~joehw/jdk8/8005280/webrev/ I concur with your observation that this issue is fixed by 8005281, in which case we can change the focus for 8005280 to extend the test coverage as you have done. The new tests look good to me except that you've prefixed them all with "propertyfile_" and so are inconsistent with the existing tests. I think it would be good to rename them to be consistent before pushing this. -Alan From Ulf.Zibis at CoSoCo.de Fri Dec 21 12:19:45 2012 From: Ulf.Zibis at CoSoCo.de (Ulf) Date: Fri, 21 Dec 2012 13:19:45 +0100 Subject: Fwd: Re: Review request: 8003562: Provide a command-line tool to find static dependenciesh In-Reply-To: <50D38720.3020408@oracle.com> References: <50D0F867.80100@oracle.com> <50D337B0.2090504@oracle.com> <50D37DDE.6040905@CoSoCo.de> <50D38720.3020408@oracle.com> Message-ID: <50D453E1.80502@CoSoCo.de> A little more verbose (as member of class JDepsTask): enum Option { VERBOSE (false, "-v", "--verbose"), PACKAGE (true, "-p", "--package"), ...; private boolean hasParam; private String[] aliases; private Option (boolean hasParam, String aliases...) { ...; } process (String form, String param) { If (hasParam && (param == null || param.length == 0 || param.charAt(0) == '-')) throw new BadArgs("err.missing.arg", form).showUsage(true); switch (this) { case VERBOSE : verbose = Verbose.VERBOSE; break; case PACKAGE : packageNames.add(param); break; ... } } } -Ulf From forax at univ-mlv.fr Fri Dec 21 12:28:49 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Fri, 21 Dec 2012 13:28:49 +0100 Subject: RFR: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50D42A64.3050804@oracle.com> References: <50D40178.3060604@oracle.com> <50D42A64.3050804@oracle.com> Message-ID: <50D45601.10501@univ-mlv.fr> On 12/21/2012 10:22 AM, Alan Bateman wrote: > On 21/12/2012 06:28, Henry Jen wrote: >> Hi, >> >> This patch adds a couple APIs to java.util.logging.Logger so that >> construction of log messages only occurs when it is actually to be >> logged by using Supplier instead of String. >> >> Since the idea is to avoid unnecessary construction of log messages, >> thus APIs imply formatting are not provided. Thus all forms of logrb and >> log with Parameters are not included. >> >> log with Throwable are named to be logEx or logpEx to avoid null >> ambiguous as it seems like it's quite common usage with >> >> logger.log(level, null, thrown) >> >> Specdiff and webrev can be found at following, >> >> http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/specdiff/diff.html >> http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/webrev/ >> >> Cheers, >> Henry > Henry - just a quick comment on the class description. I think it would > be better not to include the sentence "Since 1.8 ..." as it that will > quickly become a historical note. It would be much better (in my view) > to just highlight the methods with something like "Several of the > methods take a Supplier function ..." and make the potential performance > benefit of using these methods clear. > > -Alan. > You should also add a note saying that the supplier can be specified as a lambda and in that case, the lambda *must* not capture value of local variable, otherwise a supplier object will be created each time you log something. R?mi From david.holmes at oracle.com Fri Dec 21 13:13:42 2012 From: david.holmes at oracle.com (David Holmes) Date: Fri, 21 Dec 2012 23:13:42 +1000 Subject: PPC Linux 64 needs -fsigned-char option for gcc In-Reply-To: References: Message-ID: <50D46086.90503@oracle.com> One thing that would be nice to come out of this porting effort is better organisation of platform specific aspects. I would prefer to see an arch.make file for each arch rather than have all these platform specific sections. (It was fine when you only had a couple of flavours but now the balance has shifted). The JDK ppc/arm references were simply the minimum we needed for our embedded builds to work. They don't really offer proper arm/ppc support. For hotspot we rely on setting ARCH and overriding EXTRA_CFLAGS via the environment or make invocation, so these architectures are not treated as first-class citizens by hotspot. This particular example is particularly bad because the arm/ppc values are completely different to the kinds of values set for the other archs! I don't even think we continue to use these in the new build. David ---- On 21/12/2012 7:40 PM, Sean Chou wrote: > Hello, > > We found -fsigned-char is added to ppc platform, but not added to ppc64 > platform. As they are different platforms, I think it is needed for > ppc64 as well. Currently I just added one line modification as follow, > but there may be more places to modify. If some one can give some > comments, I can make a complete webrev. > > The buggy scenario we found needs closed code to reproduce, so it is not > reproduced with current openjdk build on ppc linux from AIX porting > project. I tested with ibmjdk, the patch works. > > I found CFLAGS_REQUIRED_ppc is from changeset > http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/54d8193f177b . Is it > enough to add ppc64 option for places ppc appears in that patch? > > ///////////////////////// the patch //////////////////////// > > diff --git a/make/common/Defs-linux.gmk b/make/common/Defs-linux.gmk > --- a/make/common/Defs-linux.gmk > +++ b/make/common/Defs-linux.gmk > @@ -196,6 +196,7 @@ > LDFLAGS_COMMON_sparc += -m32 -mcpu=v9 > CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN > CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN > +CFLAGS_REQUIRED_ppc64 += -fsigned-char -D_BIG_ENDIAN > ifeq ($(ZERO_BUILD), true) > CFLAGS_REQUIRED = $(ZERO_ARCHFLAG) > ifeq ($(ZERO_ENDIANNESS), little) > > > -- > > Best Regards, > Sean Chou From peter.levart at gmail.com Fri Dec 21 13:47:28 2012 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 21 Dec 2012 14:47:28 +0100 Subject: RFR: CR#8004561 : Additional Functional Interfaces and Updates In-Reply-To: References: Message-ID: <50D46870.6060808@gmail.com> I see that (given Function f, g), f.compose(g) means: f?g, rather than f?g. Would mathematicians complain? :-) Regards, Peter On 12/21/2012 02:41 AM, Mike Duigou wrote: > Hello all; > > Here are some additional functional interfaces for review. The additions fill in holes for primitive types and for two operand "Bi" operations. > > http://cr.openjdk.java.net/~mduigou/8004561/0/webrev/ > http://cr.openjdk.java.net/~mduigou/8004561/0/specdiff/java/util/function/package-summary.html > > Additionally, this patch contains naming updates on the existing functional interfaces following 335 EG review. It does not include the interface specializations and default methods previously proposed in CR#8004015. That proposal has been withdrawn. It turned out that user errors involving unexpected boxing were just too common for the value provided. > > Mike From david.lloyd at redhat.com Fri Dec 21 15:12:22 2012 From: david.lloyd at redhat.com (David M. Lloyd) Date: Fri, 21 Dec 2012 09:12:22 -0600 Subject: java.nio.*Buffer read/write atomicity In-Reply-To: <50D3B0F3.7030509@oracle.com> References: <20121220171134.E89FA9FA@eggemoggin.niobe.net> <50D34868.5030207@oracle.com> <50D350E1.8020101@oracle.com> <50D3576B.3070803@oracle.com> <50D3B0F3.7030509@oracle.com> Message-ID: <50D47C56.1010905@redhat.com> On 12/20/2012 06:44 PM, David Holmes wrote: > On 21/12/2012 4:22 AM, Aleksey Shipilev wrote: >> The astonishment comes from this: >> a. racy Unsafe.putInt(...) to byte[] is atomic* >> b. racy direct ByteBuffer.putInt(...) is atomic* >> c. racy heap ByteBuffer.putInt(...) is NOT! >> d. racy heap ByteBuffer.asIntBuffer().put(...) is NOT atomic again! > > The only thing I find astonishing here is that anyone would spend time > analysing how different non-thread-safe data structures behave in the > face of data races. Seriously I think you are in a very small crowd :) > Even the c-i discussion was all over the field with very little actual > discussion of atomicity as such. Well I reckon that atomicity might become important in the face of buffer slices - particularly the practice of slicing up large buffers into smaller buffers, for the purposes of pooling or whatever. Especially if someone thinks it is a good idea to use weird unalignable sizes for their slices. > If there are performance issues that can be addressed here, or you can > generally make this "better", then fine. But atomicity is not a problem > here and the last thing we want is to encourage people to use these > classes in racy contexts because they now think it is "safe" because of > atomic accesses. > > David > ---- > >> So then, the hacky code over the byte arrays appears more consistent >> than public API, without any solid reason for that? Granted, we can >> always put our fingers in our ears and sing "la-la-la, you were never >> guaranteed that", but I would say this is surprising inconsistency. And >> by the way direct ByteBuffers (inadvertently) deal with that, it's >> obvious we can do the same for heap ByteBuffers. >> >> I feel dumb for having to explain this, I should have probably publish >> the CR with the change and advocate it helps performance, fixing the >> atomicity issue under the cover. The atomicity does not have to be >> spec'ed, but I would certainly vote for it for the equivalent >> implementation. >> >> Sorry for mudding the quiet waters. >> >> -Aleksey. >> >> (*) subject to underlying hardware memory model, alignment, etc. >> >> On 12/20/2012 10:03 PM, Vitaly Davidovich wrote: >>> But why would there be astonishment/surprise here if it says it's not >>> threadsafe? I guess that's the part I'm having trouble understanding. >>> >>> Sent from my phone >>> >>> On Dec 20, 2012 12:54 PM, "Aleksey Shipilev" >>> > >>> wrote: >>> >>> On 12/20/2012 09:49 PM, Vitaly Davidovich wrote: >>> > Just curious - what's the driver for this? Suppose it did >>> have full >>> > width writes/reads - you still shouldn't use it in a data >>> racey way >>> > since it's not spec'd to be threadsafe and you can only >>> observe torn >>> > reads/writes if you access it without synchronization. >>> >>> The driver is the infamous "principle of least astonishment", >>> aided by >>> my purism. Java is remarkable in the way it deals with races, >>> trying to >>> surprise the least when something breaks. I think the change >>> that brings >>> in more consistency without sacrificing maintainability and/or >>> performance is the change we endorse, right? >>> >>> -Aleksey. >>> >> -- - DML From kelly.ohair at oracle.com Fri Dec 21 15:18:41 2012 From: kelly.ohair at oracle.com (Kelly O'Hair) Date: Fri, 21 Dec 2012 07:18:41 -0800 Subject: Request for Review: Java SE 8 Compact Profiles In-Reply-To: <50D3FF29.6010005@oracle.com> References: <50D3FF29.6010005@oracle.com> Message-ID: On Dec 20, 2012, at 10:18 PM, David Holmes wrote: > webrevs: > > top-level repo: http://cr.openjdk.java.net/~dholmes/8004265/webrev.top/ These comments in Main.gmk don't seem to make sense: 117 # Note: This double-colon rule is intentional, to support 118 # custom make file integration. 119 images:: source-tips demos images-only Do lines 117 and 118 just need to be deleted? > > The main change is to simply add profiles and profiles-only as top level make targets (similar to images). There is also a change to remove the hardcoded version information (though this may be handled by a separate CR). > > jdk repo: http://cr.openjdk.java.net/~dholmes/8004265/webrev.jdk/ Can't cover the makefiles 100%, Erik would be best to look at some of this, but this is what I have so far: On JarReorder.java, it seems like you have just deleted a warning that someone explicitly asked for a class to be included, and also explicitly asked for that class to be excluded. If we are changing the tool so that exclusion just silently trumps any inclusion request, seems like we should just do that and delete this message. I'm fine with that, but the if(false) seems a bit terse. Why are some of the makefiles named with a ".txt" suffix? Like makefiles/profile-includes.txt? Overall, I have always been uncomfortable with these detailed exclude/include lists when they get down to listing specific class files, not that your changes are making it any worse, but I do see this as an opportunity to improve things in the long run by capturing the specifics of our product shipments. So no objections from me at this time, but at some point we need Erik to check this out. Unfortunately, everybody on build-infra will be busy for a few weeks trying to get the cutover done. :^( -kto From Alan.Bateman at oracle.com Fri Dec 21 15:33:02 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 21 Dec 2012 15:33:02 +0000 Subject: RFR : 8003228 : (props) sun.jnu.encoding should be set to UTF-8 [macosx] In-Reply-To: <50D38F14.5050100@oracle.com> References: <50D35E6C.8060205@oracle.com> <50D38F14.5050100@oracle.com> Message-ID: <50D4812E.7040402@oracle.com> On 20/12/2012 22:20, Brent Christian wrote: > Forgot a regtest - now included w/ v.01: > > http://cr.openjdk.java.net/~bchristi/8003228/webrev.01/ > I think the change is okay, it would nice to have got an authoritative reference to give more confidence that this is the right thing but that doesn't seem to be possible. I also think it's important that the folks on macosx-port-dev that have been complaining about this help us test it out, particularly folks that work in Asian locales. I don't know how many of them build the jdk so you might need to send a reminder once there is a jdk8 build available with this change. I don't think we should consider backporting this change to jdk7u until there is strong evidence that the change in jdk8 is good. Thanks for creating a test. I'm not sure that test/java/util/Properties is right place as that directory is for tests of the java.util.Properties API. I guess I would move it to java/util/System as there isn't an obvious place in the sun/** tree. In ExpectedEncoding then it looks it is missing an exit in the bad usage case. Also as an alternative to the failed flag then you could just throw an exception. -Alan. From david.dehaven at oracle.com Fri Dec 21 15:43:08 2012 From: david.dehaven at oracle.com (David DeHaven) Date: Fri, 21 Dec 2012 07:43:08 -0800 Subject: RFR 8004547: Extend JavaFX launcher support... In-Reply-To: <50D406BB.7050100@oracle.com> References: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> <50D406BB.7050100@oracle.com> Message-ID: <3417CACD-506E-4C4E-A8AA-13160C868D3F@oracle.com> >> Request for review for extending the launcher support to allow the JavaFX runtime to fully support all of it's launch features, including preloaders, classpath, etc.. >> >> Webrev: >> http://cr.openjdk.java.net/~ddehaven/8004547/webrev.1/ > > FXHelper.canLauncherFXAppJar launches a JAR with JavaFX-Application-Class. In the current version (before this fix), a FX JAR whose manifest can have a Main-Class entry that specifies the JavaFX application class that extends javafx.application.Application. Is that case no longer supported? Other than that, looks good. Yes, it's handled. If there is no JavaFX-Application-Class and if the class defined by Main-Class extends Application then that will be detected later and launched using LM_CLASS instead of LM_JAR. Two of the tests specifically target this condition (lines 218 and 268). > Minor comment: FXHelper.canLaunchFXAppJarand canLaunchFXAppClass - when they are called, we don't know if it's a FX class but I interpreted the canLaunchFXAppxxx method name that the given class is known to be an FX app but checking if it's launchable. Would it be better to rename to isFXAppxxx? Perhaps it's appropriate to call > if (FXHelper.isFxAppJar(..)) { > FXHelper.loadJavaFXLauncher(); > return FXHelper.class; > } I was trying to keep it down to a single method call. The names do look a bit misleading though, I'll think on that a bit. -DrD- From mandy.chung at oracle.com Fri Dec 21 16:13:39 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 21 Dec 2012 08:13:39 -0800 Subject: RFR 8004547: Extend JavaFX launcher support... In-Reply-To: <3417CACD-506E-4C4E-A8AA-13160C868D3F@oracle.com> References: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> <50D406BB.7050100@oracle.com> <3417CACD-506E-4C4E-A8AA-13160C868D3F@oracle.com> Message-ID: <50D48AB3.9060408@oracle.com> On 12/21/2012 7:43 AM, David DeHaven wrote: >>> Request for review for extending the launcher support to allow the JavaFX runtime to fully support all of it's launch features, including preloaders, classpath, etc.. >>> >> >>> >> Webrev: >>> >> http://cr.openjdk.java.net/~ddehaven/8004547/webrev.1/ >> > >> > FXHelper.canLauncherFXAppJar launches a JAR with JavaFX-Application-Class. In the current version (before this fix), a FX JAR whose manifest can have a Main-Class entry that specifies the JavaFX application class that extends javafx.application.Application. Is that case no longer supported? Other than that, looks good. > Yes, it's handled. If there is no JavaFX-Application-Class and if the class defined by Main-Class extends Application then that will be detected later and launched using LM_CLASS instead of LM_JAR. Two of the tests specifically target this condition (lines 218 and 268). Later I figured out that too. In that case, I think loadJavaFxLauncher() is called twice. LM_CLASS may be used for a JAR file with a Main-Class pointing to a FX application entry point which is confusing. So the fxlauncher only needs to know the main class but not any other information in the JAR manifest? In any case, if LM_JAR only means to launch a JAR file with a JavaFX-Application-Class entry in the manifest, it's not really a JAR mode and perhaps better to rename it too. Thanks Mandy From kumar.x.srinivasan at oracle.com Fri Dec 21 16:42:28 2012 From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan) Date: Fri, 21 Dec 2012 08:42:28 -0800 Subject: RFR 8004547: Extend JavaFX launcher support... In-Reply-To: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> References: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> Message-ID: <50D49174.3020103@oracle.com> David, It looks great here are few items I noticed: 1. The error defined by: +java.launcher.javafx.error1=\ + Error: The JavaFX runtime is incompatible with the Java launcher is used for a signature mismatch, I suggest changing the message to reflect the real reason. 2. Nit: extraneous new lines, maybe ? 3. typo: 525 // Check the existance and signature of main and abort if it's incorrect 525 // Check the existence and signature of main and abort if incorrect FXLauncherTest Nit: -System.out.println("Main-Class: "+mainClassEntry); +System.out.println("Main-Class: " + mainClassEntry); Kumar > Request for review for extending the launcher support to allow the JavaFX runtime to fully support all of it's launch features, including preloaders, classpath, etc.. > > Webrev: > http://cr.openjdk.java.net/~ddehaven/8004547/webrev.1/ > > Corresponding JavaFX JIRA issue that these changes depend on: > http://javafx-jira.kenai.com/browse/RT-26751 > > > This should be the final step in adding launcher support for JavaFX applications. These changes should allow any future changes to be done entirely in the JavaFX runtime. The changes for RT-26751 are in this weeks promotion of JavaFX, so should be available in next weeks JRE build (I think.. I'm never sure about promotion timing..). > > -DrD- > From joe.darcy at oracle.com Fri Dec 21 16:46:00 2012 From: joe.darcy at oracle.com (joe.darcy at oracle.com) Date: Fri, 21 Dec 2012 16:46:00 +0000 Subject: hg: jdk8/tl/langtools: 8005282: Use @library tag with non-relative path for javac tests Message-ID: <20121221164605.393E347337@hg.openjdk.java.net> Changeset: b52a38d4536c Author: darcy Date: 2012-12-21 08:45 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/b52a38d4536c 8005282: Use @library tag with non-relative path for javac tests Reviewed-by: jjg ! test/tools/javac/7129225/TestImportStar.java ! test/tools/javac/cast/intersection/model/Model01.java ! test/tools/javac/classreader/T7031108.java ! test/tools/javac/enum/6350057/T6350057.java ! test/tools/javac/enum/6424358/T6424358.java ! test/tools/javac/file/T7018098.java ! test/tools/javac/multicatch/model/ModelChecker.java ! test/tools/javac/options/T7022337.java ! test/tools/javac/processing/6348499/T6348499.java ! test/tools/javac/processing/6359313/T6359313.java ! test/tools/javac/processing/6365040/T6365040.java ! test/tools/javac/processing/6413690/T6413690.java ! test/tools/javac/processing/6414633/T6414633.java ! test/tools/javac/processing/6430209/T6430209.java ! test/tools/javac/processing/6499119/ClassProcessor.java ! test/tools/javac/processing/6511613/clss41701.java ! test/tools/javac/processing/6512707/T6512707.java ! test/tools/javac/processing/6634138/T6634138.java ! test/tools/javac/processing/6994946/SemanticErrorTest.java ! test/tools/javac/processing/6994946/SyntaxErrorTest.java ! test/tools/javac/processing/T6920317.java ! test/tools/javac/processing/T7196462.java ! test/tools/javac/processing/TestWarnErrorCount.java ! test/tools/javac/processing/environment/TestSourceVersion.java ! test/tools/javac/processing/environment/round/TestContext.java ! test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java ! test/tools/javac/processing/errors/TestErrorCount.java ! test/tools/javac/processing/errors/TestFatalityOfParseErrors.java ! test/tools/javac/processing/errors/TestOptionSyntaxErrors.java ! test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.java ! test/tools/javac/processing/errors/TestReturnCode.java ! test/tools/javac/processing/filer/TestFilerConstraints.java ! test/tools/javac/processing/filer/TestGetResource.java ! test/tools/javac/processing/filer/TestGetResource2.java ! test/tools/javac/processing/filer/TestInvalidRelativeNames.java ! test/tools/javac/processing/filer/TestLastRound.java ! test/tools/javac/processing/filer/TestPackageInfo.java ! test/tools/javac/processing/filer/TestValidRelativeNames.java ! test/tools/javac/processing/messager/6362067/T6362067.java ! test/tools/javac/processing/messager/MessagerBasics.java ! test/tools/javac/processing/model/6194785/T6194785.java ! test/tools/javac/processing/model/6341534/T6341534.java ! test/tools/javac/processing/model/element/TestAnonClassNames.java ! test/tools/javac/processing/model/element/TestElement.java ! test/tools/javac/processing/model/element/TestMissingElement/TestMissingElement.java ! test/tools/javac/processing/model/element/TestMissingElement2/TestMissingClass.java ! test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericClass1.java ! test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericClass2.java ! test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericInterface1.java ! test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericInterface2.java ! test/tools/javac/processing/model/element/TestMissingElement2/TestMissingInterface.java ! test/tools/javac/processing/model/element/TestNames.java ! test/tools/javac/processing/model/element/TestPackageElement.java ! test/tools/javac/processing/model/element/TestResourceElement.java ! test/tools/javac/processing/model/element/TestResourceVariable.java ! test/tools/javac/processing/model/element/TestTypeParameter.java ! test/tools/javac/processing/model/element/TypeParamBounds.java ! test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java ! test/tools/javac/processing/model/type/MirroredTypeEx/Plurality.java ! test/tools/javac/processing/model/type/NoTypes.java ! test/tools/javac/processing/model/type/TestUnionType.java ! test/tools/javac/processing/model/util/BinaryName.java ! test/tools/javac/processing/model/util/GetTypeElemBadArg.java ! test/tools/javac/processing/model/util/NoSupers.java ! test/tools/javac/processing/model/util/OverridesSpecEx.java ! test/tools/javac/processing/model/util/TypesBadArg.java ! test/tools/javac/processing/model/util/deprecation/TestDeprecation.java ! test/tools/javac/processing/model/util/directSupersOfErr/DirectSupersOfErr.java ! test/tools/javac/processing/model/util/elements/TestGetConstantExpression.java ! test/tools/javac/processing/model/util/elements/TestGetPackageOf.java ! test/tools/javac/processing/model/util/filter/TestIterables.java ! test/tools/javac/processing/options/testCommandLineClasses/Test.java ! test/tools/javac/processing/options/testPrintProcessorInfo/Test.java ! test/tools/javac/processing/options/testPrintProcessorInfo/TestWithXstdout.java ! test/tools/javac/processing/warnings/UseImplicit/TestProcUseImplicitWarning.java ! test/tools/javac/processing/werror/WError1.java ! test/tools/javac/processing/werror/WErrorGen.java ! test/tools/javac/processing/werror/WErrorLast.java ! test/tools/javac/resolve/ResolveHarness.java ! test/tools/javac/util/T6597678.java ! test/tools/javac/util/context/T7021650.java From chris.hegarty at oracle.com Fri Dec 21 16:49:05 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 21 Dec 2012 16:49:05 +0000 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 In-Reply-To: <50D445BE.3020205@univ-mlv.fr> References: <50D34B5A.8050103@oracle.com> <50D445BE.3020205@univ-mlv.fr> Message-ID: <50D49301.7020409@oracle.com> Updated webrev/specdiff: http://cr.openjdk.java.net/~chegar/8003981/ver.01/ I also included 'webrev_diffAgainstVer00', so you can easily see the differences against the last webrev. Note: I remove any reference to the threshold,MIN_ARRAY_SORT_GRAN, in the API, given the other comments on this change. Remi, Thank you for the detailed review. > in Arrays.parallelSort(TYPE[] a, int fromIndex, int toIndex), > there is no need to have the two supplementary local variable origin and > fence, Agreed, and changed. > ws is not a great better name (workspaceArray?), I had to read the code > of ArraySortHelpers to understand. changed to 'workspace', and removed local variable where suitable. > ArraySortHelpers should be renamed to ArrayParallelSortHelpers. Agreed, changed to ArraysParallelSortHelpers > In ArraySortHelpers, all Sorter, Merger, etc. should declare only one > field by line, currently, the formatting of the fields is weird. Yes, formatting is a little funny since the code is very vertically verbose. I played with a few different styles, mainly lining up multiple declarations per line vertically, but eventually settled on the standard vertical style. I'm not too fussed either way, but I think what we have now is easier to read. > In all Sorter, instead of calling Arrays.sort(), you should call > DualPivotQuicksort.sort to avoid unnecessary range checks. Yes, I see your point. The implementation note in the spec says Arrays.sort, but I think this suggestion is good. I made the change, and since DualPivotQuicksort.sort is inclusive of toIndex/right -1 from toIndex/right. > In compute() of Sorter and Merger, you should copy a and w in local > variables (a = this.a) to help the VM to figure out that they never > changed, > it will also reduce the bytecode size. Yes final local variable where possible. > In Sorter.compute, n should be loaded in a local field, > int l = origin; > int g = gran; > int n = this.n; same as above. > In Merger.compute, the sequence of inits before the second while should be: > int l = lo; > int lFence = l + nleft; // instead of lo + nleft > int r = ro; > int rFence = r + nright; // instead of ro + nright > int k = wo; > it should not changed the performance but it's more inline with the > coding style of the rest of the code IMO. Agreed, and changed. -Chris. On 12/21/2012 11:19 AM, Remi Forax wrote: > On 12/20/2012 06:31 PM, Chris Hegarty wrote: >> This is a review request for the addition of utility methods to >> java.util.Arrays that provide sorting of arrays in parallel, JEP 103 [1]. >> >> Webrev: >> http://cr.openjdk.java.net/~chegar/8003981/ver.00/ >> >> Current sorting implementations provided by the Java Collections >> Framework (Collections.sort and Arrays.sort) all perform the sorting >> operation sequentially in the calling thread. This enhancement will >> offer the same set of sorting operations currently provided by the >> Arrays class, but with a parallel implementation that utilizes the >> Fork/Join framework. These new API?s are still synchronous with regard >> to the calling thread as it will not proceed past the sorting >> operation until the parallel sort is complete. >> >> The actual sorting API this proposal adds will leverage the >> ForkJoinPool.commonPool (default Fork/Join pool defined as part of JEP >> 155). The sorting algorithm is that used in Doug Lea?s ParallelArray >> implementation. >> >> This work was originally done over in the lambda/lambda repo by David >> Holmes, and is now being cleaned up and brought into jdk8. >> >> Open issues/differences from version in lambda: >> 1) Is is necessary for MIN_ARRAY_SORT_GRAN to be in the public API? >> It is an implementation detail (easy to remove). >> 2) The use of FJP.commonPool is an implementation detail, not >> part of the spec. Should not be a problem, just worth pointing >> out, as it differs from what is in lambda/lambda. >> >> -Chris. >> >> [1] http://openjdk.java.net/jeps/103 > > Hi Chris, > in Arrays.parallelSort(TYPE[] a, int fromIndex, int toIndex), > there is no need to have the two supplementary local variable origin and > fence, > ws is not a great better name (workspaceArray?), I had to read the code > of ArraySortHelpers to understand. > > ArraySortHelpers should be renamed to ArrayParallelSortHelpers. > > In ArraySortHelpers, all Sorter, Merger, etc. should declare only one > field by line, currently, the formatting of the fields is weird. > > In all Sorter, instead of calling Arrays.sort(), you should call > DualPivotQuicksort.sort to avoid unnecessary range checks. > > In compute() of Sorter and Merger, you should copy a and w in local > variables (a = this.a) to help the VM to figure out that they never > changed, > it will also reduce the bytecode size. > > In Sorter.compute, n should be loaded in a local field, > int l = origin; > int g = gran; > int n = this.n; > > In Merger.compute, the sequence of inits before the second while should be: > int l = lo; > int lFence = l + nleft; // instead of lo + nleft > int r = ro; > int rFence = r + nright; // instead of ro + nright > int k = wo; > it should not changed the performance but it's more inline with the > coding style of the rest of the code IMO. > > cheers, > R?mi > From david.dehaven at oracle.com Fri Dec 21 16:58:03 2012 From: david.dehaven at oracle.com (David DeHaven) Date: Fri, 21 Dec 2012 08:58:03 -0800 Subject: RFR 8004547: Extend JavaFX launcher support... In-Reply-To: <50D48AB3.9060408@oracle.com> References: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> <50D406BB.7050100@oracle.com> <3417CACD-506E-4C4E-A8AA-13160C868D3F@oracle.com> <50D48AB3.9060408@oracle.com> Message-ID: >>>> Request for review for extending the launcher support to allow the JavaFX runtime to fully support all of it's launch features, including preloaders, classpath, etc.. >>>> >> >> Webrev: >>>> >> http://cr.openjdk.java.net/~ddehaven/8004547/webrev.1/ >>> > > FXHelper.canLauncherFXAppJar launches a JAR with JavaFX-Application-Class. In the current version (before this fix), a FX JAR whose manifest can have a Main-Class entry that specifies the JavaFX application class that extends javafx.application.Application. Is that case no longer supported? Other than that, looks good. >> Yes, it's handled. If there is no JavaFX-Application-Class and if the class defined by Main-Class extends Application then that will be detected later and launched using LM_CLASS instead of LM_JAR. Two of the tests specifically target this condition (lines 218 and 268). > > Later I figured out that too. In that case, I think loadJavaFxLauncher() is called twice. LM_CLASS may be used for a JAR file with a Main-Class pointing to a FX application entry point which is confusing. So the fxlauncher only needs to know the main class but not any other information in the JAR manifest? I think you're confused as to what's happening.. In the absence of JavaFX-Application-Class, canLaunchFXAppJar simply returns false. It does not load the FX launcher on failure or it would be doing so for non-FX jars which would cause testExtraneousJars to fail. getMainClassFromJar then returns the class name defined by Main-Class. At that point it's processed no differently than any non-FX application jar, the main class is loaded and calls canLaunchFXAppClass where the doesExtendFXApplication check passes and *then* it loads the FX launcher and uses LM_CLASS to launch the application, not LM_JAR. Essentially, launching an FX app via "java -jar fxapp.jar" is the same as "java -cp fxapp.jar SomeFXAppClass" if there is no JavaFX-Application-Class attribute. As for naming of those methods? how about canLaunchAsFXAppClass and canLaunchAsFXAppJar (just added "As" in the middle). That should no longer imply it's an FX app class or jar but still convey what it's doing. -DrD- From david.dehaven at oracle.com Fri Dec 21 17:09:15 2012 From: david.dehaven at oracle.com (David DeHaven) Date: Fri, 21 Dec 2012 09:09:15 -0800 Subject: RFR 8004547: Extend JavaFX launcher support... In-Reply-To: <50D49174.3020103@oracle.com> References: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> <50D49174.3020103@oracle.com> Message-ID: > David, > > It looks great here are few items I noticed: > 1. The error defined by: > > +java.launcher.javafx.error1=\ > + Error: The JavaFX runtime is incompatible with the Java launcher > > is used for a signature mismatch, I suggest changing the > message to reflect the real reason. How about: Error: The JavaFX launchApplication method has the wrong signature, it\n\ must be declared static and return a value of type void > 2. Nit: extraneous new lines, maybe ? What lines? I removed a few from FXHelper to tighten it up a bit, and the extra one at the end. > 3. typo: > > 525 // Check the existance and signature of main and abort if it's incorrect > 525 // Check the existence and signature of main and abort if incorrect Fixed. > FXLauncherTest > > Nit: > > -System.out.println("Main-Class: "+mainClassEntry); > +System.out.println("Main-Class: " + mainClassEntry); Fixed.. again, not sure how it reverted. Maybe I went too crazy hitting Undo :) -DrD- From zhong.j.yu at gmail.com Fri Dec 21 17:09:28 2012 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Fri, 21 Dec 2012 11:09:28 -0600 Subject: RFR: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50D40178.3060604@oracle.com> References: <50D40178.3060604@oracle.com> Message-ID: Question: why not delay the evaluation of the message even further, until LogRecord.getMessage() is invoked? Since a logger might be enabled for the level, but the handler is not, so the message is not really logged. Or is that considered uncommon? On Fri, Dec 21, 2012 at 12:28 AM, Henry Jen wrote: > Hi, > > This patch adds a couple APIs to java.util.logging.Logger so that > construction of log messages only occurs when it is actually to be > logged by using Supplier instead of String. > > Since the idea is to avoid unnecessary construction of log messages, > thus APIs imply formatting are not provided. Thus all forms of logrb and > log with Parameters are not included. > > log with Throwable are named to be logEx or logpEx to avoid null > ambiguous as it seems like it's quite common usage with > > logger.log(level, null, thrown) > > Specdiff and webrev can be found at following, > > http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/specdiff/diff.html > http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/webrev/ > > Cheers, > Henry From vicente.romero at oracle.com Fri Dec 21 17:40:10 2012 From: vicente.romero at oracle.com (vicente.romero at oracle.com) Date: Fri, 21 Dec 2012 17:40:10 +0000 Subject: hg: jdk8/tl/langtools: 8003512: javac doesn't work with jar files with >64k entries Message-ID: <20121221174012.A48EA47340@hg.openjdk.java.net> Changeset: 189b26e3818f Author: vromero Date: 2012-12-21 15:27 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/189b26e3818f 8003512: javac doesn't work with jar files with >64k entries Reviewed-by: jjg, ksrini Contributed-by: martinrb at google.com ! src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java + test/tools/javac/file/zip/8003512/LoadClassFromJava6CreatedJarTest.java ! test/tools/javac/file/zip/Utils.java From mandy.chung at oracle.com Fri Dec 21 17:44:30 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 21 Dec 2012 09:44:30 -0800 Subject: RFR 8004547: Extend JavaFX launcher support... In-Reply-To: References: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> <50D406BB.7050100@oracle.com> <3417CACD-506E-4C4E-A8AA-13160C868D3F@oracle.com> <50D48AB3.9060408@oracle.com> Message-ID: <50D49FFE.9020108@oracle.com> On 12/21/2012 8:58 AM, David DeHaven wrote: >> Later I figured out that too. In that case, I think loadJavaFxLauncher() is called twice. LM_CLASS may be used for a JAR file with a Main-Class pointing to a FX application entry point which is confusing. So the fxlauncher only needs to know the main class but not any other information in the JAR manifest? > I think you're confused as to what's happening.. I need more coffee this morning :-) > > In the absence of JavaFX-Application-Class, canLaunchFXAppJar simply returns false. It does not load the FX launcher on failure or it would be doing so for non-FX jars which would cause testExtraneousJars to fail. getMainClassFromJar then returns the class name defined by Main-Class. At that point it's processed no differently than any non-FX application jar, the main class is loaded and calls canLaunchFXAppClass where the doesExtendFXApplication check passes and *then* it loads the FX launcher and uses LM_CLASS to launch the application, not LM_JAR. > Essentially, launching an FX app via "java -jar fxapp.jar" is the same as "java -cp fxapp.jar SomeFXAppClass" if there is no JavaFX-Application-Class attribute. This explains what caused the confusion - I didn't expect that "java -jar fxapp.jar" will be passed to fxlauncher with the same launch mode as "java -cp fxapp.jar SomeFXAppClass" (i.e. LM_CLASS). I think the semantics there was not obvious why it is not LM_JAR mode but JAVAFX_LAUNCH_MODE_xxx has a different semantics than LM_JAR and LM_CLASS that are defined in java.c and also LauncherHelper. Is there any reason why "java -cp fxapp.jar" can't be passed to fxlauncher with LM_JAR mode? That'll be consistent how launch mode is used in java.c and the non-FX app. I'll leave it for you and Kumar/Kevin to decide if this is important to address. > > > As for naming of those methods? how about canLaunchAsFXAppClass and canLaunchAsFXAppJar (just added "As" in the middle). That should no longer imply it's an FX app class or jar but still convey what it's doing. That helps. Thanks Mandy From forax at univ-mlv.fr Fri Dec 21 17:43:43 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Fri, 21 Dec 2012 18:43:43 +0100 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 In-Reply-To: <50D49301.7020409@oracle.com> References: <50D34B5A.8050103@oracle.com> <50D445BE.3020205@univ-mlv.fr> <50D49301.7020409@oracle.com> Message-ID: <50D49FCF.50406@univ-mlv.fr> On 12/21/2012 05:49 PM, Chris Hegarty wrote: > Updated webrev/specdiff: > http://cr.openjdk.java.net/~chegar/8003981/ver.01/ > > I also included 'webrev_diffAgainstVer00', so you can easily see the > differences against the last webrev. > > Note: I remove any reference to the threshold,MIN_ARRAY_SORT_GRAN, in > the API, given the other comments on this change. > > > Remi, > Thank you for the detailed review. Chris, all is green for me, thumb up. [...] > > > In all Sorter, instead of calling Arrays.sort(), you should call > > DualPivotQuicksort.sort to avoid unnecessary range checks. > > Yes, I see your point. The implementation note in the spec says > Arrays.sort, but I think this suggestion is good. I made the change, > and since DualPivotQuicksort.sort is inclusive of toIndex/right -1 > from toIndex/right. good catch ! [...] > > > -Chris. R?mi > > > > On 12/21/2012 11:19 AM, Remi Forax wrote: >> On 12/20/2012 06:31 PM, Chris Hegarty wrote: >>> This is a review request for the addition of utility methods to >>> java.util.Arrays that provide sorting of arrays in parallel, JEP 103 >>> [1]. >>> >>> Webrev: >>> http://cr.openjdk.java.net/~chegar/8003981/ver.00/ >>> >>> Current sorting implementations provided by the Java Collections >>> Framework (Collections.sort and Arrays.sort) all perform the sorting >>> operation sequentially in the calling thread. This enhancement will >>> offer the same set of sorting operations currently provided by the >>> Arrays class, but with a parallel implementation that utilizes the >>> Fork/Join framework. These new API?s are still synchronous with regard >>> to the calling thread as it will not proceed past the sorting >>> operation until the parallel sort is complete. >>> >>> The actual sorting API this proposal adds will leverage the >>> ForkJoinPool.commonPool (default Fork/Join pool defined as part of JEP >>> 155). The sorting algorithm is that used in Doug Lea?s ParallelArray >>> implementation. >>> >>> This work was originally done over in the lambda/lambda repo by David >>> Holmes, and is now being cleaned up and brought into jdk8. >>> >>> Open issues/differences from version in lambda: >>> 1) Is is necessary for MIN_ARRAY_SORT_GRAN to be in the public API? >>> It is an implementation detail (easy to remove). >>> 2) The use of FJP.commonPool is an implementation detail, not >>> part of the spec. Should not be a problem, just worth pointing >>> out, as it differs from what is in lambda/lambda. >>> >>> -Chris. >>> >>> [1] http://openjdk.java.net/jeps/103 >> >> Hi Chris, >> in Arrays.parallelSort(TYPE[] a, int fromIndex, int toIndex), >> there is no need to have the two supplementary local variable origin and >> fence, >> ws is not a great better name (workspaceArray?), I had to read the code >> of ArraySortHelpers to understand. >> >> ArraySortHelpers should be renamed to ArrayParallelSortHelpers. >> >> In ArraySortHelpers, all Sorter, Merger, etc. should declare only one >> field by line, currently, the formatting of the fields is weird. >> >> In all Sorter, instead of calling Arrays.sort(), you should call >> DualPivotQuicksort.sort to avoid unnecessary range checks. >> >> In compute() of Sorter and Merger, you should copy a and w in local >> variables (a = this.a) to help the VM to figure out that they never >> changed, >> it will also reduce the bytecode size. >> >> In Sorter.compute, n should be loaded in a local field, >> int l = origin; >> int g = gran; >> int n = this.n; >> >> In Merger.compute, the sequence of inits before the second while >> should be: >> int l = lo; >> int lFence = l + nleft; // instead of lo + nleft >> int r = ro; >> int rFence = r + nright; // instead of ro + nright >> int k = wo; >> it should not changed the performance but it's more inline with the >> coding style of the rest of the code IMO. >> >> cheers, >> R?mi >> From stuart.marks at oracle.com Fri Dec 21 17:50:00 2012 From: stuart.marks at oracle.com (Stuart Marks) Date: Fri, 21 Dec 2012 09:50:00 -0800 Subject: 7187882: TEST_BUG: java/rmi/activation/checkusage/CheckUsage.java fails intermittently Message-ID: <50D4A148.5070406@oracle.com> Hi all, Please review these additional RMI test cleanups: http://cr.openjdk.java.net/~smarks/reviews/7187882/webrev.0/ in service of fixing the following bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7187882 The basic problem here is that tests were waiting for the JVM subprocess to exit, but not waiting for all output from the subprocess to be collected. The fix includes a bit of new infrastructure in RMI's test library and adjustment of several other tests to use it. Thanks, s'marks From peter.levart at gmail.com Fri Dec 21 17:52:48 2012 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 21 Dec 2012 18:52:48 +0100 Subject: RFR: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50D40178.3060604@oracle.com> References: <50D40178.3060604@oracle.com> Message-ID: <50D4A1F0.4090206@gmail.com> Hi Henry, again, To delay constructing message to as late as possible, you could construct a LogRecord with a reference to Supplier and only evaluate the Supplier on the first call to LogRecord.getMessage() and then cache-it. Like the following: http://dl.dropbox.com/u/101777488/jdk8-tl/LogRecord/webrev/index.html Also, the "staging" Block call-back in doLog() is a very nice lambda usage, but it comes with a cost of constructing another lambda object for each call to those methods... Regards, Peter On 12/21/2012 07:28 AM, Henry Jen wrote: > Hi, > > This patch adds a couple APIs to java.util.logging.Logger so that > construction of log messages only occurs when it is actually to be > logged by using Supplier instead of String. > > Since the idea is to avoid unnecessary construction of log messages, > thus APIs imply formatting are not provided. Thus all forms of logrb and > log with Parameters are not included. > > log with Throwable are named to be logEx or logpEx to avoid null > ambiguous as it seems like it's quite common usage with > > logger.log(level, null, thrown) > > Specdiff and webrev can be found at following, > > http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/specdiff/diff.html > http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/webrev/ > > Cheers, > Henry From huizhe.wang at oracle.com Fri Dec 21 18:03:18 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Fri, 21 Dec 2012 10:03:18 -0800 Subject: RFR 8005280: (props) Improve test coverage for small XML parser In-Reply-To: <50D4509D.6090508@oracle.com> References: <50D41FAF.8070702@oracle.com> <50D4509D.6090508@oracle.com> Message-ID: <50D4A466.9000604@oracle.com> On 12/21/2012 4:05 AM, Alan Bateman wrote: > On 21/12/2012 08:37, Joe Wang wrote: >> The cause of the LoadAndStoreXML test failure appeared to be that of >> 8005281 that Alan just fixed. Before the 8005281 patch, I was able to >> get the tests to pass when I isolated the relevant tests (that is, >> copy LoadAndStoreXML and remove other test cases). After the 8005281 >> patch, LoadAndStoreXML passed in its original form. >> >> I've also added a few more invalid xml files, plus international >> characters to testLoadAndStore. >> >> Webrev: >> http://cr.openjdk.java.net/~joehw/jdk8/8005280/webrev/ > I concur with your observation that this issue is fixed by 8005281, in > which case we can change the focus for 8005280 to extend the test > coverage as you have done. Subject corrected. > > The new tests look good to me except that you've prefixed them all > with "propertyfile_" and so are inconsistent with the existing tests. > I think it would be good to rename them to be consistent before > pushing this. Files are renamed. I added a new test "CompatibilityTest" to test behavior compatibility with the regular JDK XML provider. Webrev: http://cr.openjdk.java.net/~joehw/jdk8/8005280/webrev/ -Joe > > -Alan > From kurchi.subhra.hazra at oracle.com Fri Dec 21 18:21:22 2012 From: kurchi.subhra.hazra at oracle.com (Kurchi Hazra) Date: Fri, 21 Dec 2012 10:21:22 -0800 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 In-Reply-To: <50D49FCF.50406@univ-mlv.fr> References: <50D34B5A.8050103@oracle.com> <50D445BE.3020205@univ-mlv.fr> <50D49301.7020409@oracle.com> <50D49FCF.50406@univ-mlv.fr> Message-ID: <50D4A8A2.1050205@oracle.com> Isn't the optimal granularity value different for different number of cores, differing amounts of memory available in a machine etc? If someone is trying to use a parallelSort to take adavntage of all the cores in a machine, he is anyway a little bit of an advanced user I guess. - Kurchi On 21.12.2012 09:43, Remi Forax wrote: > On 12/21/2012 05:49 PM, Chris Hegarty wrote: >> Updated webrev/specdiff: >> http://cr.openjdk.java.net/~chegar/8003981/ver.01/ >> >> I also included 'webrev_diffAgainstVer00', so you can easily see the >> differences against the last webrev. >> >> Note: I remove any reference to the threshold,MIN_ARRAY_SORT_GRAN, in >> the API, given the other comments on this change. >> >> >> Remi, >> Thank you for the detailed review. > > Chris, > all is green for me, thumb up. > > [...] > >> >> > In all Sorter, instead of calling Arrays.sort(), you should call >> > DualPivotQuicksort.sort to avoid unnecessary range checks. >> >> Yes, I see your point. The implementation note in the spec says >> Arrays.sort, but I think this suggestion is good. I made the change, >> and since DualPivotQuicksort.sort is inclusive of toIndex/right -1 >> from toIndex/right. > > good catch ! > > [...] > >> >> >> -Chris. > > R?mi > >> >> >> >> On 12/21/2012 11:19 AM, Remi Forax wrote: >>> On 12/20/2012 06:31 PM, Chris Hegarty wrote: >>>> This is a review request for the addition of utility methods to >>>> java.util.Arrays that provide sorting of arrays in parallel, JEP >>>> 103 [1]. >>>> >>>> Webrev: >>>> http://cr.openjdk.java.net/~chegar/8003981/ver.00/ >>>> >>>> Current sorting implementations provided by the Java Collections >>>> Framework (Collections.sort and Arrays.sort) all perform the sorting >>>> operation sequentially in the calling thread. This enhancement will >>>> offer the same set of sorting operations currently provided by the >>>> Arrays class, but with a parallel implementation that utilizes the >>>> Fork/Join framework. These new API?s are still synchronous with regard >>>> to the calling thread as it will not proceed past the sorting >>>> operation until the parallel sort is complete. >>>> >>>> The actual sorting API this proposal adds will leverage the >>>> ForkJoinPool.commonPool (default Fork/Join pool defined as part of JEP >>>> 155). The sorting algorithm is that used in Doug Lea?s ParallelArray >>>> implementation. >>>> >>>> This work was originally done over in the lambda/lambda repo by David >>>> Holmes, and is now being cleaned up and brought into jdk8. >>>> >>>> Open issues/differences from version in lambda: >>>> 1) Is is necessary for MIN_ARRAY_SORT_GRAN to be in the public API? >>>> It is an implementation detail (easy to remove). >>>> 2) The use of FJP.commonPool is an implementation detail, not >>>> part of the spec. Should not be a problem, just worth pointing >>>> out, as it differs from what is in lambda/lambda. >>>> >>>> -Chris. >>>> >>>> [1] http://openjdk.java.net/jeps/103 >>> >>> Hi Chris, >>> in Arrays.parallelSort(TYPE[] a, int fromIndex, int toIndex), >>> there is no need to have the two supplementary local variable origin >>> and >>> fence, >>> ws is not a great better name (workspaceArray?), I had to read the >>> code >>> of ArraySortHelpers to understand. >>> >>> ArraySortHelpers should be renamed to ArrayParallelSortHelpers. >>> >>> In ArraySortHelpers, all Sorter, Merger, etc. should declare only one >>> field by line, currently, the formatting of the fields is weird. >>> >>> In all Sorter, instead of calling Arrays.sort(), you should call >>> DualPivotQuicksort.sort to avoid unnecessary range checks. >>> >>> In compute() of Sorter and Merger, you should copy a and w in local >>> variables (a = this.a) to help the VM to figure out that they never >>> changed, >>> it will also reduce the bytecode size. >>> >>> In Sorter.compute, n should be loaded in a local field, >>> int l = origin; >>> int g = gran; >>> int n = this.n; >>> >>> In Merger.compute, the sequence of inits before the second while >>> should be: >>> int l = lo; >>> int lFence = l + nleft; // instead of lo + nleft >>> int r = ro; >>> int rFence = r + nright; // instead of ro + nright >>> int k = wo; >>> it should not changed the performance but it's more inline with the >>> coding style of the rest of the code IMO. >>> >>> cheers, >>> R?mi >>> > -- -Kurchi From dl at cs.oswego.edu Fri Dec 21 18:24:14 2012 From: dl at cs.oswego.edu (Doug Lea) Date: Fri, 21 Dec 2012 13:24:14 -0500 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 In-Reply-To: <50D34B5A.8050103@oracle.com> References: <50D34B5A.8050103@oracle.com> Message-ID: <50D4A94E.90407@cs.oswego.edu> On 12/20/12 12:31, Chris Hegarty wrote: > This is a review request for the addition of utility methods to java.util.Arrays > that provide sorting of arrays in parallel, JEP 103 [1]. A side-note on this: Suitable Object/Comparable versions of DualPivot sort might someday be better fits to the parallel split logic and locality patterns than current Arrays.sort. Vladimir and I discussed this briefly a few years ago, but I don't know if they were ever developed. Otherwise, on quick glance, despite the now-huge vertical-space usage :-), the updated webrev looks OK to me. -Doug From brent.christian at oracle.com Fri Dec 21 18:25:04 2012 From: brent.christian at oracle.com (Brent Christian) Date: Fri, 21 Dec 2012 10:25:04 -0800 Subject: RFR : 8003228 : (props) sun.jnu.encoding should be set to UTF-8 [macosx] In-Reply-To: <50D4812E.7040402@oracle.com> References: <50D35E6C.8060205@oracle.com> <50D38F14.5050100@oracle.com> <50D4812E.7040402@oracle.com> Message-ID: <50D4A980.5000108@oracle.com> On 12/21/12 7:33 AM, Alan Bateman wrote: > I also think it's important that the folks on macosx-port-dev that have > been complaining about this help us test it out, particularly folks that > work in Asian locales. I don't know how many of them build the jdk so > you might need to send a reminder once there is a jdk8 build available > with this change. I don't think we should consider backporting this > change to jdk7u until there is strong evidence that the change in jdk8 > is good. Definitely agree. > Thanks for creating a test. I'm not sure that test/java/util/Properties > is right place as that directory is for tests of the > java.util.Properties API. I guess I would move it to java/util/System as > there isn't an obvious place in the sun/** tree. I wasn't quite sure where to put it. Moved to java/lang/System (assuming you didn't actually mean java/util/System). > In ExpectedEncoding > then it looks it is missing an exit in the bad usage case. Thanks, fixed. > Also as an > alternative to the failed flag then you could just throw an exception. When practical, I like to test and report all tested conditions (instead of failing fast). I think it helps provide scope to a failure, just from looking at the test report. Bit of a personal preference, I guess. I can change it to fail fast if that's preferred. I do think an exception stack trace is easier to spot to someone just glancing through test results. So I now have the flag and an exception - hope that's okay. :) Updated webrev: http://cr.openjdk.java.net/~bchristi/8003228/webrev.02/ Thanks, -Brent From Lance.Andersen at oracle.com Fri Dec 21 18:40:57 2012 From: Lance.Andersen at oracle.com (Lance Andersen) Date: Fri, 21 Dec 2012 13:40:57 -0500 Subject: RFR 8005280: (props) Improve test coverage for small XML parser In-Reply-To: <50D4A466.9000604@oracle.com> References: <50D41FAF.8070702@oracle.com> <50D4509D.6090508@oracle.com> <50D4A466.9000604@oracle.com> Message-ID: +1 On Dec 21, 2012, at 1:03 PM, Joe Wang wrote: > > > On 12/21/2012 4:05 AM, Alan Bateman wrote: >> On 21/12/2012 08:37, Joe Wang wrote: >>> The cause of the LoadAndStoreXML test failure appeared to be that of 8005281 that Alan just fixed. Before the 8005281 patch, I was able to get the tests to pass when I isolated the relevant tests (that is, copy LoadAndStoreXML and remove other test cases). After the 8005281 patch, LoadAndStoreXML passed in its original form. >>> >>> I've also added a few more invalid xml files, plus international characters to testLoadAndStore. >>> >>> Webrev: >>> http://cr.openjdk.java.net/~joehw/jdk8/8005280/webrev/ >> I concur with your observation that this issue is fixed by 8005281, in which case we can change the focus for 8005280 to extend the test coverage as you have done. > > Subject corrected. > >> >> The new tests look good to me except that you've prefixed them all with "propertyfile_" and so are inconsistent with the existing tests. I think it would be good to rename them to be consistent before pushing this. > > Files are renamed. I added a new test "CompatibilityTest" to test behavior compatibility with the regular JDK XML provider. > > Webrev: > http://cr.openjdk.java.net/~joehw/jdk8/8005280/webrev/ > > -Joe > >> >> -Alan >> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com From Alan.Bateman at oracle.com Fri Dec 21 19:08:19 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 21 Dec 2012 19:08:19 +0000 Subject: RFR 8005280: (props) Improve test coverage for small XML parser In-Reply-To: <50D4A466.9000604@oracle.com> References: <50D41FAF.8070702@oracle.com> <50D4509D.6090508@oracle.com> <50D4A466.9000604@oracle.com> Message-ID: <50D4B3A3.9050203@oracle.com> On 21/12/2012 18:03, Joe Wang wrote: > : > > Files are renamed. I added a new test "CompatibilityTest" to test > behavior compatibility with the regular JDK XML provider. > > Webrev: > http://cr.openjdk.java.net/~joehw/jdk8/8005280/webrev/ > > -Joe Thanks for renaming the propertyfile_ prefix from the new test cases, looks much cleaner now. On Compatibility.xml then I guess it should very rare to use this for Properties. I guess the test is okay, just wondering about require the small parser to support it. In CompatibilityTest.loadPropertyFile then it looks like the file is not closed. -Alan From chris.hegarty at oracle.com Fri Dec 21 19:09:48 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 21 Dec 2012 19:09:48 +0000 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 In-Reply-To: <50D4A94E.90407@cs.oswego.edu> References: <50D34B5A.8050103@oracle.com> <50D4A94E.90407@cs.oswego.edu> Message-ID: <20FB03D2-65E6-42F8-B7A6-6C166A4CE874@oracle.com> Doug, Just a quick question/confirmation, you are ok with the threshold not being exposed I the API, right? -Chris On 21 Dec 2012, at 18:24, Doug Lea

wrote: > On 12/20/12 12:31, Chris Hegarty wrote: >> This is a review request for the addition of utility methods to java.util.Arrays >> that provide sorting of arrays in parallel, JEP 103 [1]. > > A side-note on this: Suitable Object/Comparable versions of > DualPivot sort might someday be better fits to the parallel split > logic and locality patterns than current Arrays.sort. > Vladimir and I discussed this briefly a few years ago, but I > don't know if they were ever developed. > > Otherwise, on quick glance, despite the now-huge vertical-space usage :-), > the updated webrev looks OK to me. > > -Doug > From dl at cs.oswego.edu Fri Dec 21 19:14:17 2012 From: dl at cs.oswego.edu (Doug Lea) Date: Fri, 21 Dec 2012 14:14:17 -0500 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 In-Reply-To: <20FB03D2-65E6-42F8-B7A6-6C166A4CE874@oracle.com> References: <50D34B5A.8050103@oracle.com> <50D4A94E.90407@cs.oswego.edu> <20FB03D2-65E6-42F8-B7A6-6C166A4CE874@oracle.com> Message-ID: <50D4B509.1060206@cs.oswego.edu> On 12/21/12 14:09, Chris Hegarty wrote: > Doug, > > Just a quick question/confirmation, you are ok with the threshold not being exposed I the API, right? > Yes, I think I argued against exposing it initially :-) -Doug > -Chris > > On 21 Dec 2012, at 18:24, Doug Lea
wrote: > >> On 12/20/12 12:31, Chris Hegarty wrote: >>> This is a review request for the addition of utility methods to java.util.Arrays >>> that provide sorting of arrays in parallel, JEP 103 [1]. >> >> A side-note on this: Suitable Object/Comparable versions of >> DualPivot sort might someday be better fits to the parallel split >> logic and locality patterns than current Arrays.sort. >> Vladimir and I discussed this briefly a few years ago, but I >> don't know if they were ever developed. >> >> Otherwise, on quick glance, despite the now-huge vertical-space usage :-), >> the updated webrev looks OK to me. >> >> -Doug >> > From huizhe.wang at oracle.com Fri Dec 21 19:56:35 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Fri, 21 Dec 2012 11:56:35 -0800 Subject: RFR 8005280: (props) Improve test coverage for small XML parser In-Reply-To: <50D4B3A3.9050203@oracle.com> References: <50D41FAF.8070702@oracle.com> <50D4509D.6090508@oracle.com> <50D4A466.9000604@oracle.com> <50D4B3A3.9050203@oracle.com> Message-ID: <50D4BEF3.6070708@oracle.com> On 12/21/2012 11:08 AM, Alan Bateman wrote: > On 21/12/2012 18:03, Joe Wang wrote: >> : >> >> Files are renamed. I added a new test "CompatibilityTest" to test >> behavior compatibility with the regular JDK XML provider. >> >> Webrev: >> http://cr.openjdk.java.net/~joehw/jdk8/8005280/webrev/ >> >> -Joe > Thanks for renaming the propertyfile_ prefix from the new test cases, > looks much cleaner now. > > On Compatibility.xml then I guess it should very rare to use this for > Properties. I guess the test is okay, just wondering about require the > small parser to support it. I searched by properties.dtd and found the CDATA usage. So I went ahead experimenting what would not be rejected by the regular provider and tested against the small parser. I agree the cases other than CDATA are rare. > In CompatibilityTest.loadPropertyFile then it looks like the file is > not closed. Properties' loadFromXML stated that it will close the stream after loading. But it doesn't hurt to double-check. New webrev: http://cr.openjdk.java.net/~joehw/jdk8/8005280/webrev/ -Joe > > -Alan From chris.hegarty at oracle.com Fri Dec 21 20:01:42 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Fri, 21 Dec 2012 20:01:42 +0000 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 In-Reply-To: <50D4A8A2.1050205@oracle.com> References: <50D34B5A.8050103@oracle.com> <50D445BE.3020205@univ-mlv.fr> <50D49301.7020409@oracle.com> <50D49FCF.50406@univ-mlv.fr> <50D4A8A2.1050205@oracle.com> Message-ID: The granularity is the threshold beyond which we no longer split the array, for its parts to be sorted as separate tasks, and then merged together. At some point it becomes more costly to do this split and merge than simply sorting the array. I think Paul put it best by calling finding the optimal threshold a black art. This API is targeted at the average developer that simply wants the sorting to be as past a reasonably possible, on their multi-core machine, without having to run benchmarks, profiling, etc. I am concerned that exposing the threshold will simply confuse most developers. -Chris On 21 Dec 2012, at 18:21, Kurchi Hazra wrote: > Isn't the optimal granularity value different for different number of cores, differing amounts of memory available in a machine etc? > If someone is trying to use a parallelSort to take adavntage of all the cores in a machine, he is anyway a little bit of an > advanced user I guess. > > - Kurchi > > On 21.12.2012 09:43, Remi Forax wrote: >> On 12/21/2012 05:49 PM, Chris Hegarty wrote: >>> Updated webrev/specdiff: >>> http://cr.openjdk.java.net/~chegar/8003981/ver.01/ >>> >>> I also included 'webrev_diffAgainstVer00', so you can easily see the differences against the last webrev. >>> >>> Note: I remove any reference to the threshold,MIN_ARRAY_SORT_GRAN, in the API, given the other comments on this change. >>> >>> >>> Remi, >>> Thank you for the detailed review. >> >> Chris, >> all is green for me, thumb up. >> >> [...] >> >>> >>> > In all Sorter, instead of calling Arrays.sort(), you should call >>> > DualPivotQuicksort.sort to avoid unnecessary range checks. >>> >>> Yes, I see your point. The implementation note in the spec says Arrays.sort, but I think this suggestion is good. I made the change, and since DualPivotQuicksort.sort is inclusive of toIndex/right -1 from toIndex/right. >> >> good catch ! >> >> [...] >> >>> >>> >>> -Chris. >> >> R?mi >> >>> >>> >>> >>> On 12/21/2012 11:19 AM, Remi Forax wrote: >>>> On 12/20/2012 06:31 PM, Chris Hegarty wrote: >>>>> This is a review request for the addition of utility methods to >>>>> java.util.Arrays that provide sorting of arrays in parallel, JEP 103 [1]. >>>>> >>>>> Webrev: >>>>> http://cr.openjdk.java.net/~chegar/8003981/ver.00/ >>>>> >>>>> Current sorting implementations provided by the Java Collections >>>>> Framework (Collections.sort and Arrays.sort) all perform the sorting >>>>> operation sequentially in the calling thread. This enhancement will >>>>> offer the same set of sorting operations currently provided by the >>>>> Arrays class, but with a parallel implementation that utilizes the >>>>> Fork/Join framework. These new API?s are still synchronous with regard >>>>> to the calling thread as it will not proceed past the sorting >>>>> operation until the parallel sort is complete. >>>>> >>>>> The actual sorting API this proposal adds will leverage the >>>>> ForkJoinPool.commonPool (default Fork/Join pool defined as part of JEP >>>>> 155). The sorting algorithm is that used in Doug Lea?s ParallelArray >>>>> implementation. >>>>> >>>>> This work was originally done over in the lambda/lambda repo by David >>>>> Holmes, and is now being cleaned up and brought into jdk8. >>>>> >>>>> Open issues/differences from version in lambda: >>>>> 1) Is is necessary for MIN_ARRAY_SORT_GRAN to be in the public API? >>>>> It is an implementation detail (easy to remove). >>>>> 2) The use of FJP.commonPool is an implementation detail, not >>>>> part of the spec. Should not be a problem, just worth pointing >>>>> out, as it differs from what is in lambda/lambda. >>>>> >>>>> -Chris. >>>>> >>>>> [1] http://openjdk.java.net/jeps/103 >>>> >>>> Hi Chris, >>>> in Arrays.parallelSort(TYPE[] a, int fromIndex, int toIndex), >>>> there is no need to have the two supplementary local variable origin and >>>> fence, >>>> ws is not a great better name (workspaceArray?), I had to read the code >>>> of ArraySortHelpers to understand. >>>> >>>> ArraySortHelpers should be renamed to ArrayParallelSortHelpers. >>>> >>>> In ArraySortHelpers, all Sorter, Merger, etc. should declare only one >>>> field by line, currently, the formatting of the fields is weird. >>>> >>>> In all Sorter, instead of calling Arrays.sort(), you should call >>>> DualPivotQuicksort.sort to avoid unnecessary range checks. >>>> >>>> In compute() of Sorter and Merger, you should copy a and w in local >>>> variables (a = this.a) to help the VM to figure out that they never >>>> changed, >>>> it will also reduce the bytecode size. >>>> >>>> In Sorter.compute, n should be loaded in a local field, >>>> int l = origin; >>>> int g = gran; >>>> int n = this.n; >>>> >>>> In Merger.compute, the sequence of inits before the second while should be: >>>> int l = lo; >>>> int lFence = l + nleft; // instead of lo + nleft >>>> int r = ro; >>>> int rFence = r + nright; // instead of ro + nright >>>> int k = wo; >>>> it should not changed the performance but it's more inline with the >>>> coding style of the rest of the code IMO. >>>> >>>> cheers, >>>> R?mi > > -- > -Kurchi > From kurchi.subhra.hazra at oracle.com Fri Dec 21 20:09:18 2012 From: kurchi.subhra.hazra at oracle.com (Kurchi Hazra) Date: Fri, 21 Dec 2012 12:09:18 -0800 Subject: RFR 8003981: Support Parallel Array Sorting - JEP 103 In-Reply-To: References: <50D34B5A.8050103@oracle.com> <50D445BE.3020205@univ-mlv.fr> <50D49301.7020409@oracle.com> <50D49FCF.50406@univ-mlv.fr> <50D4A8A2.1050205@oracle.com> Message-ID: <50D4C1EE.2090209@oracle.com> Alright, I have used Intel's Thread Building Blocks, where the user has(or had) to do the splitting up of tasks himself, and I remember having to do some level of profiling on different machines for getting some performance advantage over the serial version of any algorithm. But I guess we are not aiming for that kind of accuracy here. Thanks for clarifying, - Kurchi On 21.12.2012 12:01, Chris Hegarty wrote: > The granularity is the threshold beyond which we no longer split the array, for its parts to be sorted as separate tasks, and then merged together. At some point it becomes more costly to do this split and merge than simply sorting the array. I think Paul put it best by calling finding the optimal threshold a black art. > > This API is targeted at the average developer that simply wants the sorting to be as past a reasonably possible, on their multi-core machine, without having to run benchmarks, profiling, etc. I am concerned that exposing the threshold will simply confuse most developers. > > -Chris > > On 21 Dec 2012, at 18:21, Kurchi Hazra wrote: > >> Isn't the optimal granularity value different for different number of cores, differing amounts of memory available in a machine etc? >> If someone is trying to use a parallelSort to take adavntage of all the cores in a machine, he is anyway a little bit of an >> advanced user I guess. >> >> - Kurchi >> >> On 21.12.2012 09:43, Remi Forax wrote: >>> On 12/21/2012 05:49 PM, Chris Hegarty wrote: >>>> Updated webrev/specdiff: >>>> http://cr.openjdk.java.net/~chegar/8003981/ver.01/ >>>> >>>> I also included 'webrev_diffAgainstVer00', so you can easily see the differences against the last webrev. >>>> >>>> Note: I remove any reference to the threshold,MIN_ARRAY_SORT_GRAN, in the API, given the other comments on this change. >>>> >>>> >>>> Remi, >>>> Thank you for the detailed review. >>> Chris, >>> all is green for me, thumb up. >>> >>> [...] >>> >>>>> In all Sorter, instead of calling Arrays.sort(), you should call >>>>> DualPivotQuicksort.sort to avoid unnecessary range checks. >>>> Yes, I see your point. The implementation note in the spec says Arrays.sort, but I think this suggestion is good. I made the change, and since DualPivotQuicksort.sort is inclusive of toIndex/right -1 from toIndex/right. >>> good catch ! >>> >>> [...] >>> >>>> >>>> -Chris. >>> R?mi >>> >>>> >>>> >>>> On 12/21/2012 11:19 AM, Remi Forax wrote: >>>>> On 12/20/2012 06:31 PM, Chris Hegarty wrote: >>>>>> This is a review request for the addition of utility methods to >>>>>> java.util.Arrays that provide sorting of arrays in parallel, JEP 103 [1]. >>>>>> >>>>>> Webrev: >>>>>> http://cr.openjdk.java.net/~chegar/8003981/ver.00/ >>>>>> >>>>>> Current sorting implementations provided by the Java Collections >>>>>> Framework (Collections.sort and Arrays.sort) all perform the sorting >>>>>> operation sequentially in the calling thread. This enhancement will >>>>>> offer the same set of sorting operations currently provided by the >>>>>> Arrays class, but with a parallel implementation that utilizes the >>>>>> Fork/Join framework. These new API?s are still synchronous with regard >>>>>> to the calling thread as it will not proceed past the sorting >>>>>> operation until the parallel sort is complete. >>>>>> >>>>>> The actual sorting API this proposal adds will leverage the >>>>>> ForkJoinPool.commonPool (default Fork/Join pool defined as part of JEP >>>>>> 155). The sorting algorithm is that used in Doug Lea?s ParallelArray >>>>>> implementation. >>>>>> >>>>>> This work was originally done over in the lambda/lambda repo by David >>>>>> Holmes, and is now being cleaned up and brought into jdk8. >>>>>> >>>>>> Open issues/differences from version in lambda: >>>>>> 1) Is is necessary for MIN_ARRAY_SORT_GRAN to be in the public API? >>>>>> It is an implementation detail (easy to remove). >>>>>> 2) The use of FJP.commonPool is an implementation detail, not >>>>>> part of the spec. Should not be a problem, just worth pointing >>>>>> out, as it differs from what is in lambda/lambda. >>>>>> >>>>>> -Chris. >>>>>> >>>>>> [1] http://openjdk.java.net/jeps/103 >>>>> Hi Chris, >>>>> in Arrays.parallelSort(TYPE[] a, int fromIndex, int toIndex), >>>>> there is no need to have the two supplementary local variable origin and >>>>> fence, >>>>> ws is not a great better name (workspaceArray?), I had to read the code >>>>> of ArraySortHelpers to understand. >>>>> >>>>> ArraySortHelpers should be renamed to ArrayParallelSortHelpers. >>>>> >>>>> In ArraySortHelpers, all Sorter, Merger, etc. should declare only one >>>>> field by line, currently, the formatting of the fields is weird. >>>>> >>>>> In all Sorter, instead of calling Arrays.sort(), you should call >>>>> DualPivotQuicksort.sort to avoid unnecessary range checks. >>>>> >>>>> In compute() of Sorter and Merger, you should copy a and w in local >>>>> variables (a = this.a) to help the VM to figure out that they never >>>>> changed, >>>>> it will also reduce the bytecode size. >>>>> >>>>> In Sorter.compute, n should be loaded in a local field, >>>>> int l = origin; >>>>> int g = gran; >>>>> int n = this.n; >>>>> >>>>> In Merger.compute, the sequence of inits before the second while should be: >>>>> int l = lo; >>>>> int lFence = l + nleft; // instead of lo + nleft >>>>> int r = ro; >>>>> int rFence = r + nright; // instead of ro + nright >>>>> int k = wo; >>>>> it should not changed the performance but it's more inline with the >>>>> coding style of the rest of the code IMO. >>>>> >>>>> cheers, >>>>> R?mi >> -- >> -Kurchi >> -- -Kurchi From Alan.Bateman at oracle.com Fri Dec 21 20:35:16 2012 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Fri, 21 Dec 2012 20:35:16 +0000 Subject: RFR 8005280: (props) Improve test coverage for small XML parser In-Reply-To: <50D4BEF3.6070708@oracle.com> References: <50D41FAF.8070702@oracle.com> <50D4509D.6090508@oracle.com> <50D4A466.9000604@oracle.com> <50D4B3A3.9050203@oracle.com> <50D4BEF3.6070708@oracle.com> Message-ID: <50D4C804.6020104@oracle.com> On 21/12/2012 19:56, Joe Wang wrote: > : > > I searched by properties.dtd and found the CDATA usage. So I went > ahead experimenting what would not be rejected by the regular > provider and tested against the small parser. I agree the cases other > than CDATA are rare. Okay. > >> In CompatibilityTest.loadPropertyFile then it looks like the file is >> not closed. > > Properties' loadFromXML stated that it will close the stream after > loading. But it doesn't hurt to double-check. > New webrev: > http://cr.openjdk.java.net/~joehw/jdk8/8005280/webrev/ What you have now is okay but I think it would be nicer if it were changed to use try-with-resources (no need to generate a new webrev for that). -Alan From huizhe.wang at oracle.com Fri Dec 21 21:18:15 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Fri, 21 Dec 2012 13:18:15 -0800 Subject: RFR 8005280: (props) Improve test coverage for small XML parser In-Reply-To: <50D4C804.6020104@oracle.com> References: <50D41FAF.8070702@oracle.com> <50D4509D.6090508@oracle.com> <50D4A466.9000604@oracle.com> <50D4B3A3.9050203@oracle.com> <50D4BEF3.6070708@oracle.com> <50D4C804.6020104@oracle.com> Message-ID: <50D4D217.8010400@oracle.com> On 12/21/2012 12:35 PM, Alan Bateman wrote: > On 21/12/2012 19:56, Joe Wang wrote: >> : >> >> I searched by properties.dtd and found the CDATA usage. So I went >> ahead experimenting what would not be rejected by the regular >> provider and tested against the small parser. I agree the cases >> other than CDATA are rare. > Okay. > >> >>> In CompatibilityTest.loadPropertyFile then it looks like the file is >>> not closed. >> >> Properties' loadFromXML stated that it will close the stream after >> loading. But it doesn't hurt to double-check. >> New webrev: >> http://cr.openjdk.java.net/~joehw/jdk8/8005280/webrev/ > What you have now is okay but I think it would be nicer if it were > changed to use try-with-resources (no need to generate a new webrev > for that). I still have the source=1.5 mentality :) In 2009, we dropped JDK 1.4 support for the jaxp standalone. I guess it's time to make a jump to source=1.7 now! I re-generated the webrev just to keep the record. I will push after a new jprt test. -Joe > > -Alan From peter.levart at gmail.com Fri Dec 21 21:37:05 2012 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 21 Dec 2012 22:37:05 +0100 Subject: RFR: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50D4A1F0.4090206@gmail.com> References: <50D40178.3060604@oracle.com> <50D4A1F0.4090206@gmail.com> Message-ID: <50D4D681.3040009@gmail.com> On 12/21/2012 06:52 PM, Peter Levart wrote: > Hi Henry, again, > > To delay constructing message to as late as possible, you could > construct a LogRecord with a reference to Supplier and only > evaluate the Supplier on the first call to LogRecord.getMessage() and > then cache-it. Like the following: > > http://dl.dropbox.com/u/101777488/jdk8-tl/LogRecord/webrev/index.html > On a second thought, the above might not be a good idea. The message should be materialized before passing the LogRecord to a handler, since some handlers might evaluate message in a special "logging" thread and therefore invoking a user provided Supplier in another thread might have undesirable effects (threading issues)... Regards, Peter > Also, the "staging" Block call-back in doLog() is a very nice lambda > usage, but it comes with a cost of constructing another lambda object > for each call to those methods... > > Regards, Peter > > On 12/21/2012 07:28 AM, Henry Jen wrote: >> Hi, >> >> This patch adds a couple APIs to java.util.logging.Logger so that >> construction of log messages only occurs when it is actually to be >> logged by using Supplier instead of String. >> >> Since the idea is to avoid unnecessary construction of log messages, >> thus APIs imply formatting are not provided. Thus all forms of logrb and >> log with Parameters are not included. >> >> log with Throwable are named to be logEx or logpEx to avoid null >> ambiguous as it seems like it's quite common usage with >> >> logger.log(level, null, thrown) >> >> Specdiff and webrev can be found at following, >> >> http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/specdiff/diff.html >> http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/webrev/ >> >> Cheers, >> Henry > From naoto.sato at oracle.com Fri Dec 21 23:09:30 2012 From: naoto.sato at oracle.com (Naoto Sato) Date: Fri, 21 Dec 2012 15:09:30 -0800 Subject: RFR : 8003228 : (props) sun.jnu.encoding should be set to UTF-8 [macosx] In-Reply-To: <50D38F14.5050100@oracle.com> References: <50D35E6C.8060205@oracle.com> <50D38F14.5050100@oracle.com> Message-ID: <50D4EC2A.2020905@oracle.com> Hi Brent, The change looks good to me. Sorry for the delay, as I was taking a half day off. Naoto On 12/20/12 2:20 PM, Brent Christian wrote: > Forgot a regtest - now included w/ v.01: > > http://cr.openjdk.java.net/~bchristi/8003228/webrev.01/ > > Thanks, > -Brent > > On 12/20/12 10:52 AM, Brent Christian wrote: >> Hi, >> >> I've prepared a JDK 8 fix for 8003228 [1]. The webrev is here: >> http://cr.openjdk.java.net/~bchristi/8003228/webrev.00/ >> >> JPRT passes on all platforms (with the exception of two known bugs[2]). >> >> There was some recent discussion related to this - see [3]. >> >> Thanks, >> -Brent >> >> [1] http://bugs.sun.com/view_bug.do?bug_id=8003228 >> >> [2] 8005195 (Doclint tests on Windows), 8004544 >> (FDSeparateCompilationTest timeout) >> >> [3] >> http://mail.openjdk.java.net/pipermail/macosx-port-dev/2012-November/005124.html >> >> >> From david.holmes at oracle.com Fri Dec 21 23:27:43 2012 From: david.holmes at oracle.com (David Holmes) Date: Sat, 22 Dec 2012 09:27:43 +1000 Subject: Request for Review: Java SE 8 Compact Profiles In-Reply-To: References: <50D3FF29.6010005@oracle.com> Message-ID: <50D4F06F.3080302@oracle.com> On 22/12/2012 1:18 AM, Kelly O'Hair wrote: > > On Dec 20, 2012, at 10:18 PM, David Holmes wrote: > >> webrevs: >> >> top-level repo:http://cr.openjdk.java.net/~dholmes/8004265/webrev.top/ > > These comments in Main.gmk don't seem to make sense: > > 117 # Note: This double-colon rule is intentional, to support > 118 # custom make file integration. > 119 images:: source-tips demos images-only > > Do lines 117 and 118 just need to be deleted? No they are correct - sorry if they don't make sense. A "custom" makefile (such as the Oracle JDK closed makefile) may need to augment the images target (as we previously did in the old build). The :: rule allows for this custom images target to effectively concatenate it's recipe with the main one. >> >> The main change is to simply add profiles and profiles-only as top >> level make targets (similar to images). There is also a change to >> remove the hardcoded version information (though this may be handled >> by a separate CR). >> >> jdk repo:http://cr.openjdk.java.net/~dholmes/8004265/webrev.jdk/ > > Can't cover the makefiles 100%, Erik would be best to look at some of > this, but this is what I have so far: > > On JarReorder.java, it seems like you have just deleted a warning that > someone explicitly asked for > a class to be included, and also explicitly asked for that class to be > excluded. > If we are changing the tool so that exclusion just silently trumps any > inclusion request, seems like we > should just do that and delete this message. I'm fine with that, but the > if(false) seems a bit terse. Yes ideally this change will trigger a closer look at jarreorder and how it is used. AFAIK those listings have been decaying. But the warning message was far too noisy for the profiles builds. I did not want to go down a path of trying to define per-profile reorder lists given that we haven't maintained this for the full JRE anyway. > Why are some of the makefiles named with a ".txt" suffix? Like > makefiles/profile-includes.txt? Because they aren't makefiles ;-) They are txt files that define named lists that happen to be compatible with makefile variable declarations. These lists also get used by other tools eg javac and javadoc. > Overall, I have always been uncomfortable with these detailed > exclude/include lists when they get > down to listing specific class files, not that your changes are making > it any worse, but I do see this > as an opportunity to improve things in the long run by capturing the > specifics of our product shipments. > > So no objections from me at this time, but at some point we need Erik to > check this out. > Unfortunately, everybody on build-infra will be busy for a few weeks > trying to get the cutover done. :^( Not to mention the Xmas/NewYear break. :( Thanks, David > > -kto > > From mandy.chung at oracle.com Fri Dec 21 23:38:17 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Fri, 21 Dec 2012 15:38:17 -0800 Subject: Fwd: Re: Review request: 8003562: Provide a command-line tool to find static dependenciesh In-Reply-To: <50D453E1.80502@CoSoCo.de> References: <50D0F867.80100@oracle.com> <50D337B0.2090504@oracle.com> <50D37DDE.6040905@CoSoCo.de> <50D38720.3020408@oracle.com> <50D453E1.80502@CoSoCo.de> Message-ID: <50D4F2E9.5080505@oracle.com> Ulf, I actually prefer the current way, a separate implementation of the process method for each option rather than having a single big switch on enum constants. I wrote my implementation of the handleOptions method (the previous version is copied from JavapTask) [1]. That also addresses the bug you found when an empty parameter is passed to the last option. I'm happy with this version and hope you are. As for the -R vs -r option, '-r' was initially used as "--reverse" which is gone now and I could use it. I prefer not to make change in the interface for the initial push as I am waiting for CCC approval (I believe the process we have about compatibility). I expect the jdeps tool will evolve after getting feedback. I'll look at that together with other potential enhancements after the initial push. Happy Holidays and Happy New Year! Mandy [1] http://cr.openjdk.java.net/~mchung/jdk8/webrevs/jdeps/webrev.07/langtools/src/share/classes/com/sun/tools/jdeps/JdepsTask.java.html On 12/21/2012 4:19 AM, Ulf wrote: > A little more verbose (as member of class JDepsTask): > > enum Option { > VERBOSE (false, "-v", "--verbose"), > PACKAGE (true, "-p", "--package"), > ...; > private boolean hasParam; > private String[] aliases; > private Option (boolean hasParam, String aliases...) { > ...; > } > process (String form, String param) { > If (hasParam && > (param == null || param.length == 0 || param.charAt(0) > == '-')) > throw new BadArgs("err.missing.arg", form).showUsage(true); > switch (this) { > case VERBOSE : verbose = Verbose.VERBOSE; break; > case PACKAGE : packageNames.add(param); break; > ... > } > } > } > > > -Ulf > From kelly.ohair at oracle.com Sat Dec 22 00:11:37 2012 From: kelly.ohair at oracle.com (Kelly O'Hair) Date: Fri, 21 Dec 2012 16:11:37 -0800 Subject: Request for Review: Java SE 8 Compact Profiles In-Reply-To: <50D4F06F.3080302@oracle.com> References: <50D3FF29.6010005@oracle.com> <50D4F06F.3080302@oracle.com> Message-ID: On Dec 21, 2012, at 3:27 PM, David Holmes wrote: > On 22/12/2012 1:18 AM, Kelly O'Hair wrote: >> >> On Dec 20, 2012, at 10:18 PM, David Holmes wrote: >> >>> webrevs: >>> >>> top-level repo:http://cr.openjdk.java.net/~dholmes/8004265/webrev.top/ >> >> These comments in Main.gmk don't seem to make sense: >> >> 117 # Note: This double-colon rule is intentional, to support >> 118 # custom make file integration. >> 119 images:: source-tips demos images-only >> >> Do lines 117 and 118 just need to be deleted? > > No they are correct - sorry if they don't make sense. A "custom" makefile (such as the Oracle JDK closed makefile) may need to augment the images target (as we previously did in the old build). The :: rule allows for this custom images target to effectively concatenate it's recipe with the main one. Never mond me, my eyes played tricks on me, I did not see :: just : :^( > >>> >>> The main change is to simply add profiles and profiles-only as top >>> level make targets (similar to images). There is also a change to >>> remove the hardcoded version information (though this may be handled >>> by a separate CR). >>> >>> jdk repo:http://cr.openjdk.java.net/~dholmes/8004265/webrev.jdk/ >> >> Can't cover the makefiles 100%, Erik would be best to look at some of >> this, but this is what I have so far: >> >> On JarReorder.java, it seems like you have just deleted a warning that >> someone explicitly asked for >> a class to be included, and also explicitly asked for that class to be >> excluded. >> If we are changing the tool so that exclusion just silently trumps any >> inclusion request, seems like we >> should just do that and delete this message. I'm fine with that, but the >> if(false) seems a bit terse. > > Yes ideally this change will trigger a closer look at jarreorder and how it is used. AFAIK those listings have been decaying. But the warning message was far too noisy for the profiles builds. I did not want to go down a path of trying to define per-profile reorder lists given that we haven't maintained this for the full JRE anyway. Can we add a comment as to that being the reason for the if(false)? Maybe file a separate Issue to fix it someday, or maybe toss the whole ball of JarReorder wax someday. ;^) > >> Why are some of the makefiles named with a ".txt" suffix? Like >> makefiles/profile-includes.txt? > > Because they aren't makefiles ;-) They are txt files that define named lists that happen to be compatible with makefile variable declarations. But they aren't plain text files, right? > > These lists also get used by other tools eg javac and javadoc. Do we have any convention for the file suffix on these yet? Or is the long term plan to just use .txt? > >> Overall, I have always been uncomfortable with these detailed >> exclude/include lists when they get >> down to listing specific class files, not that your changes are making >> it any worse, but I do see this >> as an opportunity to improve things in the long run by capturing the >> specifics of our product shipments. >> >> So no objections from me at this time, but at some point we need Erik to >> check this out. >> Unfortunately, everybody on build-infra will be busy for a few weeks >> trying to get the cutover done. :^( > > Not to mention the Xmas/NewYear break. :( Yeah, might be a limited vacation for some of us. -kto > > Thanks, > David > > >> >> -kto >> >> From henry.jen at oracle.com Sat Dec 22 00:17:24 2012 From: henry.jen at oracle.com (Henry Jen) Date: Fri, 21 Dec 2012 16:17:24 -0800 Subject: RFR: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50D4D681.3040009@gmail.com> References: <50D40178.3060604@oracle.com> <50D4A1F0.4090206@gmail.com> <50D4D681.3040009@gmail.com> Message-ID: <739A7241-995B-43B2-BCAF-E0F7E8E92FD6@oracle.com> And deal with serialization is also another concern. As I don't think *ALL* handlers use a different log level to Logger would be that a common case, current implementation should be effective. This patch is a really simple idea, and as Peter and Remi both have pointed out, there is an associated cost of lambda form. What to expect here is a reasonable saving by replace message construction cost with lambda construction cost. The block form is really an attempt to not repeating the code everywhere, but the efficient concern is real, so we should probably just copy&paste instead of use block. The renaming idea is a good one. The original thought is to keep the API arguments in place. Now that Peter proposed, it's definitely looks better and apparently is acceptable to developers. Cheers, Henry On Dec 21, 2012, at 1:37 PM, Peter Levart wrote: > On 12/21/2012 06:52 PM, Peter Levart wrote: >> Hi Henry, again, >> >> To delay constructing message to as late as possible, you could construct a LogRecord with a reference to Supplier and only evaluate the Supplier on the first call to LogRecord.getMessage() and then cache-it. Like the following: >> >> http://dl.dropbox.com/u/101777488/jdk8-tl/LogRecord/webrev/index.html >> > On a second thought, the above might not be a good idea. The message should be materialized before passing the LogRecord to a handler, since some handlers might evaluate message in a special "logging" thread and therefore invoking a user provided Supplier in another thread might have undesirable effects (threading issues)... > > Regards, Peter > >> Also, the "staging" Block call-back in doLog() is a very nice lambda usage, but it comes with a cost of constructing another lambda object for each call to those methods... >> >> Regards, Peter >> >> On 12/21/2012 07:28 AM, Henry Jen wrote: >>> Hi, >>> >>> This patch adds a couple APIs to java.util.logging.Logger so that >>> construction of log messages only occurs when it is actually to be >>> logged by using Supplier instead of String. >>> >>> Since the idea is to avoid unnecessary construction of log messages, >>> thus APIs imply formatting are not provided. Thus all forms of logrb and >>> log with Parameters are not included. >>> >>> log with Throwable are named to be logEx or logpEx to avoid null >>> ambiguous as it seems like it's quite common usage with >>> >>> logger.log(level, null, thrown) >>> >>> Specdiff and webrev can be found at following, >>> >>> >>> http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/specdiff/diff.html >>> http://cr.openjdk.java.net/~henryjen/ccc/8005263.0/webrev/ >>> >>> >>> Cheers, >>> Henry >>> >> > From david.dehaven at oracle.com Sat Dec 22 00:57:37 2012 From: david.dehaven at oracle.com (David DeHaven) Date: Fri, 21 Dec 2012 16:57:37 -0800 Subject: RFR 8004547: Extend JavaFX launcher support... In-Reply-To: <50D49FFE.9020108@oracle.com> References: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> <50D406BB.7050100@oracle.com> <3417CACD-506E-4C4E-A8AA-13160C868D3F@oracle.com> <50D48AB3.9060408@oracle.com> <50D49FFE.9020108@oracle.com> Message-ID: > I need more coffee this morning :-) I have that problem often :) >> In the absence of JavaFX-Application-Class, canLaunchFXAppJar simply returns false. It does not load the FX launcher on failure or it would be doing so for non-FX jars which would cause testExtraneousJars to fail. getMainClassFromJar then returns the class name defined by Main-Class. At that point it's processed no differently than any non-FX application jar, the main class is loaded and calls canLaunchFXAppClass where the doesExtendFXApplication check passes and *then* it loads the FX launcher and uses LM_CLASS to launch the application, not LM_JAR. >> Essentially, launching an FX app via "java -jar fxapp.jar" is the same as "java -cp fxapp.jar SomeFXAppClass" if there is no JavaFX-Application-Class attribute. > > This explains what caused the confusion - I didn't expect that "java -jar fxapp.jar" will be passed to fxlauncher with the same launch mode as "java -cp fxapp.jar SomeFXAppClass" (i.e. LM_CLASS). I think the semantics there was not obvious why it is not LM_JAR mode but JAVAFX_LAUNCH_MODE_xxx has a different semantics than LM_JAR and LM_CLASS that are defined in java.c and also LauncherHelper. Is there any reason why "java -cp fxapp.jar" can't be passed to fxlauncher with LM_JAR mode? That'll be consistent how launch mode is used in java.c and the non-FX app. I'll leave it for you and Kumar/Kevin to decide if this is important to address. I *think* what you're asking is why can't we always use "LM_JAR" if java was launched with "java -jar fxapp.jar", correct? Even if there are no JavaFX-* attributes in the manifest. I don't entirely disagree with the idea? it would require some adjustments to this patch and I'd have to file an issue against FX to have it fall back on Main-Class when it encounters a jar with no JavaFX-* attributes and at least two of the tests would have to be suppressed until the FX launcher is fixed and in sync. Kevin, do you have any thoughts on the matter? -DrD- From david.holmes at oracle.com Sat Dec 22 01:01:01 2012 From: david.holmes at oracle.com (David Holmes) Date: Sat, 22 Dec 2012 11:01:01 +1000 Subject: Request for Review: Java SE 8 Compact Profiles In-Reply-To: References: <50D3FF29.6010005@oracle.com> <50D4F06F.3080302@oracle.com> Message-ID: <50D5064D.2050600@oracle.com> On 22/12/2012 10:11 AM, Kelly O'Hair wrote: > On Dec 21, 2012, at 3:27 PM, David Holmes wrote: >>> On JarReorder.java, it seems like you have just deleted a warning that >>> someone explicitly asked for >>> a class to be included, and also explicitly asked for that class to be >>> excluded. >>> If we are changing the tool so that exclusion just silently trumps any >>> inclusion request, seems like we >>> should just do that and delete this message. I'm fine with that, but the >>> if(false) seems a bit terse. >> >> Yes ideally this change will trigger a closer look at jarreorder and how it is used. AFAIK those listings have been decaying. But the warning message was far too noisy for the profiles builds. I did not want to go down a path of trying to define per-profile reorder lists given that we haven't maintained this for the full JRE anyway. > > Can we add a comment as to that being the reason for the if(false)? Maybe file a separate Issue to fix it someday, > or maybe toss the whole ball of JarReorder wax someday. ;^) Okay I'll add a comment and comment out the line and see if there is an existing CR to revisit jarreorder. >> >>> Why are some of the makefiles named with a ".txt" suffix? Like >>> makefiles/profile-includes.txt? >> >> Because they aren't makefiles ;-) They are txt files that define named lists that happen to be compatible with makefile variable declarations. > > But they aren't plain text files, right? What is a plain text file ??? They look like make variable declarations, they also look like property definitions. I liken these files to the version.numbers file that happen to contain stuff that looks like makefile variable declarations - should they be .gmk files too? >> >> These lists also get used by other tools eg javac and javadoc. > > Do we have any convention for the file suffix on these yet? Or is the long term plan to just use .txt? Right now it is the .txt. If we want/need to change this then now is the time as I'll have to sync this with the langtools changes. Not a huge deal to change later I suppose. But I'm not sure there is any obviously better choice. >>> Unfortunately, everybody on build-infra will be busy for a few weeks >>> trying to get the cutover done. :^( >> >> Not to mention the Xmas/NewYear break. :( > > Yeah, might be a limited vacation for some of us. Limited vacation, limited weekends, ... ;-) David > -kto > >> >> Thanks, >> David >> >> >>> >>> -kto >>> >>> > From huizhe.wang at oracle.com Sat Dec 22 01:30:21 2012 From: huizhe.wang at oracle.com (huizhe.wang at oracle.com) Date: Sat, 22 Dec 2012 01:30:21 +0000 Subject: hg: jdk8/tl/jdk: 8005280: (props) Improve test coverage for small XML parser Message-ID: <20121222013044.87D3D47361@hg.openjdk.java.net> Changeset: c1227b872a12 Author: joehw Date: 2012-12-21 17:29 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/c1227b872a12 8005280: (props) Improve test coverage for small XML parser Summary: added a few more invalid XML files, international characters to LoadAndStore test, and a behavior compatibility test. Reviewed-by: alanb, lancea + test/java/util/Properties/Compatibility.xml + test/java/util/Properties/CompatibilityTest.java ! test/java/util/Properties/LoadAndStoreXML.java + test/java/util/Properties/invalidxml/BadDocType.xml - test/java/util/Properties/invalidxml/BadDocType.xml.excluded + test/java/util/Properties/invalidxml/DTDRootNotMatch.xml + test/java/util/Properties/invalidxml/IllegalComment.xml + test/java/util/Properties/invalidxml/IllegalEntry.xml + test/java/util/Properties/invalidxml/IllegalEntry1.xml + test/java/util/Properties/invalidxml/IllegalKeyAttribute.xml + test/java/util/Properties/invalidxml/NoDocType.xml - test/java/util/Properties/invalidxml/NoDocType.xml.excluded + test/java/util/Properties/invalidxml/NoNamespaceSupport.xml From kevin.rushforth at oracle.com Sat Dec 22 01:52:53 2012 From: kevin.rushforth at oracle.com (Kevin Rushforth) Date: Fri, 21 Dec 2012 17:52:53 -0800 Subject: RFR 8004547: Extend JavaFX launcher support... In-Reply-To: References: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> <50D406BB.7050100@oracle.com> <3417CACD-506E-4C4E-A8AA-13160C868D3F@oracle.com> <50D48AB3.9060408@oracle.com> <50D49FFE.9020108@oracle.com> Message-ID: <50D51275.9000600@oracle.com> Inline... David DeHaven wrote: >> I need more coffee this morning :-) >> > > I have that problem often :) > > > >>> In the absence of JavaFX-Application-Class, canLaunchFXAppJar simply returns false. It does not load the FX launcher on failure or it would be doing so for non-FX jars which would cause testExtraneousJars to fail. getMainClassFromJar then returns the class name defined by Main-Class. At that point it's processed no differently than any non-FX application jar, the main class is loaded and calls canLaunchFXAppClass where the doesExtendFXApplication check passes and *then* it loads the FX launcher and uses LM_CLASS to launch the application, not LM_JAR. >>> Essentially, launching an FX app via "java -jar fxapp.jar" is the same as "java -cp fxapp.jar SomeFXAppClass" if there is no JavaFX-Application-Class attribute. >>> >> This explains what caused the confusion - I didn't expect that "java -jar fxapp.jar" will be passed to fxlauncher with the same launch mode as "java -cp fxapp.jar SomeFXAppClass" (i.e. LM_CLASS). I think the semantics there was not obvious why it is not LM_JAR mode but JAVAFX_LAUNCH_MODE_xxx has a different semantics than LM_JAR and LM_CLASS that are defined in java.c and also LauncherHelper. Is there any reason why "java -cp fxapp.jar" can't be passed to fxlauncher with LM_JAR mode? That'll be consistent how launch mode is used in java.c and the non-FX app. I'll leave it for you and Kumar/Kevin to decide if this is important to address. >> > > > I *think* what you're asking is why can't we always use "LM_JAR" if java was launched with "java -jar fxapp.jar", correct? Even if there are no JavaFX-* attributes in the manifest. > > I don't entirely disagree with the idea? it would require some adjustments to this patch and I'd have to file an issue against FX to have it fall back on Main-Class when it encounters a jar with no JavaFX-* attributes and at least two of the tests would have to be suppressed until the FX launcher is fixed and in sync. > > Kevin, do you have any thoughts on the matter? > If that what Mandy is asking then it might make sense (I see no way we could use LM_JAR for java -cp fxapp.jar FxClass). I'm not sure what the implications are, though. It seems like it might complicate the logic in the FX launcher since we would have to add logic to handle both the presence and absence of JavaFX-Application-Class, but it might not be too bad. One case to consider is that in the absence of JavaFX-Application-Class, an FX application specified via Main-Class would behave differently if there was a main() method (in that case the main method is called and we wouldn't even get to the FX launcher, right?) versus if the main() method were not present. Or am I missing something? I'll be on vacation for the rest of the year, so won't be able to discuss this idea in detail until after then. -- Kevin From kevin.rushforth at oracle.com Sat Dec 22 01:53:05 2012 From: kevin.rushforth at oracle.com (Kevin Rushforth) Date: Fri, 21 Dec 2012 17:53:05 -0800 Subject: RFR 8004547: Extend JavaFX launcher support... In-Reply-To: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> References: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> Message-ID: <50D51281.3000609@oracle.com> > > The changes for RT-26751 are in this weeks promotion of JavaFX, so should be available in next weeks JRE build (I think.. I'm never sure about promotion timing..). > No, we have a synchronized promotion now. So this week's FX promotion and this week's JDK promotion are the same thing. -- Kevin David DeHaven wrote: > Request for review for extending the launcher support to allow the JavaFX runtime to fully support all of it's launch features, including preloaders, classpath, etc.. > > Webrev: > http://cr.openjdk.java.net/~ddehaven/8004547/webrev.1/ > > Corresponding JavaFX JIRA issue that these changes depend on: > http://javafx-jira.kenai.com/browse/RT-26751 > > > This should be the final step in adding launcher support for JavaFX applications. These changes should allow any future changes to be done entirely in the JavaFX runtime. The changes for RT-26751 are in this weeks promotion of JavaFX, so should be available in next weeks JRE build (I think.. I'm never sure about promotion timing..). > > -DrD- > > From kelly.ohair at oracle.com Sat Dec 22 01:53:38 2012 From: kelly.ohair at oracle.com (Kelly O'Hair) Date: Fri, 21 Dec 2012 17:53:38 -0800 Subject: Request for Review: Java SE 8 Compact Profiles In-Reply-To: <50D5064D.2050600@oracle.com> References: <50D3FF29.6010005@oracle.com> <50D4F06F.3080302@oracle.com> <50D5064D.2050600@oracle.com> Message-ID: <6B317A77-A641-4810-A8A4-C5A0A251E33B@oracle.com> On Dec 21, 2012, at 5:01 PM, David Holmes wrote: > On 22/12/2012 10:11 AM, Kelly O'Hair wrote: >> On Dec 21, 2012, at 3:27 PM, David Holmes wrote: >>>> On JarReorder.java, it seems like you have just deleted a warning that >>>> someone explicitly asked for >>>> a class to be included, and also explicitly asked for that class to be >>>> excluded. >>>> If we are changing the tool so that exclusion just silently trumps any >>>> inclusion request, seems like we >>>> should just do that and delete this message. I'm fine with that, but the >>>> if(false) seems a bit terse. >>> >>> Yes ideally this change will trigger a closer look at jarreorder and how it is used. AFAIK those listings have been decaying. But the warning message was far too noisy for the profiles builds. I did not want to go down a path of trying to define per-profile reorder lists given that we haven't maintained this for the full JRE anyway. >> >> Can we add a comment as to that being the reason for the if(false)? Maybe file a separate Issue to fix it someday, >> or maybe toss the whole ball of JarReorder wax someday. ;^) > > Okay I'll add a comment and comment out the line and see if there is an existing CR to revisit jarreorder. OK. > >>> >>>> Why are some of the makefiles named with a ".txt" suffix? Like >>>> makefiles/profile-includes.txt? >>> >>> Because they aren't makefiles ;-) They are txt files that define named lists that happen to be compatible with makefile variable declarations. >> >> But they aren't plain text files, right? > > What is a plain text file ??? They look like make variable declarations, they also look like property definitions. I liken these files to the version.numbers file that happen to contain stuff that looks like makefile variable declarations - should they be .gmk files too? I guess what I'm saying is that they have a particular syntax, it's not arbitrary text. Leave them as is, we can deal with it later. > >>> >>> These lists also get used by other tools eg javac and javadoc. >> >> Do we have any convention for the file suffix on these yet? Or is the long term plan to just use .txt? > > Right now it is the .txt. If we want/need to change this then now is the time as I'll have to sync this with the langtools changes. Not a huge deal to change later I suppose. But I'm not sure there is any obviously better choice. I'd have to think about it more. I'm fine with leaving them as .txt files for now. > >>>> Unfortunately, everybody on build-infra will be busy for a few weeks >>>> trying to get the cutover done. :^( >>> >>> Not to mention the Xmas/NewYear break. :( >> >> Yeah, might be a limited vacation for some of us. > > Limited vacation, limited weekends, ... ;-) Yup. :^( -kto > > David > >> -kto >> >>> >>> Thanks, >>> David >>> >>> >>>> >>>> -kto >>>> >>>> >> From henry.jen at oracle.com Sat Dec 22 04:50:18 2012 From: henry.jen at oracle.com (Henry Jen) Date: Fri, 21 Dec 2012 20:50:18 -0800 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message Message-ID: <50D53C0A.6000203@oracle.com> Hi, Update patch with review feedback, - JavaDoc update for benefit and gotcha. - logEx/logpEx is not log/logp with Supplier as last argument. As a matter of fact, all API with Supplier takes it as last argument. - No more doLog(Level, Supplier, Block) helper for performance concerns. Specdiff and webrev can be found at following, http://cr.openjdk.java.net/~henryjen/ccc/8005263.1/specdiff/diff.html http://cr.openjdk.java.net/~henryjen/ccc/8005263.1/webrev/ Cheers, Henry From joe.darcy at oracle.com Sat Dec 22 05:54:40 2012 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 21 Dec 2012 21:54:40 -0800 Subject: Review request:Updated JDK-8004728 Implement core reflection API for parameter reflection In-Reply-To: <50D2431F.6030006@oracle.com> References: <50D2431F.6030006@oracle.com> Message-ID: <50D54B20.1000400@oracle.com> Hello Eric, A few initial comments. I'm not convinced a getNumParameters method pulls its weight. At the very least, the specification should be updated to say whether or not it includes synthetic + "natural" parameters or just natural ones. (Different methods in core reflection indirectly return a synthetic + "natural" count vs a natural count today.) I recommend referencing syntheticness in the way core reflection was recently update to do: 8005097: Tie isSynthetic javadoc to the JLS http://hg.openjdk.java.net/jdk8/tl/jdk/rev/1f9c19741285 I think the notion of parameter equality should be expanded to include the declaring executable. In the fullness of time, the getAnnotations methods will need to account for synthetic parameters and skip over them. One example of this wrinkle today is if the parameters of a constructor for an inner class are annotated. For the tests, I recommend a few changes. First, code like this for(int i = 0; i < parameters.length; i++) { Parameter p = parameters[i]; .... } is more natural as a for-each loop: for(Paramter p : m.getParameters()) { .... } The per method or per parameter expected results can be encoded using annotations. One recent example of this technique can be found in the fix for: 8005042: Add Method.isDefault to core reflection http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0a1398021c7c HTH, -Joe On 12/19/2012 2:43 PM, Eric McCorkle wrote: > Hello, > > Please review the implementation of the core reflection API for method > parameter reflection. This changeset introduces a new class, Parameter, > which represents information about method parameters. It introduces a > new method into Executable which returns an array of the parameters for > the method or constructor represented by the Executable. > > This is part of a larger set of changes which implement portions of the > method parameter reflection functionality in hotspot and javac. > > > The open webrev is here: > http://cr.openjdk.java.net/~jgish/~emccorkl/webrev/JDK-8004729/ > > > The feature request is here: > http://bugs.sun.com/view_bug.do?bug_id=8004729 > > > The latest version of the spec can be found here: > http://cr.openjdk.java.net/~abuckley/8misc.pdf > > Thanks, > Eric From forax at univ-mlv.fr Sat Dec 22 10:11:26 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Sat, 22 Dec 2012 11:11:26 +0100 Subject: Review request:Updated JDK-8004728 Implement core reflection API for parameter reflection In-Reply-To: <50D54B20.1000400@oracle.com> References: <50D2431F.6030006@oracle.com> <50D54B20.1000400@oracle.com> Message-ID: <50D5874E.9010506@univ-mlv.fr> On 12/22/2012 06:54 AM, Joe Darcy wrote: > Hello Eric, > > A few initial comments. > > I'm not convinced a getNumParameters method pulls its weight. At the > very least, the specification should be updated to say whether or not > it includes synthetic + "natural" parameters or just natural ones. > (Different methods in core reflection indirectly return a synthetic + > "natural" count vs a natural count today.) Hi Joe, getNumParameters (I prefer the name getParameterCount() BTW) is very important for other languages than Java, by example most of the dynamic language runtimes use multi-dispatch at the border between their languages and Java, so their runtimes group methods with the same arity together and being able to do that without calling getParameterTypes() is a good idea IMO. cheers, R?mi From peter.levart at gmail.com Sat Dec 22 11:13:55 2012 From: peter.levart at gmail.com (Peter Levart) Date: Sat, 22 Dec 2012 12:13:55 +0100 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50D53C0A.6000203@oracle.com> References: <50D53C0A.6000203@oracle.com> Message-ID: <50D595F3.4070101@gmail.com> Hi Henry, Plain and simple. I just noticed a few spellings: line 670, 696, 863: "Thus is it" -> "Thus it is" - this one has already been written wrong in the original source, so it just multiplied by copy-paste line 688, 743, 854: "Log a in-time" -> "Log an in-time" Regards, Peter On 12/22/2012 05:50 AM, Henry Jen wrote: > Hi, > > Update patch with review feedback, > - JavaDoc update for benefit and gotcha. > - logEx/logpEx is not log/logp with Supplier as last argument. > As a matter of fact, all API with Supplier takes it as last > argument. > - No more doLog(Level, Supplier, Block) helper for > performance concerns. > > Specdiff and webrev can be found at following, > > http://cr.openjdk.java.net/~henryjen/ccc/8005263.1/specdiff/diff.html > http://cr.openjdk.java.net/~henryjen/ccc/8005263.1/webrev/ > > Cheers, > Henry > From forax at univ-mlv.fr Sat Dec 22 12:45:25 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Sat, 22 Dec 2012 13:45:25 +0100 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50D595F3.4070101@gmail.com> References: <50D53C0A.6000203@oracle.com> <50D595F3.4070101@gmail.com> Message-ID: <50D5AB65.70506@univ-mlv.fr> On 12/22/2012 12:13 PM, Peter Levart wrote: > Hi Henry, > > Plain and simple. yes, > > I just noticed a few spellings: > > line 670, 696, 863: "Thus is it" -> "Thus it is" - this one has > already been written wrong in the original source, so it just > multiplied by copy-paste > line 688, 743, 854: "Log a in-time" -> "Log an in-time" and also there is no @since 1.8 for method log(Level, Supplier) > > Regards, Peter cheers, R?mi > > On 12/22/2012 05:50 AM, Henry Jen wrote: >> Hi, >> >> Update patch with review feedback, >> - JavaDoc update for benefit and gotcha. >> - logEx/logpEx is not log/logp with Supplier as last argument. >> As a matter of fact, all API with Supplier takes it as last >> argument. >> - No more doLog(Level, Supplier, Block) helper for >> performance concerns. >> >> Specdiff and webrev can be found at following, >> >> http://cr.openjdk.java.net/~henryjen/ccc/8005263.1/specdiff/diff.html >> http://cr.openjdk.java.net/~henryjen/ccc/8005263.1/webrev/ >> >> Cheers, >> Henry >> > From jason_mehrens at hotmail.com Sat Dec 22 15:30:58 2012 From: jason_mehrens at hotmail.com (Jason Mehrens) Date: Sat, 22 Dec 2012 09:30:58 -0600 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50D53C0A.6000203@oracle.com> References: <50D53C0A.6000203@oracle.com> Message-ID: The msg argument in most cases is a string literal because it is either a resource bundle key or a MessageFormat literal. The established best practice is to convert on the fly construction of messages to use the MessageFormat syle logging. This current patch is kind of anti-pattern of that practice. I would think the real win would be to delay construction of the 'params' argument in the logging framework. Allowing the callers to write logger.log(level, "{0}", Foo::bar) and have the call to bar be lazy eval would be the best of both the logging world and the lambda world. Jason > Date: Fri, 21 Dec 2012 20:50:18 -0800 > From: henry.jen at oracle.com > To: core-libs-dev at openjdk.java.net; lambda-dev at openjdk.java.net > Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message > > Hi, > > Update patch with review feedback, > - JavaDoc update for benefit and gotcha. > - logEx/logpEx is not log/logp with Supplier as last argument. > As a matter of fact, all API with Supplier takes it as last > argument. > - No more doLog(Level, Supplier, Block) helper for > performance concerns. > > Specdiff and webrev can be found at following, > > http://cr.openjdk.java.net/~henryjen/ccc/8005263.1/specdiff/diff.html > http://cr.openjdk.java.net/~henryjen/ccc/8005263.1/webrev/ > > Cheers, > Henry > From peter.levart at gmail.com Sat Dec 22 15:38:56 2012 From: peter.levart at gmail.com (Peter Levart) Date: Sat, 22 Dec 2012 16:38:56 +0100 Subject: EnumData space optimization in j.l.Class (JEP-146) In-Reply-To: <50D0BAE8.8070609@univ-mlv.fr> References: <50CF3C0A.8030203@gmail.com> <50CF8E10.3050705@oracle.com> <50CF995B.20807@gmail.com> <50CF9F19.2020609@univ-mlv.fr> <50D034F7.7080609@gmail.com> <50D0BAE8.8070609@univ-mlv.fr> Message-ID: <50D5D410.5010706@gmail.com> At end... On 12/18/2012 07:50 PM, Remi Forax wrote: > On 12/18/2012 10:18 AM, Peter Levart wrote: >> On 12/17/2012 11:39 PM, Remi Forax wrote: >>> On 12/17/2012 11:14 PM, Peter Levart wrote: >>>> On 12/17/2012 10:26 PM, Mandy Chung wrote: >>>>> On 12/17/12 7:36 AM, Peter Levart wrote: >>>>>> Hi David and others, >>>>>> >>>>>> Here's a patch that eliminates one of two fields in >>>>>> java.lang.Class, related to caching enum constants: >>>>>> >>>>>> http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.enum/webrev.01/index.html >>>>>> >>>>>> >>>>>> It does it by moving one field to a subclass of HashMap, which is >>>>>> referenced by a remaining field that serves two different >>>>>> purposes/stages of caching. >>>>>> >>>>> >>>>> Your observation of merging the enumConstants and >>>>> enumConstantDirectory is a good one. I see that caching of >>>>> enumConstantDirectory is important as it's used by EnumMap and >>>>> EnumSet whose performance is critical (specified with constant >>>>> time operations). I'm unsure about Class.getEnumConstants whether >>>>> it's performance critical and worths the complexity of your >>>>> proposed fix (the enumData field of two types). If a class has >>>>> cached an enumConstantDirectory, Class.getEnumConstants can return >>>>> a clone of its values(). >>>>> >>>>> Anyone knows how Class.getEnumConstants is commonly used and needs >>>>> to be performant? I suspect it's more typical to obtain the list >>>>> of enum constants statistically (calling Enum.values()) than >>>>> reflectively. >>>> Hi Mandy, >>>> >>>> public Class.getEnumConstants() is a reflection mirror of >>>> SomeEnum.values(). It returns a defensive copy of the constants >>>> array. The primary place for Enum constants is in a private static >>>> final $VALUES field, generated by compiler in each Enum subclass. >>>> But that I think is not part of specification, so for internal >>>> usage (as far as I have managed to find out only in the >>>> constructors of EnumSet and EnumMap), the package-private >>>> Class.getEnumConstantsShared() is used which obtains a copy of the >>>> array by calling SomeEnum.values() and than caches is. >>>> >>>> The Class.enumConstantDirectory() on the other hand is an internal >>>> package-private method that returns a shared/cached Map, >>>> which is used internally to implement SomeEnum.valueOf(String) and >>>> Enum.valueOf(Class, String) static methods. >>>> >>>> Both package-private methods must be fast. >>>> >>>> Regards, Peter >>> >>> for what it worth, I'm the guy behind the patch of bug 6276988 (it >>> was before OpenJDK was setup BTW), >>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6276988 >>> and for the little story, I need that patch because I was developing >>> an Eclipse plugin that uses EnumSet to represent the possible >>> completion values. >>> So to answer to Mandy, this application needs really fast EnumSet >>> creation thus really fast getEnumConstantShared() because the >>> EnumSets was created as user types code. >> Hi R?mi, >> >> is 600M EnumSets / sec good enough for a fast typist? > > The eclipse plugin uses is a LR parser (a GLR exactly) which has the > stupid property that it can change the whole parse tree if you just > add one character. > > Also i'm maybe wrong but, if you test with several different 'enum > classes', you should see a slowdown. > > R?mi > You're right. I modified the test to use 5 different enum classes interchangeably in a loop: https://raw.github.com/plevart/jdk8-tl/JEP-149.enum/test/src/test/EnumTest.java The slowdown of EnumSet.noneOf() compared to original code was more apparent - about 50% when there's an array assigned to enumData field and more than 60% when there's already an EnumData object holding the array reference. MyEnum.valueOf(String) seems to be unaffected - more cycles spent elsewhere in the code-path to be significant. When I changed the "if (enumData instanceof Enum[])" with "if (enumData != null)", the slowdown of EnumSet.noneOf() was less apparent - about 24% when there's an array assigned to enumData and about 44% when there's EnumData object. MyEnum.valueOf(String) shows the same performance. So in order to affect the performance as little as possible, I devised a more direct approach without instanceof checks and casts. Here it is: http://dl.dropbox.com/u/101777488/jdk8-tl/JEP-149.enum/webrev.02/index.html With this change, EnumSet.noneOf() is only about 12% slower than original code and MyEnum.valueOf(String) performs the same. This code has a space overhead of an extra object with two fields, but it is expected that the number of enum classes compared to non-enum classes is small and the reduction of a field in the java.lang.Class pays off. Even though this is a single field and it might not shrink (not every but approx. half of all?) java.lang.Class object (s) on 32bit architectures due to alignment constraints, it presents an opportunity for shrinkage when other individual fields in java.lang.Class are similarly removed. One such opportunity presents the 2+1 remaining fields used for caching annotations. I understand that contributions to JEP-149 are closed already, but I post this here for any future reference. Regards, Peter From mandy.chung at oracle.com Sat Dec 22 16:07:37 2012 From: mandy.chung at oracle.com (Mandy Chung) Date: Sat, 22 Dec 2012 08:07:37 -0800 Subject: RFR 8004547: Extend JavaFX launcher support... In-Reply-To: <50D51275.9000600@oracle.com> References: <303CEFBB-9D1F-4D39-812F-EFA079B9BB8C@oracle.com> <50D406BB.7050100@oracle.com> <3417CACD-506E-4C4E-A8AA-13160C868D3F@oracle.com> <50D48AB3.9060408@oracle.com> <50D49FFE.9020108@oracle.com> <50D51275.9000600@oracle.com> Message-ID: <50D5DAC9.5030004@oracle.com> On 12/21/2012 5:52 PM, Kevin Rushforth wrote: > > David DeHaven wrote: >> >>> This explains what caused the confusion - I didn't expect that "java -jar fxapp.jar" will be passed to fxlauncher with the same launch mode as "java -cp fxapp.jar SomeFXAppClass" (i.e. LM_CLASS). I think the semantics there was not obvious why it is not LM_JAR mode but JAVAFX_LAUNCH_MODE_xxx has a different semantics than LM_JAR and LM_CLASS that are defined in java.c and also LauncherHelper. Is there any reason why "java -cp fxapp.jar" can't be passed to fxlauncher with LM_JAR mode? That'll be consistent how launch mode is used in java.c and the non-FX app. I'll leave it for you and Kumar/Kevin to decide if this is important to address. >>> >> >> >> I *think* what you're asking is why can't we always use "LM_JAR" if java was launched with "java -jar fxapp.jar", correct? Even if there are no JavaFX-* attributes in the manifest. To be specific - when the fx app is launched by "java -jar fxapp.jar", it's a JAR file and shouldn't it be passed to fxlauncher as in JAR file mode? I had assumed that the fxlauncher may need to read the manifest if it's launched as a JAR file regardless of the presence of JavaFX-Application-Class attribute (but maybe not with the understanding I have in this discussion). Reading your reply and Kevin's reply, the launchMode parameter of the launchApplication method (i.e. fxlauncher) specifies whether fxapp.jar has a JavaFX-Application-Class attribute or a FX app entry point (that could be a JAR file or specified in the classpath) and also indicate the name parameter is a class name or a JAR file name - that is not what LM_JAR and LM_CLASS mean in java.c and LauncherHelper. Strictly speaking the parameter is not launch mode to me. I don't object to what you have. Aside from this issue, your change looks really good. Additional comments for the launchApplication method would really help. Thanks for the explanation. Happy Holidays and Happy New Year. Mandy From jeffhain at rocketmail.com Sat Dec 22 16:40:57 2012 From: jeffhain at rocketmail.com (Jeff Hain) Date: Sat, 22 Dec 2012 16:40:57 +0000 (GMT) Subject: Review request:Updated JDK-8004728 Implement core reflection API for parameter reflection In-Reply-To: <50D5874E.9010506@univ-mlv.fr> References: <50D2431F.6030006@oracle.com> <50D54B20.1000400@oracle.com> <50D5874E.9010506@univ-mlv.fr> Message-ID: <1356194457.26268.YahooMailNeo@web132103.mail.ird.yahoo.com> R?mi wrote: >getNumParameters (I prefer the name getParameterCount() BTW) I prefer getParameterCount() too. When something has "nb", "num", "nbr" or "number" in its name, people might get wrong about whether it refers to a count (n sheeps) or to an identifier (sheep number n). If "count" or "id"-likes can't be used instead, and one has to stick with "number"-likes, one rule could be to use "nbr" for counts and "num" for ids: both have the same size (handy for code alignment), and they respectively match with french "nombre" and "num?ro", which have the appropriate meanings. -Jeff From rob.mckenna at oracle.com Sun Dec 23 01:19:59 2012 From: rob.mckenna at oracle.com (Rob McKenna) Date: Sun, 23 Dec 2012 01:19:59 +0000 Subject: Request for Review: 5049299: (process) Use posix_spawn, not fork, on S10 to avoid swap exhaustion In-Reply-To: References: <50AE98B1.2040200@oracle.com> <50B81A8D.2040403@oracle.com> <50B82C94.90109@oracle.com> <50D277BE.8060705@oracle.com> Message-ID: <50D65C3F.2040004@oracle.com> Hi Martin, thanks a lot for this. I've renamed LINKFLAG to the more appropriate (and common) ARCHFLAG. It seems to pop up all around our source but if build-dev know of a better (or canonical) way of doing it I'll take it! The BUILD_JEXEC differences don't show up in my webrev or hg diff, but I see them in the jdk.patch generated by webrev. I have no idea why this is. (I did use the JEXEC stuff as a template for the JSPAWNHELPER code, but I don't recall altering the JEXEC stuff in any way. It looks like its limited to indentation. Strange.) W.r.t. useFork, I'll discuss this with Alan once he has a spare minute. I believe he may have had some concerns, but I'll let you know how that goes either way. The only __APPLE__ should be to get the call to _NSGetEnviron(). Everything else should be bsd. I've put a webrev at: http://cr.openjdk.java.net/~robm/5049299/webrev.03/ I hope this addresses the rest of your comments. -Rob P.S. Gah, just noticed you requested the move of that enum to a single flavour independent file. I'll do that for the next round. (src/solaris/classes/java/lang/ProcessImpl.java?) On 20/12/12 04:04, Martin Buchholz wrote: > Thanks for this. I agree with the strategy. > > I'm hoping build folks and macosx folks also take a look at this hairy > change. > > +LINKFLAG = > +ifeq ($(ARCH_DATA_MODEL), 64) > +LINKFLAG = -m64 > +endif > > It looks wrong to be specifying toolchain-specific flags here. Also, > -m64 is logically a compiler flag, i.e. belongs in a variable with a > name like CFLAGS. > > --- > ifeq ($(OPENJDK_TARGET_OS), solaris) > -ifeq ($(OPENJDK_TARGET_CPU_BITS), 32) > -BUILD_JEXEC := 1 > -endif > + ifeq ($(OPENJDK_TARGET_CPU_BITS), 32) > + BUILD_JEXEC := 1 > + endif > endif > > Why mess with jexec? > > --- > > + String s = System.getProperty("java.lang.useFork"); > > "java.lang.Process.useFork" is a better name. > Also, useFork suggests it's a binary choice. Wouldn't it be better to > have the system property > "java.lang.Process.spawn.mechanism" with values fork, vfork, > posix_spawn, clone > > --- > > + enum LaunchMechanism { > + CLONE(1), FORK(2), > + VFORK(3), SPAWN(4); > > I would rename SPAWN to POSIX_SPAWN. > The enum can be moved to a unix-flavor-independent file. > > --- > > + helperpath = javahome + "/lib/" + osarch + > "/jspawnhelper"; > > There ought to be a standard way to get the "libarchdir" > > > --- > > Of course, WhyCantJohnnyExec should have been WhyJohnnyCantExec > This is your chance to correct my mistake! > > > --- > > Sometimes I see __APPLE__ sometimes I see _ALLBSD_SOURCE. Hopefully > such things will be removed later when the new build system is obligatory. > > --- > > > + /* Initialize xx_parentPathv[] */ > > It's not called xx_anything any more. > > > --- > > + shutItDown(); > > How about renaming to usageError() ? > > --- > > + r = sscanf (argv[argc-1], "%d:%d", &fdin, &fdout); > > How about checking for argc == 2 ? > > Martin > > On Wed, Dec 19, 2012 at 6:28 PM, Rob McKenna > wrote: > > Hi folks, > > Thanks for the feedback so far. I've uploaded a new webrev to: > > http://cr.openjdk.java.net/~robm/5049299/webrev.02/ > > > > I've made the following headline changes: > > - Initial effort to get this stuff into the new build-infra. > Hoping build-infra can steer me in the right direction. (note to > build infra reviewers: see links below) > > - Source thats shared between jspawnhelper.c and UNIXProcess_md.c > now resides in childproc.h/c. This results in cleaner changes to > the makefiles. > > - jspawnhelper moved to /lib/ on solaris (ipc > necessitate the use of a separate jspawnhelper for each arch) and > just /lib on macosx. > > The following links to earlier threads are well worth reading for > additional context: > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012417.html > http://mail.openjdk.java.net/pipermail/core-libs-dev/2009-June/001747.html > > -Rob > > > On 30/11/12 03:48, Rob McKenna wrote: > > Hi David, > > On 30/11/12 02:31, David Holmes wrote: > > Hi Rob, > > This is only a superficial scan. > > The changes in java/java/makefile look pretty horrible. > What are all those -R entries? > > Library search paths. Currently jprochelper is linked to > libjava. I'm hoping to either cut their number (by altering > jprochelpers home) or get rid of them altogether (by avoiding > linking at all) in the next draft, they are indeed ungainly. > > > We will need equivalent changes for the new build system > before this is pushed. > > Indeed. > > Is the spawn use BSD specific (as per > UnixProcess.java.BSD) or Apple specific (as per __APPLE_ > in UNIXProcess_md.c) ? > > Eesh, thanks, it applies to both platforms. > > Are the UnixProcess.java files similar enough that we > could use a single template and generate the per-OS variants? > > Before this change .bsd & .linux were identical (iirc) > unfortunately, no longer. Solaris has differences. When you > say "generate the per-OS variants" how do you mean? I'd like > to keep it as straightforward as possible from a sustaining > perspective. (personally I'd like to just extend a base class > and try to get away from the makefiles as much as possible - > we can discuss this in 8000975 which I'll revisit once I get > through this) > > In UNIXProcess_md.c: > > 209 #ifdef _CS_PATH > 210 char *pathbuf; > 211 size_t n; > 212 n = confstr(_CS_PATH,NULL,(size_t) 0); > 213 pathbuf = malloc(n); > 214 if (pathbuf == NULL) > 215 abort(); > 216 confstr(_CS_PATH, pathbuf, n); > 217 return pathbuf; > 218 #else > > what is _CS_PATH and why are we calling abort()? !!!! > > As per Martins comments I'm going to separate this into > another change. See: > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2009-May/001686.html > > and > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012456.html > > > for context. I'll look to fall back to the previous code if > the pathbuf malloc fails. > > What is all the xx_ naming ?? > > I believe Michael was using it to denote shared calls. > (functions called from both jprochelper and within > UNIXProcess_md.c). I presumed it was placeholder text > actually, in any case it may go away in the next iteration as > per previous comments. If not, I'm happy to replace it with > whatever gets it past codereview. > > -Rob > > David > ----- > > > On 23/11/2012 7:27 AM, Rob McKenna wrote: > > Hi folks, > > Looking for a review for the webrev below, which also > resolves: > > 7175692: (process) Process.exec should use posix_spawn > [macosx] > > For additional context and a brief description it > would be well worth > looking at the following thread started by Michael > McMahon, who did the > brunt of the work for this fix: > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2009-May/thread.html#1644 > > > > Basically the fix aims to swap fork for posix_spawn as > the default > process launch mechanism on Solaris and Mac OSX in > order to avoid swap > exhaustion issues encountered with fork()/exec(). It > also offers a flag > (java.lang.useFork) to allow a user to revert to the > old behaviour. > > I'm having trouble seeing the wood for the trees at > this point so I'm > anticipating plenty of feedback. In particular I'd > appreciate some > discussion on: > > - The binary launcher name & property name may need > some work. A more > general property ("java.lang.launchMechanism") to > allow a user to > specify a particular call was mooted too. It may be > more future proof > and I'm completely open to that. (e.g. > launchMechanism=spawn|fork|vfork|clone - we would > obviously ignore > inapplicable values on a per-platform basis) > - I'd like a more robust way of checking that someone > isn't trying to > use jprochelper outside of the context for which it is > meant. > - The decision around which call to use getting moved > to the java level > and away from the native preprocessor. > > The webrev is at: > > http://cr.openjdk.java.net/~robm/5049299/webrev.01/ > > > > Thanks a lot, > > -Rob > > > > From brian.goetz at oracle.com Sun Dec 23 18:36:41 2012 From: brian.goetz at oracle.com (Brian Goetz) Date: Sun, 23 Dec 2012 13:36:41 -0500 Subject: RFR: CR#8004561 : Additional Functional Interfaces and Updates In-Reply-To: References: Message-ID: <50D74F39.4090700@oracle.com> Yes, this is a deliberate u-turn that comes as a result of the unexpected interactions with the overloading resolution rules. By having DoubleBlock extending Block, we created problems for overloading. For example, consider this expected-to-be-common overloading in Bunch: Bunch transform(Function transformer) IntBunch transform(IntFunction transformer) There are some conflicting rules in overload selection: - prefer more-specific SAMs to less specific (favors IntFunction) - prefer less boxing/unboxing What we'd like is to choose the former when the "natural" type of transformer is T -> Integer and the latter when the "natural" type is T -> int. But, because the more specific rule has higher priority, we would coerce a T -> Integer into a T -> int (with unboxing) all the time. On 12/20/2012 9:07 PM, Howard Lovatt wrote: > 1. DoubleBlock doesn't extend Block and doesn't have a default > method, similarly int and long > 2. Similarly all the rest like Function aren't extended > > Is this the correct link - it seems to have gone backwards? > > -- Howard. > > > On 21 December 2012 12:41, Mike Duigou wrote: > >> Hello all; >> >> Here are some additional functional interfaces for review. The additions >> fill in holes for primitive types and for two operand "Bi" operations. >> >> http://cr.openjdk.java.net/~mduigou/8004561/0/webrev/ >> >> http://cr.openjdk.java.net/~mduigou/8004561/0/specdiff/java/util/function/package-summary.html >> >> Additionally, this patch contains naming updates on the existing >> functional interfaces following 335 EG review. It does not include the >> interface specializations and default methods previously proposed in >> CR#8004015. That proposal has been withdrawn. It turned out that user >> errors involving unexpected boxing were just too common for the value >> provided. >> >> Mike >> >> > > From brian.goetz at oracle.com Sun Dec 23 18:45:08 2012 From: brian.goetz at oracle.com (Brian Goetz) Date: Sun, 23 Dec 2012 13:45:08 -0500 Subject: RFR: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50D45601.10501@univ-mlv.fr> References: <50D40178.3060604@oracle.com> <50D42A64.3050804@oracle.com> <50D45601.10501@univ-mlv.fr> Message-ID: <50D75134.7060907@oracle.com> >> Henry - just a quick comment on the class description. I think it would >> be better not to include the sentence "Since 1.8 ..." as it that will >> quickly become a historical note. It would be much better (in my view) >> to just highlight the methods with something like "Several of the >> methods take a Supplier function ..." and make the potential performance >> benefit of using these methods clear. > > You should also add a note saying that the supplier can be specified as > a lambda and in that case, the lambda *must* not capture value of local > variable, otherwise a supplier object will be created each time you log > something. No, don't do this. First of all, just because the performance characteristics of capturing lambdas are one way today on HotSpot compared to non-capturing, does not mean we should burn this into spec. Also, there's no way to enforce it. More importantly, a capturing lambda might still be way better than a String, as in this example: log(DEBUG, () -> "Children of " + name + ": " + getChildrenOf(name)); Collecting getChildren (and turning it into a String) commonly involves something thousands of times as expensive as an object creation. From forax at univ-mlv.fr Mon Dec 24 15:55:05 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Mon, 24 Dec 2012 16:55:05 +0100 Subject: RFR: CR#8004561 : Additional Functional Interfaces and Updates In-Reply-To: <50D74F39.4090700@oracle.com> References: <50D74F39.4090700@oracle.com> Message-ID: <50D87AD9.5040206@univ-mlv.fr> On 12/23/2012 07:36 PM, Brian Goetz wrote: > Yes, this is a deliberate u-turn that comes as a result of the > unexpected interactions with the overloading resolution rules. maybe it's because the overloading resolution rules are not the right ones ? I've no idea if it's better or not, I'm just thinking loudly. > By having DoubleBlock extending Block, we created problems for > overloading. For example, consider this expected-to-be-common > overloading in Bunch: > > Bunch transform(Function transformer) > IntBunch transform(IntFunction transformer) > > There are some conflicting rules in overload selection: > - prefer more-specific SAMs to less specific (favors IntFunction) > - prefer less boxing/unboxing > > What we'd like is to choose the former when the "natural" type of > transformer is T -> Integer and the latter when the "natural" type is T > -> int. But, because the more specific rule has higher priority, we > would coerce a T -> Integer into a T -> int (with unboxing) all the time. Brian, Why the algorithm that select the most specific SAMs use the return type of the SAM descriptor, the classical algorithm doesn't use the return type. R?mi > > > > > On 12/20/2012 9:07 PM, Howard Lovatt wrote: >> 1. DoubleBlock doesn't extend Block and doesn't have a default >> method, similarly int and long >> 2. Similarly all the rest like Function aren't extended >> >> Is this the correct link - it seems to have gone backwards? >> >> -- Howard. >> >> >> On 21 December 2012 12:41, Mike Duigou wrote: >> >>> Hello all; >>> >>> Here are some additional functional interfaces for review. The additions >>> fill in holes for primitive types and for two operand "Bi" operations. >>> >>> http://cr.openjdk.java.net/~mduigou/8004561/0/webrev/ >>> >>> http://cr.openjdk.java.net/~mduigou/8004561/0/specdiff/java/util/function/package-summary.html >>> >>> Additionally, this patch contains naming updates on the existing >>> functional interfaces following 335 EG review. It does not include the >>> interface specializations and default methods previously proposed in >>> CR#8004015. That proposal has been withdrawn. It turned out that user >>> errors involving unexpected boxing were just too common for the value >>> provided. >>> >>> Mike >>> >>> >> From forax at univ-mlv.fr Mon Dec 24 16:15:34 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Mon, 24 Dec 2012 17:15:34 +0100 Subject: RFR: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50D75134.7060907@oracle.com> References: <50D40178.3060604@oracle.com> <50D42A64.3050804@oracle.com> <50D45601.10501@univ-mlv.fr> <50D75134.7060907@oracle.com> Message-ID: <50D87FA6.6070002@univ-mlv.fr> On 12/23/2012 07:45 PM, Brian Goetz wrote: >>> Henry - just a quick comment on the class description. I think it would >>> be better not to include the sentence "Since 1.8 ..." as it that will >>> quickly become a historical note. It would be much better (in my view) >>> to just highlight the methods with something like "Several of the >>> methods take a Supplier function ..." and make the potential >>> performance >>> benefit of using these methods clear. >> >> You should also add a note saying that the supplier can be specified as >> a lambda and in that case, the lambda *must* not capture value of local >> variable, otherwise a supplier object will be created each time you log >> something. > > No, don't do this. > > First of all, just because the performance characteristics of > capturing lambdas are one way today on HotSpot compared to > non-capturing, does not mean we should burn this into spec. It's not related to Hotspot. javac translation uses invokedynamic (by the specification) and the metafactory provided by the JDK uses for non-capturing lambda a ConstantCallSite which is guaranteed by the JSR 292 to be considered as a constant. Hotspot just implements the JSR 292. So this is true for all metafactory implementation that uses a ConstantCallSite as the one provided by the JDK. > Also, there's no way to enforce it. not a lambda problem, but a JSR 292 problem, and it should be enforced by tests, it's JEP 165. > More importantly, a capturing lambda might still be way better than a > String, as in this example: > > log(DEBUG, () -> "Children of " + name + ": " + getChildrenOf(name)); > > Collecting getChildren (and turning it into a String) commonly > involves something thousands of times as expensive as an object creation. Yes, true it depends on the cost of getChildrenOf, my point was to add a sentence saying that using a lambda that capture local variables may impact performance. R?mi From peter.levart at gmail.com Mon Dec 24 17:17:41 2012 From: peter.levart at gmail.com (Peter Levart) Date: Mon, 24 Dec 2012 18:17:41 +0100 Subject: RFR: CR#8004561 : Additional Functional Interfaces and Updates In-Reply-To: <50D87AD9.5040206@univ-mlv.fr> References: <50D74F39.4090700@oracle.com> <50D87AD9.5040206@univ-mlv.fr> Message-ID: <50D88E35.60906@gmail.com> On 12/24/2012 04:55 PM, Remi Forax wrote: > On 12/23/2012 07:36 PM, Brian Goetz wrote: >> Yes, this is a deliberate u-turn that comes as a result of the >> unexpected interactions with the overloading resolution rules. > > maybe it's because the overloading resolution rules are not the right > ones ? > I've no idea if it's better or not, I'm just thinking loudly. > >> By having DoubleBlock extending Block, we created problems for >> overloading. For example, consider this expected-to-be-common >> overloading in Bunch: >> >> Bunch transform(Function transformer) >> IntBunch transform(IntFunction transformer) >> >> There are some conflicting rules in overload selection: >> - prefer more-specific SAMs to less specific (favors IntFunction) >> - prefer less boxing/unboxing >> >> What we'd like is to choose the former when the "natural" type of >> transformer is T -> Integer and the latter when the "natural" type is T >> -> int. But, because the more specific rule has higher priority, we >> would coerce a T -> Integer into a T -> int (with unboxing) all the >> time. > > Brian, Why the algorithm that select the most specific SAMs use the > return type of the SAM descriptor, > the classical algorithm doesn't use the return type. I think Brian was referring to the most specific SAM type. The "classical" algorithm prefers methods with more specific parameter types and SAM type acts as parameter type here. If IntFunction is a subtype of Function then the method with parameter of type IntFunction is selected in preference to Function regardless of lambda's "structural" or "natural" type, provided that lambda conversion is valid for both. If parameter types of two overloaded methods are unrelated (not in a sub-super-type relationship) then the "classical" algorithm barfs, but lambda conversion can use structural properties of unrelated SAM types to select the most appropriate in this case. Regards, Peter > > R?mi > >> >> >> >> >> On 12/20/2012 9:07 PM, Howard Lovatt wrote: >>> 1. DoubleBlock doesn't extend Block and doesn't have a default >>> method, similarly int and long >>> 2. Similarly all the rest like Function aren't extended >>> >>> Is this the correct link - it seems to have gone backwards? >>> >>> -- Howard. >>> >>> >>> On 21 December 2012 12:41, Mike Duigou wrote: >>> >>>> Hello all; >>>> >>>> Here are some additional functional interfaces for review. The >>>> additions >>>> fill in holes for primitive types and for two operand "Bi" operations. >>>> >>>> http://cr.openjdk.java.net/~mduigou/8004561/0/webrev/ >>>> >>>> http://cr.openjdk.java.net/~mduigou/8004561/0/specdiff/java/util/function/package-summary.html >>>> >>>> >>>> Additionally, this patch contains naming updates on the existing >>>> functional interfaces following 335 EG review. It does not include the >>>> interface specializations and default methods previously proposed in >>>> CR#8004015. That proposal has been withdrawn. It turned out that user >>>> errors involving unexpected boxing were just too common for the value >>>> provided. >>>> >>>> Mike >>>> >>>> >>> > From tbuktu at hotmail.com Tue Dec 25 15:23:07 2012 From: tbuktu at hotmail.com (Tim Buktu) Date: Tue, 25 Dec 2012 16:23:07 +0100 Subject: Updated unit test for BigInteger patch (#4837946) Message-ID: /On 01/30/2012 09:06 AM, Joe Darcy wrote:/ > On 01/27/2012 02:41 PM, Tim Buktu wrote: > >/ On 01/11/2012 11:59 AM, Joe Darcy wrote: > />>/ Thanks Tim. I'll add this to my review queue after Alan Eliasen's work > />>/ (finally) gets in. > />/ Is there a timeframe for this yet? > / > The timeframe is on the order of weeks to months. > > Cheers, > > -Joe Seeing as it's been a while, I was wondering if this is still being considered for JDK 8. Would it help if I made an updated patch against the current BigInteger.java? Thanks, Tim From forax at univ-mlv.fr Tue Dec 25 23:11:18 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Wed, 26 Dec 2012 00:11:18 +0100 Subject: RFR: CR#8004561 : Additional Functional Interfaces and Updates In-Reply-To: <50D88E35.60906@gmail.com> References: <50D74F39.4090700@oracle.com> <50D87AD9.5040206@univ-mlv.fr> <50D88E35.60906@gmail.com> Message-ID: <50DA3296.2090502@univ-mlv.fr> On 12/24/2012 06:17 PM, Peter Levart wrote: > On 12/24/2012 04:55 PM, Remi Forax wrote: >> On 12/23/2012 07:36 PM, Brian Goetz wrote: >>> Yes, this is a deliberate u-turn that comes as a result of the >>> unexpected interactions with the overloading resolution rules. >> >> maybe it's because the overloading resolution rules are not the right >> ones ? >> I've no idea if it's better or not, I'm just thinking loudly. >> >>> By having DoubleBlock extending Block, we created problems for >>> overloading. For example, consider this expected-to-be-common >>> overloading in Bunch: >>> >>> Bunch transform(Function transformer) >>> IntBunch transform(IntFunction transformer) >>> >>> There are some conflicting rules in overload selection: >>> - prefer more-specific SAMs to less specific (favors IntFunction) >>> - prefer less boxing/unboxing >>> >>> What we'd like is to choose the former when the "natural" type of >>> transformer is T -> Integer and the latter when the "natural" type is T >>> -> int. But, because the more specific rule has higher priority, we >>> would coerce a T -> Integer into a T -> int (with unboxing) all the >>> time. >> >> Brian, Why the algorithm that select the most specific SAMs use the >> return type of the SAM descriptor, >> the classical algorithm doesn't use the return type. > I think Brian was referring to the most specific SAM type. The > "classical" algorithm prefers methods with more specific parameter > types and SAM type acts as parameter type here. If IntFunction is a > subtype of Function then the method with parameter of type > IntFunction is selected in preference to Function > regardless of lambda's "structural" or "natural" type, provided that > lambda conversion is valid for both. > > If parameter types of two overloaded methods are unrelated (not in a > sub-super-type relationship) then the "classical" algorithm barfs, but > lambda conversion can use structural properties of unrelated SAM types > to select the most appropriate in this case. yes, I know, my question is why the algorithm uses the return type when comparing SAM types structurally ? > > Regards, Peter >> >> R?mi regards, R?mi >> >>> >>> >>> >>> >>> On 12/20/2012 9:07 PM, Howard Lovatt wrote: >>>> 1. DoubleBlock doesn't extend Block and doesn't have a default >>>> method, similarly int and long >>>> 2. Similarly all the rest like Function aren't extended >>>> >>>> Is this the correct link - it seems to have gone backwards? >>>> >>>> -- Howard. >>>> >>>> >>>> On 21 December 2012 12:41, Mike Duigou wrote: >>>> >>>>> Hello all; >>>>> >>>>> Here are some additional functional interfaces for review. The >>>>> additions >>>>> fill in holes for primitive types and for two operand "Bi" >>>>> operations. >>>>> >>>>> http://cr.openjdk.java.net/~mduigou/8004561/0/webrev/ >>>>> >>>>> http://cr.openjdk.java.net/~mduigou/8004561/0/specdiff/java/util/function/package-summary.html >>>>> >>>>> >>>>> Additionally, this patch contains naming updates on the existing >>>>> functional interfaces following 335 EG review. It does not include >>>>> the >>>>> interface specializations and default methods previously proposed in >>>>> CR#8004015. That proposal has been withdrawn. It turned out that user >>>>> errors involving unexpected boxing were just too common for the value >>>>> provided. >>>>> >>>>> Mike >>>>> >>>>> >>>> >> > From bhavesh.x.patel at oracle.com Wed Dec 26 01:27:38 2012 From: bhavesh.x.patel at oracle.com (bhavesh.x.patel at oracle.com) Date: Wed, 26 Dec 2012 01:27:38 +0000 Subject: hg: jdk8/tl/langtools: 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes Message-ID: <20121226012742.E24CF4739F@hg.openjdk.java.net> Changeset: 690c41cdab55 Author: bpatel Date: 2012-12-25 17:23 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/690c41cdab55 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes Reviewed-by: jjg ! src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java ! src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java ! src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties ! src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java ! src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java ! src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml ! src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java ! test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java + test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java + test/com/sun/javadoc/testLambdaFeature/pkg/A.java + test/com/sun/javadoc/testLambdaFeature/pkg/B.java ! test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java From mlists at juma.me.uk Wed Dec 26 10:25:52 2012 From: mlists at juma.me.uk (Ismael Juma) Date: Wed, 26 Dec 2012 10:25:52 +0000 (UTC) Subject: RFR: CR#8004561 : Additional Functional Interfaces and Updates References: <50D46870.6060808@gmail.com> Message-ID: Peter Levart writes: > I see that (given Function f, g), f.compose(g) means: f?g, rather than > f?g. Would mathematicians complain? For what it's worth, Scala has "andThen" for "f;g" and "compose" for "f?g". Best, Ismael From mikhail.cherkasov at oracle.com Wed Dec 26 14:50:33 2012 From: mikhail.cherkasov at oracle.com (mikhail cherkasov) Date: Wed, 26 Dec 2012 18:50:33 +0400 Subject: Replacing deprecated String constructor Message-ID: <50DB0EB9.90300@oracle.com> Hi All, I work on removing javac's warring and not sure about how properly replace deprecated String constructors. Is 'new String(data, off, len, StandardCharsets.ISO_8859_1)' equivalent replacement for 'new String(data, 0, off, len)' ? Thanks, Mikhail. From xueming.shen at oracle.com Wed Dec 26 15:29:44 2012 From: xueming.shen at oracle.com (Xueming Shen) Date: Wed, 26 Dec 2012 10:29:44 -0500 Subject: Replacing deprecated String constructor In-Reply-To: <50DB0EB9.90300@oracle.com> References: <50DB0EB9.90300@oracle.com> Message-ID: <50DB17E8.70604@oracle.com> Yes, they should be equivalent, except the performance will be slightly different. The "deprecated" one is faster. And in most cases, the new String(..., String charsetName) version is faster than the new String(..., Charset cs) version. -sherman On 12/26/2012 9:50 AM, mikhail cherkasov wrote: > Hi All, > > I work on removing javac's warring and not sure about how > properly replace deprecated String constructors. > > Is 'new String(data, off, len, StandardCharsets.ISO_8859_1)' > equivalent replacement for 'new String(data, 0, off, len)' ? > > Thanks, > Mikhail. From sean.mullan at oracle.com Wed Dec 26 15:44:59 2012 From: sean.mullan at oracle.com (sean.mullan at oracle.com) Date: Wed, 26 Dec 2012 15:44:59 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20121226154556.058FC473A9@hg.openjdk.java.net> Changeset: 4d28776d7007 Author: mullan Date: 2012-12-26 10:07 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4d28776d7007 8005117: Eliminate dependency from ConfigSpiFile to com.sun.security.auth.login.ConfigFile Reviewed-by: alanb, mchung, weijun ! src/share/classes/com/sun/security/auth/login/ConfigFile.java ! src/share/classes/sun/security/provider/ConfigSpiFile.java Changeset: d9cab18f326a Author: mullan Date: 2012-12-26 10:08 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/d9cab18f326a Merge - make/jdk/asm/Makefile From huizhe.wang at oracle.com Wed Dec 26 23:06:13 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Wed, 26 Dec 2012 15:06:13 -0800 Subject: RFR: (jaxp) 8005473 : Warnings compiling jaxp Message-ID: <50DB82E5.20504@oracle.com> Hi, This is a patch to clean up compiling warnings in jaxp. Bug: http://bugs.sun.com/view_bug.do?bug_id=8005473 Webrev: http://cr.openjdk.java.net/~joehw/jdk8/8005473/webrev/ Thanks, Joe From henry.jen at oracle.com Thu Dec 27 00:23:30 2012 From: henry.jen at oracle.com (Henry Jen) Date: Wed, 26 Dec 2012 16:23:30 -0800 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: References: <50D53C0A.6000203@oracle.com> Message-ID: <50DB9502.4090406@oracle.com> On 12/22/2012 07:30 AM, Jason Mehrens wrote: > The msg argument in most cases is a string literal because it is either > a resource bundle key or a MessageFormat literal. The established best > practice is to convert on the fly construction of messages to use > the MessageFormat syle logging. This current patch is kind of > anti-pattern of that practice. I would think the real win would be to > delay construction of the 'params' argument in the logging framework. > Allowing the callers to write logger.log(level, "{0}", Foo::bar) and > have the call to bar be lazy eval would be the best of both the logging > world and the lambda world. > For messages not just only for developer, they should be localized as you suggested and in such cases, it is possible to achieve the laziness via Object.toString(), less straightforward than using a lambda, but is possible. Cheers, Henry From weijun.wang at oracle.com Thu Dec 27 00:31:14 2012 From: weijun.wang at oracle.com (Weijun Wang) Date: Thu, 27 Dec 2012 08:31:14 +0800 Subject: RFR: (jaxp) 8005473 : Warnings compiling jaxp In-Reply-To: <50DB82E5.20504@oracle.com> References: <50DB82E5.20504@oracle.com> Message-ID: <50DB96D2.9060909@oracle.com> The code changes look fine. Thanks Max On 12/27/2012 07:06 AM, Joe Wang wrote: > Hi, > > This is a patch to clean up compiling warnings in jaxp. > > Bug: http://bugs.sun.com/view_bug.do?bug_id=8005473 > Webrev: http://cr.openjdk.java.net/~joehw/jdk8/8005473/webrev/ > > Thanks, > Joe From brian.burkhalter at oracle.com Thu Dec 27 01:12:21 2012 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Wed, 26 Dec 2012 17:12:21 -0800 Subject: Updated unit test for BigInteger patch (#4837946) In-Reply-To: References: Message-ID: <30ECED2F-D951-42E1-B039-853EF6733FF5@oracle.com> On Dec 25, 2012, at 04:23 PM, Tim Buktu wrote: > /On 01/30/2012 09:06 AM, Joe Darcy wrote:/ > >> On 01/27/2012 02:41 PM, Tim Buktu wrote: >>> / On 01/11/2012 11:59 AM, Joe Darcy wrote: >> />>/ Thanks Tim. I'll add this to my review queue after Alan Eliasen's work >> />>/ (finally) gets in. >> />/ Is there a timeframe for this yet? >> / >> The timeframe is on the order of weeks to months. >> >> Cheers, >> >> -Joe > Seeing as it's been a while, I was wondering if this is still being > considered for JDK 8. Would it help if I made an updated patch against > the current BigInteger.java? > Thanks, > > Tim It would definitely be helpful to have a patch against the current BigInteger.java. Thanks, Brian From chris.hegarty at oracle.com Thu Dec 27 08:23:24 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 27 Dec 2012 08:23:24 +0000 Subject: RFR: (jaxp) 8005473 : Warnings compiling jaxp In-Reply-To: <50DB96D2.9060909@oracle.com> References: <50DB82E5.20504@oracle.com> <50DB96D2.9060909@oracle.com> Message-ID: On 27 Dec 2012, at 00:31, Weijun Wang wrote: > The code changes look fine. +1. Nice to see warnings being cleaned up. -Chris > > Thanks > Max > > On 12/27/2012 07:06 AM, Joe Wang wrote: >> Hi, >> >> This is a patch to clean up compiling warnings in jaxp. >> >> Bug: http://bugs.sun.com/view_bug.do?bug_id=8005473 >> Webrev: http://cr.openjdk.java.net/~joehw/jdk8/8005473/webrev/ >> >> Thanks, >> Joe From forax at univ-mlv.fr Thu Dec 27 13:25:15 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Thu, 27 Dec 2012 14:25:15 +0100 Subject: RFR: (jaxp) 8005473 : Warnings compiling jaxp In-Reply-To: <50DB82E5.20504@oracle.com> References: <50DB82E5.20504@oracle.com> Message-ID: <50DC4C3B.7030202@univ-mlv.fr> On 12/27/2012 12:06 AM, Joe Wang wrote: > Hi, > > This is a patch to clean up compiling warnings in jaxp. > > Bug: http://bugs.sun.com/view_bug.do?bug_id=8005473 > Webrev: http://cr.openjdk.java.net/~joehw/jdk8/8005473/webrev/ > > Thanks, > Joe Hi Joe, Method method = clazz.getMethod(DOM_LEVEL3_METHOD); is equivalent to Method method = clazz.getMethod(DOM_LEVEL3_METHOD, new Class[0]); so you allocate an empty array each time you call getMethod. A better patch is to cast null to Class[] (or Object[] for invoke) Method method = clazz.getMethod(DOM_LEVEL3_METHOD, (Class[])null); cheers, R?mi From huizhe.wang at oracle.com Thu Dec 27 18:03:06 2012 From: huizhe.wang at oracle.com (Joe Wang) Date: Thu, 27 Dec 2012 10:03:06 -0800 Subject: RFR: (jaxp) 8005473 : Warnings compiling jaxp In-Reply-To: <50DC4C3B.7030202@univ-mlv.fr> References: <50DB82E5.20504@oracle.com> <50DC4C3B.7030202@univ-mlv.fr> Message-ID: <50DC8D5A.3080402@oracle.com> Thanks all! I've updated the webrev with Remi's suggestion. -Joe On 12/27/2012 5:25 AM, Remi Forax wrote: > On 12/27/2012 12:06 AM, Joe Wang wrote: >> Hi, >> >> This is a patch to clean up compiling warnings in jaxp. >> >> Bug: http://bugs.sun.com/view_bug.do?bug_id=8005473 >> Webrev: http://cr.openjdk.java.net/~joehw/jdk8/8005473/webrev/ >> >> Thanks, >> Joe > > Hi Joe, > Method method = clazz.getMethod(DOM_LEVEL3_METHOD); > is equivalent to > Method method = clazz.getMethod(DOM_LEVEL3_METHOD, new Class[0]); > so you allocate an empty array each time you call getMethod. > > A better patch is to cast null to Class[] (or Object[] for invoke) > Method method = clazz.getMethod(DOM_LEVEL3_METHOD, (Class[])null); > > cheers, > R?mi > > From Ulf.Zibis at CoSoCo.de Thu Dec 27 18:33:27 2012 From: Ulf.Zibis at CoSoCo.de (Ulf Zibis) Date: Thu, 27 Dec 2012 19:33:27 +0100 Subject: Fwd: Re: Review request: 8003562: Provide a command-line tool to find static dependenciesh In-Reply-To: <50D4F2E9.5080505@oracle.com> References: <50D0F867.80100@oracle.com> <50D337B0.2090504@oracle.com> <50D37DDE.6040905@CoSoCo.de> <50D38720.3020408@oracle.com> <50D453E1.80502@CoSoCo.de> <50D4F2E9.5080505@oracle.com> Message-ID: <50DC9477.4040602@CoSoCo.de> Am 22.12.2012 00:38, schrieb Mandy Chung: > Ulf, > > I actually prefer the current way, a separate implementation of the process method for each option > rather than having a single big switch on enum constants. I wrote my implementation of the > handleOptions method (the previous version is copied from JavapTask) [1]. That also addresses > the bug you found when an empty parameter is passed to the last option. I'm happy with this > version and hope you are. Mandy, I respect your decision. It's your code. Nevertheless I still like my enum approach, as ... - it saves from plenty class files, - I believe, it only needs a third of code lines, - and therefore should be much better readable. Thanks for your wishes, I send them back -Ulf From zhong.j.yu at gmail.com Thu Dec 27 19:16:10 2012 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Thu, 27 Dec 2012 13:16:10 -0600 Subject: Scaling problem of HashMap (introduced with alternative hashing) Message-ID: Reported by the SO question http://stackoverflow.com/questions/14010906 the HashMap constructor contains a CAS, which is kind of surprising. Could it be removed? transient final int hashSeed = sun.misc.Hashing.randomHashSeed(this); // CAS Zhong Yu From jason_mehrens at hotmail.com Thu Dec 27 19:22:27 2012 From: jason_mehrens at hotmail.com (Jason Mehrens) Date: Thu, 27 Dec 2012 13:22:27 -0600 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50DB9502.4090406@oracle.com> References: <50D53C0A.6000203@oracle.com>, , <50DB9502.4090406@oracle.com> Message-ID: Henry, Please don't apply this patch. This patch and the suggested workarounds are still an anti-pattern of the logging API. You don't want to encourage this type of on the fly message construction because it can't be localized. Even Netbeans has a code hint to undo this pattern that you are enabling. The problem with this patch is it fails to meet even its own goals when used it in a real world context. The stated goal is to eliminate unnecessary message construction but, in this patch you will pay the cost of message construction when you create a LogRecord. If you configure a system with MemoryHandler to track the events that lead up to a failure you will pay the message cost on every LogRecord that passes through the ring buffer. With this API change, we are performing costly message construction for evicted and unformatted records which is awful. This same kind of worst case behavior happens when the handler levels are higher than the logger level or if a handler is using a filter to track a specific error. I've used combinations of those logging configurations on production applications to track down elusive errors (See bug 6219960). This patch assumes that if a record is loggable by a logger that it will be formatted and that is incorrect. In the 1.4-1.7 logging, message construction cost is delayed until formatting which is as lazy as it gets in the logging world. Take the workaround you suggest bellow. If you apply Object.toString() to any of the arguments, then that cripples what you can do with custom Filter or custom Formatter because you want to be able to access the arguments in their original form and not the string representation. Also, you always want to use the ResouceBundle assigned to the LogRecord from the logger to do the localization. The msg supplier won't know what that is at the time the lambda is created or I would have to recreate code that the logger already does for me every time I want to log something. It would be easier to do what we've done since 1.4 which is use a guard statement to avoid evaluation of the expensive method call. Against this patch if I use a lambda or a guard they will both evaluate the expensive call under the same scenarios. Take the 'DiagnosisMessages::systemHealthStatus' example from the API docs. Seems fine until you realize that someday you might have to read the output of that statement in a log somewhere or you want to create a filter that only shows when the system is unhealthy. So you start to transform that example and realize that you don't want to create a 'systemHealthStatusWithContextMsg' method because it can't be localized during formatting. You don't want to simply perform msg concatenation because that is bad practice and doesn't use lambda. So skip using the lambda APIs because you can use the parameterized logging with a guard statement and that allows you to localize the message and or use the raw parameter data in a Filter to determine which system value has exceed some threshold without resorting to message parsing. Parameters are always more useful than a preformatted string message. Once you arrive here, there is no need for a message parameter to be anything other than a message format pattern or a resource bundle key. Both of those types of messages are string literals so I don't need a Supplier. I think what would be more powerful and fitting patch would be to overload all of the Logger.finest, Logger.finer, Logger.fine, etc. like 'Logger.finer(String msg, Throwable thrown, Supplier... params)' or use a sub-interface of Supplier. As long as the given Supplier.toString() is implemented as: 'return String.valueof(get())' then the existing logging API would format these lazy parameters the same way and would properly delay the construction cost to only at the time of formatting. Filters would be allowed access to the original parameters through the supplier interface and the already established localization in the logging API would still work. The established best practice of not creating on the fly messages would still remain an enduring goal of the logging API. Respectfully, Jason > For messages not just only for developer, they should be localized as > you suggested and in such cases, it is possible to achieve the laziness > via Object.toString(), less straightforward than using a lambda, but is > possible. > > Cheers, > Henry > From aleksey.shipilev at oracle.com Thu Dec 27 19:38:49 2012 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Thu, 27 Dec 2012 23:38:49 +0400 Subject: Scaling problem of HashMap (introduced with alternative hashing) In-Reply-To: References: Message-ID: <5B72EDA5-641A-4691-AC9B-457C7BAAD489@oracle.com> Looks very like dumb inlined java.util.Random? Is there a security threat to use ThreadLocalRandom instead there? -Aleksey. On 27.12.2012, at 23:16, Zhong Yu wrote: > Reported by the SO question > > http://stackoverflow.com/questions/14010906 > > the HashMap constructor contains a CAS, which is kind of surprising. > Could it be removed? > > transient final int hashSeed = > sun.misc.Hashing.randomHashSeed(this); // CAS > > Zhong Yu From mike.duigou at oracle.com Thu Dec 27 19:55:06 2012 From: mike.duigou at oracle.com (Mike Duigou) Date: Thu, 27 Dec 2012 11:55:06 -0800 Subject: Scaling problem of HashMap (introduced with alternative hashing) In-Reply-To: <5B72EDA5-641A-4691-AC9B-457C7BAAD489@oracle.com> References: <5B72EDA5-641A-4691-AC9B-457C7BAAD489@oracle.com> Message-ID: I am responding on the StackOverflow thread. I will look into using ThreadLocalRandom. The random.next() is clearly a potential bottleneck but given that this happens only once per HashMap instance it is still unclear why a reasonable application would want to create hundreds or thousands of hash maps per second. Mike On Dec 27 2012, at 11:38 , Aleksey Shipilev wrote: > Looks very like dumb inlined java.util.Random? > Is there a security threat to use ThreadLocalRandom instead there? > > -Aleksey. > > On 27.12.2012, at 23:16, Zhong Yu wrote: > >> Reported by the SO question >> >> http://stackoverflow.com/questions/14010906 >> >> the HashMap constructor contains a CAS, which is kind of surprising. >> Could it be removed? >> >> transient final int hashSeed = >> sun.misc.Hashing.randomHashSeed(this); // CAS >> >> Zhong Yu From eric.mccorkle at oracle.com Thu Dec 27 19:57:32 2012 From: eric.mccorkle at oracle.com (Eric McCorkle) Date: Thu, 27 Dec 2012 14:57:32 -0500 Subject: Scaling problem of HashMap (introduced with alternative hashing) In-Reply-To: References: Message-ID: It looks like its just generating a unique random seed for each HashMap. It seems like that could be made thread-local. On Dec 27, 2012, at 2:16 PM, Zhong Yu wrote: > Reported by the SO question > > http://stackoverflow.com/questions/14010906 > > the HashMap constructor contains a CAS, which is kind of surprising. > Could it be removed? > > transient final int hashSeed = > sun.misc.Hashing.randomHashSeed(this); // CAS > > Zhong Yu From aleksey.shipilev at oracle.com Thu Dec 27 20:02:32 2012 From: aleksey.shipilev at oracle.com (Aleksey Shipilev) Date: Fri, 28 Dec 2012 00:02:32 +0400 Subject: Scaling problem of HashMap (introduced with alternative hashing) In-Reply-To: References: <5B72EDA5-641A-4691-AC9B-457C7BAAD489@oracle.com> Message-ID: Transient HashMaps allocated on demand are actually quite often in user code. I think at large enough machine you will hit the coherence wall much sooner than the allocation wall. Pity I missed to review that code long before. Please let me know if you need help figuring out another solution. -Aleksey. On 27.12.2012, at 23:55, Mike Duigou wrote: > I am responding on the StackOverflow thread. I will look into using ThreadLocalRandom. > > The random.next() is clearly a potential bottleneck but given that this happens only once per HashMap instance it is still unclear why a reasonable application would want to create hundreds or thousands of hash maps per second. > > Mike > > On Dec 27 2012, at 11:38 , Aleksey Shipilev wrote: > >> Looks very like dumb inlined java.util.Random? >> Is there a security threat to use ThreadLocalRandom instead there? >> >> -Aleksey. >> >> On 27.12.2012, at 23:16, Zhong Yu wrote: >> >>> Reported by the SO question >>> >>> http://stackoverflow.com/questions/14010906 >>> >>> the HashMap constructor contains a CAS, which is kind of surprising. >>> Could it be removed? >>> >>> transient final int hashSeed = >>> sun.misc.Hashing.randomHashSeed(this); // CAS >>> >>> Zhong Yu > From zhong.j.yu at gmail.com Thu Dec 27 20:21:52 2012 From: zhong.j.yu at gmail.com (Zhong Yu) Date: Thu, 27 Dec 2012 14:21:52 -0600 Subject: Scaling problem of HashMap (introduced with alternative hashing) In-Reply-To: References: <5B72EDA5-641A-4691-AC9B-457C7BAAD489@oracle.com> Message-ID: On Thu, Dec 27, 2012 at 1:55 PM, Mike Duigou wrote: > I am responding on the StackOverflow thread. I will look into using ThreadLocalRandom. > > The random.next() is clearly a potential bottleneck but given that this happens only once per HashMap instance it is still unclear why a reasonable application would want to create hundreds or thousands of hash maps per second. That is pretty common, for example, in a web server, each request may use a HashMap for headers, and there are thousands of requests per second. That's probably not a big deal either on commodity hardware, but OP got 64 cores. Zhong Yu > Mike > > On Dec 27 2012, at 11:38 , Aleksey Shipilev wrote: > >> Looks very like dumb inlined java.util.Random? >> Is there a security threat to use ThreadLocalRandom instead there? >> >> -Aleksey. >> >> On 27.12.2012, at 23:16, Zhong Yu wrote: >> >>> Reported by the SO question >>> >>> http://stackoverflow.com/questions/14010906 >>> >>> the HashMap constructor contains a CAS, which is kind of surprising. >>> Could it be removed? >>> >>> transient final int hashSeed = >>> sun.misc.Hashing.randomHashSeed(this); // CAS >>> >>> Zhong Yu > From brian.goetz at oracle.com Thu Dec 27 20:40:22 2012 From: brian.goetz at oracle.com (Brian Goetz) Date: Thu, 27 Dec 2012 15:40:22 -0500 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: References: <50D53C0A.6000203@oracle.com>, , <50DB9502.4090406@oracle.com> Message-ID: <50DCB236.4020709@oracle.com> I think a significant fraction of the community would disagree with you. We ran a survey where we collected suggestions for lambdafying API methods, and this one came in top of the list. There is a significant fraction of the developer community that uses the logging API and doesn't care at all about localization, but does care about logging performance. One doesn't have to look very far to see that it is common practice to surround logging calls with if (logger.isLogging(level)) logger.log(level, msgExpr) to work around the eager evaluation. And such a practice is brittle, because it's easy to forget to do it in one place, and lose the benefit. Now, your answer might be "force all users to use message catalogs." But that's pretty mean. A lot of users really, really don't want to use message catalogs. They want to do: logger.log(level, () -> String.format(...)); You're basically saying we should force-feed those users some message-catalog vegetables, because it's good for them. > Henry, > Please don't apply this patch. This patch and the suggested workarounds are still an anti-pattern of the logging API. You don't want to encourage this type of on the fly message construction because it can't be localized. Even Netbeans has a code hint to undo this pattern that you are enabling. The problem with this patch is it fails to meet even its own goals when used it in a real world context. The stated goal is to eliminate unnecessary message construction but, in this patch you will pay the cost of message construction when you create a LogRecord. If you configure a system with MemoryHandler to track the events that lead up to a failure you will pay the message cost on every LogRecord that passes through the ring buffer. With this API change, we are performing costly message construction for evicted and unformatted records which is awful. This same kind of worst case behavior happens when the handler levels are higher than the logger level or if a handler is ! using a filter to track a specific error. I've used combinations of those logging configurations on production applications to track down elusive errors (See bug 6219960). This patch assumes that if a record is loggable by a logger that it will be formatted and that is incorrect. In the 1.4-1.7 logging, message construction cost is delayed until formatting which is as lazy as it gets in the logging world. Take the workaround you suggest bellow. If you apply Object.toString() to any of the arguments, then that cripples what you can do with custom Filter or custom Formatter because you want to be able to access the arguments in their original form and not the string representation. Also, you always want to use the ResouceBundle assigned to the LogRecord from the logger to do the localization. The msg supplier won't know what that is at the time the lambda is created or I would have to recreate code that the logger already does for me every time I want to log something. It would! be easie r to do what we've done since 1.4 which is use a guard statement to avoid evaluation of the expensive method call. Against this patch if I use a lambda or a guard they will both evaluate the expensive call under the same scenarios. Take the 'DiagnosisMessages::systemHealthStatus' example from the API docs. Seems fine until you realize that someday you might have to read the output of that statement in a log somewhere or you want to create a filter that only shows when the system is unhealthy. So you start to transform that example and realize that you don't want to create a 'systemHealthStatusWithContextMsg' method because it can't be localized during formatting. You don't want to simply perform msg concatenation because that is bad practice and doesn't use lambda. So skip using the lambda APIs because you can use the parameterized logging with a guard statement and that allows you to localize the message and or use the raw parameter data in a Filter to determine which ! system va lue has exceed some threshold without resorting to message parsing. Parameters are always more useful than a preformatted string message. Once you arrive here, there is no need for a message parameter to be anything other than a message format pattern or a resource bundle key. Both of those types of messages are string literals so I don't need a Supplier. I think what would be more powerful and fitting patch would be to overload all of the Logger.finest, Logger.finer, Logger.fine, etc. like 'Logger.finer(String msg, Throwable thrown, Supplier... params)' or use a sub-interface of Supplier. As long as the given Supplier.toString() is implemented as: 'return String.valueof(get())' then the existing logging API would format these lazy parameters the same way and would properly delay the construction cost to only at the time of formatting. Filters would be allowed access to the original parameters through the supplier interface and the already established localization in th! e logging API would still work. The established best practice of not creating on the fly messages would still remain an enduring goal of the logging API. Respectfully, Jason > >> For messages not just only for developer, they should be localized as >> you suggested and in such cases, it is possible to achieve the laziness >> via Object.toString(), less straightforward than using a lambda, but is >> possible. >> >> Cheers, >> Henry >> > > > > > > From chris.hegarty at oracle.com Thu Dec 27 21:41:59 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 27 Dec 2012 21:41:59 +0000 Subject: RFR: (jaxp) 8005473 : Warnings compiling jaxp In-Reply-To: <50DC8D5A.3080402@oracle.com> References: <50DB82E5.20504@oracle.com> <50DC4C3B.7030202@univ-mlv.fr> <50DC8D5A.3080402@oracle.com> Message-ID: <50DCC0A7.4010902@oracle.com> >> Method method = clazz.getMethod(DOM_LEVEL3_METHOD); >> is equivalent to >> Method method = clazz.getMethod(DOM_LEVEL3_METHOD, new Class[0]); >> so you allocate an empty array each time you call getMethod. >> >> A better patch is to cast null to Class[] (or Object[] for invoke) >> Method method = clazz.getMethod(DOM_LEVEL3_METHOD, (Class[])null); Is this something that the compiler could do? Or is this "inefficiency" baked into spec, or serve another purpose? -Chris. >> >> cheers, >> R?mi >> >> From chris.hegarty at oracle.com Thu Dec 27 21:59:01 2012 From: chris.hegarty at oracle.com (chris.hegarty at oracle.com) Date: Thu, 27 Dec 2012 21:59:01 +0000 Subject: hg: jdk8/tl/jdk: 8003981: Support Parallel Array Sorting - JEP 103 Message-ID: <20121227215929.084D9473DE@hg.openjdk.java.net> Changeset: 9d984ccd17fc Author: chegar Date: 2012-12-27 21:55 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/9d984ccd17fc 8003981: Support Parallel Array Sorting - JEP 103 Reviewed-by: chegar, forax, dholmes, dl Contributed-by: david.holmes at oracle.com, dl at cs.oswego.edu, chris.hegarty at oracle.com ! make/java/java/FILES_java.gmk ! src/share/classes/java/util/Arrays.java + src/share/classes/java/util/ArraysParallelSortHelpers.java + test/java/util/Arrays/ParallelSorting.java From forax at univ-mlv.fr Thu Dec 27 22:26:06 2012 From: forax at univ-mlv.fr (Remi Forax) Date: Thu, 27 Dec 2012 23:26:06 +0100 Subject: RFR: (jaxp) 8005473 : Warnings compiling jaxp In-Reply-To: <50DCC0A7.4010902@oracle.com> References: <50DB82E5.20504@oracle.com> <50DC4C3B.7030202@univ-mlv.fr> <50DC8D5A.3080402@oracle.com> <50DCC0A7.4010902@oracle.com> Message-ID: <50DCCAFE.2060306@univ-mlv.fr> On 12/27/2012 10:41 PM, Chris Hegarty wrote: > >>> Method method = clazz.getMethod(DOM_LEVEL3_METHOD); >>> is equivalent to >>> Method method = clazz.getMethod(DOM_LEVEL3_METHOD, new Class[0]); >>> so you allocate an empty array each time you call getMethod. >>> >>> A better patch is to cast null to Class[] (or Object[] for invoke) >>> Method method = clazz.getMethod(DOM_LEVEL3_METHOD, (Class[])null); > > Is this something that the compiler could do? Or is this > "inefficiency" baked into spec, or serve another purpose? The compiler has to create an empty array if there is not enough parameter from the spec (JLS7 15.12.2.4), but Class.getMethod() or Method.invoke() are special because they specified that null is a valid argument equivalent to an empty array. > > -Chris. R?mi From chris.hegarty at oracle.com Thu Dec 27 23:48:09 2012 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Thu, 27 Dec 2012 23:48:09 +0000 Subject: RFR: (jaxp) 8005473 : Warnings compiling jaxp In-Reply-To: <50DCCAFE.2060306@univ-mlv.fr> References: <50DB82E5.20504@oracle.com> <50DC4C3B.7030202@univ-mlv.fr> <50DC8D5A.3080402@oracle.com> <50DCC0A7.4010902@oracle.com> <50DCCAFE.2060306@univ-mlv.fr> Message-ID: <876D8E05-9141-442D-A768-2CE6FA234CE1@oracle.com> On 27 Dec 2012, at 22:26, Remi Forax wrote: > On 12/27/2012 10:41 PM, Chris Hegarty wrote: >> >>>> Method method = clazz.getMethod(DOM_LEVEL3_METHOD); >>>> is equivalent to >>>> Method method = clazz.getMethod(DOM_LEVEL3_METHOD, new Class[0]); >>>> so you allocate an empty array each time you call getMethod. >>>> >>>> A better patch is to cast null to Class[] (or Object[] for invoke) >>>> Method method = clazz.getMethod(DOM_LEVEL3_METHOD, (Class[])null); >> >> Is this something that the compiler could do? Or is this "inefficiency" baked into spec, or serve another purpose? > > The compiler has to create an empty array if there is not enough parameter from the spec (JLS7 15.12.2.4), but Class.getMethod() or Method.invoke() are special because they specified that null is a valid argument equivalent to an empty array. Ok, thanks Remi. -Chris. > >> >> -Chris. > > R?mi > From jason_mehrens at hotmail.com Fri Dec 28 00:16:52 2012 From: jason_mehrens at hotmail.com (Jason Mehrens) Date: Thu, 27 Dec 2012 18:16:52 -0600 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50DCB236.4020709@oracle.com> References: <50D53C0A.6000203@oracle.com>, , , , <50DB9502.4090406@oracle.com>, , <50DCB236.4020709@oracle.com> Message-ID: Brian, It's on my list too for lambdafying I just disagree with current implementation. I understand and agree that having to create a guard should not be required. It's awful to have to do. The point is that patch is still way too eager because you don't want to evaluate a message until the LogRecord arrives at a formatter inside of a handler. I don't want force anyone to use catalogs. I want to force everyone to use message parameterized logging (with or without a catalog) because it is powerful, lazy, and doesn't taste like a vegetable. If your concern is sugary sweets then, add overloaded methods that make message parameterized logging easy for the caller. If patch was rewritten like I proposed, it would be as terse as your example bellow. The difference is it would actually be lazy and would be useful when you need to create a custom filter to find some ghost in a production machine. Relevant or not, my patch would also enable lambdas and message catalogs. That is something that will never happen under the current patch. Jason > I think a significant fraction of the community would disagree with you. > We ran a survey where we collected suggestions for lambdafying API > methods, and this one came in top of the list. > There is a significant fraction of the developer community that uses the > logging API and doesn't care at all about localization, but does care > about logging performance. One doesn't have to look very far to see > that it is common practice to surround logging calls with > > if (logger.isLogging(level)) > logger.log(level, msgExpr) > > to work around the eager evaluation. And such a practice is brittle, > because it's easy to forget to do it in one place, and lose the benefit. > Now, your answer might be "force all users to use message catalogs." > But that's pretty mean. A lot of users really, really don't want to use > message catalogs. They want to do: > > logger.log(level, () -> String.format(...)); > > You're basically saying we should force-feed those users some > message-catalog vegetables, because it's good for them. From peter.levart at gmail.com Fri Dec 28 00:42:21 2012 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 28 Dec 2012 01:42:21 +0100 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50DB9502.4090406@oracle.com> References: <50D53C0A.6000203@oracle.com> <50DB9502.4090406@oracle.com> Message-ID: <50DCEAED.1040006@gmail.com> What about the following API: public class LogRecordFactory { private final Level level; public LogRecordFactory(Level level) { this.level = level; } public LogRecord create(String msg) { return new LogRecord(level, msg); } public LogRecord create(String msg, Object... parameters) { LogRecord lr = create(msg); lr.setParameters(parameters); return lr; } // ...etc... } and then in the Logger... public void log(Level level, Function logRecordProducer) { if (level.intValue() < levelValue || levelValue == offValue) { return; } LogRecord lr = logRecordProducer.apply(new LogRecordFactory(level)); doLog(lr); } which would be used as: logger.log(Level.INFO, lrp -> lrp.create("Status is: %s", getStatus())); Regards, Peter On 12/27/2012 01:23 AM, Henry Jen wrote: > On 12/22/2012 07:30 AM, Jason Mehrens wrote: >> The msg argument in most cases is a string literal because it is either >> a resource bundle key or a MessageFormat literal. The established best >> practice is to convert on the fly construction of messages to use >> the MessageFormat syle logging. This current patch is kind of >> anti-pattern of that practice. I would think the real win would be to >> delay construction of the 'params' argument in the logging framework. >> Allowing the callers to write logger.log(level, "{0}", Foo::bar) and >> have the call to bar be lazy eval would be the best of both the logging >> world and the lambda world. >> > For messages not just only for developer, they should be localized as > you suggested and in such cases, it is possible to achieve the laziness > via Object.toString(), less straightforward than using a lambda, but is > possible. > > Cheers, > Henry > From peter.levart at gmail.com Fri Dec 28 00:55:52 2012 From: peter.levart at gmail.com (Peter Levart) Date: Fri, 28 Dec 2012 01:55:52 +0100 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <50DCEAED.1040006@gmail.com> References: <50D53C0A.6000203@oracle.com> <50DB9502.4090406@oracle.com> <50DCEAED.1040006@gmail.com> Message-ID: <50DCEE18.5070907@gmail.com> And to save creation of a helper object, LogRecordFactory could be an interface implemented by LogRecord... Peter On 12/28/2012 01:42 AM, Peter Levart wrote: > What about the following API: > > public class LogRecordFactory { > > private final Level level; > > public LogRecordFactory(Level level) { > this.level = level; > } > > public LogRecord create(String msg) { > return new LogRecord(level, msg); > } > > public LogRecord create(String msg, Object... parameters) { > LogRecord lr = create(msg); > lr.setParameters(parameters); > return lr; > } > > // ...etc... > } > > > and then in the Logger... > > public void log(Level level, Function > logRecordProducer) { > if (level.intValue() < levelValue || levelValue == offValue) { > return; > } > LogRecord lr = logRecordProducer.apply(new > LogRecordFactory(level)); > doLog(lr); > } > > > which would be used as: > > logger.log(Level.INFO, lrp -> lrp.create("Status is: %s", > getStatus())); > > > Regards, Peter > > > On 12/27/2012 01:23 AM, Henry Jen wrote: >> On 12/22/2012 07:30 AM, Jason Mehrens wrote: >>> The msg argument in most cases is a string literal because it is either >>> a resource bundle key or a MessageFormat literal. The established best >>> practice is to convert on the fly construction of messages to use >>> the MessageFormat syle logging. This current patch is kind of >>> anti-pattern of that practice. I would think the real win would be to >>> delay construction of the 'params' argument in the logging framework. >>> Allowing the callers to write logger.log(level, "{0}", Foo::bar) and >>> have the call to bar be lazy eval would be the best of both the logging >>> world and the lambda world. >> For messages not just only for developer, they should be localized as >> you suggested and in such cases, it is possible to achieve the laziness >> via Object.toString(), less straightforward than using a lambda, but is >> possible. >> >> Cheers, >> Henry >> > From huizhe.wang at oracle.com Fri Dec 28 02:21:11 2012 From: huizhe.wang at oracle.com (huizhe.wang at oracle.com) Date: Fri, 28 Dec 2012 02:21:11 +0000 Subject: hg: jdk8/tl/jaxp: 8005473: Warnings compiling jaxp Message-ID: <20121228022116.28F0A473F1@hg.openjdk.java.net> Changeset: d4aea0225e80 Author: joehw Date: 2012-12-27 18:17 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/d4aea0225e80 8005473: Warnings compiling jaxp Summary: clean up compiling warnings. Reviewed-by: weijun, chegar, forax ! src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java ! src/javax/xml/transform/FactoryFinder.java ! src/javax/xml/validation/SchemaFactoryFinder.java ! src/javax/xml/xpath/XPathFactoryFinder.java From henry.jen at oracle.com Fri Dec 28 02:24:17 2012 From: henry.jen at oracle.com (Henry Jen) Date: Thu, 27 Dec 2012 18:24:17 -0800 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: References: <50D53C0A.6000203@oracle.com>, , , , <50DB9502.4090406@oracle.com>, , <50DCB236.4020709@oracle.com> Message-ID: As stated in the beginning of the review thread, the reason we don't have Supplier version for other API is that a formatter is involved and can achieve same laziness easily. The key is MessageFormatter can take arguments, which will be used to generate the output. As there is no directly support for Supplier, a possible solution is to have a wrapper class take a Supplier lambda, class Collector { final Supplier supplier; Collector(Supplier supplier) { this.supplier = supplier; } T collect() { return supplier.get(); } @Override String toString() { return supplier.get().toString(); } } It's not entirely beautiful, but is a general solution for applying supplier for MessageFormat. As the handler issue, I would argue that the logger would set to the lowest number required to be logged, i.e, at least one handler will format the message, thus the timing is not an real issue given the other caching/serialization concern discussed. Hope that helps, let me know if I missed something. Cheers, Henry On Dec 27, 2012, at 4:16 PM, Jason Mehrens wrote: > Brian, > > It's on my list too for lambdafying I just disagree with current implementation. I understand and agree that having to create a guard should not be required. It's awful to have to do. The point is that patch is still way too eager because you don't want to evaluate a message until the LogRecord arrives at a formatter inside of a handler. I don't want force anyone to use catalogs. I want to force everyone to use message parameterized logging (with or without a catalog) because it is powerful, lazy, and doesn't taste like a vegetable. If your concern is sugary sweets then, add overloaded methods that make message parameterized logging easy for the caller. If patch was rewritten like I proposed, it would be as terse as your example bellow. The difference is it would actually be lazy and would be useful when you need to create a custom filter to find some ghost in a production machine. Relevant or not, my patch would also enable lambdas and message catalogs. That is something that will never happen under the current patch. > > Jason > > > I think a significant fraction of the community would disagree with you. > > We ran a survey where we collected suggestions for lambdafying API > > methods, and this one came in top of the list. > > There is a significant fraction of the developer community that uses the > > logging API and doesn't care at all about localization, but does care > > about logging performance. One doesn't have to look very far to see > > that it is common practice to surround logging calls with > > > > if (logger.isLogging(level)) > > logger.log(level, msgExpr) > > > > to work around the eager evaluation. And such a practice is brittle, > > because it's easy to forget to do it in one place, and lose the benefit. > > Now, your answer might be "force all users to use message catalogs." > > But that's pretty mean. A lot of users really, really don't want to use > > message catalogs. They want to do: > > > > logger.log(level, () -> String.format(...)); > > > > You're basically saying we should force-feed those users some > > message-catalog vegetables, because it's good for them. > > From masayoshi.okutsu at oracle.com Fri Dec 28 05:35:06 2012 From: masayoshi.okutsu at oracle.com (masayoshi.okutsu at oracle.com) Date: Fri, 28 Dec 2012 05:35:06 +0000 Subject: hg: jdk8/tl/jdk: 8005471: DateFormat: Time zone info is not localized when adapter is CLDR Message-ID: <20121228053527.266194740C@hg.openjdk.java.net> Changeset: 4ad38db38fff Author: okutsu Date: 2012-12-28 14:13 +0900 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4ad38db38fff 8005471: DateFormat: Time zone info is not localized when adapter is CLDR Reviewed-by: peytoia ! src/share/classes/sun/util/resources/TimeZoneNamesBundle.java + test/java/util/TimeZone/CLDRDisplayNamesTest.java From yuka.kamiya at oracle.com Fri Dec 28 06:17:06 2012 From: yuka.kamiya at oracle.com (yuka.kamiya at oracle.com) Date: Fri, 28 Dec 2012 06:17:06 +0000 Subject: hg: jdk8/tl/jdk: 8005277: Regression in JDK 7 in Bidi implementation Message-ID: <20121228061726.7F8D347415@hg.openjdk.java.net> Changeset: 1da019e7999a Author: peytoia Date: 2012-12-28 15:07 +0900 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/1da019e7999a 8005277: Regression in JDK 7 in Bidi implementation Reviewed-by: okutsu ! src/share/classes/sun/text/bidi/BidiBase.java ! test/java/text/Bidi/BidiConformance.java + test/java/text/Bidi/Bug8005277.java From masayoshi.okutsu at oracle.com Fri Dec 28 07:46:32 2012 From: masayoshi.okutsu at oracle.com (masayoshi.okutsu at oracle.com) Date: Fri, 28 Dec 2012 07:46:32 +0000 Subject: hg: jdk8/tl/jdk: 8005561: typo in Calendar Message-ID: <20121228074652.4D09447416@hg.openjdk.java.net> Changeset: f3ac419e2bf0 Author: okutsu Date: 2012-12-28 16:39 +0900 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f3ac419e2bf0 8005561: typo in Calendar Reviewed-by: peytoia ! src/share/classes/java/util/Calendar.java From xuelei.fan at oracle.com Fri Dec 28 08:55:23 2012 From: xuelei.fan at oracle.com (xuelei.fan at oracle.com) Date: Fri, 28 Dec 2012 08:55:23 +0000 Subject: hg: jdk8/tl/jdk: 7109274: Restrict the use of certificates with RSA keys less than 1024 bits Message-ID: <20121228085543.B65E547419@hg.openjdk.java.net> Changeset: 645d774b683a Author: xuelei Date: 2012-12-28 00:48 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/645d774b683a 7109274: Restrict the use of certificates with RSA keys less than 1024 bits Summary: This restriction is applied via the Java Security property, "jdk.certpath.disabledAlgorithms". This will impact providers that adhere to this security property. Reviewed-by: mullan ! src/share/lib/security/java.security-linux ! src/share/lib/security/java.security-macosx ! src/share/lib/security/java.security-solaris ! src/share/lib/security/java.security-windows ! test/java/security/cert/CertPathBuilder/targetConstraints/BuildEEBasicConstraints.java ! test/java/security/cert/pkix/policyChanges/TestPolicy.java ! test/sun/security/provider/certpath/DisabledAlgorithms/CPBuilder.java ! test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorEndEntity.java ! test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorIntermediate.java ! test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorTrustAnchor.java ! test/sun/security/ssl/com/sun/net/ssl/internal/ssl/ClientHandshaker/RSAExport.java + test/sun/security/ssl/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java ! test/sun/security/ssl/javax/net/ssl/TLSv12/ShortRSAKey512.java ! test/sun/security/tools/jarsigner/concise_jarsigner.sh From xuelei.fan at oracle.com Fri Dec 28 11:53:16 2012 From: xuelei.fan at oracle.com (xuelei.fan at oracle.com) Date: Fri, 28 Dec 2012 11:53:16 +0000 Subject: hg: jdk8/tl/jdk: 8003265: Need to clone array of input/output parameters Message-ID: <20121228115351.CAE4B4741D@hg.openjdk.java.net> Changeset: 4472a641b4dc Author: xuelei Date: 2012-12-28 03:50 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4472a641b4dc 8003265: Need to clone array of input/output parameters Reviewed-by: mullan ! src/share/classes/com/sun/jndi/dns/DnsContext.java ! src/share/classes/com/sun/jndi/ldap/BasicControl.java From jason_mehrens at hotmail.com Fri Dec 28 15:15:45 2012 From: jason_mehrens at hotmail.com (Jason Mehrens) Date: Fri, 28 Dec 2012 09:15:45 -0600 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: References: <50D53C0A.6000203@oracle.com>, , , , <50DB9502.4090406@oracle.com>, , <50DCB236.4020709@oracle.com>, , Message-ID: Henry, It is beautiful if that code lives only inside of the logger and the caller is unaware of its existence. Same is true for writing a guard statement. The formatter can not always achieve the same laziness. If I converted your example in the API docs to be passed in the params argument I would have to evaluate it to a string before the logger call or create a supplier that overrides toString to return DiagnosisMessages.systemHealthStatus(). We are forcing caller to create the ugly code which the exact opposite of what you are trying to do with this patch. As soon as you use a MemoryHandler or install a Handler filter the levels will be the lowest number required. The problem is you end up throwing out or filtering out volumes of LogRecords that are never formatted. This is common when you are hunting for a specific error and what to see the last X number of messages that led up to the error. That was the technique used to reopen bug id 6840067. If I created a working proof of concept would that change anything or is this patch a done deal? Jason > Subject: Re: RFR 2: JDK-8005263: Logging APIs takes Supplier for message > From: henry.jen at oracle.com > Date: Thu, 27 Dec 2012 18:24:17 -0800 > CC: brian.goetz at oracle.com; lambda-dev at openjdk.java.net; core-libs-dev at openjdk.java.net > To: jason_mehrens at hotmail.com > > As stated in the beginning of the review thread, the reason we don't have Supplier version for other API is that a formatter is involved and can achieve same laziness easily. > > The key is MessageFormatter can take arguments, which will be used to generate the output. As there is no directly support for Supplier, a possible solution is to have a wrapper class take a Supplier lambda, > > class Collector { > final Supplier supplier; > > Collector(Supplier supplier) { > this.supplier = supplier; > } > > T collect() { > return supplier.get(); > } > > @Override > String toString() { > return supplier.get().toString(); > } > } > > It's not entirely beautiful, but is a general solution for applying supplier for MessageFormat. > > As the handler issue, I would argue that the logger would set to the lowest number required to be logged, i.e, at least one handler will format the message, thus the timing is not an real issue given the other caching/serialization concern discussed. > > Hope that helps, let me know if I missed something. > > Cheers, > Henry > > > On Dec 27, 2012, at 4:16 PM, Jason Mehrens wrote: > >> Brian, >> >> It's on my list too for lambdafying I just disagree with current implementation. I understand and agree that having to create a guard should not be required. It's awful to have to do. The point is that patch is still way too eager because you don't want to evaluate a message until the LogRecord arrives at a formatter inside of a handler. I don't want force anyone to use catalogs. I want to force everyone to use message parameterized logging (with or without a catalog) because it is powerful, lazy, and doesn't taste like a vegetable. If your concern is sugary sweets then, add overloaded methods that make message parameterized logging easy for the caller. If patch was rewritten like I proposed, it would be as terse as your example bellow. The difference is it would actually be lazy and would be useful when you need to create a custom filter to find some ghost in a production machine. Relevant or not, my patch would also enable lambdas and message catalogs. That is something that will never happen under the current patch. >> >> Jason >> >>> I think a significant fraction of the community would disagree with you. >>> We ran a survey where we collected suggestions for lambdafying API >>> methods, and this one came in top of the list. >>> There is a significant fraction of the developer community that uses the >>> logging API and doesn't care at all about localization, but does care >>> about logging performance. One doesn't have to look very far to see >>> that it is common practice to surround logging calls with >>> >>> if (logger.isLogging(level)) >>> logger.log(level, msgExpr) >>> >>> to work around the eager evaluation. And such a practice is brittle, >>> because it's easy to forget to do it in one place, and lose the benefit. >>> Now, your answer might be "force all users to use message catalogs." >>> But that's pretty mean. A lot of users really, really don't want to use >>> message catalogs. They want to do: >>> >>> logger.log(level, () -> String.format(...)); >>> >>> You're basically saying we should force-feed those users some >>> message-catalog vegetables, because it's good for them. >> >> > From jim.gish at oracle.com Fri Dec 28 15:19:22 2012 From: jim.gish at oracle.com (Jim Gish) Date: Fri, 28 Dec 2012 10:19:22 -0500 Subject: RFR: 8005118: (str) Javadoc styles are inconsistent Message-ID: <50DDB87A.5010304@oracle.com> Please revieiw the following change (simple, non-functional, non-spec change to bring some consistency to the javadoc tags - using {@code } where possible, etc.} http://cr.openjdk.java.net/~jgish/Bug8005118-String-spec-consistency/ Here's the specdiff as well: http://cr.openjdk.java.net/~jgish/Bug8005118-string-specdiff/ Thanks, Jim -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From joe.darcy at oracle.com Fri Dec 28 19:07:23 2012 From: joe.darcy at oracle.com (Joe Darcy) Date: Fri, 28 Dec 2012 11:07:23 -0800 Subject: RFR: 8005118: (str) Javadoc styles are inconsistent In-Reply-To: <50DDB87A.5010304@oracle.com> References: <50DDB87A.5010304@oracle.com> Message-ID: <50DDEDEB.10100@oracle.com> Looks fine; cheers, -Joe On 12/28/2012 7:19 AM, Jim Gish wrote: > Please revieiw the following change (simple, non-functional, non-spec > change to bring some consistency to the javadoc tags - using {@code } > where possible, etc.} > > http://cr.openjdk.java.net/~jgish/Bug8005118-String-spec-consistency/ > > > Here's the specdiff as well: > http://cr.openjdk.java.net/~jgish/Bug8005118-string-specdiff/ > > > Thanks, > Jim > From jim.gish at oracle.com Fri Dec 28 20:53:17 2012 From: jim.gish at oracle.com (Jim Gish) Date: Fri, 28 Dec 2012 15:53:17 -0500 Subject: RFR: 8005118: (str) Javadoc styles are inconsistent In-Reply-To: <50DDEDEB.10100@oracle.com> References: <50DDB87A.5010304@oracle.com> <50DDEDEB.10100@oracle.com> Message-ID: <50DE06BD.4080200@oracle.com> Thanks, Joe. Could you please submit for me? Jim On 12/28/2012 02:07 PM, Joe Darcy wrote: > Looks fine; cheers, > > -Joe > > On 12/28/2012 7:19 AM, Jim Gish wrote: >> Please revieiw the following change (simple, non-functional, non-spec >> change to bring some consistency to the javadoc tags - using {@code } >> where possible, etc.} >> >> http://cr.openjdk.java.net/~jgish/Bug8005118-String-spec-consistency/ >> >> >> >> Here's the specdiff as well: >> http://cr.openjdk.java.net/~jgish/Bug8005118-string-specdiff/ >> >> >> Thanks, >> Jim >> > -- Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304 Oracle Java Platform Group | Core Libraries Team 35 Network Drive Burlington, MA 01803 jim.gish at oracle.com From henry.jen at oracle.com Sat Dec 29 00:11:02 2012 From: henry.jen at oracle.com (Henry Jen) Date: Fri, 28 Dec 2012 16:11:02 -0800 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: References: <50D53C0A.6000203@oracle.com>, , , , <50DB9502.4090406@oracle.com>, , <50DCB236.4020709@oracle.com>, , Message-ID: <84D3ABF1-2D55-43F9-AF17-7439B36795DF@oracle.com> Jason, If I understand you correctly, there are two main concerns, 1. You want to encourage MessageFormat style logging, consider the other way is an anti-pattern. 2. The construction of message could be further eliminated when a filter is involved. Here is what I thought, For 1, the new API is simply enabling developer to provide a log message for the LogRecord, without forcing any formatting. In fact, because it's a Supplier, it actually enables all possibility about formatting. I can imagine all current MessageFormat style logging capability implemented as a Supplier. For 2, I don't disagree with you. However, as you said, it's worst case scenario when *all* handlers *never* try to call LogRecord.getMessage(). With serialization implications and compatibility concerns, we don't want to rush a change on LogRecord. Instead, current patch is simple and should be able to address many cases. Would it be good enough if we can defer the message construction after Logger.filter check, but construct the message before publish to Handlers? As Peter had pointed out earlier, we can add a reference in LogRecord to exchange for filtering at Logger level. But we cannot deferred further down to handler level without side-effects. Now again, for MessageFormat style logging, we don't lose any capability, and the laziness is already possible via proper use of parameters. The reason I don't include such a helper class for lambda to be used in parameter is that it's trivial. For parameter version, those should probably be customized to work with formatter anyway. I think it is reasonable to say the current patch is a step forward, and there are probably rooms to improve in the future. Next version I'll enable defer message construction until Logger filter check. Cheers, Henry On Dec 28, 2012, at 7:15 AM, Jason Mehrens wrote: > > Henry, > > It is beautiful if that code lives only inside of the logger and the caller is unaware of its existence. Same is true for writing a guard statement. > > The formatter can not always achieve the same laziness. If I converted your example in the API docs to be passed in the params argument I would have to evaluate it to a string before the logger call or create a supplier that overrides toString to return DiagnosisMessages.systemHealthStatus(). We are forcing caller to create the ugly code which the exact opposite of what you are trying to do with this patch. > > As soon as you use a MemoryHandler or install a Handler filter the levels will be the lowest number required. The problem is you end up throwing out or filtering out volumes of LogRecords that are never formatted. This is common when you are hunting for a specific error and what to see the last X number of messages that led up to the error. That was the technique used to reopen bug id 6840067. If I created a working proof of concept would that change anything or is this patch a done deal? > > Jason >> Subject: Re: RFR 2: JDK-8005263: Logging APIs takes Supplier for message >> From: henry.jen at oracle.com >> Date: Thu, 27 Dec 2012 18:24:17 -0800 >> CC: brian.goetz at oracle.com; lambda-dev at openjdk.java.net; core-libs-dev at openjdk.java.net >> To: jason_mehrens at hotmail.com >> >> As stated in the beginning of the review thread, the reason we don't have Supplier version for other API is that a formatter is involved and can achieve same laziness easily. >> >> The key is MessageFormatter can take arguments, which will be used to generate the output. As there is no directly support for Supplier, a possible solution is to have a wrapper class take a Supplier lambda, >> >> class Collector { >> final Supplier supplier; >> >> Collector(Supplier supplier) { >> this.supplier = supplier; >> } >> >> T collect() { >> return supplier.get(); >> } >> >> @Override >> String toString() { >> return supplier.get().toString(); >> } >> } >> >> It's not entirely beautiful, but is a general solution for applying supplier for MessageFormat. >> >> As the handler issue, I would argue that the logger would set to the lowest number required to be logged, i.e, at least one handler will format the message, thus the timing is not an real issue given the other caching/serialization concern discussed. >> >> Hope that helps, let me know if I missed something. >> >> Cheers, >> Henry >> >> >> On Dec 27, 2012, at 4:16 PM, Jason Mehrens wrote: >> >>> Brian, >>> >>> It's on my list too for lambdafying I just disagree with current implementation. I understand and agree that having to create a guard should not be required. It's awful to have to do. The point is that patch is still way too eager because you don't want to evaluate a message until the LogRecord arrives at a formatter inside of a handler. I don't want force anyone to use catalogs. I want to force everyone to use message parameterized logging (with or without a catalog) because it is powerful, lazy, and doesn't taste like a vegetable. If your concern is sugary sweets then, add overloaded methods that make message parameterized logging easy for the caller. If patch was rewritten like I proposed, it would be as terse as your example bellow. The difference is it would actually be lazy and would be useful when you need to create a custom filter to find some ghost in a production machine. Relevant or not, my patch would also enable lambdas and message catalogs. That is something that will never happen under the current patch. >>> >>> Jason >>> >>>> I think a significant fraction of the community would disagree with you. >>>> We ran a survey where we collected suggestions for lambdafying API >>>> methods, and this one came in top of the list. >>>> There is a significant fraction of the developer community that uses the >>>> logging API and doesn't care at all about localization, but does care >>>> about logging performance. One doesn't have to look very far to see >>>> that it is common practice to surround logging calls with >>>> >>>> if (logger.isLogging(level)) >>>> logger.log(level, msgExpr) >>>> >>>> to work around the eager evaluation. And such a practice is brittle, >>>> because it's easy to forget to do it in one place, and lose the benefit. >>>> Now, your answer might be "force all users to use message catalogs." >>>> But that's pretty mean. A lot of users really, really don't want to use >>>> message catalogs. They want to do: >>>> >>>> logger.log(level, () -> String.format(...)); >>>> >>>> You're basically saying we should force-feed those users some >>>> message-catalog vegetables, because it's good for them. >>> >>> >> From stuart.marks at oracle.com Sat Dec 29 01:35:45 2012 From: stuart.marks at oracle.com (stuart.marks at oracle.com) Date: Sat, 29 Dec 2012 01:35:45 +0000 Subject: hg: jdk8/tl/jdk: 2 new changesets Message-ID: <20121229013626.4A8414743B@hg.openjdk.java.net> Changeset: 0cfcba56cfa7 Author: jgish Date: 2012-12-28 18:32 -0500 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/0cfcba56cfa7 8005594: Fix to 8003265 breaks build Summary: backout changeset 4472a641b4dc Reviewed-by: smarks, wetmore ! src/share/classes/com/sun/jndi/dns/DnsContext.java ! src/share/classes/com/sun/jndi/ldap/BasicControl.java Changeset: ac5e29b62288 Author: smarks Date: 2012-12-28 17:36 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/ac5e29b62288 Merge From henry.jen at oracle.com Sat Dec 29 02:30:55 2012 From: henry.jen at oracle.com (Henry Jen) Date: Fri, 28 Dec 2012 18:30:55 -0800 Subject: RFR 2: JDK-8005263: Logging APIs takes Supplier for message In-Reply-To: <84D3ABF1-2D55-43F9-AF17-7439B36795DF@oracle.com> References: <50D53C0A.6000203@oracle.com>, , , , <50DB9502.4090406@oracle.com>, , <50DCB236.4020709@oracle.com>, , <84D3ABF1-2D55-43F9-AF17-7439B36795DF@oracle.com> Message-ID: <9378FC35-69A0-4152-9C91-102A1895460D@oracle.com> On Dec 28, 2012, at 4:11 PM, Henry Jen wrote: > Next version I'll enable defer message construction until Logger filter check. > On a second thought and after more reading into logging code in JDK, it seems like Filter is mostly applied to Handler instead of Logger, thus it's not really that beneficial. I also didn't find a way to configure Logger filter except programmed via setFilter API, that's another evidence that rarely a filter is applied to a Logger. There is no guarantee that Filter won't cause side-effect with lazy message construction on LogRecord although it's much less likely as Handler could do. Given all those factors, I don't think it's mature to implement. Cheers, Henry From mandy.chung at oracle.com Sat Dec 29 06:25:45 2012 From: mandy.chung at oracle.com (mandy.chung at oracle.com) Date: Sat, 29 Dec 2012 06:25:45 +0000 Subject: hg: jdk8/tl: 8003562: Provide a CLI tool to analyze class dependencies Message-ID: <20121229062545.A48AB47443@hg.openjdk.java.net> Changeset: c37401e77c80 Author: mchung Date: 2012-12-28 22:20 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/rev/c37401e77c80 8003562: Provide a CLI tool to analyze class dependencies Reviewed-by: jjg, alanb, ulfzibis, erikj ! common/bin/compare_exceptions.sh.incl From mandy.chung at oracle.com Sat Dec 29 06:27:27 2012 From: mandy.chung at oracle.com (mandy.chung at oracle.com) Date: Sat, 29 Dec 2012 06:27:27 +0000 Subject: hg: jdk8/tl/jdk: 8003562: Provide a CLI tool to analyze class dependencies Message-ID: <20121229062815.2274F47444@hg.openjdk.java.net> Changeset: 28b47ed08c63 Author: mchung Date: 2012-12-28 22:21 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/28b47ed08c63 8003562: Provide a CLI tool to analyze class dependencies Reviewed-by: jjg, alanb, ulfzibis, erikj ! make/common/Release.gmk ! make/docs/NON_CORE_PKGS.gmk ! make/launchers/Makefile ! make/launchers/Makefile.launcher ! makefiles/CompileLaunchers.gmk ! makefiles/CreateJars.gmk ! makefiles/Images.gmk From mandy.chung at oracle.com Sat Dec 29 06:31:06 2012 From: mandy.chung at oracle.com (mandy.chung at oracle.com) Date: Sat, 29 Dec 2012 06:31:06 +0000 Subject: hg: jdk8/tl/langtools: 8003562: Provide a CLI tool to analyze class dependencies Message-ID: <20121229063119.DD3B047445@hg.openjdk.java.net> Changeset: 0c244701188e Author: mchung Date: 2012-12-28 22:25 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/0c244701188e 8003562: Provide a CLI tool to analyze class dependencies Reviewed-by: jjg, alanb, ulfzibis, erikj ! make/build.properties ! makefiles/BuildLangtools.gmk ! src/share/classes/com/sun/tools/classfile/Dependencies.java ! src/share/classes/com/sun/tools/classfile/Dependency.java + src/share/classes/com/sun/tools/jdeps/Archive.java + src/share/classes/com/sun/tools/jdeps/ClassFileReader.java + src/share/classes/com/sun/tools/jdeps/JdepsTask.java + src/share/classes/com/sun/tools/jdeps/Main.java + src/share/classes/com/sun/tools/jdeps/PlatformClassPath.java + src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties + src/share/classes/com/sun/tools/jdeps/resources/jdk.properties + src/share/classes/com/sun/tools/jdeps/resources/version.properties-template ! test/Makefile + test/tools/jdeps/Basic.java + test/tools/jdeps/Test.java + test/tools/jdeps/p/Foo.java From chris.hegarty at oracle.com Sat Dec 29 11:01:17 2012 From: chris.hegarty at oracle.com (chris.hegarty at oracle.com) Date: Sat, 29 Dec 2012 11:01:17 +0000 Subject: hg: jdk8/tl/jdk: 8005556: java/net/Socks/SocksV4Test.java is missing @run tag Message-ID: <20121229110200.0BEA247449@hg.openjdk.java.net> Changeset: 3cc25d0e3bb0 Author: chegar Date: 2012-12-29 11:00 +0000 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/3cc25d0e3bb0 8005556: java/net/Socks/SocksV4Test.java is missing @run tag Reviewed-by: alanb ! test/java/net/Socks/SocksV4Test.java From tbuktu at hotmail.com Sat Dec 29 14:18:01 2012 From: tbuktu at hotmail.com (Tim Buktu) Date: Sat, 29 Dec 2012 15:18:01 +0100 Subject: Review Request: BigInteger patch for efficient multiplication and division (#4837946) Message-ID: Hello, I updated my patch that speeds up multiplication and division of large BigIntegers. The changes vs. the older patch were trivial. BigInteger.java: https://gist.github.com/1576025 Diff against current BigInteger: https://gist.github.com/1576016 The patch to the unit test still applies. BigIntegerTest.java: https://gist.github.com/1586990 Diff against current BigIntegerTest.java: https://gist.github.com/1586984 See the original posts at http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-January/008860.html and http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-January/008875.html Comments and critique are appreciated. Thanks, Tim From stevenschlansker at gmail.com Sat Dec 29 17:25:06 2012 From: stevenschlansker at gmail.com (Steven Schlansker) Date: Sat, 29 Dec 2012 09:25:06 -0800 Subject: Improving performance and reducing object allocations of java.util.UUID to/from string Message-ID: <1D5C783C-A599-4FD5-B6C2-4346662AA02F@gmail.com> Hello core-libs-dev, My company uses UUIDs throughout our software. We recently identified that the java.util.UUID implementations of fromString and toString are horridly inefficient. An incomplete list of the inefficiencies: * fromString uses a regular expression that is not even precompiled * fromString uses a regular expression to parse out the "-" markers, requiring the allocation of many String and String[] objects, when a simple linear scan works just fine * fromString unnecessarily allocates multiple Long objects * toString creates a char[64], a String object which copies that, and a sub-String object for *each* of the 5 hex digit segments * toString produces a fixed-length result but involves multiple StringBuilder concatenations Everyone that I have shown the relevant code to has been horrified by the complete lack of care towards object allocations. While I am a big fan of the "object allocation is free until otherwise proven" philosophy, we traced multiple production problems down to these hotspots. But instead of just whining about it, I wish to contribute a patch which I believe fixes the problem. This is my first attempt to submit anything to the JDK, so please be nice :-) My initial attempt has yielded micro benchmarks with very favorable outcomes. By taking the appropriate code from java.lang.Long, modifying it to work on a single pre-allocated array+offset rather than returning a String, and scanning for dashes instead of regex splitting I reduced times 3-6x and object allocations to the low single digits. My Google Caliper benchmark is available here, to ensure that I have not committed any benchmark sins: https://gist.github.com/4356621 benchmark instances Bytes ns linear runtime JdkUuidFromString 51.00 1544.0 608.2 ============================== NewUuidFromString 2.00 72.0 179.1 ======== JdkUuidToString 31.00 1720.0 321.4 =============== NewUuidToString 3.00 200.0 51.5 == In particular, the reduction of object allocations from ~1.5KB to 72/200 bytes dramatically reduces GC pressure when you sit in a tight loop deserializing millions of UUIDs from strings. I believe the same patch can (and should?) apply to jdk7u and jdk8, as the code does not seem to have changed. I would appreciate any feedback on the code style, efficiency, or correctness that you can offer. I have run the "java/util/UUID" jtreg suite against this and it passes. We stole the more thorough Apache Harmony tests for this and they pass as well: https://github.com/stevenschlansker/components-ness-core/blob/master/src/test/java/com/nesscomputing/uuid/TestNessUUID.java I have not yet secured a CLA, but my company is in the process of signing one. The rest of the message is a "hg export" of my change set, which is current to the tip of jdk7. Happy holidays, and thank you for your time! Steven Schlansker # HG changeset patch # User Steven Schlansker # Date 1356737383 0 # Node ID a812c963b96f08112f6805cbc380b12af196f788 # Parent 9b8c96f96a0f9a5801b55530a387fefbe50482a3 java.util.UUID: improve performance of UUID#toString and UUID#fromString by avoiding many unnecessary object allocations. benchmark instances Bytes ns linear runtime JdkUuidFromString 51.00 1544.0 608.2 ============================== NewUuidFromString 2.00 72.0 179.1 ======== JdkUuidToString 31.00 1720.0 321.4 =============== NewUuidToString 3.00 200.0 51.5 == diff -r 9b8c96f96a0f -r a812c963b96f src/share/classes/java/util/UUID.java --- a/src/share/classes/java/util/UUID.java Mon Jun 27 13:21:34 2011 -0700 +++ b/src/share/classes/java/util/UUID.java Fri Dec 28 23:29:43 2012 +0000 @@ -189,26 +189,79 @@ * described in {@link #toString} * */ - public static UUID fromString(String name) { - String[] components = name.split("-"); - if (components.length != 5) - throw new IllegalArgumentException("Invalid UUID string: "+name); - for (int i=0; i<5; i++) - components[i] = "0x"+components[i]; + public static UUID fromString(String str) { + int dashCount = 4; + int [] dashPos = new int [6]; + dashPos[0] = -1; + dashPos[5] = str.length(); - long mostSigBits = Long.decode(components[0]).longValue(); + for (int i = str.length()-1; i >= 0; i--) { + if (str.charAt(i) == '-') { + if (dashCount == 0) { + throw new IllegalArgumentException("Invalid UUID string: " + str); + } + dashPos[dashCount--] = i; + } + } + + if (dashCount > 0) { + throw new IllegalArgumentException("Invalid UUID string: " + str); + } + + long mostSigBits = decode(str, dashPos, 0) & 0xffffffffL; mostSigBits <<= 16; - mostSigBits |= Long.decode(components[1]).longValue(); + mostSigBits |= decode(str, dashPos, 1) & 0xffffL; mostSigBits <<= 16; - mostSigBits |= Long.decode(components[2]).longValue(); + mostSigBits |= decode(str, dashPos, 2) & 0xffff); - long leastSigBits = Long.decode(components[3]).longValue(); + long leastSigBits = decode(str, dashPos, 3) & 0xffffL; leastSigBits <<= 48; - leastSigBits |= Long.decode(components[4]).longValue(); + leastSigBits |= decode(str, dashPos, 4) & 0xffffffffffffL; return new UUID(mostSigBits, leastSigBits); } + private static long decode(final String str, final int [] dashPos, final int field) { + int start = dashPos[field]+1; + int end = dashPos[field+1]; + if (start >= end) { + throw new IllegalArgumentException("Invalid UUID string: " + str); + } + long curr = 0; + for (int i = start; i < end; i++) { + int x = getNibbleFromChar(str.charAt(i)); + curr <<= 4; + if (curr < 0) { + throw new NumberFormatException("long overflow"); + } + curr |= x; + } + return curr; + } + + private static final int NUM_ALPHA_DIFF = 'A' - '9' - 1; + private static final int LOWER_UPPER_DIFF = 'a' - 'A'; + + private static int getNibbleFromChar(final char c) + { + int x = c - '0'; + if (x > 9) { + x -= NUM_ALPHA_DIFF; // difference between '9' and 'A' + if (x > 15) { + x -= LOWER_UPPER_DIFF; // difference between 'a' and 'A' + } + if (x < 10) { + throw new IllegalArgumentException(c + " is not a valid character for an UUID string"); + } + } + + if (x < 0 || x > 15) { + throw new IllegalArgumentException(c + " is not a valid character for an UUID string"); + } + + return x; + } + // Field Accessor Methods /** @@ -372,19 +425,46 @@ * @return A string representation of this {@code UUID} */ public String toString() { - return (digits(mostSigBits >> 32, 8) + "-" + - digits(mostSigBits >> 16, 4) + "-" + - digits(mostSigBits, 4) + "-" + - digits(leastSigBits >> 48, 4) + "-" + - digits(leastSigBits, 12)); + return toString(getMostSignificantBits(), getLeastSignificantBits()); } - /** Returns val represented by the specified number of hex digits. */ - private static String digits(long val, int digits) { - long hi = 1L << (digits * 4); - return Long.toHexString(hi | (val & (hi - 1))).substring(1); + public static String toString(long msb, long lsb) { + char[] uuidChars = new char[36]; + + hexDigits(uuidChars, 0, 8, msb >> 32); + uuidChars[8] = '-'; + hexDigits(uuidChars, 9, 4, msb >> 16); + uuidChars[13] = '-'; + hexDigits(uuidChars, 14, 4, msb); + uuidChars[18] = '-'; + hexDigits(uuidChars, 19, 4, lsb >> 48); + uuidChars[23] = '-'; + hexDigits(uuidChars, 24, 12, lsb); + + return new String(uuidChars); } + private static void hexDigits(char[] dest, int offset, int digits, long val) { + long hi = 1L << (digits * 4); + toUnsignedString(dest, offset, digits, hi | (val & (hi - 1)), 4); + } + + private final static char[] HEX_DIGITS = { + '0' , '1' , '2' , '3' , '4' , '5' , + '6' , '7' , '8' , '9' , 'a' , 'b' , + 'c' , 'd' , 'e' , 'f' + }; + + private static void toUnsignedString(char[] dest, int offset, int len, long i, int shift) { + int charPos = len; + int radix = 1 << shift; + long mask = radix - 1; + do { + dest[offset + --charPos] = HEX_DIGITS[(int)(i & mask)]; + i >>>= shift; + } while (i != 0 && charPos > 0); + } + /** * Returns a hash code for this {@code UUID}. * From kelly.ohair at oracle.com Sat Dec 29 20:51:33 2012 From: kelly.ohair at oracle.com (Kelly O'Hair) Date: Sat, 29 Dec 2012 12:51:33 -0800 Subject: RMI java processes left running on JPRT systems Message-ID: <576B79E0-7EB5-4715-9C83-A8C53827F8F6@oracle.com> FYI... After shutting down JPRT I found two systems with ActivationGroupInit java processes running. I am assuming that a test case has fired them up and forgotten about them??? Not sure why JPRT did not kill them automatically... -kto jprtadm at sc11136053:~> jps -l -m 11651 sun.tools.jps.Jps -l -m 16530 sun.rmi.server.ActivationGroupInit jprtadm at sc11136053:~> ps -fel | fgrep java 0 S jprtadm 11669 11603 0 80 0 - 511 pipe_w 12:35 pts/0 00:00:00 fgrep java 0 S jprtadm 16530 1 0 80 0 - 239212 futex_ Dec27 ? 00:01:02 /opt/jprt/T/P1/211212.chhegar/testproduct/linux_i586_2.6-product/jre/bin/java -Djava.security.manager=default -Djava.security.policy=/opt/jprt/T/P1/211212.chhegar/s/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/group.security.policy -DunregisterGroup.port=53315 -Dtest.src=/opt/jprt/T/P1/211212.chhegar/s/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup -Dtest.classes=/opt/jprt/T/P1/211212.chhegar/s/jdk/build/linux-i586/testoutput/jdk_rmi/JTwork/classes/java/rmi/activation/ActivationSystem/unregisterGroup sun.rmi.server.ActivationGroupInit jprtadm at sc11136053:~> uname -a Linux sc11136053 2.6.27.25-78.2.56.fc9.i686 #1 SMP Thu Jun 18 12:47:50 EDT 2009 i686 i686 i386 GNU/Linux jprtadm at sc11136053:~> jprtadm at sc11136024:~> jps -l -m 17187 sun.rmi.server.ActivationGroupInit 5809 sun.tools.jps.Jps -l -m 12314 sun.rmi.server.ActivationGroupInit jprtadm at sc11136024:~> ps -fel | fgrep java 0 S jprtadm 12314 1 0 80 0 - 239252 futex_ Dec26 ? 00:01:26 /opt/jprt/T/P1/172428.jzavgren/testproduct/linux_i586_2.6-product/jre/bin/java -Djava.security.manager=default -DunregisterGroup.port=42896 -Djava.security.policy=/opt/jprt/T/P1/172428.jzavgren/s/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/group.security.policy -Dtest.src=/opt/jprt/T/P1/172428.jzavgren/s/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup -Dtest.classes=/opt/jprt/T/P1/172428.jzavgren/s/jdk/build/linux-i586/testoutput/jdk_rmi/JTwork/classes/java/rmi/activation/ActivationSystem/unregisterGroup sun.rmi.server.ActivationGroupInit 0 S jprtadm 17187 1 0 80 0 - 239231 futex_ Dec27 ? 00:00:52 /opt/jprt/T/P1/020528.jcg-int/testproduct/linux_i586_2.6-product/jre/bin/java -Djava.security.policy=/opt/jprt/T/P1/020528.jcg-int/s/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/group.security.policy -Djava.security.manager=default -DunregisterGroup.port=43443 -Dtest.src=/opt/jprt/T/P1/020528.jcg-int/s/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup -Dtest.classes=/opt/jprt/T/P1/020528.jcg-int/s/jdk/build/linux-i586/testoutput/jdk_rmi/JTwork/classes/java/rmi/activation/ActivationSystem/unregisterGroup sun.rmi.server.ActivationGroupInit From jonathan.gibbons at oracle.com Sun Dec 30 01:33:30 2012 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Sun, 30 Dec 2012 01:33:30 +0000 Subject: hg: jdk8/tl/langtools: 8004727: Add compiler support for parameter reflection Message-ID: <20121230013335.3541C47452@hg.openjdk.java.net> Changeset: 31780dd06ec7 Author: jjg Date: 2012-12-29 17:33 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/31780dd06ec7 8004727: Add compiler support for parameter reflection Reviewed-by: jjg Contributed-by: eric.mccorkle at oracle.com ! src/share/classes/com/sun/tools/classfile/Attribute.java ! src/share/classes/com/sun/tools/classfile/ClassWriter.java + src/share/classes/com/sun/tools/classfile/MethodParameters_attribute.java ! src/share/classes/com/sun/tools/javac/code/Symbol.java ! src/share/classes/com/sun/tools/javac/jvm/ClassReader.java ! src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java ! src/share/classes/com/sun/tools/javac/main/Option.java ! src/share/classes/com/sun/tools/javac/resources/javac.properties ! src/share/classes/com/sun/tools/javac/util/Names.java ! src/share/classes/com/sun/tools/javap/AttributeWriter.java + test/tools/javac/MethodParameters.java + test/tools/javap/MethodParameters.java From jonathan.gibbons at oracle.com Sun Dec 30 14:20:43 2012 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Sun, 30 Dec 2012 14:20:43 +0000 Subject: hg: jdk8/tl/langtools: 8005195: Doclint regression tests fail on windows Message-ID: <20121230142048.B011E4745A@hg.openjdk.java.net> Changeset: 383bc0fbd759 Author: jjg Date: 2012-12-30 06:17 -0800 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/383bc0fbd759 8005195: Doclint regression tests fail on windows Reviewed-by: mcimadamore ! test/tools/doclint/DocLintTester.java From vladimir.kozlov at oracle.com Thu Dec 20 19:21:48 2012 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Thu, 20 Dec 2012 19:21:48 -0000 Subject: RFR (XS): CR 8004330: Add missing Unsafe entry points for addAndGet() family In-Reply-To: <50D36104.8000701@oracle.com> References: <50D36104.8000701@oracle.com> Message-ID: <50D3654F.2030106@oracle.com> Looks good for me. I will sponsor these changes after we get a review from JDK side. Thanks, Vladimir On 12/20/12 11:03 AM, Aleksey Shipilev wrote: > Hi, > > Sorry for cross-list posting, but this change affects both HS and JDK. > > This simple change is missing from recently committed CR 7023898. While > the VM support is there in Hotspot, no methods are exposed in Unsafe to > actually make use of those intrinsics. This is the webrev fixing that: > http://cr.openjdk.java.net/~shade/8004330/webrev.00/ > > It turns out the getAndSet intrinsics HotSpot are overloaded, which had > deluged both Doug and me in the previous patch. These namings are > inconsistent with other Unsafe intrinsic naming convention, so this > change fixes that as well. > > Testing: > - Built and tested in Linux x86_64 > - java-concurrency-torture [1] atomicity tests are passed for > AtomicIntegerV8 [2] and AtomicLongV8 [3] making use of those intrinsics > on Linux x86_64 > - running the java-concurrency-torture tests "-XX:+PrintInlining | > grep Unsafe" tells all intrinsics have been successfully inlined > - no other testing is expected for this trivial change. > > I would need a sponsor to push this. Thanks for your patience and reviews! > > Contributors: > - dl: original patch, testing > - shade: due diligence, messing with reviews, tests, and rebuilds > > -Aleksey. > > [1] https://github.com/shipilev/java-concurrency-torture/ > [2] > https://github.com/shipilev/java-concurrency-torture/blob/master/src/main/java/org/openjdk/concurrent/torture/tests/atomics/integer/AtomicIntegerV8PairwiseTests.java > [3] > https://github.com/shipilev/java-concurrency-torture/blob/master/src/main/java/org/openjdk/concurrent/torture/tests/atomics/longs/AtomicLongV8PairwiseTests.java >