From aph at redhat.com Sat Apr 1 08:55:22 2017 From: aph at redhat.com (Andrew Haley) Date: Sat, 1 Apr 2017 09:55:22 +0100 Subject: RFR 9: 8165641 : Deprecate Object.finalize In-Reply-To: References: <96fe9ae0-993a-aea6-cabf-f079450dc128@Oracle.com> <49eb0b85-130a-b74d-e760-120674de6ebc@oracle.com> Message-ID: On 31/03/17 19:56, Hans Boehm wrote: > This method should be used when cleanup actions (finalize() calls, or > Reference enqueuing, Cleaner invocation) could otherwise be triggered while > a resource under control of the object is still in use. This method should > normally be called when these cleanup facilities are used to perform > actions other than simply issuing a warning. It's still pretty confusing. It would be simpler to say that reachabilityFence should be used at the end of every method of a class which has cleanup actions if you don't want those cleanup actions to be run before the end of that method. In that case, reachabilityFence only makes any difference in cases where otherwise you'd have a bug. Andrew. From hboehm at google.com Sat Apr 1 17:19:05 2017 From: hboehm at google.com (Hans Boehm) Date: Sat, 1 Apr 2017 10:19:05 -0700 Subject: RFR 9: 8165641 : Deprecate Object.finalize In-Reply-To: References: <96fe9ae0-993a-aea6-cabf-f079450dc128@Oracle.com> <49eb0b85-130a-b74d-e760-120674de6ebc@oracle.com> Message-ID: That also sounds fine to me. The difficulty with applying this, especially in the JNI case, is that you may need several reachability fences at the end of each method, guarding parameters and temporaries, not all of which may be naturally in scope at the end. But we're not going to be able to include a full discussion here. In the interest of full disclosure, we currently, at least temporarily, dodge this issue by inhibiting dead variable elimination for references. On Apr 1, 2017 01:55, "Andrew Haley" wrote: On 31/03/17 19:56, Hans Boehm wrote: > This method should be used when cleanup actions (finalize() calls, or > Reference enqueuing, Cleaner invocation) could otherwise be triggered while > a resource under control of the object is still in use. This method should > normally be called when these cleanup facilities are used to perform > actions other than simply issuing a warning. It's still pretty confusing. It would be simpler to say that reachabilityFence should be used at the end of every method of a class which has cleanup actions if you don't want those cleanup actions to be run before the end of that method. In that case, reachabilityFence only makes any difference in cases where otherwise you'd have a bug. Andrew. From claes.redestad at oracle.com Mon Apr 3 14:31:35 2017 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 3 Apr 2017 16:31:35 +0200 Subject: [10] RFR: 8177631: Outdated performance advice in StringCoding Message-ID: <7241b6b2-a43b-1b1d-4e6b-8a24f9268b0b@oracle.com> Hi, Class.getClassLoader0 was once an expensive native operation, but since JDK-6642881 was fixed it is now a simple getter, retrieving a final field injected during class load. Thus the advice in StringCoding that getClass().getClassLoader0 is expensive should be removed. Webrev: http://cr.openjdk.java.net/~redestad/8177631/jdk.01/ Bugs: https://bugs.openjdk.java.net/browse/JDK-8177631 Thanks! /Claes From Roger.Riggs at Oracle.com Mon Apr 3 14:44:16 2017 From: Roger.Riggs at Oracle.com (Roger Riggs) Date: Mon, 3 Apr 2017 10:44:16 -0400 Subject: RFR 9: 8165641 : Deprecate Object.finalize In-Reply-To: <31a37a8c-e3fd-96cf-00a4-090d65c21cff@Oracle.com> References: <96fe9ae0-993a-aea6-cabf-f079450dc128@Oracle.com> <49eb0b85-130a-b74d-e760-120674de6ebc@oracle.com> <31a37a8c-e3fd-96cf-00a4-090d65c21cff@Oracle.com> Message-ID: <78e0fb3c-0850-4aa9-9f73-e319e8a8e7b9@Oracle.com> The api note for Object.finalize is not an optimal location for this more general advice, but is good as far as it can go in relation to the current changes to deprecate Object.finalize(). The webrev[1] is updated to add a paragraph to the apiNote[2]: * @apiNote * Classes that embed non-heap resources have a number of options * for cleanup of those resources. The class must ensure that the * lifetime of each instance is longer than that of any resource it embeds. * {@link java.lang.ref.Reference#reachabilityFence} can be used to ensure that * objects remain reachable while resources embedded in the object are in use. Regards, Roger [1] http://cr.openjdk.java.net/~rriggs/webrev-finalize-deprecate-8165641 [2] http://cr.openjdk.java.net/~rriggs/webrev-finalize-deprecate-8165641/src/java.base/share/classes/java/lang/Object.java.sdiff.html From xueming.shen at oracle.com Mon Apr 3 15:29:27 2017 From: xueming.shen at oracle.com (Xueming Shen) Date: Mon, 03 Apr 2017 08:29:27 -0700 Subject: [10] RFR: 8177631: Outdated performance advice in StringCoding In-Reply-To: <7241b6b2-a43b-1b1d-4e6b-8a24f9268b0b@oracle.com> References: <7241b6b2-a43b-1b1d-4e6b-8a24f9268b0b@oracle.com> Message-ID: <58E26A57.2020005@oracle.com> +1 On 4/3/17, 7:31 AM, Claes Redestad wrote: > Hi, > > Class.getClassLoader0 was once an expensive native operation, but > since JDK-6642881 > was fixed it is now a simple getter, retrieving a final field injected > during class load. > Thus the advice in StringCoding that getClass().getClassLoader0 is > expensive should be > removed. > > Webrev: http://cr.openjdk.java.net/~redestad/8177631/jdk.01/ > Bugs: https://bugs.openjdk.java.net/browse/JDK-8177631 > > Thanks! > > /Claes From weijun.wang at oracle.com Mon Apr 3 15:30:34 2017 From: weijun.wang at oracle.com (Weijun Wang) Date: Mon, 3 Apr 2017 23:30:34 +0800 Subject: [9] RFR 8177969: Faster FilePermission::implies by avoiding the use of Path::relativize Message-ID: <4f1e0c02-a11d-2694-84ad-cf8804021f3c@oracle.com> http://cr.openjdk.java.net/~weijun/8177969/webrev.00/ This new implementation of containsPath(Path,Path) uses the logic of Path::relativize without directly calling it, which is much faster now. Thanks Max From claes.redestad at oracle.com Mon Apr 3 15:29:26 2017 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 3 Apr 2017 17:29:26 +0200 Subject: [10] RFR: 8177631: Outdated performance advice in StringCoding In-Reply-To: <58E26A57.2020005@oracle.com> References: <7241b6b2-a43b-1b1d-4e6b-8a24f9268b0b@oracle.com> <58E26A57.2020005@oracle.com> Message-ID: On 04/03/2017 05:29 PM, Xueming Shen wrote: > +1 Thanks Sherman! /Claes From hboehm at google.com Mon Apr 3 17:34:17 2017 From: hboehm at google.com (Hans Boehm) Date: Mon, 3 Apr 2017 10:34:17 -0700 Subject: RFR 9: 8165641 : Deprecate Object.finalize In-Reply-To: <78e0fb3c-0850-4aa9-9f73-e319e8a8e7b9@Oracle.com> References: <96fe9ae0-993a-aea6-cabf-f079450dc128@Oracle.com> <49eb0b85-130a-b74d-e760-120674de6ebc@oracle.com> <31a37a8c-e3fd-96cf-00a4-090d65c21cff@Oracle.com> <78e0fb3c-0850-4aa9-9f73-e319e8a8e7b9@Oracle.com> Message-ID: Thanks! I think that helps a lot. On Mon, Apr 3, 2017 at 7:44 AM, Roger Riggs wrote: > The api note for Object.finalize is not an optimal location for this more > general advice, > but is good as far as it can go in relation to the current changes to > deprecate Object.finalize(). > > The webrev[1] is updated to add a paragraph to the apiNote[2]: > > * @apiNote > * Classes that embed non-heap resources have a number of options > * for cleanup of those resources. The class must ensure that the > * lifetime of each instance is longer than that of any resource it > embeds. > * {@link java.lang.ref.Reference#reachabilityFence} can be used to > ensure that > * objects remain reachable while resources embedded in the object are > in use. > > Regards, Roger > > [1] http://cr.openjdk.java.net/~rriggs/webrev-finalize-deprecate-8165641 > [2] http://cr.openjdk.java.net/~rriggs/webrev-finalize-deprecate > -8165641/src/java.base/share/classes/java/lang/Object.java.sdiff.html > From paul.sandoz at oracle.com Mon Apr 3 19:39:28 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 3 Apr 2017 12:39:28 -0700 Subject: RFR [9] 8177738: Runtime.Version must be a value-based class In-Reply-To: References: Message-ID: Hi, 962 * [1-9][0-9]*((\.0)*\.[1-9][0-9]*)* You removed the initial ?^? which is still mentioned in JDK-8148822 < `^[1-9][0-9]*(((\.0)*\.[1-9][0-9]*)*)*$`. The sequence may be of arbitrary --- > `^[1-9][0-9]*((\.0)*\.[1-9][0-9]*)*$`. The sequence may be of arbitrary JEP 223 is still using the former. Which is correct? Since Version is now value based i think you need to check where it?s identity is used and replace with equals (which means ensuring that equals is efficient and could use identity under the covers). See usages in JarFile. ? Separately i wish we could avoid using List as the internal representation, it?s very inefficient, int[] is much better, the cost is then on the version() method but it?s easy to create an immutable List wrapping the array. (I logged an issue for that, but cannot remember the number.) You patch gets us closer to that, especially with the change to parseVersionNumbers method. Paul. > On 30 Mar 2017, at 10:04, Pavel Rappo wrote: > > Hello, > > Please review the following change: > > http://cr.openjdk.java.net/~prappo/8177738/webrev.00/ > > This is an attempt to resolve a group of issues related to Version-String API > and its implementation: > > 8177738: Runtime.Version must be a value-based class > 8148822: (spec) Regex in Runtime.Version and JEP 223 should match > 8160954: (spec) Runtime.Version regex and $PRE/$OPT issues > 8148877: (spec) Specify when an empty '+' is required in a version string > > A good amount of work has been already done here and we just need to finish it. > Let me explain what this patch does starting from the most trivial changes. > > - Fixes certain javadoc issues [a] (e.g. dangling html tags, overly qualified > symbol references in @link tags, etc.) > > - Refactors Basic.java test, making it a little bit easier to read/modify this > test in the future. > > - Addresses [2] in Runtime.java:963,1050. In addition I've rephrased Runtime.java:951 > to reflect the fact a version string contains only the mentioned components and > nothing else. In other words, $VSTR *matches* a valid version-string rather than > *finds* itself somewhere in this version-string. > > - Makes Runtime.Version a value-based class [1][5]. The class has gotten `final` > modifier, the only constructor has become private and the usual (in this case) > verbiage has been added to the javadoc. Before that, Runtime.Version had ticked > all other the boxes in the value-based class checklist already. > > - Improves $VNUM list mechanics in VersionProps.java.template and Runtime.java:1149-1153 > by providing immutable list instead of unmodifiable. This change has become > possible due to the fact Runtime.Version constructor has become private and, > thus, all the callers are known and trusted. > > - Removes redundant/explicit javadoc declarations in `hashCode`, `equals` and > `compareTo` methods. These methods are documented needlessly explicit. The only > truly justified comment sits inside `compareToIgnoreOptional` method. > Since `compareToIgnoreOptional` and `equalsIgnoreOptional` are not inherited, > I marked the "consistent-with" relationship between them explicitly [c]. > > - Now a few words about a not-so-pleasant part which addresses [3][4]. In a > nutshell the regex-style format ($VSTR) which is used in the spec to define the > version-string, matches all valid version strings and *some more*. > > Here's the format: > > $VNUM(-$PRE)?(\+($BUILD)?(-$OPT)?)? > > If we expand all optional elements we will get the following 8 possibilities: > > ## $VSTR $PRE $BUILD $OPT EXAMPLE > -------------------------------------------------------------------------------- > 1 $VNUM 0 0 0 9.0.1 > 2 $VNUM+-$OPT 0 0 1 9.0.1+-longcat.dev > 3 $VNUM+$BUILD 0 1 0 9.0.1+256 > 4 $VNUM+$BUILD-$OPT 0 1 1 9.0.1+256-longcat.dev > 5 $VNUM-$PRE 1 0 0 9.0.1-ea > * 6 $VNUM-$PRE+-$OPT 1 0 1 9.0.1-ea+-longcat.dev > 7 $VNUM-$PRE+$BUILD 1 1 0 9.0.1-ea+256 > 8 $VNUM-$PRE+$BUILD-$OPT 1 1 1 9.0.1-ea+256-longcat.dev > > Now, ##6 was disallowed by design. In the case when $BUILD is not present, but > both $PRE and $OPT are, the $VSTR will instead look like this: > > 6 $VNUM-$PRE-$OPT 1 0 1 9.0.1-ea-longcat.dev > > (i.e. without the "+" separator). > > This is a problem because it means that in addition to the format it needs a > clear description of exceptional cases which are to be subtracted from the set > of matched version-strings. Such a description has been proposed in [6] (you can > have a look at the webrev that thread refers to): > > *

If the build number is unset, then {@code '+'} may only be present > * when {@code $OPT} is present and {@code $PRE} is not. > > It indeed may be a satisfactory solution. However I would argue that it's > probably not the best one. I suspect spec readers will jump straight to the > format completely missing "the special case" paragraph simply because the format > attracts attention and neatly defines the version-string. Neatly but wrongly. > > Another option would be to split the $VSTR format into a minimal number of > sub-cases (e.g. Runtime:1032-1034). This will require no extra "special case" > paragraph and will draw reader's attention to all the subtleties on the spot. > > # ## > -------------------------------------------------------------------------------- > 1 $VNUM(-$PRE)?\+$BUILD(-$OPT)? 3, 4, 7, 8 > 2 $VNUM-$PRE(-$OPT)? 5, 6 > 3 $VNUM(+-$OPT)? 1, 2 > > One more option would be to require "+" to be there in the case where any > component to the right from $PRE is present (i.e. $BUILD or $OPT or both). > This will greatly simplify the rules and allow the $VSTR to stay as it is today. > > This option would affect only the case ##6: > > 6 $VNUM-$PRE+-$OPT 1 0 1 9.0.1-ea+-longcat.dev > ^^ > Yes, it looks a bit ugly, but we already have this ugliness in case 2 (and we > can't get rid of it because of [3]): > > 2 $VNUM+-$OPT 0 0 1 9.0.1+-longcat.dev > ^^ > I suspect both 2 and 6 will be pretty rare anyway as it would mean optional > build information is there, but the build number is not. > Sounds like a corner case to me. > > Thanks, > -Pavel > > -------------------------------------------------------------------------------- > [1] https://bugs.openjdk.java.net/browse/JDK-8177738 > [2] https://bugs.openjdk.java.net/browse/JDK-8148822 > [3] https://bugs.openjdk.java.net/browse/JDK-8148877 > [4] https://bugs.openjdk.java.net/browse/JDK-8160954 > [5] http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-March/046813.html > [6] http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-October/044277.html > > [a] If you build locally or use promoted builds, please keep in mind there's a > known issue with rendering documentation for Runtime.Version in > some browsers: https://bugs.openjdk.java.net/browse/JDK-8177727 > [b] Startup time/memory footprint might benefit as well (it will definitely > require some benchmarking to determine if it is the case) > [c] Even though I'm fully aware I do not have the full knowledge the design > decisions were based upon, I must say I fail to see why equalsIgnoreOptional > and compareToIgnoreOptional methods have been introduced from the day 1. > It looks like something that could be neatly solved by providing a custom > Comparator if needed. > From paul.sandoz at oracle.com Mon Apr 3 20:05:12 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 3 Apr 2017 13:05:12 -0700 Subject: RFR: jsr166 jdk10 integration wave 1 In-Reply-To: References: Message-ID: Hi, Looks good. It?s trivial but we probably require a CCC for ScheduledThreadPoolExecutor calling out the NPE for null unit argument values, to clarify pool sizes of TPE, and to clarify that AbortPolicy default handler for TPE *and* STPE. We are not quite there yet with the CCC being open (soon i hope!), so i can create the CCC for you. Paul. > On 30 Mar 2017, at 14:38, Martin Buchholz wrote: > > OK, this wave is open for review again. > > On Wed, Mar 29, 2017 at 12:57 PM, Martin Buchholz wrote: > Oops. Martin forgot to check ScheduledExecutorService, and there's some overlap in specs, which requires some rework. > > On Wed, Mar 29, 2017 at 11:43 AM, Martin Buchholz wrote: > First jdk10 integration > > http://cr.openjdk.java.net/~martin/webrevs/openjdk10/jsr166-integration/ > > Mostly focused on thread pools. > > From pavel.rappo at oracle.com Mon Apr 3 23:40:30 2017 From: pavel.rappo at oracle.com (Pavel Rappo) Date: Tue, 4 Apr 2017 00:40:30 +0100 Subject: RFR [9] 8177738: Runtime.Version must be a value-based class In-Reply-To: References: Message-ID: <23774589-8C1C-4BA1-B5E8-4A25BCF58560@oracle.com> > On 3 Apr 2017, at 20:39, Paul Sandoz wrote: > > Hi, > > 962 * [1-9][0-9]*((\.0)*\.[1-9][0-9]*)* > > You removed the initial ?^? which is still mentioned in JDK-8148822 > > < `^[1-9][0-9]*(((\.0)*\.[1-9][0-9]*)*)*$`. The sequence may be of arbitrary > --- >> `^[1-9][0-9]*((\.0)*\.[1-9][0-9]*)*$`. The sequence may be of arbitrary > > JEP 223 is still using the former. Which is correct? The patch from the thread [1] I referred to in my previous email removes ^ and $. So in this case I simply reused the patch and, once again [2], I do agree this is an odd place to use boundary matchers, given $VNUM is only a prefix in $VSTR and not the whole regex. As for the JEP question, it's more for original designers/authors. If we agree on it I will update the JEP. > Since Version is now value based i think you need to check where it?s identity is used and replace with equals (which means ensuring that equals is efficient and could use identity under the covers). See usages in JarFile. Will do, thanks! > ? > > Separately i wish we could avoid using List as the internal representation, it?s very inefficient, int[] is much better, the cost is then on the version() method but it?s easy to create an immutable List wrapping the array. (I logged an issue for that, but cannot remember the number.) What are you concerns specifically? The startup time? The amount of simultaneously existing Version objects at runtime? The use of `Integer` wrapper? -------------------------------------------------------------------------------- [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-October/044277.html [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-March/046941.html From paul.sandoz at oracle.com Mon Apr 3 23:50:47 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 3 Apr 2017 16:50:47 -0700 Subject: RFR [9] 8177738: Runtime.Version must be a value-based class In-Reply-To: <23774589-8C1C-4BA1-B5E8-4A25BCF58560@oracle.com> References: <23774589-8C1C-4BA1-B5E8-4A25BCF58560@oracle.com> Message-ID: <4547C274-290D-442F-BBD6-AB7E7837936A@oracle.com> > On 3 Apr 2017, at 16:40, Pavel Rappo wrote: > > >> On 3 Apr 2017, at 20:39, Paul Sandoz wrote: >> >> Hi, >> >> 962 * [1-9][0-9]*((\.0)*\.[1-9][0-9]*)* >> >> You removed the initial ?^? which is still mentioned in JDK-8148822 >> >> < `^[1-9][0-9]*(((\.0)*\.[1-9][0-9]*)*)*$`. The sequence may be of arbitrary >> --- >>> `^[1-9][0-9]*((\.0)*\.[1-9][0-9]*)*$`. The sequence may be of arbitrary >> >> JEP 223 is still using the former. Which is correct? > > The patch from the thread [1] I referred to in my previous email removes ^ and $. > So in this case I simply reused the patch and, once again [2], I do agree this > is an odd place to use boundary matchers, given $VNUM is only a prefix in $VSTR > and not the whole regex. > > As for the JEP question, it's more for original designers/authors. If we agree > on it I will update the JEP. > Ok, no objections, i was just unsure as to which was the proposed authoritative answer. Perhaps for the record you should also update the description of JDK-8148822? >> Since Version is now value based i think you need to check where it?s identity is used and replace with equals (which means ensuring that equals is efficient and could use identity under the covers). See usages in JarFile. > > Will do, thanks! > >> ? >> >> Separately i wish we could avoid using List as the internal representation, it?s very inefficient, int[] is much better, the cost is then on the version() method but it?s easy to create an immutable List wrapping the array. (I logged an issue for that, but cannot remember the number.) > > What are you concerns specifically? It?s just not particularly efficient to box int to Integer into a List on the heap esp for the expected number of version components, and i suspect the version() method probably not something that will often be called, so taking a hit there with a AbstractList wrapper is fine. It?s quite a simple change, esp. with the the foundation you have set up, so seems worthwhile (separate issue, not this one). Paul. > > The startup time? > The amount of simultaneously existing Version objects at runtime? > The use of `Integer` wrapper? > > -------------------------------------------------------------------------------- > [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-October/044277.html > [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-March/046941.html > > From martinrb at google.com Tue Apr 4 02:51:10 2017 From: martinrb at google.com (Martin Buchholz) Date: Mon, 3 Apr 2017 19:51:10 -0700 Subject: RFR: jsr166 jdk10 integration wave 1 In-Reply-To: References: Message-ID: Thanks! On Mon, Apr 3, 2017 at 1:05 PM, Paul Sandoz wrote: > Hi, > > Looks good. > > It?s trivial but we probably require a CCC for ScheduledThreadPoolExecutor > calling out the NPE for null unit argument values, to clarify pool sizes of > TPE, and to clarify that AbortPolicy default handler for TPE *and* STPE. We > are not quite there yet with the CCC being open (soon i hope!), so i can > create the CCC for you. > > Paul. > > > > On 30 Mar 2017, at 14:38, Martin Buchholz wrote: > > > > OK, this wave is open for review again. > > > > On Wed, Mar 29, 2017 at 12:57 PM, Martin Buchholz > wrote: > > Oops. Martin forgot to check ScheduledExecutorService, and there's some > overlap in specs, which requires some rework. > > > > On Wed, Mar 29, 2017 at 11:43 AM, Martin Buchholz > wrote: > > First jdk10 integration > > > > http://cr.openjdk.java.net/~martin/webrevs/openjdk10/jsr166-integration/ > > > > Mostly focused on thread pools. > > > > > > From claes.redestad at oracle.com Tue Apr 4 13:51:48 2017 From: claes.redestad at oracle.com (Claes Redestad) Date: Tue, 4 Apr 2017 15:51:48 +0200 Subject: Bytestacks: bytecode level diagnostic tool for JVM startup analysis Message-ID: Hi core-libs, some might be aware that I've been working on startup performance, sometimes finding a thing or two in the JDK core libraries that can be improved... Initially this was mostly guess-work based on changes that were found to have caused regressions, but I've also been experimenting with a tool to more systematically visualize and analyze what's going on during startup, bytecode-by-bytecode. This has turned out to be very useful at pinpointing sources of startup regressions, and I've now cleaned it up enough to publish a first version of it: http://cr.openjdk.java.net/~redestad/bytestacks/bytecode-startup-analysis.html I hope someone here will find this useful, and if there's interest in seeing this developed further then I hope I can find it a home in some more formalized (codetools?) project. Thanks! /Claes From joe.darcy at oracle.com Tue Apr 4 17:53:30 2017 From: joe.darcy at oracle.com (joe darcy) Date: Tue, 4 Apr 2017 10:53:30 -0700 Subject: JDK 9 RFR of JDK-8177949: @link tag arguments need correction for ElementType documentation Message-ID: Hello, Please review the innocuous doc-only patch below to fix JDK-8177949: @link tag arguments need correction for ElementType documentation Thanks, -Joe diff -r 1a8997b4292d src/java.base/share/classes/java/lang/annotation/ElementType.java --- a/src/java.base/share/classes/java/lang/annotation/ElementType.java Tue Apr 04 08:10:13 2017 -0700 +++ b/src/java.base/share/classes/java/lang/annotation/ElementType.java Tue Apr 04 10:51:16 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, 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 @@ -28,7 +28,7 @@ /** * The constants of this enumerated type provide a simple classification of the * syntactic locations where annotations may appear in a Java program. These - * constants are used in {@link Target java.lang.annotation.Target} + * constants are used in {@link java.lang.annotation.Target Target} * meta-annotations to specify where it is legal to write annotations of a * given type. * From lance.andersen at oracle.com Tue Apr 4 17:55:15 2017 From: lance.andersen at oracle.com (Lance Andersen) Date: Tue, 4 Apr 2017 13:55:15 -0400 Subject: JDK 9 RFR of JDK-8177949: @link tag arguments need correction for ElementType documentation In-Reply-To: References: Message-ID: +1 > On Apr 4, 2017, at 1:53 PM, joe darcy wrote: > > Hello, > > Please review the innocuous doc-only patch below to fix > > JDK-8177949: @link tag arguments need correction for ElementType documentation > > Thanks, > > -Joe > > > diff -r 1a8997b4292d src/java.base/share/classes/java/lang/annotation/ElementType.java > --- a/src/java.base/share/classes/java/lang/annotation/ElementType.java Tue Apr 04 08:10:13 2017 -0700 > +++ b/src/java.base/share/classes/java/lang/annotation/ElementType.java Tue Apr 04 10:51:16 2017 -0700 > @@ -1,5 +1,5 @@ > /* > - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. > + * Copyright (c) 2003, 2017, 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 > @@ -28,7 +28,7 @@ > /** > * The constants of this enumerated type provide a simple classification of the > * syntactic locations where annotations may appear in a Java program. These > - * constants are used in {@link Target java.lang.annotation.Target} > + * constants are used in {@link java.lang.annotation.Target Target} > * meta-annotations to specify where it is legal to write annotations of a > * given type. > * > 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 stuart.marks at oracle.com Tue Apr 4 19:52:44 2017 From: stuart.marks at oracle.com (Stuart Marks) Date: Tue, 4 Apr 2017 12:52:44 -0700 Subject: JDK 9 RFR(s): 8150488: add note to Scanner.findAll() regardingpossible infinite streams In-Reply-To: References: <58DC7E53.6040603@oracle.com> <58dd2aba.298fdf0a.86cca.3418@mx.google.com> Message-ID: Anything further on this? I'd at least like to add the API note I proposed in order to document this issue. I'm reluctant to start tinkering with the behavior of this method at this late stage in the release. BTW I used Scanner.findAll() in a little programming exercise I worked on the other day. It worked perfectly. :-) s'marks On 3/30/17 2:19 PM, Stuart Marks wrote: > Hi Timo, Sherman, > > Thanks for looking at this. > > Sherman wrote: > >> This might practically put the api itself almost useless? it might be an easy >> task to spot >> whether or not it's a 0-width-match-possible regex when the regex is simple, >> but it gets >> harder and harder, if not impossible when the regex gets complicated, >> especially consider >> the possible use scenario that the use site is embedded deeply inside a >> library implementation. > > Well, not "useless", but perhaps less useful than one might like. :-) > > I think this is potentially surprising behavior, which is why I at least wanted > to add the note. It's not clear to me whether we should try to fix this by > changing Scanner though. > > Essentially, findAll() is defined in terms of findWithinHorizon(pattern, 0). So > if one were to write a loop like so: > > String str; > while ((str = scanner.findWithinHorizon(pattern, 0)) != null) { > System.out.println(str); > } > > then this loop would have the same problem if pattern were to match zero > characters. > >> The alternative is to "fix" it, maybe as what Matcher.find() does, if the >> previous match is >> zero-width-match (the fist==last), we step one to the next cursor before next >> try. I know > > Interesting, I didn't know Matcher.find() advances the cursor like this. But > Scanner.findWithinHorizon() apparently doesn't, so that's why an infinite loop > can occur. > >> Scanner.findPatternInBuffer() is setting new region set every time it is >> invoked which makes >> it complicated, but I would assume it might be still worth a trying? for >> example, utilize the >> "hasNextResult"/matcher.end(). I'm not sure without looking into the code, does >> >> while (hasNext(pattern)) { >> next(pattern); >> } >> >> have the same issue, when pattern matches 0-width? > > No, this doesn't have the problem, because hasNext(pat) and next(pat) match > delimited tokens. Each call to next() implicitly advances past the next > delimiter to reach the subsequent token, if any. > > > On 3/30/17 8:56 AM, Timo Kinnunen wrote: >> I guess this somewhat contrived example also wouldn?t work? >> >> String s = "\\b\\w+|\\G|\\B"; >> String t = "Matcher m = Pattern.compile(s).matcher(t);\n"; >> Matcher m = Pattern.compile(s).matcher(t); >> while(m.find()) { >> System.out.println("'" + m.group() + "'"); >> } > > Right, so if you rewrote this loop to use Scanner.findWithinHorizon() instead of > Matcher, > > Scanner sc = new Scanner(t); > String str; > while ((str = sc.findWithinHorizon(s, 0)) != null) { > System.out.println("'" + str + "'"); > } > > you'd get an infinite loop with str being continually assigned the empty string. > As Sherman mentioned, the Matcher.find() will advance the cursor if it gets a > zero-width match, avoiding this problem. > > * * * > > This didn't come up in the code review thread, which was mostly about concurrent > modification and late-binding of the spliterator: > > http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-September/035034.html > > I remember noting this phenomenon a while back, which is why I had filed the bug > to add a note. I seem to remember discussing it, though, but it might have been > in a meeting or in a hallway conversation. > > This bug (JDK-8150488) does note that an infinite stream might be unexpected or > surprising, but it's not a fatal problem. It can be terminated with limit(). It > can also be terminated with takeWhile(), also added in JDK 9. Maybe I could > mention these in the API note. > > I guess we could also consider changing the implicit findWithinHorizon() loop > that findAll() does, perhaps by having it terminate on a zero-width match. Or we > could even change findWithinHorizon's behavior if it gets a zero-width match, > siilar to what Matcher.find() does. But I'm quite reluctant to start making such > changes at this point. > > s'marks > > > >> // Outputs: >> // 'Matcher' >> // '' >> // 'm' >> // '' >> // '' >> // '' >> // 'Pattern' >> // '' >> // 'compile' >> // '' >> // 's' >> // '' >> // '' >> // 'matcher' >> // '' >> // 't' >> // '' >> // '' >> // '' >> // '' >> >> >> >> Sent from Mail for Windows 10 >> >> From: Xueming Shen >> Sent: Thursday, March 30, 2017 05:41 >> To: core-libs-dev at openjdk.java.net >> Subject: Re: JDK 9 RFR(s): 8150488: add note to Scanner.findAll() >> regardingpossible infinite streams >> >> On 3/29/17, 5:56 PM, Stuart Marks wrote: >>> Hi all, >>> >>> Please review these non-normative textual additions to the >>> Scanner.findAll() method docs. These methods were added earlier in JDK >>> 9; there's a small pitfall if the regex can match zero characters. >>> >> Stuart, >> >> This might practically put the api itself almost useless? it might be an >> easy task to spot >> whether or not it's a 0-width-match-possible regex when the regex is >> simple, but it gets >> harder and harder, if not impossible when the regex gets complicated, >> especially consider >> the possible use scenario that the use site is embedded deeply inside a >> library implementation. >> >> The alternative is to "fix" it, maybe as what Matcher.find() does, if >> the previous match is >> zero-width-match (the fist==last), we step one to the next cursor before >> next try. I know >> Scanner.findPatternInBuffer() is setting new region set every time it is >> invoked which makes >> it complicated, but I would assume it might be still worth a trying? for >> example, utilize the >> "hasNextResult"/matcher.end(). I'm not sure without looking into the >> code, does >> >> while (hasNext(pattern)) { >> next(pattern); >> } >> >> have the same issue, when pattern matches 0-width? >> >> Thanks! >> -Sherman >> >> >> >> >>> Thanks, >>> >>> s'marks >>> >>> >>> # HG changeset patch >>> # User smarks >>> # Date 1490749958 25200 >>> # Tue Mar 28 18:12:38 2017 -0700 >>> # Node ID 6b43c4698752779793d58813f46d3687c17dde75 >>> # Parent fb54b256d751ae3191e9cef42ff9f5630931f047 >>> 8150488: add note to Scanner.findAll() regarding possible infinite >>> streams >>> Reviewed-by: XXX >>> >>> diff -r fb54b256d751 -r 6b43c4698752 >>> src/java.base/share/classes/java/util/Scanner.java >>> --- a/src/java.base/share/classes/java/util/Scanner.java Mon Mar 27 >>> 15:12:01 2017 -0700 >>> +++ b/src/java.base/share/classes/java/util/Scanner.java Tue Mar 28 >>> 18:12:38 2017 -0700 >>> @@ -2808,6 +2808,10 @@ >>> * } >>> * } >>> * >>> + *

The pattern must always match at least one character. If >>> the pattern >>> + * can match zero characters, the result will be an infinite stream >>> + * of empty matches. >>> + * >>> * @param pattern the pattern to be matched >>> * @return a sequential stream of match results >>> * @throws NullPointerException if pattern is null >>> @@ -2829,6 +2833,11 @@ >>> * scanner.findAll(Pattern.compile(patString)) >>> * } >>> * >>> + * @apiNote >>> + * The pattern must always match at least one character. If the >>> pattern >>> + * can match zero characters, the result will be an infinite stream >>> + * of empty matches. >>> + * >>> * @param patString the pattern string >>> * @return a sequential stream of match results >>> * @throws NullPointerException if patString is null >> >> From xueming.shen at oracle.com Tue Apr 4 23:10:32 2017 From: xueming.shen at oracle.com (Xueming Shen) Date: Tue, 04 Apr 2017 16:10:32 -0700 Subject: JDK 9 RFR(s): 8150488: add note to Scanner.findAll() regardingpossible infinite streams In-Reply-To: References: <58DC7E53.6040603@oracle.com> <58dd2aba.298fdf0a.86cca.3418@mx.google.com> Message-ID: <58E427E8.2020901@oracle.com> On 4/4/17, 12:52 PM, Stuart Marks wrote: > Anything further on this? > > I'd at least like to add the API note I proposed in order to document > this issue. I'm reluctant to start tinkering with the behavior of this > method at this late stage in the release. > > BTW I used Scanner.findAll() in a little programming exercise I worked > on the other day. It worked perfectly. :-) H Stuart, The word "useless" was definitely exaggerate :-) Really meant to say the note might make the api less useful/popular. Personally I think the use scenario and the expected resulting behavior of StreamfinaAll(ptn) should be more equivalent/similar to the use case of while (s.hasNext(p)) { s.next(p); }, or while (m.find()) { }, therefor it is probably desired it can be used without worrying the possibility of getting into an infinite loop. That said, I agree it might be hard to argue to fix it in jdk9. The question is if we are going to fix it in 9u sometime in the further, is it still worth putting down the note in the API now. I'm fine if you believe a note will help at least make the issue a known/documented usage limitation, for JDK9. Yes, I think we did chat about this one at the hallway some time when either you or something ran into the loop by using the method ... Thanks, Sherman > > s'marks > > On 3/30/17 2:19 PM, Stuart Marks wrote: >> Hi Timo, Sherman, >> >> Thanks for looking at this. >> >> Sherman wrote: >> >>> This might practically put the api itself almost useless? it might >>> be an easy >>> task to spot >>> whether or not it's a 0-width-match-possible regex when the regex is >>> simple, >>> but it gets >>> harder and harder, if not impossible when the regex gets complicated, >>> especially consider >>> the possible use scenario that the use site is embedded deeply inside a >>> library implementation. >> >> Well, not "useless", but perhaps less useful than one might like. :-) >> >> I think this is potentially surprising behavior, which is why I at >> least wanted >> to add the note. It's not clear to me whether we should try to fix >> this by >> changing Scanner though. >> >> Essentially, findAll() is defined in terms of >> findWithinHorizon(pattern, 0). So >> if one were to write a loop like so: >> >> String str; >> while ((str = scanner.findWithinHorizon(pattern, 0)) != null) { >> System.out.println(str); >> } >> >> then this loop would have the same problem if pattern were to match zero >> characters. >> >>> The alternative is to "fix" it, maybe as what Matcher.find() does, >>> if the >>> previous match is >>> zero-width-match (the fist==last), we step one to the next cursor >>> before next >>> try. I know >> >> Interesting, I didn't know Matcher.find() advances the cursor like >> this. But >> Scanner.findWithinHorizon() apparently doesn't, so that's why an >> infinite loop >> can occur. >> >>> Scanner.findPatternInBuffer() is setting new region set every time >>> it is >>> invoked which makes >>> it complicated, but I would assume it might be still worth a trying? >>> for >>> example, utilize the >>> "hasNextResult"/matcher.end(). I'm not sure without looking into the >>> code, does >>> >>> while (hasNext(pattern)) { >>> next(pattern); >>> } >>> >>> have the same issue, when pattern matches 0-width? >> >> No, this doesn't have the problem, because hasNext(pat) and next(pat) >> match >> delimited tokens. Each call to next() implicitly advances past the next >> delimiter to reach the subsequent token, if any. >> >> >> On 3/30/17 8:56 AM, Timo Kinnunen wrote: >>> I guess this somewhat contrived example also wouldn?t work? >>> >>> String s = "\\b\\w+|\\G|\\B"; >>> String t = "Matcher m = Pattern.compile(s).matcher(t);\n"; >>> Matcher m = Pattern.compile(s).matcher(t); >>> while(m.find()) { >>> System.out.println("'" + m.group() + "'"); >>> } >> >> Right, so if you rewrote this loop to use Scanner.findWithinHorizon() >> instead of >> Matcher, >> >> Scanner sc = new Scanner(t); >> String str; >> while ((str = sc.findWithinHorizon(s, 0)) != null) { >> System.out.println("'" + str + "'"); >> } >> >> you'd get an infinite loop with str being continually assigned the >> empty string. >> As Sherman mentioned, the Matcher.find() will advance the cursor if >> it gets a >> zero-width match, avoiding this problem. >> >> * * * >> >> This didn't come up in the code review thread, which was mostly about >> concurrent >> modification and late-binding of the spliterator: >> >> >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-September/035034.html >> >> I remember noting this phenomenon a while back, which is why I had >> filed the bug >> to add a note. I seem to remember discussing it, though, but it might >> have been >> in a meeting or in a hallway conversation. >> >> This bug (JDK-8150488) does note that an infinite stream might be >> unexpected or >> surprising, but it's not a fatal problem. It can be terminated with >> limit(). It >> can also be terminated with takeWhile(), also added in JDK 9. Maybe I >> could >> mention these in the API note. >> >> I guess we could also consider changing the implicit >> findWithinHorizon() loop >> that findAll() does, perhaps by having it terminate on a zero-width >> match. Or we >> could even change findWithinHorizon's behavior if it gets a >> zero-width match, >> siilar to what Matcher.find() does. But I'm quite reluctant to start >> making such >> changes at this point. >> >> s'marks >> >> >> >>> // Outputs: >>> // 'Matcher' >>> // '' >>> // 'm' >>> // '' >>> // '' >>> // '' >>> // 'Pattern' >>> // '' >>> // 'compile' >>> // '' >>> // 's' >>> // '' >>> // '' >>> // 'matcher' >>> // '' >>> // 't' >>> // '' >>> // '' >>> // '' >>> // '' >>> >>> >>> >>> Sent from Mail for Windows 10 >>> >>> From: Xueming Shen >>> Sent: Thursday, March 30, 2017 05:41 >>> To: core-libs-dev at openjdk.java.net >>> Subject: Re: JDK 9 RFR(s): 8150488: add note to Scanner.findAll() >>> regardingpossible infinite streams >>> >>> On 3/29/17, 5:56 PM, Stuart Marks wrote: >>>> Hi all, >>>> >>>> Please review these non-normative textual additions to the >>>> Scanner.findAll() method docs. These methods were added earlier in JDK >>>> 9; there's a small pitfall if the regex can match zero characters. >>>> >>> Stuart, >>> >>> This might practically put the api itself almost useless? it might >>> be an >>> easy task to spot >>> whether or not it's a 0-width-match-possible regex when the regex is >>> simple, but it gets >>> harder and harder, if not impossible when the regex gets complicated, >>> especially consider >>> the possible use scenario that the use site is embedded deeply inside a >>> library implementation. >>> >>> The alternative is to "fix" it, maybe as what Matcher.find() does, if >>> the previous match is >>> zero-width-match (the fist==last), we step one to the next cursor >>> before >>> next try. I know >>> Scanner.findPatternInBuffer() is setting new region set every time >>> it is >>> invoked which makes >>> it complicated, but I would assume it might be still worth a trying? >>> for >>> example, utilize the >>> "hasNextResult"/matcher.end(). I'm not sure without looking into the >>> code, does >>> >>> while (hasNext(pattern)) { >>> next(pattern); >>> } >>> >>> have the same issue, when pattern matches 0-width? >>> >>> Thanks! >>> -Sherman >>> >>> >>> >>> >>>> Thanks, >>>> >>>> s'marks >>>> >>>> >>>> # HG changeset patch >>>> # User smarks >>>> # Date 1490749958 25200 >>>> # Tue Mar 28 18:12:38 2017 -0700 >>>> # Node ID 6b43c4698752779793d58813f46d3687c17dde75 >>>> # Parent fb54b256d751ae3191e9cef42ff9f5630931f047 >>>> 8150488: add note to Scanner.findAll() regarding possible infinite >>>> streams >>>> Reviewed-by: XXX >>>> >>>> diff -r fb54b256d751 -r 6b43c4698752 >>>> src/java.base/share/classes/java/util/Scanner.java >>>> --- a/src/java.base/share/classes/java/util/Scanner.java Mon Mar 27 >>>> 15:12:01 2017 -0700 >>>> +++ b/src/java.base/share/classes/java/util/Scanner.java Tue Mar 28 >>>> 18:12:38 2017 -0700 >>>> @@ -2808,6 +2808,10 @@ >>>> * } >>>> * } >>>> * >>>> + *

The pattern must always match at least one character. If >>>> the pattern >>>> + * can match zero characters, the result will be an infinite >>>> stream >>>> + * of empty matches. >>>> + * >>>> * @param pattern the pattern to be matched >>>> * @return a sequential stream of match results >>>> * @throws NullPointerException if pattern is null >>>> @@ -2829,6 +2833,11 @@ >>>> * scanner.findAll(Pattern.compile(patString)) >>>> * } >>>> * >>>> + * @apiNote >>>> + * The pattern must always match at least one character. If the >>>> pattern >>>> + * can match zero characters, the result will be an infinite >>>> stream >>>> + * of empty matches. >>>> + * >>>> * @param patString the pattern string >>>> * @return a sequential stream of match results >>>> * @throws NullPointerException if patString is null >>> >>> From kumar.x.srinivasan at oracle.com Wed Apr 5 00:18:12 2017 From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan) Date: Tue, 04 Apr 2017 17:18:12 -0700 Subject: JDK 9 RFR(s): JDK-8065825: Make the java -help consistent with the man page Message-ID: <58E437C4.1080306@oracle.com> Hello, Please review: http://cr.openjdk.java.net/~ksrini/8065825/webrev.00/ This adds a few things to the java -help and some minor cleanup. Thanks Kumar From timo.kinnunen at gmail.com Wed Apr 5 00:33:35 2017 From: timo.kinnunen at gmail.com (Timo Kinnunen) Date: Wed, 5 Apr 2017 02:33:35 +0200 Subject: JDK 9 RFR(s): 8150488: add note to Scanner.findAll()regardingpossible infinite streams In-Reply-To: <58E427E8.2020901@oracle.com> References: <58DC7E53.6040603@oracle.com> <58dd2aba.298fdf0a.86cca.3418@mx.google.com> <58E427E8.2020901@oracle.com> Message-ID: <58e43b5f.86ba1c0a.175c5.80a8@mx.google.com> Hi, I agree, the behavior should change to work like Matcher.find() which is probably the better known API. E.g. http://www.regular-expressions.info/continue.html describes Java?s Matcher?s behavior on empty matches but doesn?t mention any other APIs beside that. If we say a regex engine?s task is to find non-overlapping matches in a given input then it repeatedly returning the same empty match at the same location could even be considered a bug. Sent from Mail for Windows 10 From: Xueming Shen Sent: Wednesday, April 5, 2017 01:11 To: Stuart Marks Cc: Timo Kinnunen; core-libs-dev at openjdk.java.net Subject: Re: JDK 9 RFR(s): 8150488: add note to Scanner.findAll()regardingpossible infinite streams On 4/4/17, 12:52 PM, Stuart Marks wrote: > Anything further on this? > > I'd at least like to add the API note I proposed in order to document > this issue. I'm reluctant to start tinkering with the behavior of this > method at this late stage in the release. > > BTW I used Scanner.findAll() in a little programming exercise I worked > on the other day. It worked perfectly. :-) H Stuart, The word "useless" was definitely exaggerate :-) Really meant to say the note might make the api less useful/popular. Personally I think the use scenario and the expected resulting behavior of StreamfinaAll(ptn) should be more equivalent/similar to the use case of while (s.hasNext(p)) { s.next(p); }, or while (m.find()) { }, therefor it is probably desired it can be used without worrying the possibility of getting into an infinite loop. That said, I agree it might be hard to argue to fix it in jdk9. The question is if we are going to fix it in 9u sometime in the further, is it still worth putting down the note in the API now. I'm fine if you believe a note will help at least make the issue a known/documented usage limitation, for JDK9. Yes, I think we did chat about this one at the hallway some time when either you or something ran into the loop by using the method ... Thanks, Sherman > > s'marks > > On 3/30/17 2:19 PM, Stuart Marks wrote: >> Hi Timo, Sherman, >> >> Thanks for looking at this. >> >> Sherman wrote: >> >>> This might practically put the api itself almost useless? it might >>> be an easy >>> task to spot >>> whether or not it's a 0-width-match-possible regex when the regex is >>> simple, >>> but it gets >>> harder and harder, if not impossible when the regex gets complicated, >>> especially consider >>> the possible use scenario that the use site is embedded deeply inside a >>> library implementation. >> >> Well, not "useless", but perhaps less useful than one might like. :-) >> >> I think this is potentially surprising behavior, which is why I at >> least wanted >> to add the note. It's not clear to me whether we should try to fix >> this by >> changing Scanner though. >> >> Essentially, findAll() is defined in terms of >> findWithinHorizon(pattern, 0). So >> if one were to write a loop like so: >> >> String str; >> while ((str = scanner.findWithinHorizon(pattern, 0)) != null) { >> System.out.println(str); >> } >> >> then this loop would have the same problem if pattern were to match zero >> characters. >> >>> The alternative is to "fix" it, maybe as what Matcher.find() does, >>> if the >>> previous match is >>> zero-width-match (the fist==last), we step one to the next cursor >>> before next >>> try. I know >> >> Interesting, I didn't know Matcher.find() advances the cursor like >> this. But >> Scanner.findWithinHorizon() apparently doesn't, so that's why an >> infinite loop >> can occur. >> >>> Scanner.findPatternInBuffer() is setting new region set every time >>> it is >>> invoked which makes >>> it complicated, but I would assume it might be still worth a trying? >>> for >>> example, utilize the >>> "hasNextResult"/matcher.end(). I'm not sure without looking into the >>> code, does >>> >>> while (hasNext(pattern)) { >>> next(pattern); >>> } >>> >>> have the same issue, when pattern matches 0-width? >> >> No, this doesn't have the problem, because hasNext(pat) and next(pat) >> match >> delimited tokens. Each call to next() implicitly advances past the next >> delimiter to reach the subsequent token, if any. >> >> >> On 3/30/17 8:56 AM, Timo Kinnunen wrote: >>> I guess this somewhat contrived example also wouldn?t work? >>> >>> String s = "\\b\\w+|\\G|\\B"; >>> String t = "Matcher m = Pattern.compile(s).matcher(t);\n"; >>> Matcher m = Pattern.compile(s).matcher(t); >>> while(m.find()) { >>> System.out.println("'" + m.group() + "'"); >>> } >> >> Right, so if you rewrote this loop to use Scanner.findWithinHorizon() >> instead of >> Matcher, >> >> Scanner sc = new Scanner(t); >> String str; >> while ((str = sc.findWithinHorizon(s, 0)) != null) { >> System.out.println("'" + str + "'"); >> } >> >> you'd get an infinite loop with str being continually assigned the >> empty string. >> As Sherman mentioned, the Matcher.find() will advance the cursor if >> it gets a >> zero-width match, avoiding this problem. >> >> * * * >> >> This didn't come up in the code review thread, which was mostly about >> concurrent >> modification and late-binding of the spliterator: >> >> >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-September/035034.html >> >> I remember noting this phenomenon a while back, which is why I had >> filed the bug >> to add a note. I seem to remember discussing it, though, but it might >> have been >> in a meeting or in a hallway conversation. >> >> This bug (JDK-8150488) does note that an infinite stream might be >> unexpected or >> surprising, but it's not a fatal problem. It can be terminated with >> limit(). It >> can also be terminated with takeWhile(), also added in JDK 9. Maybe I >> could >> mention these in the API note. >> >> I guess we could also consider changing the implicit >> findWithinHorizon() loop >> that findAll() does, perhaps by having it terminate on a zero-width >> match. Or we >> could even change findWithinHorizon's behavior if it gets a >> zero-width match, >> siilar to what Matcher.find() does. But I'm quite reluctant to start >> making such >> changes at this point. >> >> s'marks >> >> >> >>> // Outputs: >>> // 'Matcher' >>> // '' >>> // 'm' >>> // '' >>> // '' >>> // '' >>> // 'Pattern' >>> // '' >>> // 'compile' >>> // '' >>> // 's' >>> // '' >>> // '' >>> // 'matcher' >>> // '' >>> // 't' >>> // '' >>> // '' >>> // '' >>> // '' >>> >>> >>> >>> Sent from Mail for Windows 10 >>> >>> From: Xueming Shen >>> Sent: Thursday, March 30, 2017 05:41 >>> To: core-libs-dev at openjdk.java.net >>> Subject: Re: JDK 9 RFR(s): 8150488: add note to Scanner.findAll() >>> regardingpossible infinite streams >>> >>> On 3/29/17, 5:56 PM, Stuart Marks wrote: >>>> Hi all, >>>> >>>> Please review these non-normative textual additions to the >>>> Scanner.findAll() method docs. These methods were added earlier in JDK >>>> 9; there's a small pitfall if the regex can match zero characters. >>>> >>> Stuart, >>> >>> This might practically put the api itself almost useless? it might >>> be an >>> easy task to spot >>> whether or not it's a 0-width-match-possible regex when the regex is >>> simple, but it gets >>> harder and harder, if not impossible when the regex gets complicated, >>> especially consider >>> the possible use scenario that the use site is embedded deeply inside a >>> library implementation. >>> >>> The alternative is to "fix" it, maybe as what Matcher.find() does, if >>> the previous match is >>> zero-width-match (the fist==last), we step one to the next cursor >>> before >>> next try. I know >>> Scanner.findPatternInBuffer() is setting new region set every time >>> it is >>> invoked which makes >>> it complicated, but I would assume it might be still worth a trying? >>> for >>> example, utilize the >>> "hasNextResult"/matcher.end(). I'm not sure without looking into the >>> code, does >>> >>> while (hasNext(pattern)) { >>> next(pattern); >>> } >>> >>> have the same issue, when pattern matches 0-width? >>> >>> Thanks! >>> -Sherman >>> >>> >>> >>> >>>> Thanks, >>>> >>>> s'marks >>>> >>>> >>>> # HG changeset patch >>>> # User smarks >>>> # Date 1490749958 25200 >>>> # Tue Mar 28 18:12:38 2017 -0700 >>>> # Node ID 6b43c4698752779793d58813f46d3687c17dde75 >>>> # Parent fb54b256d751ae3191e9cef42ff9f5630931f047 >>>> 8150488: add note to Scanner.findAll() regarding possible infinite >>>> streams >>>> Reviewed-by: XXX >>>> >>>> diff -r fb54b256d751 -r 6b43c4698752 >>>> src/java.base/share/classes/java/util/Scanner.java >>>> --- a/src/java.base/share/classes/java/util/Scanner.java Mon Mar 27 >>>> 15:12:01 2017 -0700 >>>> +++ b/src/java.base/share/classes/java/util/Scanner.java Tue Mar 28 >>>> 18:12:38 2017 -0700 >>>> @@ -2808,6 +2808,10 @@ >>>> * } >>>> * } >>>> * >>>> + *

The pattern must always match at least one character. If >>>> the pattern >>>> + * can match zero characters, the result will be an infinite >>>> stream >>>> + * of empty matches. >>>> + * >>>> * @param pattern the pattern to be matched >>>> * @return a sequential stream of match results >>>> * @throws NullPointerException if pattern is null >>>> @@ -2829,6 +2833,11 @@ >>>> * scanner.findAll(Pattern.compile(patString)) >>>> * } >>>> * >>>> + * @apiNote >>>> + * The pattern must always match at least one character. If the >>>> pattern >>>> + * can match zero characters, the result will be an infinite >>>> stream >>>> + * of empty matches. >>>> + * >>>> * @param patString the pattern string >>>> * @return a sequential stream of match results >>>> * @throws NullPointerException if patString is null >>> >>> From amy.lu at oracle.com Wed Apr 5 05:31:46 2017 From: amy.lu at oracle.com (Amy Lu) Date: Wed, 5 Apr 2017 13:31:46 +0800 Subject: JDK 9 RFR of JDK-8177640: jdk/internal/util/jar/TestVersionedStream.java fails on Windows Message-ID: Please review this test-only change. jdk/internal/util/jar/TestVersionedStream.java This test fails on Windows platforms. Test tries to create and write something to the files (in test preparation method 'createFiles') for later comparison (in test method 'test'). The content write to the new created file contains path and line separator,but test does not take into account the platform difference. bug: https://bugs.openjdk.java.net/browse/JDK-8177640 webrev: http://cr.openjdk.java.net/~amlu/8177640/webrev.00/ Thanks, Amy From stuart.marks at oracle.com Wed Apr 5 05:48:53 2017 From: stuart.marks at oracle.com (Stuart Marks) Date: Tue, 4 Apr 2017 22:48:53 -0700 Subject: JDK 9 RFR(s): 8150488: add note to Scanner.findAll() regardingpossible infinite streams In-Reply-To: <58E427E8.2020901@oracle.com> References: <58DC7E53.6040603@oracle.com> <58dd2aba.298fdf0a.86cca.3418@mx.google.com> <58E427E8.2020901@oracle.com> Message-ID: <89d5129f-faff-20cb-eb86-6d3bb4151958@oracle.com> On 4/4/17 4:10 PM, Xueming Shen wrote: > On 4/4/17, 12:52 PM, Stuart Marks wrote: >> I'd at least like to add the API note I proposed in order to document this >> issue. I'm reluctant to start tinkering with the behavior of this method at >> this late stage in the release. >> >> BTW I used Scanner.findAll() in a little programming exercise I worked on the >> other day. It worked perfectly. :-) > > The word "useless" was definitely exaggerate :-) Really meant to say the > note might make the api less useful/popular. > Personally I think the use scenario and the expected resulting behavior of > StreamfinaAll(ptn) should be more equivalent/similar to the use case of > while (s.hasNext(p)) { s.next(p); }, or while (m.find()) { }, therefor it is > probably desired it can be used without worrying the possibility of getting > into an infinite loop. The Scanner.tokens() API, also added in Java 9, provides a stream of delimited tokens (strings) that's more-or-less equivalent of a hasNext()/next() loop. Just as findWithinHorizon() is a distinct use case from hasNext()/next() delimited tokens, findAll() provides for distinct uses from tokens(). > That said, I agree it might be hard to argue to fix it in jdk9. The question > is if we are going to fix it in 9u sometime in the further, is it still worth > putting down the note in the API now. I'm fine if you believe a note will > help at least make the issue a known/documented usage limitation, for JDK9. > > Yes, I think we did chat about this one at the hallway some time when either > you or something ran into the loop by using the method ... There are already a couple ways you can get unexpected behavior with Scanner if you're not careful. For example, see the warnings in findWithinHorizon() and skip() about the possibility of buffering up the entire input. These methods are useful, but if you're not careful with the regex you provide, things can go wrong. The findAll() method seems to be in the same situation. It's not clear to me that any of these are bugs for which there's a reasonable fix. So yes, I think the note is necessary. I could also add something about terminating such streams with limit() or takeWhile(). s'marks > > Thanks, > Sherman > > >> >> s'marks >> >> On 3/30/17 2:19 PM, Stuart Marks wrote: >>> Hi Timo, Sherman, >>> >>> Thanks for looking at this. >>> >>> Sherman wrote: >>> >>>> This might practically put the api itself almost useless? it might be an easy >>>> task to spot >>>> whether or not it's a 0-width-match-possible regex when the regex is simple, >>>> but it gets >>>> harder and harder, if not impossible when the regex gets complicated, >>>> especially consider >>>> the possible use scenario that the use site is embedded deeply inside a >>>> library implementation. >>> >>> Well, not "useless", but perhaps less useful than one might like. :-) >>> >>> I think this is potentially surprising behavior, which is why I at least wanted >>> to add the note. It's not clear to me whether we should try to fix this by >>> changing Scanner though. >>> >>> Essentially, findAll() is defined in terms of findWithinHorizon(pattern, 0). So >>> if one were to write a loop like so: >>> >>> String str; >>> while ((str = scanner.findWithinHorizon(pattern, 0)) != null) { >>> System.out.println(str); >>> } >>> >>> then this loop would have the same problem if pattern were to match zero >>> characters. >>> >>>> The alternative is to "fix" it, maybe as what Matcher.find() does, if the >>>> previous match is >>>> zero-width-match (the fist==last), we step one to the next cursor before next >>>> try. I know >>> >>> Interesting, I didn't know Matcher.find() advances the cursor like this. But >>> Scanner.findWithinHorizon() apparently doesn't, so that's why an infinite loop >>> can occur. >>> >>>> Scanner.findPatternInBuffer() is setting new region set every time it is >>>> invoked which makes >>>> it complicated, but I would assume it might be still worth a trying? for >>>> example, utilize the >>>> "hasNextResult"/matcher.end(). I'm not sure without looking into the code, does >>>> >>>> while (hasNext(pattern)) { >>>> next(pattern); >>>> } >>>> >>>> have the same issue, when pattern matches 0-width? >>> >>> No, this doesn't have the problem, because hasNext(pat) and next(pat) match >>> delimited tokens. Each call to next() implicitly advances past the next >>> delimiter to reach the subsequent token, if any. >>> >>> >>> On 3/30/17 8:56 AM, Timo Kinnunen wrote: >>>> I guess this somewhat contrived example also wouldn?t work? >>>> >>>> String s = "\\b\\w+|\\G|\\B"; >>>> String t = "Matcher m = Pattern.compile(s).matcher(t);\n"; >>>> Matcher m = Pattern.compile(s).matcher(t); >>>> while(m.find()) { >>>> System.out.println("'" + m.group() + "'"); >>>> } >>> >>> Right, so if you rewrote this loop to use Scanner.findWithinHorizon() instead of >>> Matcher, >>> >>> Scanner sc = new Scanner(t); >>> String str; >>> while ((str = sc.findWithinHorizon(s, 0)) != null) { >>> System.out.println("'" + str + "'"); >>> } >>> >>> you'd get an infinite loop with str being continually assigned the empty string. >>> As Sherman mentioned, the Matcher.find() will advance the cursor if it gets a >>> zero-width match, avoiding this problem. >>> >>> * * * >>> >>> This didn't come up in the code review thread, which was mostly about concurrent >>> modification and late-binding of the spliterator: >>> >>> >>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-September/035034.html >>> >>> I remember noting this phenomenon a while back, which is why I had filed the bug >>> to add a note. I seem to remember discussing it, though, but it might have been >>> in a meeting or in a hallway conversation. >>> >>> This bug (JDK-8150488) does note that an infinite stream might be unexpected or >>> surprising, but it's not a fatal problem. It can be terminated with limit(). It >>> can also be terminated with takeWhile(), also added in JDK 9. Maybe I could >>> mention these in the API note. >>> >>> I guess we could also consider changing the implicit findWithinHorizon() loop >>> that findAll() does, perhaps by having it terminate on a zero-width match. Or we >>> could even change findWithinHorizon's behavior if it gets a zero-width match, >>> siilar to what Matcher.find() does. But I'm quite reluctant to start making such >>> changes at this point. >>> >>> s'marks >>> >>> >>> >>>> // Outputs: >>>> // 'Matcher' >>>> // '' >>>> // 'm' >>>> // '' >>>> // '' >>>> // '' >>>> // 'Pattern' >>>> // '' >>>> // 'compile' >>>> // '' >>>> // 's' >>>> // '' >>>> // '' >>>> // 'matcher' >>>> // '' >>>> // 't' >>>> // '' >>>> // '' >>>> // '' >>>> // '' >>>> >>>> >>>> >>>> Sent from Mail for Windows 10 >>>> >>>> From: Xueming Shen >>>> Sent: Thursday, March 30, 2017 05:41 >>>> To: core-libs-dev at openjdk.java.net >>>> Subject: Re: JDK 9 RFR(s): 8150488: add note to Scanner.findAll() >>>> regardingpossible infinite streams >>>> >>>> On 3/29/17, 5:56 PM, Stuart Marks wrote: >>>>> Hi all, >>>>> >>>>> Please review these non-normative textual additions to the >>>>> Scanner.findAll() method docs. These methods were added earlier in JDK >>>>> 9; there's a small pitfall if the regex can match zero characters. >>>>> >>>> Stuart, >>>> >>>> This might practically put the api itself almost useless? it might be an >>>> easy task to spot >>>> whether or not it's a 0-width-match-possible regex when the regex is >>>> simple, but it gets >>>> harder and harder, if not impossible when the regex gets complicated, >>>> especially consider >>>> the possible use scenario that the use site is embedded deeply inside a >>>> library implementation. >>>> >>>> The alternative is to "fix" it, maybe as what Matcher.find() does, if >>>> the previous match is >>>> zero-width-match (the fist==last), we step one to the next cursor before >>>> next try. I know >>>> Scanner.findPatternInBuffer() is setting new region set every time it is >>>> invoked which makes >>>> it complicated, but I would assume it might be still worth a trying? for >>>> example, utilize the >>>> "hasNextResult"/matcher.end(). I'm not sure without looking into the >>>> code, does >>>> >>>> while (hasNext(pattern)) { >>>> next(pattern); >>>> } >>>> >>>> have the same issue, when pattern matches 0-width? >>>> >>>> Thanks! >>>> -Sherman >>>> >>>> >>>> >>>> >>>>> Thanks, >>>>> >>>>> s'marks >>>>> >>>>> >>>>> # HG changeset patch >>>>> # User smarks >>>>> # Date 1490749958 25200 >>>>> # Tue Mar 28 18:12:38 2017 -0700 >>>>> # Node ID 6b43c4698752779793d58813f46d3687c17dde75 >>>>> # Parent fb54b256d751ae3191e9cef42ff9f5630931f047 >>>>> 8150488: add note to Scanner.findAll() regarding possible infinite >>>>> streams >>>>> Reviewed-by: XXX >>>>> >>>>> diff -r fb54b256d751 -r 6b43c4698752 >>>>> src/java.base/share/classes/java/util/Scanner.java >>>>> --- a/src/java.base/share/classes/java/util/Scanner.java Mon Mar 27 >>>>> 15:12:01 2017 -0700 >>>>> +++ b/src/java.base/share/classes/java/util/Scanner.java Tue Mar 28 >>>>> 18:12:38 2017 -0700 >>>>> @@ -2808,6 +2808,10 @@ >>>>> * } >>>>> * } >>>>> * >>>>> + *

The pattern must always match at least one character. If >>>>> the pattern >>>>> + * can match zero characters, the result will be an infinite stream >>>>> + * of empty matches. >>>>> + * >>>>> * @param pattern the pattern to be matched >>>>> * @return a sequential stream of match results >>>>> * @throws NullPointerException if pattern is null >>>>> @@ -2829,6 +2833,11 @@ >>>>> * scanner.findAll(Pattern.compile(patString)) >>>>> * } >>>>> * >>>>> + * @apiNote >>>>> + * The pattern must always match at least one character. If the >>>>> pattern >>>>> + * can match zero characters, the result will be an infinite stream >>>>> + * of empty matches. >>>>> + * >>>>> * @param patString the pattern string >>>>> * @return a sequential stream of match results >>>>> * @throws NullPointerException if patString is null >>>> >>>> > From stuart.marks at oracle.com Wed Apr 5 05:50:41 2017 From: stuart.marks at oracle.com (Stuart Marks) Date: Tue, 4 Apr 2017 22:50:41 -0700 Subject: JDK 9 RFR(s): 8150488: add note to Scanner.findAll()regardingpossible infinite streams In-Reply-To: <58e43b5f.86ba1c0a.175c5.80a8@mx.google.com> References: <58DC7E53.6040603@oracle.com> <58dd2aba.298fdf0a.86cca.3418@mx.google.com> <58E427E8.2020901@oracle.com> <58e43b5f.86ba1c0a.175c5.80a8@mx.google.com> Message-ID: On 4/4/17 5:33 PM, Timo Kinnunen wrote: > > Hi, > > I agree, the behavior should change to work like Matcher.find() which is > probably the better known API. E.g. > http://www.regular-expressions.info/continue.html describes Java?s Matcher?s > behavior on empty matches but doesn?t mention any other APIs beside that. > I don't think Sherman was suggesting that. In any case this would be a change to findWithinHorizon(), which isn't in scope. s'marks > > If we say a regex engine?s task is to find non-overlapping matches in a given > input then it repeatedly returning the same empty match at the same location > could even be considered a bug. > > Sent from Mail for Windows 10 > > *From: *Xueming Shen > *Sent: *Wednesday, April 5, 2017 01:11 > *To: *Stuart Marks > *Cc: *Timo Kinnunen ; > core-libs-dev at openjdk.java.net > *Subject: *Re: JDK 9 RFR(s): 8150488: add note to > Scanner.findAll()regardingpossible infinite streams > > On 4/4/17, 12:52 PM, Stuart Marks wrote: > > > Anything further on this? > > > > > > I'd at least like to add the API note I proposed in order to document > > > this issue. I'm reluctant to start tinkering with the behavior of this > > > method at this late stage in the release. > > > > > > BTW I used Scanner.findAll() in a little programming exercise I worked > > > on the other day. It worked perfectly. :-) > > H Stuart, > > The word "useless" was definitely exaggerate :-) Really meant to say the > > note might make the api less > > useful/popular. > > Personally I think the use scenario and the expected resulting behavior > > of StreamfinaAll(ptn) > > should be more equivalent/similar to the use case of while > > (s.hasNext(p)) { s.next(p); }, or while > > (m.find()) { }, therefor it is probably desired it can be used without > > worrying the possibility of getting > > into an infinite loop. That said, I agree it might be hard to argue to > > fix it in jdk9. The question is if > > we are going to fix it in 9u sometime in the further, is it still worth > > putting down the note in the > > API now. I'm fine if you believe a note will help at least make the > > issue a known/documented usage > > limitation, for JDK9. > > Yes, I think we did chat about this one at the hallway some time when > > either you or something > > ran into the loop by using the method ... > > Thanks, > > Sherman > > > > > > s'marks > > > > > > On 3/30/17 2:19 PM, Stuart Marks wrote: > > >> Hi Timo, Sherman, > > >> > > >> Thanks for looking at this. > > >> > > >> Sherman wrote: > > >> > > >>> This might practically put the api itself almost useless? it might > > >>> be an easy > > >>> task to spot > > >>> whether or not it's a 0-width-match-possible regex when the regex is > > >>> simple, > > >>> but it gets > > >>> harder and harder, if not impossible when the regex gets complicated, > > >>> especially consider > > >>> the possible use scenario that the use site is embedded deeply inside a > > >>> library implementation. > > >> > > >> Well, not "useless", but perhaps less useful than one might like. :-) > > >> > > >> I think this is potentially surprising behavior, which is why I at > > >> least wanted > > >> to add the note. It's not clear to me whether we should try to fix > > >> this by > > >> changing Scanner though. > > >> > > >> Essentially, findAll() is defined in terms of > > >> findWithinHorizon(pattern, 0). So > > >> if one were to write a loop like so: > > >> > > >> String str; > > >> while ((str = scanner.findWithinHorizon(pattern, 0)) != null) { > > >> System.out.println(str); > > >> } > > >> > > >> then this loop would have the same problem if pattern were to match zero > > >> characters. > > >> > > >>> The alternative is to "fix" it, maybe as what Matcher.find() does, > > >>> if the > > >>> previous match is > > >>> zero-width-match (the fist==last), we step one to the next cursor > > >>> before next > > >>> try. I know > > >> > > >> Interesting, I didn't know Matcher.find() advances the cursor like > > >> this. But > > >> Scanner.findWithinHorizon() apparently doesn't, so that's why an > > >> infinite loop > > >> can occur. > > >> > > >>> Scanner.findPatternInBuffer() is setting new region set every time > > >>> it is > > >>> invoked which makes > > >>> it complicated, but I would assume it might be still worth a trying? > > >>> for > > >>> example, utilize the > > >>> "hasNextResult"/matcher.end(). I'm not sure without looking into the > > >>> code, does > > >>> > > >>> while (hasNext(pattern)) { > > >>> next(pattern); > > >>> } > > >>> > > >>> have the same issue, when pattern matches 0-width? > > >> > > >> No, this doesn't have the problem, because hasNext(pat) and next(pat) > > >> match > > >> delimited tokens. Each call to next() implicitly advances past the next > > >> delimiter to reach the subsequent token, if any. > > >> > > >> > > >> On 3/30/17 8:56 AM, Timo Kinnunen wrote: > > >>> I guess this somewhat contrived example also wouldn?t work? > > >>> > > >>> String s = "\\b\\w+|\\G|\\B"; > > >>> String t = "Matcher m = Pattern.compile(s).matcher(t);\n"; > > >>> Matcher m = Pattern.compile(s).matcher(t); > > >>> while(m.find()) { > > >>> System.out.println("'" + m.group() + "'"); > > >>> } > > >> > > >> Right, so if you rewrote this loop to use Scanner.findWithinHorizon() > > >> instead of > > >> Matcher, > > >> > > >> Scanner sc = new Scanner(t); > > >> String str; > > >> while ((str = sc.findWithinHorizon(s, 0)) != null) { > > >> System.out.println("'" + str + "'"); > > >> } > > >> > > >> you'd get an infinite loop with str being continually assigned the > > >> empty string. > > >> As Sherman mentioned, the Matcher.find() will advance the cursor if > > >> it gets a > > >> zero-width match, avoiding this problem. > > >> > > >> * * * > > >> > > >> This didn't come up in the code review thread, which was mostly about > > >> concurrent > > >> modification and late-binding of the spliterator: > > >> > > >> > > >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-September/035034.html > > >> > > >> I remember noting this phenomenon a while back, which is why I had > > >> filed the bug > > >> to add a note. I seem to remember discussing it, though, but it might > > >> have been > > >> in a meeting or in a hallway conversation. > > >> > > >> This bug (JDK-8150488) does note that an infinite stream might be > > >> unexpected or > > >> surprising, but it's not a fatal problem. It can be terminated with > > >> limit(). It > > >> can also be terminated with takeWhile(), also added in JDK 9. Maybe I > > >> could > > >> mention these in the API note. > > >> > > >> I guess we could also consider changing the implicit > > >> findWithinHorizon() loop > > >> that findAll() does, perhaps by having it terminate on a zero-width > > >> match. Or we > > >> could even change findWithinHorizon's behavior if it gets a > > >> zero-width match, > > >> siilar to what Matcher.find() does. But I'm quite reluctant to start > > >> making such > > >> changes at this point. > > >> > > >> s'marks > > >> > > >> > > >> > > >>> // Outputs: > > >>> // 'Matcher' > > >>> // '' > > >>> // 'm' > > >>> // '' > > >>> // '' > > >>> // '' > > >>> // 'Pattern' > > >>> // '' > > >>> // 'compile' > > >>> // '' > > >>> // 's' > > >>> // '' > > >>> // '' > > >>> // 'matcher' > > >>> // '' > > >>> // 't' > > >>> // '' > > >>> // '' > > >>> // '' > > >>> // '' > > >>> > > >>> > > >>> > > >>> Sent from Mail for Windows 10 > > >>> > > >>> From: Xueming Shen > > >>> Sent: Thursday, March 30, 2017 05:41 > > >>> To: core-libs-dev at openjdk.java.net > > >>> Subject: Re: JDK 9 RFR(s): 8150488: add note to Scanner.findAll() > > >>> regardingpossible infinite streams > > >>> > > >>> On 3/29/17, 5:56 PM, Stuart Marks wrote: > > >>>> Hi all, > > >>>> > > >>>> Please review these non-normative textual additions to the > > >>>> Scanner.findAll() method docs. These methods were added earlier in JDK > > >>>> 9; there's a small pitfall if the regex can match zero characters. > > >>>> > > >>> Stuart, > > >>> > > >>> This might practically put the api itself almost useless? it might > > >>> be an > > >>> easy task to spot > > >>> whether or not it's a 0-width-match-possible regex when the regex is > > >>> simple, but it gets > > >>> harder and harder, if not impossible when the regex gets complicated, > > >>> especially consider > > >>> the possible use scenario that the use site is embedded deeply inside a > > >>> library implementation. > > >>> > > >>> The alternative is to "fix" it, maybe as what Matcher.find() does, if > > >>> the previous match is > > >>> zero-width-match (the fist==last), we step one to the next cursor > > >>> before > > >>> next try. I know > > >>> Scanner.findPatternInBuffer() is setting new region set every time > > >>> it is > > >>> invoked which makes > > >>> it complicated, but I would assume it might be still worth a trying? > > >>> for > > >>> example, utilize the > > >>> "hasNextResult"/matcher.end(). I'm not sure without looking into the > > >>> code, does > > >>> > > >>> while (hasNext(pattern)) { > > >>> next(pattern); > > >>> } > > >>> > > >>> have the same issue, when pattern matches 0-width? > > >>> > > >>> Thanks! > > >>> -Sherman > > >>> > > >>> > > >>> > > >>> > > >>>> Thanks, > > >>>> > > >>>> s'marks > > >>>> > > >>>> > > >>>> # HG changeset patch > > >>>> # User smarks > > >>>> # Date 1490749958 25200 > > >>>> # Tue Mar 28 18:12:38 2017 -0700 > > >>>> # Node ID 6b43c4698752779793d58813f46d3687c17dde75 > > >>>> # Parent fb54b256d751ae3191e9cef42ff9f5630931f047 > > >>>> 8150488: add note to Scanner.findAll() regarding possible infinite > > >>>> streams > > >>>> Reviewed-by: XXX > > >>>> > > >>>> diff -r fb54b256d751 -r 6b43c4698752 > > >>>> src/java.base/share/classes/java/util/Scanner.java > > >>>> --- a/src/java.base/share/classes/java/util/Scanner.java Mon Mar 27 > > >>>> 15:12:01 2017 -0700 > > >>>> +++ b/src/java.base/share/classes/java/util/Scanner.java Tue Mar 28 > > >>>> 18:12:38 2017 -0700 > > >>>> @@ -2808,6 +2808,10 @@ > > >>>> * } > > >>>> * } > > >>>> * > > >>>> + *

The pattern must always match at least one character. If > > >>>> the pattern > > >>>> + * can match zero characters, the result will be an infinite > > >>>> stream > > >>>> + * of empty matches. > > >>>> + * > > >>>> * @param pattern the pattern to be matched > > >>>> * @return a sequential stream of match results > > >>>> * @throws NullPointerException if pattern is null > > >>>> @@ -2829,6 +2833,11 @@ > > >>>> * scanner.findAll(Pattern.compile(patString)) > > >>>> * } > > >>>> * > > >>>> + * @apiNote > > >>>> + * The pattern must always match at least one character. If the > > >>>> pattern > > >>>> + * can match zero characters, the result will be an infinite > > >>>> stream > > >>>> + * of empty matches. > > >>>> + * > > >>>> * @param patString the pattern string > > >>>> * @return a sequential stream of match results > > >>>> * @throws NullPointerException if patString is null > > >>> > > >>> > From timo.kinnunen at gmail.com Wed Apr 5 06:31:06 2017 From: timo.kinnunen at gmail.com (Timo Kinnunen) Date: Wed, 5 Apr 2017 08:31:06 +0200 Subject: JDK 9 RFR(s): 8150488: add note toScanner.findAll()regardingpossible infinite streams In-Reply-To: References: <58DC7E53.6040603@oracle.com> <58dd2aba.298fdf0a.86cca.3418@mx.google.com> <58E427E8.2020901@oracle.com> <58e43b5f.86ba1c0a.175c5.80a8@mx.google.com> Message-ID: <58e48f2a.7896df0a.d993.25c7@mx.google.com> Then Scanner.findAll() should be specified not in terms of findWithinHorizon() but something else, maybe Matcher.find(). If it?s specified using findWithinHorizon() this would require implementations of its backing regex engine to be inferior or even broken in this respect when compared to other regex engines. If a regex engine chosen for an implementation didn?t have infinite looping then that would have to be emulated! Sent from Mail for Windows 10 From: Stuart Marks Sent: Wednesday, April 5, 2017 07:50 To: Timo Kinnunen Cc: Xueming Shen; core-libs-dev at openjdk.java.net Subject: Re: JDK 9 RFR(s): 8150488: add note toScanner.findAll()regardingpossible infinite streams On 4/4/17 5:33 PM, Timo Kinnunen wrote: Hi, ? I agree, the behavior should change to work like Matcher.find() which is probably the better known API. E.g. http://www.regular-expressions.info/continue.html describes Java?s Matcher?s behavior on empty matches but doesn?t mention any other APIs beside that. I don't think Sherman was suggesting that. In any case this would be a change to findWithinHorizon(), which isn't in scope. s'marks ? If we say a regex engine?s task is to find non-overlapping matches in a given input then it repeatedly returning the same empty match at the same location could even be considered a bug. ? ? ? Sent from Mail for Windows 10 ? From: Xueming Shen Sent: Wednesday, April 5, 2017 01:11 To: Stuart Marks Cc: Timo Kinnunen; core-libs-dev at openjdk.java.net Subject: Re: JDK 9 RFR(s): 8150488: add note to Scanner.findAll()regardingpossible infinite streams ? On 4/4/17, 12:52 PM, Stuart Marks wrote: > Anything further on this? >? > I'd at least like to add the API note I proposed in order to document > this issue. I'm reluctant to start tinkering with the behavior of this > method at this late stage in the release. >? > BTW I used Scanner.findAll() in a little programming exercise I worked > on the other day. It worked perfectly. :-) ? H Stuart, ? The word "useless" was definitely exaggerate :-) Really meant to say the note might make the api less useful/popular. ? Personally I think the use scenario and the expected resulting behavior of StreamfinaAll(ptn) should be more equivalent/similar to the use case? of while (s.hasNext(p)) {?? s.next(p); }, or while (m.find()) { }, therefor it is probably desired it can be used without worrying the possibility of getting into an infinite loop. That said, I agree it might be hard to argue to fix it in jdk9. The question is if we are going to fix it in 9u sometime in the further, is it still worth putting down the note in the API now. I'm fine if you believe a note will help at least make the issue a known/documented usage limitation, for JDK9. ? Yes, I think we did chat about this one at the hallway some time when either you or something ran into the loop by using the method ... ? Thanks, Sherman ? ? >? > s'marks >? > On 3/30/17 2:19 PM, Stuart Marks wrote: >> Hi Timo, Sherman, >>? >> Thanks for looking at this. >>? >> Sherman wrote: >>? >>> This might practically put the api itself almost useless? it might >>> be an easy >>> task to spot >>> whether or not it's a 0-width-match-possible regex when the regex is >>> simple, >>> but it gets >>> harder and harder, if not impossible when the regex gets complicated, >>> especially consider >>> the possible use scenario that the use site is embedded deeply inside a >>> library implementation. >>? >> Well, not "useless", but perhaps less useful than one might like. :-) >>? >> I think this is potentially surprising behavior, which is why I at >> least wanted >> to add the note. It's not clear to me whether we should try to fix >> this by >> changing Scanner though. >>? >> Essentially, findAll() is defined in terms of >> findWithinHorizon(pattern, 0). So >> if one were to write a loop like so: >>? >>???? String str; >>???? while ((str = scanner.findWithinHorizon(pattern, 0)) != null) { >>???????? System.out.println(str); >>???? } >>? >> then this loop would have the same problem if pattern were to match zero >> characters. >>? >>> The alternative is to "fix" it, maybe as what Matcher.find() does, >>> if the >>> previous match is >>> zero-width-match (the fist==last), we step one to the next cursor >>> before next >>> try. I know >>? >> Interesting, I didn't know Matcher.find() advances the cursor like >> this. But >> Scanner.findWithinHorizon() apparently doesn't, so that's why an >> infinite loop >> can occur. >>? >>> Scanner.findPatternInBuffer() is setting new region set every time >>> it is >>> invoked which makes >>> it complicated, but I would assume it might be still worth a trying? >>> for >>> example, utilize the >>> "hasNextResult"/matcher.end(). I'm not sure without looking into the >>> code, does >>>? >>> while (hasNext(pattern)) { >>>???? next(pattern); >>> } >>>? >>> have the same issue, when pattern matches 0-width? >>? >> No, this doesn't have the problem, because hasNext(pat) and next(pat) >> match >> delimited tokens. Each call to next() implicitly advances past the next >> delimiter to reach the subsequent token, if any. >>? >>? >> On 3/30/17 8:56 AM, Timo Kinnunen wrote: >>> I guess this somewhat contrived example also wouldn?t work? >>>? >>>???????? String s = "\\b\\w+|\\G|\\B"; >>>???????? String t = "Matcher m = Pattern.compile(s).matcher(t);\n"; >>>???????? Matcher m = Pattern.compile(s).matcher(t); >>>???????? while(m.find()) { >>>???????????? System.out.println("'" + m.group() + "'"); >>>???????? } >>? >> Right, so if you rewrote this loop to use Scanner.findWithinHorizon() >> instead of >> Matcher, >>? >>???? Scanner sc = new Scanner(t); >>???? String str; >>???? while ((str = sc.findWithinHorizon(s, 0)) != null) { >>???????? System.out.println("'" + str + "'"); >>???? } >>? >> you'd get an infinite loop with str being continually assigned the >> empty string. >> As Sherman mentioned, the Matcher.find() will advance the cursor if >> it gets a >> zero-width match, avoiding this problem. >>? >> * * * >>? >> This didn't come up in the code review thread, which was mostly about >> concurrent >> modification and late-binding of the spliterator: >>? >>?? >> http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-September/035034.html >>? >> I remember noting this phenomenon a while back, which is why I had >> filed the bug >> to add a note. I seem to remember discussing it, though, but it might >> have been >> in a meeting or in a hallway conversation. >>? >> This bug (JDK-8150488) does note that an infinite stream might be >> unexpected or >> surprising, but it's not a fatal problem. It can be terminated with >> limit(). It >> can also be terminated with takeWhile(), also added in JDK 9. Maybe I >> could >> mention these in the API note. >>? >> I guess we could also consider changing the implicit >> findWithinHorizon() loop >> that findAll() does, perhaps by having it terminate on a zero-width >> match. Or we >> could even change findWithinHorizon's behavior if it gets a >> zero-width match, >> siilar to what Matcher.find() does. But I'm quite reluctant to start >> making such >> changes at this point. >>? >> s'marks >>? >>? >>? >>>???????? // Outputs: >>>???????? // 'Matcher' >>>???????? // '' >>>???????? // 'm' >>>???????? // '' >>>???????? // '' >>>???????? // '' >>>???????? // 'Pattern' >>>???????? // '' >>>???????? // 'compile' >>>???????? // '' >>>???????? // 's' >>>???????? // '' >>>???????? // '' >>>???????? // 'matcher' >>>???????? // '' >>>???????? // 't' >>>???????? // '' >>>???????? // '' >>>???????? // '' >>>???????? // '' >>>? >>>? >>>? >>> Sent from Mail for Windows 10 >>>? >>> From: Xueming Shen >>> Sent: Thursday, March 30, 2017 05:41 >>> To: core-libs-dev at openjdk.java.net >>> Subject: Re: JDK 9 RFR(s): 8150488: add note to Scanner.findAll() >>> regardingpossible infinite streams >>>? >>> On 3/29/17, 5:56 PM, Stuart Marks wrote: >>>> Hi all, >>>>? >>>> Please review these non-normative textual additions to the >>>> Scanner.findAll() method docs. These methods were added earlier in JDK >>>> 9; there's a small pitfall if the regex can match zero characters. >>>>? >>> Stuart, >>>? >>> This might practically put the api itself almost useless? it might >>> be an >>> easy task to spot >>> whether or not it's a 0-width-match-possible regex when the regex is >>> simple, but it gets >>> harder and harder, if not impossible when the regex gets complicated, >>> especially consider >>> the possible use scenario that the use site is embedded deeply inside a >>> library implementation. >>>? >>> The alternative is to "fix" it, maybe as what Matcher.find() does, if >>> the previous match is >>> zero-width-match (the fist==last), we step one to the next cursor >>> before >>> next try. I know >>> Scanner.findPatternInBuffer() is setting new region set every time >>> it is >>> invoked which makes >>> it complicated, but I would assume it might be still worth a trying? >>> for >>> example, utilize the >>> "hasNextResult"/matcher.end(). I'm not sure without looking into the >>> code, does >>>? >>> while (hasNext(pattern)) { >>>????? next(pattern); >>> } >>>? >>> have the same issue, when pattern matches 0-width? >>>? >>> Thanks! >>> -Sherman >>>? >>>? >>>? >>>? >>>> Thanks, >>>>? >>>> s'marks >>>>? >>>>? >>>> # HG changeset patch >>>> # User smarks >>>> # Date 1490749958 25200 >>>> #????? Tue Mar 28 18:12:38 2017 -0700 >>>> # Node ID 6b43c4698752779793d58813f46d3687c17dde75 >>>> # Parent? fb54b256d751ae3191e9cef42ff9f5630931f047 >>>> 8150488: add note to Scanner.findAll() regarding possible infinite >>>> streams >>>> Reviewed-by: XXX >>>>? >>>> diff -r fb54b256d751 -r 6b43c4698752 >>>> src/java.base/share/classes/java/util/Scanner.java >>>> --- a/src/java.base/share/classes/java/util/Scanner.java??? Mon Mar 27 >>>> 15:12:01 2017 -0700 >>>> +++ b/src/java.base/share/classes/java/util/Scanner.java??? Tue Mar 28 >>>> 18:12:38 2017 -0700 >>>> @@ -2808,6 +2808,10 @@ >>>>?????? * } >>>>?????? * } >>>>?????? * >>>> +???? *

The pattern must always match at least one character. If >>>> the pattern >>>> +???? * can match zero characters, the result will be an infinite >>>> stream >>>> +???? * of empty matches. >>>> +???? * >>>> ??????* @param pattern the pattern to be matched >>>>?????? * @return a sequential stream of match results >>>>?????? * @throws NullPointerException if pattern is null >>>> @@ -2829,6 +2833,11 @@ >>>>?????? *???? scanner.findAll(Pattern.compile(patString)) >>>>?????? * } >>>>?????? * >>>> +???? * @apiNote >>>> +???? * The pattern must always match at least one character. If the >>>> pattern >>>> +???? * can match zero characters, the result will be an infinite >>>> stream >>>> +???? * of empty matches. >>>> +???? * >>>>?????? * @param patString the pattern string >>>>?????? * @return a sequential stream of match results >>>>?????? * @throws NullPointerException if patString is null >>>? >>>? ? ? From chris.hegarty at oracle.com Wed Apr 5 09:08:29 2017 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 5 Apr 2017 10:08:29 +0100 Subject: RFR [9] 8178101: Migrate the thread deprecation technote to javadoc doc-files Message-ID: <719568AA-F367-4DBF-AC90-E710A50C5B09@oracle.com> As part of the ongoing doc cleanup effort, we should move the existing longstanding note on "Thread Primitive Deprecation" into the JDK repository, say under jdk/src/java.base/share/classes/java/lang/doc-files, and update the links from the Thread javadoc. http://cr.openjdk.java.net/~chegar/8178101/ The actual document has only been minimally modified, e.g. stylesheet link, etc, from the current version [1]. -Chris. [1] https://docs.oracle.com/javase/8/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html From Alan.Bateman at oracle.com Wed Apr 5 11:19:18 2017 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 5 Apr 2017 12:19:18 +0100 Subject: JDK 9 RFR(s): JDK-8065825: Make the java -help consistent with the man page In-Reply-To: <58E437C4.1080306@oracle.com> References: <58E437C4.1080306@oracle.com> Message-ID: <4637585f-c00e-2cfb-7b05-36f883aeb597@oracle.com> On 05/04/2017 01:18, Kumar Srinivasan wrote: > Hello, > > Please review: http://cr.openjdk.java.net/~ksrini/8065825/webrev.00/ > > This adds a few things to the java -help and some minor cleanup. Changing @ to @argument in the options list looks fine. I'm sure sure why @argument-files is being added to the main usage as it makes it look like an exclusive alternative (when it can be of course be used in conjunction with options). -Alan. From dawid.weiss at gmail.com Wed Apr 5 12:05:58 2017 From: dawid.weiss at gmail.com (Dawid Weiss) Date: Wed, 5 Apr 2017 14:05:58 +0200 Subject: RFR [9] 8178101: Migrate the thread deprecation technote to javadoc doc-files In-Reply-To: <719568AA-F367-4DBF-AC90-E710A50C5B09@oracle.com> References: <719568AA-F367-4DBF-AC90-E710A50C5B09@oracle.com> Message-ID: While applying this patch, you could probably piggyback a fix to this typo as well: "Cleanup would have to [be] repeated" Dawid On Wed, Apr 5, 2017 at 11:08 AM, Chris Hegarty wrote: > As part of the ongoing doc cleanup effort, we should move the existing > longstanding note on "Thread Primitive Deprecation" into the JDK > repository, say under jdk/src/java.base/share/classes/java/lang/doc-files, > and update the links from the Thread javadoc. > > http://cr.openjdk.java.net/~chegar/8178101/ > > The actual document has only been minimally modified, e.g. stylesheet > link, etc, from the current version [1]. > > -Chris. > > [1] https://docs.oracle.com/javase/8/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html From chris.hegarty at oracle.com Wed Apr 5 12:23:33 2017 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 5 Apr 2017 13:23:33 +0100 Subject: RFR [9] 8178101: Migrate the thread deprecation technote to javadoc doc-files In-Reply-To: References: <719568AA-F367-4DBF-AC90-E710A50C5B09@oracle.com> Message-ID: <4C9F2D1B-3B95-4D1E-BD25-6EE9AAE9A1D7@oracle.com> On 5 Apr 2017, at 13:05, Dawid Weiss wrote: > > While applying this patch, you could probably piggyback a fix to this > typo as well: > > "Cleanup would have to [be] repeated? Sure, will do. -Chris. > Dawid > > On Wed, Apr 5, 2017 at 11:08 AM, Chris Hegarty wrote: >> As part of the ongoing doc cleanup effort, we should move the existing >> longstanding note on "Thread Primitive Deprecation" into the JDK >> repository, say under jdk/src/java.base/share/classes/java/lang/doc-files, >> and update the links from the Thread javadoc. >> >> http://cr.openjdk.java.net/~chegar/8178101/ >> >> The actual document has only been minimally modified, e.g. stylesheet >> link, etc, from the current version [1]. >> >> -Chris. >> >> [1] https://docs.oracle.com/javase/8/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html From david.holmes at oracle.com Wed Apr 5 12:26:29 2017 From: david.holmes at oracle.com (David Holmes) Date: Wed, 5 Apr 2017 22:26:29 +1000 Subject: RFR [9] 8178101: Migrate the thread deprecation technote to javadoc doc-files In-Reply-To: <719568AA-F367-4DBF-AC90-E710A50C5B09@oracle.com> References: <719568AA-F367-4DBF-AC90-E710A50C5B09@oracle.com> Message-ID: <44d342b7-e98a-c0a7-d392-bdc2cb9560b7@oracle.com> On 5/04/2017 7:08 PM, Chris Hegarty wrote: > As part of the ongoing doc cleanup effort, we should move the existing > longstanding note on "Thread Primitive Deprecation" into the JDK > repository, say under jdk/src/java.base/share/classes/java/lang/doc-files, > and update the links from the Thread javadoc. > > http://cr.openjdk.java.net/~chegar/8178101/ Looks good Chris! > The actual document has only been minimally modified, e.g. stylesheet > link, etc, from the current version [1]. Been years since I've read that :) Thanks, David ----- > -Chris. > > [1] https://docs.oracle.com/javase/8/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html > From david.holmes at oracle.com Wed Apr 5 12:29:34 2017 From: david.holmes at oracle.com (David Holmes) Date: Wed, 5 Apr 2017 22:29:34 +1000 Subject: RFR [9] 8178101: Migrate the thread deprecation technote to javadoc doc-files In-Reply-To: <44d342b7-e98a-c0a7-d392-bdc2cb9560b7@oracle.com> References: <719568AA-F367-4DBF-AC90-E710A50C5B09@oracle.com> <44d342b7-e98a-c0a7-d392-bdc2cb9560b7@oracle.com> Message-ID: <464c139d-3334-18af-9840-ddb18e8ab52f@oracle.com> Forgot to say, doesn't the html file need a copyright notice added before we add it? David On 5/04/2017 10:26 PM, David Holmes wrote: > On 5/04/2017 7:08 PM, Chris Hegarty wrote: >> As part of the ongoing doc cleanup effort, we should move the existing >> longstanding note on "Thread Primitive Deprecation" into the JDK >> repository, say under >> jdk/src/java.base/share/classes/java/lang/doc-files, >> and update the links from the Thread javadoc. >> >> http://cr.openjdk.java.net/~chegar/8178101/ > > Looks good Chris! > >> The actual document has only been minimally modified, e.g. stylesheet >> link, etc, from the current version [1]. > > Been years since I've read that :) > > Thanks, > David > ----- > >> -Chris. >> >> [1] >> https://docs.oracle.com/javase/8/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html >> >> From chris.hegarty at oracle.com Wed Apr 5 12:42:07 2017 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Wed, 5 Apr 2017 13:42:07 +0100 Subject: RFR [9] 8178101: Migrate the thread deprecation technote to javadoc doc-files In-Reply-To: <464c139d-3334-18af-9840-ddb18e8ab52f@oracle.com> References: <719568AA-F367-4DBF-AC90-E710A50C5B09@oracle.com> <44d342b7-e98a-c0a7-d392-bdc2cb9560b7@oracle.com> <464c139d-3334-18af-9840-ddb18e8ab52f@oracle.com> Message-ID: > On 5 Apr 2017, at 13:29, David Holmes wrote: > > Forgot to say, doesn't the html file need a copyright notice added before we add it? Sure, that makes sense. The earliest reference I can find is 2005, but I?m sure that it was probably around before that! http://cr.openjdk.java.net/~chegar/8178101_inc/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html.udiff.html -Chris. From chris.w.dennis at gmail.com Wed Apr 5 12:57:58 2017 From: chris.w.dennis at gmail.com (Chris Dennis) Date: Wed, 5 Apr 2017 08:57:58 -0400 Subject: Java 9 and IntSummaryStatistics et al. In-Reply-To: References: <4420BF94-E1FB-4C24-9236-B29AF0E1B773@gmail.com> <2060281512.1263209.1490783571858.JavaMail.zimbra@u-pem.fr> <14AE3491-15A8-4823-9476-3E986E4F685D@oracle.com> <6fa9a53c-b23e-7639-eb9a-eae36b3856b4@gmail.com> <23871708-D1B7-41FB-8AC4-488A4EE40459@gmail.com> Message-ID: <2C5102D0-0405-4648-8BE8-5744B40FEE80@gmail.com> Taking from this conversation that there is consensus (at least amongst those on this thread) that this is an issue that should be fixed, what should my next steps be in order to help move this forward? > On Mar 30, 2017, at 10:01 AM, Peter Levart wrote: > > > > On 03/30/2017 03:14 PM, Chris Dennis wrote: >> This is indeed nice? but I presume that we all agree that the best solution here would be to allow instantiation of an IntSummaryStatistics object in a specific state. > > Of course. I just couldn't resist the challenge of R?mi's nice math exercise... > > Regards, Peter > >> >>> On Mar 29, 2017, at 2:43 PM, Peter Levart wrote: >>> >>> >>> >>> On 03/29/2017 06:06 PM, Chris Dennis wrote: >>>> Remi: I really have to squint pretty hard to see that as anything other than ?brute-force? - it?s still an O(N) calculation. >>> Here's O(log2(N)): >>> >>> static IntSummaryStatistics create(long count, long sum, int min, int max) { >>> if (count < 2 || min == max) { >>> return combineProduct(new IntSummaryStatistics(), count, min); >>> } else { >>> long minCnt = (count * max - sum) / (max - min); >>> long maxCnt = count - minCnt - 1; >>> long minSum = minCnt * min; >>> long maxSum = maxCnt * max; >>> long minMaxSum = minSum + maxSum; >>> int mid = (int) (sum - minMaxSum); >>> IntSummaryStatistics stats = new IntSummaryStatistics(); >>> combineProduct(stats, minCnt, min); >>> combineProduct(stats, maxCnt, max); >>> stats.accept(mid); >>> return stats; >>> } >>> } >>> >>> static IntSummaryStatistics combineProduct(IntSummaryStatistics stats, long count, int value) { >>> IntSummaryStatistics pow2 = null; >>> while (count > 0) { >>> if (pow2 == null) { >>> pow2 = new IntSummaryStatistics(); >>> pow2.accept(value); >>> } else { >>> pow2.combine(pow2); >>> } >>> if ((count & 1L) == 1L) { >>> stats.combine(pow2); >>> } >>> count >>>= 1; >>> } >>> return stats; >>> } >>> >>> >>> Regards, Peter >>> > From Roger.Riggs at Oracle.com Wed Apr 5 14:13:30 2017 From: Roger.Riggs at Oracle.com (Roger Riggs) Date: Wed, 5 Apr 2017 10:13:30 -0400 Subject: [9] RFR 8177969: Faster FilePermission::implies by avoiding the use of Path::relativize In-Reply-To: <4f1e0c02-a11d-2694-84ad-cf8804021f3c@oracle.com> References: <4f1e0c02-a11d-2694-84ad-cf8804021f3c@oracle.com> Message-ID: <9f96ed4d-9282-d776-f767-d3fe060ba895@Oracle.com> Hi Max, The code looks ok. How much faster does it make FilePermission compares? I assume if it is not accepted to be fixed in JDK 9, you will push it to JDK 10. Roger On 4/3/2017 11:30 AM, Weijun Wang wrote: > http://cr.openjdk.java.net/~weijun/8177969/webrev.00/ > > This new implementation of containsPath(Path,Path) uses the logic of > Path::relativize without directly calling it, which is much faster now. > > Thanks > Max From paul.sandoz at oracle.com Wed Apr 5 16:22:49 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 5 Apr 2017 09:22:49 -0700 Subject: JDK 9 RFR of JDK-8177640: jdk/internal/util/jar/TestVersionedStream.java fails on Windows In-Reply-To: References: Message-ID: > On 4 Apr 2017, at 22:31, Amy Lu wrote: > > Please review this test-only change. > > jdk/internal/util/jar/TestVersionedStream.java > > This test fails on Windows platforms. Test tries to create and write something to the files (in test preparation method 'createFiles') for later comparison (in test method 'test'). The content write to the new created file contains path and line separator,but test does not take into account the platform difference. > > bug: https://bugs.openjdk.java.net/browse/JDK-8177640 > webrev: http://cr.openjdk.java.net/~amlu/8177640/webrev.00/ > +1 Paul. From paul.sandoz at oracle.com Wed Apr 5 16:30:57 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 5 Apr 2017 09:30:57 -0700 Subject: Java 9 and IntSummaryStatistics et al. In-Reply-To: <2C5102D0-0405-4648-8BE8-5744B40FEE80@gmail.com> References: <4420BF94-E1FB-4C24-9236-B29AF0E1B773@gmail.com> <2060281512.1263209.1490783571858.JavaMail.zimbra@u-pem.fr> <14AE3491-15A8-4823-9476-3E986E4F685D@oracle.com> <6fa9a53c-b23e-7639-eb9a-eae36b3856b4@gmail.com> <23871708-D1B7-41FB-8AC4-488A4EE40459@gmail.com> <2C5102D0-0405-4648-8BE8-5744B40FEE80@gmail.com> Message-ID: Hi Chris, I logged this issue: https://bugs.openjdk.java.net/browse/JDK-8178117 Do you want to provide a patch? I can help guide you through the process. See here if not already familiar: http://openjdk.java.net/contribute/ Thanks, Paul. From kumar.x.srinivasan at oracle.com Wed Apr 5 16:31:38 2017 From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan) Date: Wed, 05 Apr 2017 09:31:38 -0700 Subject: JDK 9 RFR(s): JDK-8065825: Make the java -help consistent with the man page In-Reply-To: <4637585f-c00e-2cfb-7b05-36f883aeb597@oracle.com> References: <58E437C4.1080306@oracle.com> <4637585f-c00e-2cfb-7b05-36f883aeb597@oracle.com> Message-ID: <58E51BEA.2060808@oracle.com> Ok I removed it from the main usage, yes the existing explanation for @argfile should suffice. Is the information accurate with respect to all the new module options ? I have checked them, but would help to another pair of "jigsaw" eyes on it. Since the L10N freeze is coming up shortly. http://cr.openjdk.java.net/~ksrini/8065825/webrev.01/ Kumar > On 05/04/2017 01:18, Kumar Srinivasan wrote: > >> Hello, >> >> Please review: http://cr.openjdk.java.net/~ksrini/8065825/webrev.00/ >> >> This adds a few things to the java -help and some minor cleanup. > Changing @ to @argument in the options list looks fine. > > I'm sure sure why @argument-files is being added to the main usage as > it makes it look like an exclusive alternative (when it can be of > course be used in conjunction with options). > > -Alan. From stuart.marks at oracle.com Wed Apr 5 16:49:31 2017 From: stuart.marks at oracle.com (Stuart Marks) Date: Wed, 5 Apr 2017 09:49:31 -0700 Subject: JDK 9 RFR(s): 8150488: add note to Scanner.findAll() regardingpossible infinite streams In-Reply-To: <89d5129f-faff-20cb-eb86-6d3bb4151958@oracle.com> References: <58DC7E53.6040603@oracle.com> <58dd2aba.298fdf0a.86cca.3418@mx.google.com> <58E427E8.2020901@oracle.com> <89d5129f-faff-20cb-eb86-6d3bb4151958@oracle.com> Message-ID: On 4/4/17 10:48 PM, Stuart Marks wrote: > > > On 4/4/17 4:10 PM, Xueming Shen wrote: >> Personally I think the use scenario and the expected resulting behavior of >> StreamfinaAll(ptn) should be more equivalent/similar to the use case of >> while (s.hasNext(p)) { s.next(p); }, or while (m.find()) { }, therefor it is >> probably desired it can be used without worrying the possibility of getting >> into an infinite loop. > > The Scanner.tokens() API, also added in Java 9, provides a stream of delimited > tokens (strings) that's more-or-less equivalent of a hasNext()/next() loop. > > Just as findWithinHorizon() is a distinct use case from hasNext()/next() > delimited tokens, findAll() provides for distinct uses from tokens(). > >> That said, I agree it might be hard to argue to fix it in jdk9. The question >> is if we are going to fix it in 9u sometime in the further, is it still worth >> putting down the note in the API now. I'm fine if you believe a note will >> help at least make the issue a known/documented usage limitation, for JDK9. I've thought about this some more... fundamentally the behavior is odd, since Scanner.findWithinHorizon() is *based on* Matcher.find(). So why does Matcher.find() "work" and S.findWithinHorizon() produce an infinite loop? If you look in findPatternInBuffer, upon which findWithinHorizon and findAll are based, it essentially resets the matcher every time, which cases the Matcher.find() special case to be bypassed. So I think this could be considered a bug in findPatternInBuffer, which causes misbehavior to be visible in findWithinHorizon and findAll. I've filed: JDK-8178116 scanner.findWithinHorizon doesn't advance after matching zero characters This is certainly too subtle to be trying to fix right now. I guess the question is, if we believe this is a bug that will be fixed at some point, do we add a note to findAll() -- and maybe even findWithinHorizon() -- to document this? Historically we haven't documented bugs like this, so maybe not. Note also that this behavior of findWithinHorizon has been there since JDK 6, which is the earliest release I had conveniently at hand. s'marks >> >> Yes, I think we did chat about this one at the hallway some time when either >> you or something ran into the loop by using the method ... > > There are already a couple ways you can get unexpected behavior with Scanner if > you're not careful. For example, see the warnings in findWithinHorizon() and > skip() about the possibility of buffering up the entire input. These methods are > useful, but if you're not careful with the regex you provide, things can go > wrong. The findAll() method seems to be in the same situation. It's not clear to > me that any of these are bugs for which there's a reasonable fix. > > So yes, I think the note is necessary. I could also add something about > terminating such streams with limit() or takeWhile(). > > s'marks > >> >> Thanks, >> Sherman >> >> >>> >>> s'marks >>> >>> On 3/30/17 2:19 PM, Stuart Marks wrote: >>>> Hi Timo, Sherman, >>>> >>>> Thanks for looking at this. >>>> >>>> Sherman wrote: >>>> >>>>> This might practically put the api itself almost useless? it might be an easy >>>>> task to spot >>>>> whether or not it's a 0-width-match-possible regex when the regex is simple, >>>>> but it gets >>>>> harder and harder, if not impossible when the regex gets complicated, >>>>> especially consider >>>>> the possible use scenario that the use site is embedded deeply inside a >>>>> library implementation. >>>> >>>> Well, not "useless", but perhaps less useful than one might like. :-) >>>> >>>> I think this is potentially surprising behavior, which is why I at least wanted >>>> to add the note. It's not clear to me whether we should try to fix this by >>>> changing Scanner though. >>>> >>>> Essentially, findAll() is defined in terms of findWithinHorizon(pattern, 0). So >>>> if one were to write a loop like so: >>>> >>>> String str; >>>> while ((str = scanner.findWithinHorizon(pattern, 0)) != null) { >>>> System.out.println(str); >>>> } >>>> >>>> then this loop would have the same problem if pattern were to match zero >>>> characters. >>>> >>>>> The alternative is to "fix" it, maybe as what Matcher.find() does, if the >>>>> previous match is >>>>> zero-width-match (the fist==last), we step one to the next cursor before next >>>>> try. I know >>>> >>>> Interesting, I didn't know Matcher.find() advances the cursor like this. But >>>> Scanner.findWithinHorizon() apparently doesn't, so that's why an infinite loop >>>> can occur. >>>> >>>>> Scanner.findPatternInBuffer() is setting new region set every time it is >>>>> invoked which makes >>>>> it complicated, but I would assume it might be still worth a trying? for >>>>> example, utilize the >>>>> "hasNextResult"/matcher.end(). I'm not sure without looking into the code, >>>>> does >>>>> >>>>> while (hasNext(pattern)) { >>>>> next(pattern); >>>>> } >>>>> >>>>> have the same issue, when pattern matches 0-width? >>>> >>>> No, this doesn't have the problem, because hasNext(pat) and next(pat) match >>>> delimited tokens. Each call to next() implicitly advances past the next >>>> delimiter to reach the subsequent token, if any. >>>> >>>> >>>> On 3/30/17 8:56 AM, Timo Kinnunen wrote: >>>>> I guess this somewhat contrived example also wouldn?t work? >>>>> >>>>> String s = "\\b\\w+|\\G|\\B"; >>>>> String t = "Matcher m = Pattern.compile(s).matcher(t);\n"; >>>>> Matcher m = Pattern.compile(s).matcher(t); >>>>> while(m.find()) { >>>>> System.out.println("'" + m.group() + "'"); >>>>> } >>>> >>>> Right, so if you rewrote this loop to use Scanner.findWithinHorizon() >>>> instead of >>>> Matcher, >>>> >>>> Scanner sc = new Scanner(t); >>>> String str; >>>> while ((str = sc.findWithinHorizon(s, 0)) != null) { >>>> System.out.println("'" + str + "'"); >>>> } >>>> >>>> you'd get an infinite loop with str being continually assigned the empty >>>> string. >>>> As Sherman mentioned, the Matcher.find() will advance the cursor if it gets a >>>> zero-width match, avoiding this problem. >>>> >>>> * * * >>>> >>>> This didn't come up in the code review thread, which was mostly about >>>> concurrent >>>> modification and late-binding of the spliterator: >>>> >>>> >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-September/035034.html >>>> >>>> I remember noting this phenomenon a while back, which is why I had filed the >>>> bug >>>> to add a note. I seem to remember discussing it, though, but it might have been >>>> in a meeting or in a hallway conversation. >>>> >>>> This bug (JDK-8150488) does note that an infinite stream might be unexpected or >>>> surprising, but it's not a fatal problem. It can be terminated with limit(). It >>>> can also be terminated with takeWhile(), also added in JDK 9. Maybe I could >>>> mention these in the API note. >>>> >>>> I guess we could also consider changing the implicit findWithinHorizon() loop >>>> that findAll() does, perhaps by having it terminate on a zero-width match. >>>> Or we >>>> could even change findWithinHorizon's behavior if it gets a zero-width match, >>>> siilar to what Matcher.find() does. But I'm quite reluctant to start making >>>> such >>>> changes at this point. >>>> >>>> s'marks >>>> >>>> >>>> >>>>> // Outputs: >>>>> // 'Matcher' >>>>> // '' >>>>> // 'm' >>>>> // '' >>>>> // '' >>>>> // '' >>>>> // 'Pattern' >>>>> // '' >>>>> // 'compile' >>>>> // '' >>>>> // 's' >>>>> // '' >>>>> // '' >>>>> // 'matcher' >>>>> // '' >>>>> // 't' >>>>> // '' >>>>> // '' >>>>> // '' >>>>> // '' >>>>> >>>>> >>>>> >>>>> Sent from Mail for Windows 10 >>>>> >>>>> From: Xueming Shen >>>>> Sent: Thursday, March 30, 2017 05:41 >>>>> To: core-libs-dev at openjdk.java.net >>>>> Subject: Re: JDK 9 RFR(s): 8150488: add note to Scanner.findAll() >>>>> regardingpossible infinite streams >>>>> >>>>> On 3/29/17, 5:56 PM, Stuart Marks wrote: >>>>>> Hi all, >>>>>> >>>>>> Please review these non-normative textual additions to the >>>>>> Scanner.findAll() method docs. These methods were added earlier in JDK >>>>>> 9; there's a small pitfall if the regex can match zero characters. >>>>>> >>>>> Stuart, >>>>> >>>>> This might practically put the api itself almost useless? it might be an >>>>> easy task to spot >>>>> whether or not it's a 0-width-match-possible regex when the regex is >>>>> simple, but it gets >>>>> harder and harder, if not impossible when the regex gets complicated, >>>>> especially consider >>>>> the possible use scenario that the use site is embedded deeply inside a >>>>> library implementation. >>>>> >>>>> The alternative is to "fix" it, maybe as what Matcher.find() does, if >>>>> the previous match is >>>>> zero-width-match (the fist==last), we step one to the next cursor before >>>>> next try. I know >>>>> Scanner.findPatternInBuffer() is setting new region set every time it is >>>>> invoked which makes >>>>> it complicated, but I would assume it might be still worth a trying? for >>>>> example, utilize the >>>>> "hasNextResult"/matcher.end(). I'm not sure without looking into the >>>>> code, does >>>>> >>>>> while (hasNext(pattern)) { >>>>> next(pattern); >>>>> } >>>>> >>>>> have the same issue, when pattern matches 0-width? >>>>> >>>>> Thanks! >>>>> -Sherman >>>>> >>>>> >>>>> >>>>> >>>>>> Thanks, >>>>>> >>>>>> s'marks >>>>>> >>>>>> >>>>>> # HG changeset patch >>>>>> # User smarks >>>>>> # Date 1490749958 25200 >>>>>> # Tue Mar 28 18:12:38 2017 -0700 >>>>>> # Node ID 6b43c4698752779793d58813f46d3687c17dde75 >>>>>> # Parent fb54b256d751ae3191e9cef42ff9f5630931f047 >>>>>> 8150488: add note to Scanner.findAll() regarding possible infinite >>>>>> streams >>>>>> Reviewed-by: XXX >>>>>> >>>>>> diff -r fb54b256d751 -r 6b43c4698752 >>>>>> src/java.base/share/classes/java/util/Scanner.java >>>>>> --- a/src/java.base/share/classes/java/util/Scanner.java Mon Mar 27 >>>>>> 15:12:01 2017 -0700 >>>>>> +++ b/src/java.base/share/classes/java/util/Scanner.java Tue Mar 28 >>>>>> 18:12:38 2017 -0700 >>>>>> @@ -2808,6 +2808,10 @@ >>>>>> * } >>>>>> * } >>>>>> * >>>>>> + *

The pattern must always match at least one character. If >>>>>> the pattern >>>>>> + * can match zero characters, the result will be an infinite stream >>>>>> + * of empty matches. >>>>>> + * >>>>>> * @param pattern the pattern to be matched >>>>>> * @return a sequential stream of match results >>>>>> * @throws NullPointerException if pattern is null >>>>>> @@ -2829,6 +2833,11 @@ >>>>>> * scanner.findAll(Pattern.compile(patString)) >>>>>> * } >>>>>> * >>>>>> + * @apiNote >>>>>> + * The pattern must always match at least one character. If the >>>>>> pattern >>>>>> + * can match zero characters, the result will be an infinite stream >>>>>> + * of empty matches. >>>>>> + * >>>>>> * @param patString the pattern string >>>>>> * @return a sequential stream of match results >>>>>> * @throws NullPointerException if patString is null >>>>> >>>>> >> From brian.goetz at oracle.com Wed Apr 5 18:13:50 2017 From: brian.goetz at oracle.com (Brian Goetz) Date: Wed, 5 Apr 2017 14:13:50 -0400 Subject: Java 9 and IntSummaryStatistics et al. In-Reply-To: <2C5102D0-0405-4648-8BE8-5744B40FEE80@gmail.com> References: <4420BF94-E1FB-4C24-9236-B29AF0E1B773@gmail.com> <2060281512.1263209.1490783571858.JavaMail.zimbra@u-pem.fr> <14AE3491-15A8-4823-9476-3E986E4F685D@oracle.com> <6fa9a53c-b23e-7639-eb9a-eae36b3856b4@gmail.com> <23871708-D1B7-41FB-8AC4-488A4EE40459@gmail.com> <2C5102D0-0405-4648-8BE8-5744B40FEE80@gmail.com> Message-ID: <19db4e4f-6fa3-e6ea-0e95-6493b6d74514@oracle.com> Adding a new public ctor to initialize the state to a known value seems reasonable to me. On 4/5/2017 8:57 AM, Chris Dennis wrote: > Taking from this conversation that there is consensus (at least amongst those on this thread) that this is an issue that should be fixed, what should my next steps be in order to help move this forward? From chris.w.dennis at gmail.com Wed Apr 5 18:30:50 2017 From: chris.w.dennis at gmail.com (Chris Dennis) Date: Wed, 5 Apr 2017 14:30:50 -0400 Subject: Java 9 and IntSummaryStatistics et al. In-Reply-To: References: <4420BF94-E1FB-4C24-9236-B29AF0E1B773@gmail.com> <2060281512.1263209.1490783571858.JavaMail.zimbra@u-pem.fr> <14AE3491-15A8-4823-9476-3E986E4F685D@oracle.com> <6fa9a53c-b23e-7639-eb9a-eae36b3856b4@gmail.com> <23871708-D1B7-41FB-8AC4-488A4EE40459@gmail.com> <2C5102D0-0405-4648-8BE8-5744B40FEE80@gmail.com> Message-ID: I can do that. I?ve done this before a couple of times, so it should be reasonably familiar. Will attempt to whip something up in the next couple of days. Thanks, Chris > On Apr 5, 2017, at 12:30 PM, Paul Sandoz wrote: > > Hi Chris, > > I logged this issue: > > https://bugs.openjdk.java.net/browse/JDK-8178117 > > Do you want to provide a patch? > > I can help guide you through the process. See here if not already familiar: > > http://openjdk.java.net/contribute/ > > Thanks, > Paul. From Alan.Bateman at oracle.com Wed Apr 5 19:06:08 2017 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 5 Apr 2017 20:06:08 +0100 Subject: JDK 9 RFR(s): JDK-8065825: Make the java -help consistent with the man page In-Reply-To: <58E51BEA.2060808@oracle.com> References: <58E437C4.1080306@oracle.com> <4637585f-c00e-2cfb-7b05-36f883aeb597@oracle.com> <58E51BEA.2060808@oracle.com> Message-ID: <7cea4146-78db-a9e1-4c11-38616bd0620a@oracle.com> On 05/04/2017 17:31, Kumar Srinivasan wrote: > Ok I removed it from the main usage, yes the existing > explanation for @argfile should suffice. > > Is the information accurate with respect to all the new module options ? > I have checked them, but would help to another pair of "jigsaw" eyes > on it. > Since the L10N freeze is coming up shortly. > > http://cr.openjdk.java.net/~ksrini/8065825/webrev.01/ The updated webrev looks good to me. -Alan From naoto.sato at oracle.com Wed Apr 5 21:14:55 2017 From: naoto.sato at oracle.com (Naoto Sato) Date: Wed, 5 Apr 2017 14:14:55 -0700 Subject: [8u] RFR: 8177776: Create an equivalent test case for JDK9's SupplementalJapaneseEraTest In-Reply-To: <69774039-1980-882f-2f89-fac194fd7fa7@oracle.com> References: <69774039-1980-882f-2f89-fac194fd7fa7@oracle.com> Message-ID: I revised the test case not to rely on shell script. Please review. http://cr.openjdk.java.net/~naoto/8177776/webrev.01/ Naoto On 3/30/17 2:10 PM, Naoto Sato wrote: > Hello, > > Please review the changes to the following issue: > > https://bugs.openjdk.java.net/browse/JDK-8177776 > > The proposed change is located at: > > http://cr.openjdk.java.net/~naoto/8177776/webrev.00/ > > This is for backporting fixes for JapaneseEra related issues (8054214, > 8173423). The original fixes in JDK9 included a test case, > SupplementalJapaneseEraTest which is intended for the system property > testing. The above proposed fix intends to adapt that test case into > JDK8, where calendars.properties file is used instead of the system > property. The test is pretty much identical to JDK9's. The difference is > to deal with the calendars.properties file and removed some > non-applicable cases in JDK8. > > Naoto From mandy.chung at oracle.com Wed Apr 5 22:15:09 2017 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 5 Apr 2017 15:15:09 -0700 Subject: RFR 9: 8165641 : Deprecate Object.finalize In-Reply-To: <78e0fb3c-0850-4aa9-9f73-e319e8a8e7b9@Oracle.com> References: <96fe9ae0-993a-aea6-cabf-f079450dc128@Oracle.com> <49eb0b85-130a-b74d-e760-120674de6ebc@oracle.com> <31a37a8c-e3fd-96cf-00a4-090d65c21cff@Oracle.com> <78e0fb3c-0850-4aa9-9f73-e319e8a8e7b9@Oracle.com> Message-ID: > On Apr 3, 2017, at 7:44 AM, Roger Riggs wrote: > > [1] http://cr.openjdk.java.net/~rriggs/webrev-finalize-deprecate-8165641 Typo: s/an finalizable/a finalizable/ + * The {@code finalize} method might be called on an finalizable object Otherwise, looks good. No need for a new webrev. Mandy From martinrb at google.com Wed Apr 5 22:27:46 2017 From: martinrb at google.com (Martin Buchholz) Date: Wed, 5 Apr 2017 15:27:46 -0700 Subject: RFR 9: 8165641 : Deprecate Object.finalize In-Reply-To: <78e0fb3c-0850-4aa9-9f73-e319e8a8e7b9@Oracle.com> References: <96fe9ae0-993a-aea6-cabf-f079450dc128@Oracle.com> <49eb0b85-130a-b74d-e760-120674de6ebc@oracle.com> <31a37a8c-e3fd-96cf-00a4-090d65c21cff@Oracle.com> <78e0fb3c-0850-4aa9-9f73-e319e8a8e7b9@Oracle.com> Message-ID: (I would not have deprecated finalize; I don't think we have a good enough answer for what to use instead. But) Looks good. Typo: an finalizable object From stuart.marks at oracle.com Thu Apr 6 00:44:22 2017 From: stuart.marks at oracle.com (Stuart Marks) Date: Wed, 5 Apr 2017 17:44:22 -0700 Subject: JDK 9 RFR(m): 8177788 migrate collections docs into jdk doc-files Message-ID: Hi all, Here's another step in the docs cleanup: migration of the collections technotes/guides into the JDK's javadoc doc-files. This is a webrev containing two changesets: JDK-8177787 copy collections technotes/guides html files into jdk doc-files JDK-8177788 fix links, minor editing, add Java SE 9 changes to collections docs The main way to reach these pages will now be a link from the java.util package documentation. There are a bunch of places around the javadoc that point to the obsolete location of the collections docs. These are typically within sentences of the form "This class is a member of the Java Collections Framework." The next step will be to change all those links to point to the docs in their new location. Here's the webrev: http://cr.openjdk.java.net/~smarks/reviews/8177788/webrev.0/ Thanks, s'marks From mandy.chung at oracle.com Thu Apr 6 00:54:53 2017 From: mandy.chung at oracle.com (Mandy Chung) Date: Wed, 5 Apr 2017 17:54:53 -0700 Subject: JDK 9 RFR(m): 8177788 migrate collections docs into jdk doc-files In-Reply-To: References: Message-ID: > On Apr 5, 2017, at 5:44 PM, Stuart Marks wrote: > > Hi all, > > Here's another step in the docs cleanup: migration of the collections technotes/guides into the JDK's javadoc doc-files. This is a webrev containing two changesets: > > JDK-8177787 copy collections technotes/guides html files into jdk doc-files > JDK-8177788 fix links, minor editing, add Java SE 9 changes to collections docs > > The main way to reach these pages will now be a link from the java.util package documentation. > > There are a bunch of places around the javadoc that point to the obsolete location of the collections docs. These are typically within sentences of the form "This class is a member of the Java Collections Framework." The next step will be to change all those links to point to the docs in their new location. > > Here's the webrev: > > http://cr.openjdk.java.net/~smarks/reviews/8177788/webrev.0/ Other than designfaq.html, these html files such as changes[3-9].html, index.html, overview.html, and reference.html seem not worthing to be retained. Since the links need to be fixed anyway, perhaps we should get rid of those links instead unless it references some useful documents. Mandy From stuart.marks at oracle.com Thu Apr 6 01:46:27 2017 From: stuart.marks at oracle.com (Stuart Marks) Date: Wed, 5 Apr 2017 18:46:27 -0700 Subject: JDK 9 RFR(m): 8177788 migrate collections docs into jdk doc-files In-Reply-To: References: Message-ID: <7cef5084-4d6d-9694-68aa-02b84b06ecb6@oracle.com> On 4/5/17 5:54 PM, Mandy Chung wrote: > >> On Apr 5, 2017, at 5:44 PM, Stuart Marks wrote: >> >> http://cr.openjdk.java.net/~smarks/reviews/8177788/webrev.0/ > > Other than designfaq.html, these html files such as changes[3-9].html, > index.html, overview.html, and reference.html seem not worthing > to be retained. The overview and reference are arguably redundant with the tutorial, but the tutorial isn't as comprehensive as these are. Some of the material could be dropped, rearranged, or merged into designfaq, but that's more editing than I want to do at this point. I rather like having the version history around. It's much easier than digging through release notes, or looking through documentation pages of a succession of historical JDK releases. > Since the links need to be fixed anyway, perhaps we should get rid > of those links instead unless it references some useful documents. You mean, the links from all the various collections classes, where they say "This class is a member of the Java Collections Framework" ? Fixing them isn't really a problem; it's basically a global replace. I'd rather not remove these links; they provide some cohesion to what otherwise would be random class files scattered across the JDK. s'marks From claes.redestad at oracle.com Thu Apr 6 10:45:49 2017 From: claes.redestad at oracle.com (Claes Redestad) Date: Thu, 6 Apr 2017 12:45:49 +0200 Subject: JDK 10 RFR of 8176894: Provide specialized implementation for default methods putIfAbsent, computeIfAbsent, computeIfPresent, compute in TreeMap In-Reply-To: <75959b26-9023-c662-bfda-87860a614a2c@oracle.com> References: <048a8a8d-20ac-4d32-1b49-244e85afdfd5@oracle.com> <507d83cf-2334-303a-1ae3-2bb8b1e9bd4c@oracle.com> <75959b26-9023-c662-bfda-87860a614a2c@oracle.com> Message-ID: Hi Sergey, this looks good to me*, but I can't help wonder if the modCount checking is something that should be done separately as a bug fix (with a higher priority) and be backported to 8 and 9? Alternatively re-categorize this fix as such. Thanks! /Claes * I wouldn't mind seeing the cleanup Martin suggested, i.e., write the remapValue as: private V remapValue(Entry t, K key, BiFunction remappingFunction) { V newValue = remappingFunction.apply(key, t.value); if (newValue == null) { deleteEntry(t); } else { // replace old mapping t.value = newValue; } return newValue; } On 2017-03-28 21:22, Sergey Kuksenko wrote: > Friendly reminder. > > Have you have chance to review the latest version? > > > On 03/17/2017 12:45 PM, Sergey Kuksenko wrote: >> Hi, All. >> >> I realized (thanks Tagir V.) that if we don't check modCount after >> calling mapping function we may get corrupted tree structure. >> new webrev for review: >> http://cr.openjdk.java.net/~skuksenko/corelibs/utils/8176894/webrev.01/ >> >> On 03/17/2017 11:29 AM, Martin Buchholz wrote: >>> Thanks! This looks pretty good. I have a similar effort in >>> progress to improve bulk collection operations, most of which made >>> it into jdk9. >>> >>> --- >>> >>> Please use standard java.util whitespace, as Aleksey suggested. >>> >>> --- >>> >>> Below (and in compute) I wpuld simply >>> return newValue; >>> saving a line of code and making it clearer that we are returning >>> the result of the remappingFunction >>> >>> 676 private V remapValue(Entry t, K key, BiFunction>> super K, ? super V, ? extends V> remappingFunction) { >>> 677 V newValue = remappingFunction.apply(key, t.value); >>> 678 if (newValue == null) { >>> 679 deleteEntry(t); >>> 680 return null; >>> 681 } else { >>> 682 // replace old mapping >>> 683 t.value = newValue; >>> 684 return newValue; >>> 685 } >>> 686 } >>> --- >>> >>> This code is surely tested but testing could also surely be >>> improved. That's probably not your job though (it may be mine!) >>> >>> I would probably try hand-injecting some bugs into a copy of the >>> code and seeing if our jtreg tests catch it, to increase coverage >>> confidence. >>> >>> >>> On Thu, Mar 16, 2017 at 12:04 PM, Sergey Kuksenko >>> > wrote: >>> >>> Hi All, >>> >>> Please, review: >>> https://bugs.openjdk.java.net/browse/JDK-8176894 >>> >>> http://cr.openjdk.java.net/~skuksenko/corelibs/utils/8176894/webrev.00/ >>> >>> >>> >>> The issue was created for JDK10 in order to don't disturb JDK9 >>> before launch. >>> >>> -- Best regards, >>> Sergey Kuksenko >>> >>> >> > From daniel.fuchs at oracle.com Thu Apr 6 11:00:39 2017 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Thu, 6 Apr 2017 12:00:39 +0100 Subject: 9 RFR: 8178139: Minor typo in API documentation of java.util.logging.Logger Message-ID: <188ce296-1735-ef1f-7e57-845ef9eb7fdc@oracle.com> Hi, Please find below a trivial change to fix 8178139: Minor typo in API documentation of java.util.logging.Logger https://bugs.openjdk.java.net/browse/JDK-8178139 will configured => will be configured (appears twice) This is a minor typo doc fix so AFAIU RDP2 approval is not needed. best regards, -- daniel diff --git a/src/java.logging/share/classes/java/util/logging/Logger.java b/src/java.logging/share/classes/java/util/logging/Logger.java --- a/src/java.logging/share/classes/java/util/logging/Logger.java +++ b/src/java.logging/share/classes/java/util/logging/Logger.java @@ -664,7 +664,7 @@ * a new logger is created. *

* If a new logger is created its log level will be configured - * based on the LogManager configuration and it will configured + * based on the LogManager configuration and it will be configured * to also send logging output to its parent's Handlers. It will * be registered in the LogManager global namespace. *

@@ -726,7 +726,7 @@ * *

* If a new logger is created its log level will be configured - * based on the LogManager and it will configured to also send logging + * based on the LogManager and it will be configured to also send logging * output to its parent's Handlers. It will be registered in * the LogManager global namespace. *

From lance.andersen at oracle.com Thu Apr 6 11:02:40 2017 From: lance.andersen at oracle.com (Lance Andersen) Date: Thu, 6 Apr 2017 07:02:40 -0400 Subject: 9 RFR: 8178139: Minor typo in API documentation of java.util.logging.Logger In-Reply-To: <188ce296-1735-ef1f-7e57-845ef9eb7fdc@oracle.com> References: <188ce296-1735-ef1f-7e57-845ef9eb7fdc@oracle.com> Message-ID: <9D076F56-E45E-4C02-8D61-6CC0283058D3@oracle.com> looks fine Daniel > On Apr 6, 2017, at 7:00 AM, Daniel Fuchs wrote: > > Hi, > > Please find below a trivial change to fix > 8178139: Minor typo in API documentation of java.util.logging.Logger > https://bugs.openjdk.java.net/browse/JDK-8178139 > > will configured => will be configured > (appears twice) > > This is a minor typo doc fix so AFAIU RDP2 approval is not needed. > > best regards, > > -- daniel > > diff --git a/src/java.logging/share/classes/java/util/logging/Logger.java b/src/java.logging/share/classes/java/util/logging/Logger.java > --- a/src/java.logging/share/classes/java/util/logging/Logger.java > +++ b/src/java.logging/share/classes/java/util/logging/Logger.java > @@ -664,7 +664,7 @@ > * a new logger is created. > *

> * If a new logger is created its log level will be configured > - * based on the LogManager configuration and it will configured > + * based on the LogManager configuration and it will be configured > * to also send logging output to its parent's Handlers. It will > * be registered in the LogManager global namespace. > *

> @@ -726,7 +726,7 @@ > * > *

> * If a new logger is created its log level will be configured > - * based on the LogManager and it will configured to also send logging > + * based on the LogManager and it will be configured to also send logging > * output to its parent's Handlers. It will be registered in > * the LogManager global namespace. > *

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 timo.kinnunen at gmail.com Thu Apr 6 13:38:45 2017 From: timo.kinnunen at gmail.com (Timo Kinnunen) Date: Thu, 6 Apr 2017 15:38:45 +0200 Subject: JDK 9 RFR(s): 8150488: add note to Scanner.findAll()regardingpossible infinite streams In-Reply-To: References: <58DC7E53.6040603@oracle.com> <58dd2aba.298fdf0a.86cca.3418@mx.google.com> <58E427E8.2020901@oracle.com> <89d5129f-faff-20cb-eb86-6d3bb4151958@oracle.com> Message-ID: <58e644e8.6585df0a.cb334.d1ae@mx.google.com> IMHO there should be a notice added in findAll which excludes the behavior of the stream after an empty match from any compatibility requirements while the notice remains in place. This would be to ensure that findAll and the stream it returns can be changed independently from the other methods which also have this issue. Just in case. Sent from Mail for Windows 10 From: Stuart Marks Sent: Wednesday, April 5, 2017 18:49 To: Xueming Shen Cc: core-libs-dev at openjdk.java.net Subject: Re: JDK 9 RFR(s): 8150488: add note to Scanner.findAll()regardingpossible infinite streams On 4/4/17 10:48 PM, Stuart Marks wrote: > > > On 4/4/17 4:10 PM, Xueming Shen wrote: >> Personally I think the use scenario and the expected resulting behavior of >> StreamfinaAll(ptn) should be more equivalent/similar to the use case of >> while (s.hasNext(p)) { s.next(p); }, or while (m.find()) { }, therefor it is >> probably desired it can be used without worrying the possibility of getting >> into an infinite loop. > > The Scanner.tokens() API, also added in Java 9, provides a stream of delimited > tokens (strings) that's more-or-less equivalent of a hasNext()/next() loop. > > Just as findWithinHorizon() is a distinct use case from hasNext()/next() > delimited tokens, findAll() provides for distinct uses from tokens(). > >> That said, I agree it might be hard to argue to fix it in jdk9. The question >> is if we are going to fix it in 9u sometime in the further, is it still worth >> putting down the note in the API now. I'm fine if you believe a note will >> help at least make the issue a known/documented usage limitation, for JDK9. I've thought about this some more... fundamentally the behavior is odd, since Scanner.findWithinHorizon() is *based on* Matcher.find(). So why does Matcher.find() "work" and S.findWithinHorizon() produce an infinite loop? If you look in findPatternInBuffer, upon which findWithinHorizon and findAll are based, it essentially resets the matcher every time, which cases the Matcher.find() special case to be bypassed. So I think this could be considered a bug in findPatternInBuffer, which causes misbehavior to be visible in findWithinHorizon and findAll. I've filed: JDK-8178116 scanner.findWithinHorizon doesn't advance after matching zero characters This is certainly too subtle to be trying to fix right now. I guess the question is, if we believe this is a bug that will be fixed at some point, do we add a note to findAll() -- and maybe even findWithinHorizon() -- to document this? Historically we haven't documented bugs like this, so maybe not. Note also that this behavior of findWithinHorizon has been there since JDK 6, which is the earliest release I had conveniently at hand. s'marks >> >> Yes, I think we did chat about this one at the hallway some time when either >> you or something ran into the loop by using the method ... > > There are already a couple ways you can get unexpected behavior with Scanner if > you're not careful. For example, see the warnings in findWithinHorizon() and > skip() about the possibility of buffering up the entire input. These methods are > useful, but if you're not careful with the regex you provide, things can go > wrong. The findAll() method seems to be in the same situation. It's not clear to > me that any of these are bugs for which there's a reasonable fix. > > So yes, I think the note is necessary. I could also add something about > terminating such streams with limit() or takeWhile(). > > s'marks > >> >> Thanks, >> Sherman >> >> >>> >>> s'marks >>> >>> On 3/30/17 2:19 PM, Stuart Marks wrote: >>>> Hi Timo, Sherman, >>>> >>>> Thanks for looking at this. >>>> >>>> Sherman wrote: >>>> >>>>> This might practically put the api itself almost useless? it might be an easy >>>>> task to spot >>>>> whether or not it's a 0-width-match-possible regex when the regex is simple, >>>>> but it gets >>>>> harder and harder, if not impossible when the regex gets complicated, >>>>> especially consider >>>>> the possible use scenario that the use site is embedded deeply inside a >>>>> library implementation. >>>> >>>> Well, not "useless", but perhaps less useful than one might like. :-) >>>> >>>> I think this is potentially surprising behavior, which is why I at least wanted >>>> to add the note. It's not clear to me whether we should try to fix this by >>>> changing Scanner though. >>>> >>>> Essentially, findAll() is defined in terms of findWithinHorizon(pattern, 0). So >>>> if one were to write a loop like so: >>>> >>>> String str; >>>> while ((str = scanner.findWithinHorizon(pattern, 0)) != null) { >>>> System.out.println(str); >>>> } >>>> >>>> then this loop would have the same problem if pattern were to match zero >>>> characters. >>>> >>>>> The alternative is to "fix" it, maybe as what Matcher.find() does, if the >>>>> previous match is >>>>> zero-width-match (the fist==last), we step one to the next cursor before next >>>>> try. I know >>>> >>>> Interesting, I didn't know Matcher.find() advances the cursor like this. But >>>> Scanner.findWithinHorizon() apparently doesn't, so that's why an infinite loop >>>> can occur. >>>> >>>>> Scanner.findPatternInBuffer() is setting new region set every time it is >>>>> invoked which makes >>>>> it complicated, but I would assume it might be still worth a trying? for >>>>> example, utilize the >>>>> "hasNextResult"/matcher.end(). I'm not sure without looking into the code, >>>>> does >>>>> >>>>> while (hasNext(pattern)) { >>>>> next(pattern); >>>>> } >>>>> >>>>> have the same issue, when pattern matches 0-width? >>>> >>>> No, this doesn't have the problem, because hasNext(pat) and next(pat) match >>>> delimited tokens. Each call to next() implicitly advances past the next >>>> delimiter to reach the subsequent token, if any. >>>> >>>> >>>> On 3/30/17 8:56 AM, Timo Kinnunen wrote: >>>>> I guess this somewhat contrived example also wouldn?t work? >>>>> >>>>> String s = "\\b\\w+|\\G|\\B"; >>>>> String t = "Matcher m = Pattern.compile(s).matcher(t);\n"; >>>>> Matcher m = Pattern.compile(s).matcher(t); >>>>> while(m.find()) { >>>>> System.out.println("'" + m.group() + "'"); >>>>> } >>>> >>>> Right, so if you rewrote this loop to use Scanner.findWithinHorizon() >>>> instead of >>>> Matcher, >>>> >>>> Scanner sc = new Scanner(t); >>>> String str; >>>> while ((str = sc.findWithinHorizon(s, 0)) != null) { >>>> System.out.println("'" + str + "'"); >>>> } >>>> >>>> you'd get an infinite loop with str being continually assigned the empty >>>> string. >>>> As Sherman mentioned, the Matcher.find() will advance the cursor if it gets a >>>> zero-width match, avoiding this problem. >>>> >>>> * * * >>>> >>>> This didn't come up in the code review thread, which was mostly about >>>> concurrent >>>> modification and late-binding of the spliterator: >>>> >>>> >>>> http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-September/035034.html >>>> >>>> I remember noting this phenomenon a while back, which is why I had filed the >>>> bug >>>> to add a note. I seem to remember discussing it, though, but it might have been >>>> in a meeting or in a hallway conversation. >>>> >>>> This bug (JDK-8150488) does note that an infinite stream might be unexpected or >>>> surprising, but it's not a fatal problem. It can be terminated with limit(). It >>>> can also be terminated with takeWhile(), also added in JDK 9. Maybe I could >>>> mention these in the API note. >>>> >>>> I guess we could also consider changing the implicit findWithinHorizon() loop >>>> that findAll() does, perhaps by having it terminate on a zero-width match. >>>> Or we >>>> could even change findWithinHorizon's behavior if it gets a zero-width match, >>>> siilar to what Matcher.find() does. But I'm quite reluctant to start making >>>> such >>>> changes at this point. >>>> >>>> s'marks >>>> >>>> >>>> >>>>> // Outputs: >>>>> // 'Matcher' >>>>> // '' >>>>> // 'm' >>>>> // '' >>>>> // '' >>>>> // '' >>>>> // 'Pattern' >>>>> // '' >>>>> // 'compile' >>>>> // '' >>>>> // 's' >>>>> // '' >>>>> // '' >>>>> // 'matcher' >>>>> // '' >>>>> // 't' >>>>> // '' >>>>> // '' >>>>> // '' >>>>> // '' >>>>> >>>>> >>>>> >>>>> Sent from Mail for Windows 10 >>>>> >>>>> From: Xueming Shen >>>>> Sent: Thursday, March 30, 2017 05:41 >>>>> To: core-libs-dev at openjdk.java.net >>>>> Subject: Re: JDK 9 RFR(s): 8150488: add note to Scanner.findAll() >>>>> regardingpossible infinite streams >>>>> >>>>> On 3/29/17, 5:56 PM, Stuart Marks wrote: >>>>>> Hi all, >>>>>> >>>>>> Please review these non-normative textual additions to the >>>>>> Scanner.findAll() method docs. These methods were added earlier in JDK >>>>>> 9; there's a small pitfall if the regex can match zero characters. >>>>>> >>>>> Stuart, >>>>> >>>>> This might practically put the api itself almost useless? it might be an >>>>> easy task to spot >>>>> whether or not it's a 0-width-match-possible regex when the regex is >>>>> simple, but it gets >>>>> harder and harder, if not impossible when the regex gets complicated, >>>>> especially consider >>>>> the possible use scenario that the use site is embedded deeply inside a >>>>> library implementation. >>>>> >>>>> The alternative is to "fix" it, maybe as what Matcher.find() does, if >>>>> the previous match is >>>>> zero-width-match (the fist==last), we step one to the next cursor before >>>>> next try. I know >>>>> Scanner.findPatternInBuffer() is setting new region set every time it is >>>>> invoked which makes >>>>> it complicated, but I would assume it might be still worth a trying? for >>>>> example, utilize the >>>>> "hasNextResult"/matcher.end(). I'm not sure without looking into the >>>>> code, does >>>>> >>>>> while (hasNext(pattern)) { >>>>> next(pattern); >>>>> } >>>>> >>>>> have the same issue, when pattern matches 0-width? >>>>> >>>>> Thanks! >>>>> -Sherman >>>>> >>>>> >>>>> >>>>> >>>>>> Thanks, >>>>>> >>>>>> s'marks >>>>>> >>>>>> >>>>>> # HG changeset patch >>>>>> # User smarks >>>>>> # Date 1490749958 25200 >>>>>> # Tue Mar 28 18:12:38 2017 -0700 >>>>>> # Node ID 6b43c4698752779793d58813f46d3687c17dde75 >>>>>> # Parent fb54b256d751ae3191e9cef42ff9f5630931f047 >>>>>> 8150488: add note to Scanner.findAll() regarding possible infinite >>>>>> streams >>>>>> Reviewed-by: XXX >>>>>> >>>>>> diff -r fb54b256d751 -r 6b43c4698752 >>>>>> src/java.base/share/classes/java/util/Scanner.java >>>>>> --- a/src/java.base/share/classes/java/util/Scanner.java Mon Mar 27 >>>>>> 15:12:01 2017 -0700 >>>>>> +++ b/src/java.base/share/classes/java/util/Scanner.java Tue Mar 28 >>>>>> 18:12:38 2017 -0700 >>>>>> @@ -2808,6 +2808,10 @@ >>>>>> * } >>>>>> * } >>>>>> * >>>>>> + *

The pattern must always match at least one character. If >>>>>> the pattern >>>>>> + * can match zero characters, the result will be an infinite stream >>>>>> + * of empty matches. >>>>>> + * >>>>>> * @param pattern the pattern to be matched >>>>>> * @return a sequential stream of match results >>>>>> * @throws NullPointerException if pattern is null >>>>>> @@ -2829,6 +2833,11 @@ >>>>>> * scanner.findAll(Pattern.compile(patString)) >>>>>> * } >>>>>> * >>>>>> + * @apiNote >>>>>> + * The pattern must always match at least one character. If the >>>>>> pattern >>>>>> + * can match zero characters, the result will be an infinite stream >>>>>> + * of empty matches. >>>>>> + * >>>>>> * @param patString the pattern string >>>>>> * @return a sequential stream of match results >>>>>> * @throws NullPointerException if patString is null >>>>> >>>>> >> From daniel.fuchs at oracle.com Thu Apr 6 13:50:18 2017 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Thu, 6 Apr 2017 14:50:18 +0100 Subject: 9 RFR: 8178139: Minor typo in API documentation of java.util.logging.Logger In-Reply-To: <9D076F56-E45E-4C02-8D61-6CC0283058D3@oracle.com> References: <188ce296-1735-ef1f-7e57-845ef9eb7fdc@oracle.com> <9D076F56-E45E-4C02-8D61-6CC0283058D3@oracle.com> Message-ID: <9f4bb6a5-72f1-7dba-9940-015528d4f8fd@oracle.com> On 06/04/2017 12:02, Lance Andersen wrote: > looks fine Daniel Thanks Lance. Pushed. -- daniel >> On Apr 6, 2017, at 7:00 AM, Daniel Fuchs > > wrote: >> >> Hi, >> >> Please find below a trivial change to fix >> 8178139: Minor typo in API documentation of java.util.logging.Logger >> https://bugs.openjdk.java.net/browse/JDK-8178139 >> >> will configured => will be configured >> (appears twice) >> >> This is a minor typo doc fix so AFAIU RDP2 approval is not needed. >> >> best regards, >> >> -- daniel >> >> diff --git >> a/src/java.logging/share/classes/java/util/logging/Logger.java >> b/src/java.logging/share/classes/java/util/logging/Logger.java >> --- a/src/java.logging/share/classes/java/util/logging/Logger.java >> +++ b/src/java.logging/share/classes/java/util/logging/Logger.java >> @@ -664,7 +664,7 @@ >> * a new logger is created. >> *

>> * If a new logger is created its log level will be configured >> - * based on the LogManager configuration and it will configured >> + * based on the LogManager configuration and it will be configured >> * to also send logging output to its parent's Handlers. It will >> * be registered in the LogManager global namespace. >> *

>> @@ -726,7 +726,7 @@ >> * >> *

>> * If a new logger is created its log level will be configured >> - * based on the LogManager and it will configured to also send >> logging >> + * based on the LogManager and it will be configured to also send >> logging >> * output to its parent's Handlers. It will be registered in >> * the LogManager global namespace. >> *

> > > > 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.w.dennis at gmail.com Thu Apr 6 14:08:48 2017 From: chris.w.dennis at gmail.com (Chris Dennis) Date: Thu, 6 Apr 2017 10:08:48 -0400 Subject: [PATCH] 8178117: Add public state constructors for Int/Long/DoubleSummaryStatistics Message-ID: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com> Hi Paul (et al) Like all things API there are wrinkles here when it comes to implementing. This patch isn?t final, there appears to be no existing test coverage for these classes beyond testing the compensating summation used in the double implementation, and I left off adding any until it was decided how much parameter validation we want (since that?s the only testing that can really occur here). The wrinkles relate to the issues around instances that have suffered overflow in count and/or sum which the existing implementation doesn?t defend against: * I chose to ignore all parameters if 'count == 0? and just leave the instance empty. I held off from validating min, max and count however. This obviously 'breaks things? (beyond how broken they would already be) if count == 0 only due to overflow. * I chose to fail if count is negative. * I chose to enforce that max and min are logically consistent with count and sum, this can break the moment either one of the overflows as well (I?m also pretty sure that the FPU logic is going to suffer here too - there might be some magic I can do with a pessimistic bit of rounding on the FPU multiplication result). I intentionally went with the most aggressive parameter validation here to establish one end of what could be implemented. There are arguments for this and also arguments for the other extreme (no validation at all). Personally I?m in favor of the current version where the creation will fail if the inputs are only possible through overflow (modulo fixing the FPU precision issues above) even though it?s at odds with approach of the existing implementation. Would appreciate thoughts/feedback. Thanks. Chris P.S. I presume tests would be required for the parameter checking (once it is finalized)? From jbluettduncan at gmail.com Thu Apr 6 14:32:48 2017 From: jbluettduncan at gmail.com (Jonathan Bluett-Duncan) Date: Thu, 6 Apr 2017 15:32:48 +0100 Subject: [PATCH] 8178117: Add public state constructors for Int/Long/DoubleSummaryStatistics In-Reply-To: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com> References: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com> Message-ID: Hi Chris, Unfortunately the patch you sent (in what I presume was an attachment) is missing. I believe the OpenJDK mailing list servers intentionally strip out attachments in all emails, which seems to be at odds with the advice given in http://openjdk.java.net/contribute/. (Either the contribution advice or the servers should be changed, ideally!) I understand that one can host patches somewhere official, but I've forgotten the details of the process. Can anyone help? Jonathan On 6 April 2017 at 15:08, Chris Dennis wrote: > Hi Paul (et al) > > Like all things API there are wrinkles here when it comes to implementing. > > This patch isn?t final, there appears to be no existing test coverage for > these classes beyond testing the compensating summation used in the double > implementation, and I left off adding any until it was decided how much > parameter validation we want (since that?s the only testing that can really > occur here). > > The wrinkles relate to the issues around instances that have suffered > overflow in count and/or sum which the existing implementation doesn?t > defend against: > > * I chose to ignore all parameters if 'count == 0? and just leave the > instance empty. I held off from validating min, max and count however. This > obviously 'breaks things? (beyond how broken they would already be) if > count == 0 only due to overflow. > * I chose to fail if count is negative. > * I chose to enforce that max and min are logically consistent with count > and sum, this can break the moment either one of the overflows as well (I?m > also pretty sure that the FPU logic is going to suffer here too - there > might be some magic I can do with a pessimistic bit of rounding on the FPU > multiplication result). > > I intentionally went with the most aggressive parameter validation here to > establish one end of what could be implemented. There are arguments for > this and also arguments for the other extreme (no validation at all). > Personally I?m in favor of the current version where the creation will fail > if the inputs are only possible through overflow (modulo fixing the FPU > precision issues above) even though it?s at odds with approach of the > existing implementation. > > Would appreciate thoughts/feedback. Thanks. > > Chris > > > P.S. I presume tests would be required for the parameter checking (once it > is finalized)? > > From chris.w.dennis at gmail.com Thu Apr 6 14:42:42 2017 From: chris.w.dennis at gmail.com (Chris Dennis) Date: Thu, 6 Apr 2017 10:42:42 -0400 Subject: [PATCH] 8178117: Add public state constructors for Int/Long/DoubleSummaryStatistics In-Reply-To: References: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com> Message-ID: # HG changeset patch # User chris_dennis # Date 1491485015 14400 # Thu Apr 06 09:23:35 2017 -0400 # Node ID d789970b8393032457885e739d76919f714bbd50 # Parent c0aecf84349c97f4241eab01f7bbfb7660d51be1 8178117: Add public state constructors for Int/Long/DoubleSummaryStatistics diff --git a/src/java.base/share/classes/java/util/DoubleSummaryStatistics.java b/src/java.base/share/classes/java/util/DoubleSummaryStatistics.java --- a/src/java.base/share/classes/java/util/DoubleSummaryStatistics.java +++ b/src/java.base/share/classes/java/util/DoubleSummaryStatistics.java @@ -76,6 +76,47 @@ public DoubleSummaryStatistics() { } /** + * Construct a non-empty instance with the supplied min, max, count, and sum. + * + *

If {@code count} is zero then the remaining parameters are ignored + * and an empty instance is constructed. + *

If the arguments are inconsistent then an {@code IllegalArgumentException} + * is thrown. The necessary consistent argument conditions are: + *

    + *
  • {@code count} &ge 0
  • + *
  • {@code min} &le {@code max}
  • + *
  • ({@code count} × {@code max}) &ge {@code sum}
  • + *
  • ({@code count} × {@code min}) &le {@code sum}
  • + *
+ * This enforcement of argument consistency means that the retrieved set of + * values from a {@code DoubleSummaryStatistics} instance may not be a legal + * set of arguments for this constructor due to arithmetic overflow in the + * original instance. + * + * @param min the minimum value + * @param max the maximum value + * @param count the count of values + * @param sum the sum of all values + * @throws IllegalArgumentException if the arguments are inconsistent + */ + public DoubleSummaryStatistics(double min, double max, long count, double sum) throws IllegalArgumentException { + if (count < 0L) { + throw new IllegalArgumentException("Negative count value"); + } else if (count > 0L) { + if (min > max) throw new IllegalArgumentException("Minimum greater than maximum"); + if (count * max < sum) throw new IllegalArgumentException("Maximum inconsistent with sum and count"); + if (count * min > sum) throw new IllegalArgumentException("Minimum inconsistent with sum and count"); + + this.count = count; + this.sum = sum; + this.simpleSum = sum; + this.sumCompensation = 0.0d; + this.min = min; + this.max = max; + } + } + + /** * Records another value into the summary information. * * @param value the input value diff --git a/src/java.base/share/classes/java/util/IntSummaryStatistics.java b/src/java.base/share/classes/java/util/IntSummaryStatistics.java --- a/src/java.base/share/classes/java/util/IntSummaryStatistics.java +++ b/src/java.base/share/classes/java/util/IntSummaryStatistics.java @@ -27,6 +27,9 @@ import java.util.function.IntConsumer; import java.util.stream.Collector; +import static java.lang.Math.multiplyExact; +import static java.lang.Math.multiplyFull; + /** * A state object for collecting statistics such as count, min, max, sum, and * average. @@ -76,6 +79,49 @@ public IntSummaryStatistics() { } /** + * Construct a non-empty instance with the supplied min, max, count, and sum. + * + *

If {@code count} is zero then the remaining parameters are ignored + * and an empty instance is constructed. + *

If the arguments are inconsistent then an {@code IllegalArgumentException} + * is thrown. The necessary consistent argument conditions are: + *

    + *
  • {@code count} &ge 0
  • + *
  • {@code min} &le {@code max}
  • + *
  • ({@code count} × {@code max}) &ge {@code sum}
  • + *
  • ({@code count} × {@code min}) &le {@code sum}
  • + *
+ * This enforcement of argument consistency means that the retrieved set of + * values from an {@code IntSummaryStatistics} instance may not be a legal + * set of arguments for this constructor due to arithmetic overflow in the + * original instance. + * + * @param min the minimum value + * @param max the maximum value + * @param count the count of values + * @param sum the sum of all values + * @throws IllegalArgumentException if the arguments are inconsistent + */ + public IntSummaryStatistics(int min, int max, long count, long sum) throws IllegalArgumentException { + if (count < 0L) { + throw new IllegalArgumentException("Negative count value"); + } else if (count > 0L) { + if (min > max) throw new IllegalArgumentException("Minimum greater than maximum"); + try { + if (multiplyExact(count, max) < sum) throw new IllegalArgumentException("Maximum inconsistent with sum and count"); + } catch (ArithmeticException e) {} + try { + if (multiplyExact(count, min) > sum) throw new IllegalArgumentException("Minimum inconsistent with sum and count"); + } catch (ArithmeticException e) {} + + this.count = count; + this.sum = sum; + this.min = min; + this.max = max; + } + } + + /** * Records a new value into the summary information * * @param value the input value diff --git a/src/java.base/share/classes/java/util/LongSummaryStatistics.java b/src/java.base/share/classes/java/util/LongSummaryStatistics.java --- a/src/java.base/share/classes/java/util/LongSummaryStatistics.java +++ b/src/java.base/share/classes/java/util/LongSummaryStatistics.java @@ -28,6 +28,8 @@ import java.util.function.LongConsumer; import java.util.stream.Collector; +import static java.lang.Math.multiplyExact; + /** * A state object for collecting statistics such as count, min, max, sum, and * average. @@ -77,6 +79,49 @@ public LongSummaryStatistics() { } /** + * Construct a non-empty instance with the supplied min, max, count, and sum. + * + *

If {@code count} is zero then the remaining parameters are ignored + * and an empty instance is constructed. + *

If the arguments are inconsistent then an {@code IllegalArgumentException} + * is thrown. The necessary consistent argument conditions are: + *

    + *
  • {@code count} &ge 0
  • + *
  • {@code min} &le {@code max}
  • + *
  • ({@code count} × {@code max}) &ge {@code sum}
  • + *
  • ({@code count} × {@code min}) &le {@code sum}
  • + *
+ * This enforcement of argument consistency means that the retrieved set of + * values from a {@code LongSummaryStatistics} instance may not be a legal + * set of arguments for this constructor due to arithmetic overflow in the + * original instance. + * + * @param min the minimum value + * @param max the maximum value + * @param count the count of values + * @param sum the sum of all values + * @throws IllegalArgumentException if the arguments are inconsistent + */ + public LongSummaryStatistics(long min, long max, long count, long sum) throws IllegalArgumentException { + if (count < 0L) { + throw new IllegalArgumentException("Negative count value"); + } else if (count > 0L) { + if (min > max) throw new IllegalArgumentException("Minimum greater than maximum"); + try { + if (multiplyExact(count, max) < sum) throw new IllegalArgumentException("Maximum inconsistent with sum and count"); + } catch (ArithmeticException e) {} + try { + if (multiplyExact(count, min) > sum) throw new IllegalArgumentException("Minimum inconsistent with sum and count"); + } catch (ArithmeticException e) {} + + this.count = count; + this.sum = sum; + this.min = min; + this.max = max; + } + } + + /** * Records a new {@code int} value into the summary information. * * @param value the input value > On Apr 6, 2017, at 10:32 AM, Jonathan Bluett-Duncan wrote: > > Hi Chris, > > Unfortunately the patch you sent (in what I presume was an attachment) is missing. I believe the OpenJDK mailing list servers intentionally strip out attachments in all emails, which seems to be at odds with the advice given in http://openjdk.java.net/contribute/. (Either the contribution advice or the servers should be changed, ideally!) > > I understand that one can host patches somewhere official, but I've forgotten the details of the process. > > Can anyone help? > > Jonathan > > > On 6 April 2017 at 15:08, Chris Dennis wrote: > Hi Paul (et al) > > Like all things API there are wrinkles here when it comes to implementing. > > This patch isn?t final, there appears to be no existing test coverage for these classes beyond testing the compensating summation used in the double implementation, and I left off adding any until it was decided how much parameter validation we want (since that?s the only testing that can really occur here). > > The wrinkles relate to the issues around instances that have suffered overflow in count and/or sum which the existing implementation doesn?t defend against: > > * I chose to ignore all parameters if 'count == 0? and just leave the instance empty. I held off from validating min, max and count however. This obviously 'breaks things? (beyond how broken they would already be) if count == 0 only due to overflow. > * I chose to fail if count is negative. > * I chose to enforce that max and min are logically consistent with count and sum, this can break the moment either one of the overflows as well (I?m also pretty sure that the FPU logic is going to suffer here too - there might be some magic I can do with a pessimistic bit of rounding on the FPU multiplication result). > > I intentionally went with the most aggressive parameter validation here to establish one end of what could be implemented. There are arguments for this and also arguments for the other extreme (no validation at all). Personally I?m in favor of the current version where the creation will fail if the inputs are only possible through overflow (modulo fixing the FPU precision issues above) even though it?s at odds with approach of the existing implementation. > > Would appreciate thoughts/feedback. Thanks. > > Chris > > > P.S. I presume tests would be required for the parameter checking (once it is finalized)? > > From Roger.Riggs at Oracle.com Thu Apr 6 14:44:51 2017 From: Roger.Riggs at Oracle.com (Roger Riggs) Date: Thu, 6 Apr 2017 10:44:51 -0400 Subject: RFR 9: 8165641 : Deprecate Object.finalize In-Reply-To: References: <96fe9ae0-993a-aea6-cabf-f079450dc128@Oracle.com> <49eb0b85-130a-b74d-e760-120674de6ebc@oracle.com> <31a37a8c-e3fd-96cf-00a4-090d65c21cff@Oracle.com> <78e0fb3c-0850-4aa9-9f73-e319e8a8e7b9@Oracle.com> Message-ID: <58fb68d2-db1c-72ea-4b3a-f2fa580eb410@Oracle.com> Thanks Mandy, I'll put you down as a reviewer for the fix. (8165641 was pushed) diff --git a/src/java.base/share/classes/java/lang/Object.java b/src/java.base/share/classes/java/lang/Object.java --- a/src/java.base/share/classes/java/lang/Object.java +++ b/src/java.base/share/classes/java/lang/Object.java @@ -593,7 +593,7 @@ public class Object { * finalization if it is no longer necessary; and no ordering is specified * among calls to {@code finalize} methods of different objects. * Furthermore, there are no guarantees regarding the timing of finalization. - * The {@code finalize} method might be called on an finalizable object + * The {@code finalize} method might be called on a finalizable object * only after an indefinite delay, if at all. * * Classes whose instances hold non-heap resources should provide a method [1] https://bugs.openjdk.java.net/browse/JDK-8178154 On 4/5/2017 6:15 PM, Mandy Chung wrote: >> On Apr 3, 2017, at 7:44 AM, Roger Riggs wrote: >> >> [1] http://cr.openjdk.java.net/~rriggs/webrev-finalize-deprecate-8165641 > > Typo: s/an finalizable/a finalizable/ > > + * The {@code finalize} method might be called on an finalizable object > > Otherwise, looks good. No need for a new webrev. > > Mandy From mandy.chung at oracle.com Thu Apr 6 14:45:49 2017 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 6 Apr 2017 07:45:49 -0700 Subject: RFR 9: 8165641 : Deprecate Object.finalize In-Reply-To: <58fb68d2-db1c-72ea-4b3a-f2fa580eb410@Oracle.com> References: <96fe9ae0-993a-aea6-cabf-f079450dc128@Oracle.com> <49eb0b85-130a-b74d-e760-120674de6ebc@oracle.com> <31a37a8c-e3fd-96cf-00a4-090d65c21cff@Oracle.com> <78e0fb3c-0850-4aa9-9f73-e319e8a8e7b9@Oracle.com> <58fb68d2-db1c-72ea-4b3a-f2fa580eb410@Oracle.com> Message-ID: +1 Mandy > On Apr 6, 2017, at 7:44 AM, Roger Riggs wrote: > > Thanks Mandy, I'll put you down as a reviewer for the fix. (8165641 was pushed) > > > diff --git a/src/java.base/share/classes/java/lang/Object.java b/src/java.base/share/classes/java/lang/Object.java > --- a/src/java.base/share/classes/java/lang/Object.java > +++ b/src/java.base/share/classes/java/lang/Object.java > @@ -593,7 +593,7 @@ public class Object { > * finalization if it is no longer necessary; and no ordering is specified > * among calls to {@code finalize} methods of different objects. > * Furthermore, there are no guarantees regarding the timing of finalization. > - * The {@code finalize} method might be called on an finalizable object > + * The {@code finalize} method might be called on a finalizable object > * only after an indefinite delay, if at all. > * > * Classes whose instances hold non-heap resources should provide a method > > > > [1] https://bugs.openjdk.java.net/browse/JDK-8178154 > > > > On 4/5/2017 6:15 PM, Mandy Chung wrote: >>> On Apr 3, 2017, at 7:44 AM, Roger Riggs wrote: >>> >>> [1] http://cr.openjdk.java.net/~rriggs/webrev-finalize-deprecate-8165641 >> >> Typo: s/an finalizable/a finalizable/ >> >> + * The {@code finalize} method might be called on an finalizable object >> >> Otherwise, looks good. No need for a new webrev. >> >> Mandy > From Roger.Riggs at Oracle.com Thu Apr 6 15:39:35 2017 From: Roger.Riggs at Oracle.com (Roger Riggs) Date: Thu, 6 Apr 2017 11:39:35 -0400 Subject: [8u] RFR: 8177776: Create an equivalent test case for JDK9's SupplementalJapaneseEraTest In-Reply-To: References: <69774039-1980-882f-2f89-fac194fd7fa7@oracle.com> Message-ID: <4306e4b1-c288-1c76-ff25-0b23f9a67137@Oracle.com> Hi Naoto, Thanks for replacing the shell script with Java code. Given the size of the JDK, I'd suggest removing the copy at the end of the test unless you can rely on jtreg to remove it promptly. The rest looks fine, Roger On 4/5/2017 5:14 PM, Naoto Sato wrote: > I revised the test case not to rely on shell script. Please review. > > http://cr.openjdk.java.net/~naoto/8177776/webrev.01/ > > Naoto > > On 3/30/17 2:10 PM, Naoto Sato wrote: >> Hello, >> >> Please review the changes to the following issue: >> >> https://bugs.openjdk.java.net/browse/JDK-8177776 >> >> The proposed change is located at: >> >> http://cr.openjdk.java.net/~naoto/8177776/webrev.00/ >> >> This is for backporting fixes for JapaneseEra related issues (8054214, >> 8173423). The original fixes in JDK9 included a test case, >> SupplementalJapaneseEraTest which is intended for the system property >> testing. The above proposed fix intends to adapt that test case into >> JDK8, where calendars.properties file is used instead of the system >> property. The test is pretty much identical to JDK9's. The difference is >> to deal with the calendars.properties file and removed some >> non-applicable cases in JDK8. >> >> Naoto From naoto.sato at oracle.com Thu Apr 6 15:46:29 2017 From: naoto.sato at oracle.com (Naoto Sato) Date: Thu, 6 Apr 2017 08:46:29 -0700 Subject: [8u] RFR: 8177776: Create an equivalent test case for JDK9's SupplementalJapaneseEraTest In-Reply-To: <4306e4b1-c288-1c76-ff25-0b23f9a67137@Oracle.com> References: <69774039-1980-882f-2f89-fac194fd7fa7@oracle.com> <4306e4b1-c288-1c76-ff25-0b23f9a67137@Oracle.com> Message-ID: Thanks for reviewing, Roger. On 4/6/17 8:39 AM, Roger Riggs wrote: > Hi Naoto, > > Thanks for replacing the shell script with Java code. > > Given the size of the JDK, I'd suggest removing the copy at the end of > the test > unless you can rely on jtreg to remove it promptly. I was thinking about using @AfterTest to do it, but then realized that jtreg automatically cleans up the "scratch" directory after the test, where the test JDK is copied into. Here is the quote from jtreg's page [1]: --- jtreg will automatically clean up any files written in the scratch directory. In general, you should not clean these files up within the test because they may provide infomation useful to diagnose a test failure, should that be necessary. --- Naoto [1] http://openjdk.java.net/jtreg/writetests.html > > The rest looks fine, Roger > > > On 4/5/2017 5:14 PM, Naoto Sato wrote: >> I revised the test case not to rely on shell script. Please review. >> >> http://cr.openjdk.java.net/~naoto/8177776/webrev.01/ >> >> Naoto >> >> On 3/30/17 2:10 PM, Naoto Sato wrote: >>> Hello, >>> >>> Please review the changes to the following issue: >>> >>> https://bugs.openjdk.java.net/browse/JDK-8177776 >>> >>> The proposed change is located at: >>> >>> http://cr.openjdk.java.net/~naoto/8177776/webrev.00/ >>> >>> This is for backporting fixes for JapaneseEra related issues (8054214, >>> 8173423). The original fixes in JDK9 included a test case, >>> SupplementalJapaneseEraTest which is intended for the system property >>> testing. The above proposed fix intends to adapt that test case into >>> JDK8, where calendars.properties file is used instead of the system >>> property. The test is pretty much identical to JDK9's. The difference is >>> to deal with the calendars.properties file and removed some >>> non-applicable cases in JDK8. >>> >>> Naoto > From brent.christian at oracle.com Thu Apr 6 20:08:23 2017 From: brent.christian at oracle.com (Brent Christian) Date: Thu, 6 Apr 2017 13:08:23 -0700 Subject: [8u] RFR: 8177776: Create an equivalent test case for JDK9's SupplementalJapaneseEraTest In-Reply-To: References: <69774039-1980-882f-2f89-fac194fd7fa7@oracle.com> Message-ID: <5a64d6fc-9cf2-6a04-9f92-fd7d75c957bd@oracle.com> Hi, Naoto On 4/5/17 2:14 PM, Naoto Sato wrote: > I revised the test case not to rely on shell script. Yay! Hopefully this can also happen sometime for JDK 9+. > http://cr.openjdk.java.net/~naoto/8177776/webrev.01/ Looks fine to me, Naoto. A few comments: * I presume additional @bug values will be added as other fixes are backported (e.g. 8054214). * On 73 Path dst = Paths.get("testjava").toAbsolutePath(); This places "dst" within the scratch directory, then? (I thought there was a jtreg system property for the scratch directory, but I can't find it so I think I'm mis-remembering). I agree with letting jtreg take care of cleaning up "scratch". If anything goes wrong with copying of the JDK (e.g. full disk), hopefully it would be easy to diagnose, with an IOException with a full stack trace. * Have you confirmed (if it's practical to do so) that this test fails when expected (detects a bug)? Thanks, -Brent > On 3/30/17 2:10 PM, Naoto Sato wrote: >> Hello, >> >> Please review the changes to the following issue: >> >> https://bugs.openjdk.java.net/browse/JDK-8177776 >> >> The proposed change is located at: >> >> http://cr.openjdk.java.net/~naoto/8177776/webrev.00/ >> >> This is for backporting fixes for JapaneseEra related issues (8054214, >> 8173423). The original fixes in JDK9 included a test case, >> SupplementalJapaneseEraTest which is intended for the system property >> testing. The above proposed fix intends to adapt that test case into >> JDK8, where calendars.properties file is used instead of the system >> property. The test is pretty much identical to JDK9's. The difference is >> to deal with the calendars.properties file and removed some >> non-applicable cases in JDK8. >> >> Naoto From naoto.sato at oracle.com Thu Apr 6 20:29:01 2017 From: naoto.sato at oracle.com (Naoto Sato) Date: Thu, 6 Apr 2017 13:29:01 -0700 Subject: [8u] RFR: 8177776: Create an equivalent test case for JDK9's SupplementalJapaneseEraTest In-Reply-To: <5a64d6fc-9cf2-6a04-9f92-fd7d75c957bd@oracle.com> References: <69774039-1980-882f-2f89-fac194fd7fa7@oracle.com> <5a64d6fc-9cf2-6a04-9f92-fd7d75c957bd@oracle.com> Message-ID: Hi Brent, thank you for the review. On 4/6/17 1:08 PM, Brent Christian wrote: > Hi, Naoto > > On 4/5/17 2:14 PM, Naoto Sato wrote: >> I revised the test case not to rely on shell script. > > Yay! Hopefully this can also happen sometime for JDK 9+. Sure. Will work on it. > >> http://cr.openjdk.java.net/~naoto/8177776/webrev.01/ > > Looks fine to me, Naoto. A few comments: > > * I presume additional @bug values will be added as other fixes are > backported (e.g. 8054214). Good point. Will add those bug ids on push. > > * On > > 73 Path dst = Paths.get("testjava").toAbsolutePath(); > > This places "dst" within the scratch directory, then? (I thought there > was a jtreg system property for the scratch directory, but I can't find > it so I think I'm mis-remembering). > > I agree with letting jtreg take care of cleaning up "scratch". Yes, "dst" will be "scratch". Not aware of any system property to designate the output directory, other than "-w" command option to specify the JTwork dir. > > If anything goes wrong with copying of the JDK (e.g. full disk), > hopefully it would be easy to diagnose, with an IOException with a full > stack trace. > > * Have you confirmed (if it's practical to do so) that this test fails > when expected (detects a bug)? Yes. Without those backports, the test will fail as expected. Naoto > > Thanks, > -Brent > >> On 3/30/17 2:10 PM, Naoto Sato wrote: >>> Hello, >>> >>> Please review the changes to the following issue: >>> >>> https://bugs.openjdk.java.net/browse/JDK-8177776 >>> >>> The proposed change is located at: >>> >>> http://cr.openjdk.java.net/~naoto/8177776/webrev.00/ >>> >>> This is for backporting fixes for JapaneseEra related issues (8054214, >>> 8173423). The original fixes in JDK9 included a test case, >>> SupplementalJapaneseEraTest which is intended for the system property >>> testing. The above proposed fix intends to adapt that test case into >>> JDK8, where calendars.properties file is used instead of the system >>> property. The test is pretty much identical to JDK9's. The difference is >>> to deal with the calendars.properties file and removed some >>> non-applicable cases in JDK8. >>> >>> Naoto From stuart.marks at oracle.com Fri Apr 7 02:09:38 2017 From: stuart.marks at oracle.com (Stuart Marks) Date: Thu, 6 Apr 2017 19:09:38 -0700 Subject: JDK 9 RFR(s): 8173152: Wrong wording in Comparator.compare() method spec Message-ID: <3c3d08ca-925e-f869-90a8-68286be75a2e@oracle.com> Hi all, Please review this small javadoc fix to correct the wording in Comparator.compare(). There's a sentence defining the sgn() notation, that says "In the foregoing description" but it occurs *before* the actual use of sgn(). I've moved this to the end of the method spec. This also makes the Comparator.compare() method spec very similar to the Comparable.compareTo() method spec. Thanks, s'marks # HG changeset patch # User smarks # Date 1491530800 25200 # Thu Apr 06 19:06:40 2017 -0700 # Node ID 1f08b6bc20078e07f7264e449a334234906d46e5 # Parent 7c72114a555820da956c81364ae7ba30698aa799 8173152: Wrong wording in Comparator.compare() method spec Reviewed-by: XXX diff -r 7c72114a5558 -r 1f08b6bc2007 src/java.base/share/classes/java/util/Comparator.java --- a/src/java.base/share/classes/java/util/Comparator.java Fri Mar 31 14:21:21 2017 -0700 +++ b/src/java.base/share/classes/java/util/Comparator.java Thu Apr 06 19:06:40 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, 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 @@ -112,12 +112,6 @@ * zero, or a positive integer as the first argument is less than, equal * to, or greater than the second.

* - * In the foregoing description, the notation - * {@code sgn(}expression{@code )} designates the mathematical - * signum function, which is defined to return one of {@code -1}, - * {@code 0}, or {@code 1} according to whether the value of - * expression is negative, zero or positive.

- * * The implementor must ensure that {@code sgn(compare(x, y)) == * -sgn(compare(y, x))} for all {@code x} and {@code y}. (This * implies that {@code compare(x, y)} must throw an exception if and only @@ -135,7 +129,13 @@ * {@code (compare(x, y)==0) == (x.equals(y))}. Generally speaking, * any comparator that violates this condition should clearly indicate * this fact. The recommended language is "Note: this comparator - * imposes orderings that are inconsistent with equals." + * imposes orderings that are inconsistent with equals."

+ * + * In the foregoing description, the notation + * {@code sgn(}expression{@code )} designates the mathematical + * signum function, which is defined to return one of {@code -1}, + * {@code 0}, or {@code 1} according to whether the value of + * expression is negative, zero or positive. * * @param o1 the first object to be compared. * @param o2 the second object to be compared. From mark.reinhold at oracle.com Fri Apr 7 14:29:41 2017 From: mark.reinhold at oracle.com (mark.reinhold at oracle.com) Date: Fri, 07 Apr 2017 07:29:41 -0700 Subject: ProcessHandle::getPid Message-ID: <20170407072941.873070683@eggemoggin.niobe.net> Playing around with the `ProcessHandle` API the other day, I noticed that it uses non-Beans accessor names (good!) -- except for `getPid()`. Is there a reason why that method isn't just `pid()`? - Mark From Roger.Riggs at Oracle.com Fri Apr 7 14:45:38 2017 From: Roger.Riggs at Oracle.com (Roger Riggs) Date: Fri, 7 Apr 2017 10:45:38 -0400 Subject: ProcessHandle::getPid In-Reply-To: <20170407072941.873070683@eggemoggin.niobe.net> References: <20170407072941.873070683@eggemoggin.niobe.net> Message-ID: <0317d211-2b5c-173d-8b14-6402a432f275@Oracle.com> Hi Mark, That's an unfortunate artifact of evolution. Process.getPid() was added early in 2014 and ProcessHandle a year later. Several iterations of ProcessHandle API explored Process being a subclass of ProcessHandle so the method names would be the same. When ProcessHandle was decoupled from Process the method name was retained for consistency. Roger On 4/7/2017 10:29 AM, mark.reinhold at oracle.com wrote: > Playing around with the `ProcessHandle` API the other day, I noticed > that it uses non-Beans accessor names (good!) -- except for `getPid()`. > > Is there a reason why that method isn't just `pid()`? > > - Mark From weijun.wang at oracle.com Fri Apr 7 14:50:01 2017 From: weijun.wang at oracle.com (Weijun Wang) Date: Fri, 7 Apr 2017 22:50:01 +0800 Subject: [9] RFR 8177969: Faster FilePermission::implies by avoiding the use of Path::relativize In-Reply-To: <9f96ed4d-9282-d776-f767-d3fe060ba895@Oracle.com> References: <4f1e0c02-a11d-2694-84ad-cf8804021f3c@oracle.com> <9f96ed4d-9282-d776-f767-d3fe060ba895@Oracle.com> Message-ID: Webrev updated at http://cr.openjdk.java.net/~weijun/8177969/webrev.01/ Changes since webrev.00 [1] 1. Copyright years. 2. Test fix. check() should include Windows drive tests like contains() does. Thanks Max [1] http://cr.openjdk.java.net/~weijun/8177969/webrev.01/interdiff.patch.html On 04/05/2017 10:13 PM, Roger Riggs wrote: > Hi Max, > > The code looks ok. > > How much faster does it make FilePermission compares? > > I assume if it is not accepted to be fixed in JDK 9, you will push it to > JDK 10. > > Roger > > > On 4/3/2017 11:30 AM, Weijun Wang wrote: >> http://cr.openjdk.java.net/~weijun/8177969/webrev.00/ >> >> This new implementation of containsPath(Path,Path) uses the logic of >> Path::relativize without directly calling it, which is much faster now. >> >> Thanks >> Max > From mark.reinhold at oracle.com Fri Apr 7 15:10:43 2017 From: mark.reinhold at oracle.com (mark.reinhold at oracle.com) Date: Fri, 07 Apr 2017 08:10:43 -0700 Subject: ProcessHandle::getPid In-Reply-To: <0317d211-2b5c-173d-8b14-6402a432f275@Oracle.com> References: <20170407072941.873070683@eggemoggin.niobe.net> <0317d211-2b5c-173d-8b14-6402a432f275@Oracle.com> Message-ID: <20170407081043.898510106@eggemoggin.niobe.net> 2017/4/7 7:45:38 -0700, roger.riggs at oracle.com: > That's an unfortunate artifact of evolution. > Process.getPid() was added early in 2014 and ProcessHandle a year later. > > Several iterations of ProcessHandle API explored Process being a > subclass of ProcessHandle > so the method names would be the same. When ProcessHandle was decoupled > from Process > the method name was retained for consistency. I would think local consistency within the new `ProcessHandle` API would be more important than external consistency with the legacy `Process` API. Please consider fixing this. - Mark From andrey.x.nazarov at oracle.com Fri Apr 7 15:35:57 2017 From: andrey.x.nazarov at oracle.com (Andrey Nazarov) Date: Fri, 7 Apr 2017 18:35:57 +0300 Subject: RFR 8178323: Add negative tests for bind services Jlink feature Message-ID: Hi, Please review 3 negative tests for Jlink which tests new bind-services/suggest-providers feature. JBS: https://bugs.openjdk.java.net/browse/JDK-8178323 webrev: http://cr.openjdk.java.net/~anazarov/8178323/webrev.00/webrev/ ?Andrey From brian.burkhalter at oracle.com Fri Apr 7 18:44:20 2017 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Fri, 7 Apr 2017 11:44:20 -0700 Subject: JDK 9 RFR(s): 8173152: Wrong wording in Comparator.compare() method spec In-Reply-To: <3c3d08ca-925e-f869-90a8-68286be75a2e@oracle.com> References: <3c3d08ca-925e-f869-90a8-68286be75a2e@oracle.com> Message-ID: Hi Stuart, On Apr 6, 2017, at 7:09 PM, Stuart Marks wrote: > - * imposes orderings that are inconsistent with equals." > + * imposes orderings that are inconsistent with equals."

Picayune question: Would the

be better on the line before ?In the foregoing?" > + * > + * In the foregoing description, the notation > + * {@code sgn(}expression{@code )} designates the mathematical > + * signum function, which is defined to return one of {@code -1}, > + * {@code 0}, or {@code 1} according to whether the value of > + * expression is negative, zero or positive. I suggest to put ?, respectively? at the end of the sentence. Brian From sean.mullan at oracle.com Fri Apr 7 20:48:25 2017 From: sean.mullan at oracle.com (Sean Mullan) Date: Fri, 7 Apr 2017 16:48:25 -0400 Subject: [9] RFR 8177969: Faster FilePermission::implies by avoiding the use of Path::relativize In-Reply-To: References: <4f1e0c02-a11d-2694-84ad-cf8804021f3c@oracle.com> <9f96ed4d-9282-d776-f767-d3fe060ba895@Oracle.com> Message-ID: This fix looks good to me. However, I would suggest adding some additional comments to the body of the containsPath method explaining what it is doing so that it is easier to understand. --Sean On 4/7/17 10:50 AM, Weijun Wang wrote: > Webrev updated at > > http://cr.openjdk.java.net/~weijun/8177969/webrev.01/ > > Changes since webrev.00 [1] > > 1. Copyright years. > > 2. Test fix. check() should include Windows drive tests like contains() > does. > > Thanks > Max > > [1] > http://cr.openjdk.java.net/~weijun/8177969/webrev.01/interdiff.patch.html > > On 04/05/2017 10:13 PM, Roger Riggs wrote: >> Hi Max, >> >> The code looks ok. >> >> How much faster does it make FilePermission compares? >> >> I assume if it is not accepted to be fixed in JDK 9, you will push it to >> JDK 10. >> >> Roger >> >> >> On 4/3/2017 11:30 AM, Weijun Wang wrote: >>> http://cr.openjdk.java.net/~weijun/8177969/webrev.00/ >>> >>> This new implementation of containsPath(Path,Path) uses the logic of >>> Path::relativize without directly calling it, which is much faster now. >>> >>> Thanks >>> Max >> From stuart.marks at oracle.com Fri Apr 7 20:54:34 2017 From: stuart.marks at oracle.com (Stuart Marks) Date: Fri, 7 Apr 2017 13:54:34 -0700 Subject: JDK 9 RFR(s): 8173152: Wrong wording in Comparator.compare() method spec In-Reply-To: References: <3c3d08ca-925e-f869-90a8-68286be75a2e@oracle.com> Message-ID: <9bbf7217-181d-94bb-b1f6-188f9e02e55a@oracle.com> On 4/7/17 11:44 AM, Brian Burkhalter wrote: > On Apr 6, 2017, at 7:09 PM, Stuart Marks > wrote: > >> - * imposes orderings that are inconsistent with equals." >> + * imposes orderings that are inconsistent with equals."

> > Picayune question: Would the

be better on the line before ?In the foregoing?" The rest of the markup in this method spec has trailing

tags, so I just kept things consistent with that. This is an odd style but it's not incorrect, as every paragraph except for the first has a

preceding it. > >> + * >> + * In the foregoing description, the notation >> + * {@code sgn(}expression{@code )} designates the mathematical >> + * signum function, which is defined to return one of {@code -1}, >> + * {@code 0}, or {@code 1} according to whether the value of >> + * expression is negative, zero or positive. > > I suggest to put ?, respectively? at the end of the sentence. Sure, I can do that. I'll also add an Oxford comma as well. I'll make the same modifications to the Comparable interface, too. Revised diffs below. s'marks # HG changeset patch # User smarks # Date 1491598302 25200 # Fri Apr 07 13:51:42 2017 -0700 # Node ID 1a623ed5238fa04674b74ee92805ec7a1f036fd9 # Parent 7c72114a555820da956c81364ae7ba30698aa799 8173152: Wrong wording in Comparator.compare() method spec Reviewed-by: XXX diff -r 7c72114a5558 -r 1a623ed5238f src/java.base/share/classes/java/lang/Comparable.java --- a/src/java.base/share/classes/java/lang/Comparable.java Fri Mar 31 14:21:21 2017 -0700 +++ b/src/java.base/share/classes/java/lang/Comparable.java Fri Apr 07 13:51:42 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, 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 @@ -124,7 +124,7 @@ * {@code sgn(}expression{@code )} designates the mathematical * signum function, which is defined to return one of {@code -1}, * {@code 0}, or {@code 1} according to whether the value of - * expression is negative, zero or positive. + * expression is negative, zero, or positive, respectively. * * @param o the object to be compared. * @return a negative integer, zero, or a positive integer as this object diff -r 7c72114a5558 -r 1a623ed5238f src/java.base/share/classes/java/util/Comparator.java --- a/src/java.base/share/classes/java/util/Comparator.java Fri Mar 31 14:21:21 2017 -0700 +++ b/src/java.base/share/classes/java/util/Comparator.java Fri Apr 07 13:51:42 2017 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, 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 @@ -112,12 +112,6 @@ * zero, or a positive integer as the first argument is less than, equal * to, or greater than the second.

* - * In the foregoing description, the notation - * {@code sgn(}expression{@code )} designates the mathematical - * signum function, which is defined to return one of {@code -1}, - * {@code 0}, or {@code 1} according to whether the value of - * expression is negative, zero or positive.

- * * The implementor must ensure that {@code sgn(compare(x, y)) == * -sgn(compare(y, x))} for all {@code x} and {@code y}. (This * implies that {@code compare(x, y)} must throw an exception if and only @@ -135,7 +129,13 @@ * {@code (compare(x, y)==0) == (x.equals(y))}. Generally speaking, * any comparator that violates this condition should clearly indicate * this fact. The recommended language is "Note: this comparator - * imposes orderings that are inconsistent with equals." + * imposes orderings that are inconsistent with equals."

+ * + * In the foregoing description, the notation + * {@code sgn(}expression{@code )} designates the mathematical + * signum function, which is defined to return one of {@code -1}, + * {@code 0}, or {@code 1} according to whether the value of + * expression is negative, zero, or positive, respectively. * * @param o1 the first object to be compared. * @param o2 the second object to be compared. From lance.andersen at oracle.com Fri Apr 7 21:11:35 2017 From: lance.andersen at oracle.com (Lance Andersen) Date: Fri, 7 Apr 2017 17:11:35 -0400 Subject: RFR: 8178130: Minor update to the Connection javadocs Message-ID: Hi all, Please review the following minor update to the Connection javadocs. The CCC has been approved. ?????????? $ hg diff diff -r 45b226ad2e05 src/java.sql/share/classes/java/sql/Connection.java --- a/src/java.sql/share/classes/java/sql/Connection.java Thu Mar 16 16:56:29 2017 -0400 +++ b/src/java.sql/share/classes/java/sql/Connection.java Fri Apr 07 15:12:08 2017 -0400 @@ -1535,8 +1535,9 @@ *

  • The connection pool caches {@code PooledConnection} objects
  • *
  • Returns a logical connection handle when {@code getConnection} is * called by the application
  • - *
  • The pool manager calls {@code Connection.close} on the logical connection handle - * prior to returning the {@code PooledConnection} back to the cache
  • + *
  • The logical {@code Connection} is closed by calling + * {@code Connection.close} prior to returning the {@code PooledConnection} + * back to the cache.
  • * * @throws SQLException if an error occurs * @since 9 @@ -1577,8 +1578,9 @@ *
  • The connection pool caches {@code PooledConnection} objects
  • *
  • Returns a logical connection handle when {@code getConnection} is * called by the application
  • - *
  • The pool manager calls {@code Connection.close} on the logical connection handle - * prior to returning the {@code PooledConnection} back to the cache
  • + *
  • The logical {@code Connection} is closed by calling + * {@code Connection.close} prior to returning the {@code PooledConnection} + * back to the cache.
  • * * @throws SQLException if an error occurs * @since 9 @@ -1590,7 +1592,10 @@ } /** - * Sets and validates the sharding keys for this connection. + * Sets and validates the sharding keys for this connection. A {@code null} + * value may be specified for the sharding Key. The validity + * of a {@code null} sharding key is vendor specific. Consult your vendors + * documentation for additional information. * @implSpec * The default implementation will throw a * {@code SQLFeatureNotSupportedException}. @@ -1600,7 +1605,8 @@ * {@code Connection}. The timeout value indicates how long the driver * should wait for the {@code Connection} to verify that the sharding key * is valid before {@code setShardingKeyIfValid} returns false. - * @param shardingKey the sharding key to be validated against this connection + * @param shardingKey the sharding key to be validated against this connection. + * The sharding key may be {@code null} * @param superShardingKey the super sharding key to be validated against this * connection. The super sharding key may be {@code null}. * @param timeout time in seconds before which the validation process is expected to @@ -1610,7 +1616,7 @@ * and set on this connection; false if the sharding keys are not valid or * the timeout period expires before the operation completes. * @throws SQLException if an error occurs while performing this validation; - * the {@code shardingkey} is {@code null}; a {@code superSharedingKey} is specified + * a {@code superSharedingKey} is specified * without a {@code shardingKey}; * this method is called on a closed {@code connection}; or * the {@code timeout} value is less than 0. @@ -1626,7 +1632,10 @@ } /** - * Sets and validates the sharding key for this connection. + * Sets and validates the sharding key for this connection. A {@code null} + * value may be specified for the sharding Key. The validity + * of a {@code null} sharding key is vendor specific. Consult your vendors + * documentation for additional information. * @implSpec * The default implementation will throw a * {@code SQLFeatureNotSupportedException}. @@ -1635,7 +1644,8 @@ * {@code Connection}. The timeout value indicates how long the driver * should wait for the {@code Connection} to verify that the sharding key * is valid before {@code setShardingKeyIfValid} returns false. - * @param shardingKey the sharding key to be validated against this connection + * @param shardingKey the sharding key to be validated against this connection. + * The sharding key may be {@code null} * @param timeout time in seconds before which the validation process is expected to * be completed,else the validation process is aborted. A value of 0 indicates * the validation process will not time out. @@ -1643,8 +1653,8 @@ * set on this connection; false if the sharding key is not valid or * the timeout period expires before the operation completes. * @throws SQLException if there is an error while performing this validation; - * this method is called on a closed {@code connection}; the {@code shardingkey} - * is {@code null}; or the {@code timeout} value is less than 0. + * this method is called on a closed {@code connection}; + * or the {@code timeout} value is less than 0. * @throws SQLFeatureNotSupportedException if the driver does not support sharding * @since 9 * @see ShardingKey @@ -1664,12 +1674,12 @@ * This method sets the specified sharding keys but does not require a * round trip to the database to validate that the sharding keys are valid * for the {@code Connection}. - * @param shardingKey the sharding key to set on this connection. + * @param shardingKey the sharding key to set on this connection. The sharding + * key may be {@code null} * @param superShardingKey the super sharding key to set on this connection. * The super sharding key may be {@code null} * @throws SQLException if an error occurs setting the sharding keys; - * this method is called on a closed {@code connection}; - * the {@code shardingkey} is {@code null}; or + * this method is called on a closed {@code connection}; or * a {@code superSharedingKey} is specified without a {@code shardingKey} * @throws SQLFeatureNotSupportedException if the driver does not support sharding * @since 9 @@ -1690,10 +1700,10 @@ * This method sets the specified sharding key but does not require a * round trip to the database to validate that the sharding key is valid * for the {@code Connection}. - * @param shardingKey the sharding key to set on this connection. - * @throws SQLException if an error occurs setting the sharding key; - * this method is called on a closed {@code connection}; or the - * {@code shardkingKey} is {@code null} + * @param shardingKey the sharding key to set on this connection. The sharding + * key may be {@code null} + * @throws SQLException if an error occurs setting the sharding key; or + * this method is called on a closed {@code connection} * @throws SQLFeatureNotSupportedException if the driver does not support sharding * @since 9 * @see ShardingKey ?????????????? 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 brian.burkhalter at oracle.com Fri Apr 7 22:24:38 2017 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Fri, 7 Apr 2017 15:24:38 -0700 Subject: RFR: 8178130: Minor update to the Connection javadocs In-Reply-To: References: Message-ID: <7E91DED6-C202-416C-9122-51F804FE28A6@oracle.com> Hi Lance, Minor comments inline. Brian On Apr 7, 2017, at 2:11 PM, Lance Andersen wrote: > Please review the following minor update to the Connection javadocs. The CCC has been approved. > > ?????????? > $ hg diff > diff -r 45b226ad2e05 src/java.sql/share/classes/java/sql/Connection.java > --- a/src/java.sql/share/classes/java/sql/Connection.java Thu Mar 16 16:56:29 2017 -0400 > +++ b/src/java.sql/share/classes/java/sql/Connection.java Fri Apr 07 15:12:08 2017 -0400 > @@ -1535,8 +1535,9 @@ > *
  • The connection pool caches {@code PooledConnection} objects
  • > *
  • Returns a logical connection handle when {@code getConnection} is > * called by the application
  • > - *
  • The pool manager calls {@code Connection.close} on the logical connection handle > - * prior to returning the {@code PooledConnection} back to the cache
  • > + *
  • The logical {@code Connection} is closed by calling > + * {@code Connection.close} prior to returning the {@code PooledConnection} > + * back to the cache.
  • I would delete ?back? in the previous line. > * > * @throws SQLException if an error occurs > * @since 9 > @@ -1577,8 +1578,9 @@ > *
  • The connection pool caches {@code PooledConnection} objects
  • > *
  • Returns a logical connection handle when {@code getConnection} is > * called by the application
  • > - *
  • The pool manager calls {@code Connection.close} on the logical connection handle > - * prior to returning the {@code PooledConnection} back to the cache
  • > + *
  • The logical {@code Connection} is closed by calling > + * {@code Connection.close} prior to returning the {@code PooledConnection} > + * back to the cache.
  • Same here. > * > * @throws SQLException if an error occurs > * @since 9 > @@ -1590,7 +1592,10 @@ > } > > /** > - * Sets and validates the sharding keys for this connection. > + * Sets and validates the sharding keys for this connection. A {@code null} > + * value may be specified for the sharding Key. The validity > + * of a {@code null} sharding key is vendor specific. Consult your vendors I would hyphenate ?vendor-specific? and change ?vendors? to ?vendor?s" > + * documentation for additional information. > * @implSpec > * The default implementation will throw a > * {@code SQLFeatureNotSupportedException}. > @@ -1600,7 +1605,8 @@ > * {@code Connection}. The timeout value indicates how long the driver > * should wait for the {@code Connection} to verify that the sharding key > * is valid before {@code setShardingKeyIfValid} returns false. > - * @param shardingKey the sharding key to be validated against this connection > + * @param shardingKey the sharding key to be validated against this connection. > + * The sharding key may be {@code null} > * @param superShardingKey the super sharding key to be validated against this > * connection. The super sharding key may be {@code null}. > * @param timeout time in seconds before which the validation process is expected to > @@ -1610,7 +1616,7 @@ > * and set on this connection; false if the sharding keys are not valid or > * the timeout period expires before the operation completes. > * @throws SQLException if an error occurs while performing this validation; > - * the {@code shardingkey} is {@code null}; a {@code superSharedingKey} is specified > + * a {@code superSharedingKey} is specified > * without a {@code shardingKey}; > * this method is called on a closed {@code connection}; or > * the {@code timeout} value is less than 0. ?less than 0? could be simple ?negative." > @@ -1626,7 +1632,10 @@ > } > > /** > - * Sets and validates the sharding key for this connection. > + * Sets and validates the sharding key for this connection. A {@code null} > + * value may be specified for the sharding Key. The validity > + * of a {@code null} sharding key is vendor specific. Consult your vendors Again I would hyphenate ?vendor-specific? and change ?vendors? to ?vendor?s" > + * documentation for additional information. > * @implSpec > * The default implementation will throw a > * {@code SQLFeatureNotSupportedException}. > @@ -1635,7 +1644,8 @@ > * {@code Connection}. The timeout value indicates how long the driver > * should wait for the {@code Connection} to verify that the sharding key > * is valid before {@code setShardingKeyIfValid} returns false. > - * @param shardingKey the sharding key to be validated against this connection > + * @param shardingKey the sharding key to be validated against this connection. > + * The sharding key may be {@code null} > * @param timeout time in seconds before which the validation process is expected to > * be completed,else the validation process is aborted. A value of 0 indicates > * the validation process will not time out. > @@ -1643,8 +1653,8 @@ > * set on this connection; false if the sharding key is not valid or > * the timeout period expires before the operation completes. > * @throws SQLException if there is an error while performing this validation; > - * this method is called on a closed {@code connection}; the {@code shardingkey} > - * is {@code null}; or the {@code timeout} value is less than 0. > + * this method is called on a closed {@code connection}; > + * or the {@code timeout} value is less than 0. Again ?less than 0? could be simple ?negative." > * @throws SQLFeatureNotSupportedException if the driver does not support sharding > * @since 9 > * @see ShardingKey > @@ -1664,12 +1674,12 @@ > * This method sets the specified sharding keys but does not require a > * round trip to the database to validate that the sharding keys are valid > * for the {@code Connection}. > - * @param shardingKey the sharding key to set on this connection. > + * @param shardingKey the sharding key to set on this connection. The sharding > + * key may be {@code null} > * @param superShardingKey the super sharding key to set on this connection. > * The super sharding key may be {@code null} > * @throws SQLException if an error occurs setting the sharding keys; > - * this method is called on a closed {@code connection}; > - * the {@code shardingkey} is {@code null}; or > + * this method is called on a closed {@code connection}; or > * a {@code superSharedingKey} is specified without a {@code shardingKey} > * @throws SQLFeatureNotSupportedException if the driver does not support sharding > * @since 9 > @@ -1690,10 +1700,10 @@ > * This method sets the specified sharding key but does not require a > * round trip to the database to validate that the sharding key is valid > * for the {@code Connection}. > - * @param shardingKey the sharding key to set on this connection. > - * @throws SQLException if an error occurs setting the sharding key; > - * this method is called on a closed {@code connection}; or the > - * {@code shardkingKey} is {@code null} > + * @param shardingKey the sharding key to set on this connection. The sharding > + * key may be {@code null} > + * @throws SQLException if an error occurs setting the sharding key; or > + * this method is called on a closed {@code connection} > * @throws SQLFeatureNotSupportedException if the driver does not support sharding > * @since 9 > * @see ShardingKey From brian.burkhalter at oracle.com Fri Apr 7 22:34:07 2017 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Fri, 7 Apr 2017 15:34:07 -0700 Subject: JDK 9 RFR(s): 8173152: Wrong wording in Comparator.compare() method spec In-Reply-To: <9bbf7217-181d-94bb-b1f6-188f9e02e55a@oracle.com> References: <3c3d08ca-925e-f869-90a8-68286be75a2e@oracle.com> <9bbf7217-181d-94bb-b1f6-188f9e02e55a@oracle.com> Message-ID: <1F68B310-64C2-410B-BF8B-F7FCCBE21844@oracle.com> On Apr 7, 2017, at 1:54 PM, Stuart Marks wrote: > On 4/7/17 11:44 AM, Brian Burkhalter wrote: >> On Apr 6, 2017, at 7:09 PM, Stuart Marks wrote: >> >>> - * imposes orderings that are inconsistent with equals." >>> + * imposes orderings that are inconsistent with equals."

    >> >> Picayune question: Would the

    be better on the line before ?In the foregoing?" > The rest of the markup in this method spec has trailing

    tags, so I just kept things consistent with that. This is an odd style but it's not incorrect, as every paragraph except for the first has a

    preceding it. That?s reasonable. >>> + * >>> + * In the foregoing description, the notation >>> + * {@code sgn(}expression{@code )} designates the mathematical >>> + * signum function, which is defined to return one of {@code -1}, >>> + * {@code 0}, or {@code 1} according to whether the value of >>> + * expression is negative, zero or positive. >> >> I suggest to put ?, respectively? at the end of the sentence. > Sure, I can do that. I'll also add an Oxford comma as well. Good, I prefer that also. > I'll make the same modifications to the Comparable interface, too. Sounds good. Reviewed. Brian From lance.andersen at oracle.com Fri Apr 7 22:45:38 2017 From: lance.andersen at oracle.com (Lance Andersen) Date: Fri, 7 Apr 2017 18:45:38 -0400 Subject: RFR: 8178130: Minor update to the Connection javadocs In-Reply-To: <7E91DED6-C202-416C-9122-51F804FE28A6@oracle.com> References: <7E91DED6-C202-416C-9122-51F804FE28A6@oracle.com> Message-ID: <72EF7E38-A474-45EC-9E74-B4BB6009F90D@oracle.com> Hi Brian, Thank you for your input. Here is the revised version: ??????? hg diff diff -r 45b226ad2e05 src/java.sql/share/classes/java/sql/Connection.java --- a/src/java.sql/share/classes/java/sql/Connection.java Thu Mar 16 16:56:29 2017 -0400 +++ b/src/java.sql/share/classes/java/sql/Connection.java Fri Apr 07 18:42:20 2017 -0400 @@ -1535,8 +1535,9 @@ *

  • The connection pool caches {@code PooledConnection} objects
  • *
  • Returns a logical connection handle when {@code getConnection} is * called by the application
  • - *
  • The pool manager calls {@code Connection.close} on the logical connection handle - * prior to returning the {@code PooledConnection} back to the cache
  • + *
  • The logical {@code Connection} is closed by calling + * {@code Connection.close} prior to returning the {@code PooledConnection} + * to the cache.
  • * * @throws SQLException if an error occurs * @since 9 @@ -1577,8 +1578,9 @@ *
  • The connection pool caches {@code PooledConnection} objects
  • *
  • Returns a logical connection handle when {@code getConnection} is * called by the application
  • - *
  • The pool manager calls {@code Connection.close} on the logical connection handle - * prior to returning the {@code PooledConnection} back to the cache
  • + *
  • The logical {@code Connection} is closed by calling + * {@code Connection.close} prior to returning the {@code PooledConnection} + * to the cache.
  • * * @throws SQLException if an error occurs * @since 9 @@ -1590,7 +1592,10 @@ } /** - * Sets and validates the sharding keys for this connection. + * Sets and validates the sharding keys for this connection. A {@code null} + * value may be specified for the sharding Key. The validity + * of a {@code null} sharding key is vendor-specific. Consult your vendor's + * documentation for additional information. * @implSpec * The default implementation will throw a * {@code SQLFeatureNotSupportedException}. @@ -1600,7 +1605,8 @@ * {@code Connection}. The timeout value indicates how long the driver * should wait for the {@code Connection} to verify that the sharding key * is valid before {@code setShardingKeyIfValid} returns false. - * @param shardingKey the sharding key to be validated against this connection + * @param shardingKey the sharding key to be validated against this connection. + * The sharding key may be {@code null} * @param superShardingKey the super sharding key to be validated against this * connection. The super sharding key may be {@code null}. * @param timeout time in seconds before which the validation process is expected to @@ -1610,10 +1616,10 @@ * and set on this connection; false if the sharding keys are not valid or * the timeout period expires before the operation completes. * @throws SQLException if an error occurs while performing this validation; - * the {@code shardingkey} is {@code null}; a {@code superSharedingKey} is specified + * a {@code superSharedingKey} is specified * without a {@code shardingKey}; * this method is called on a closed {@code connection}; or - * the {@code timeout} value is less than 0. + * the {@code timeout} value is negative. * @throws SQLFeatureNotSupportedException if the driver does not support sharding * @since 9 * @see ShardingKey @@ -1626,7 +1632,10 @@ } /** - * Sets and validates the sharding key for this connection. + * Sets and validates the sharding key for this connection. A {@code null} + * value may be specified for the sharding Key. The validity + * of a {@code null} sharding key is vendor-specific. Consult your vendor's + * documentation for additional information. * @implSpec * The default implementation will throw a * {@code SQLFeatureNotSupportedException}. @@ -1635,7 +1644,8 @@ * {@code Connection}. The timeout value indicates how long the driver * should wait for the {@code Connection} to verify that the sharding key * is valid before {@code setShardingKeyIfValid} returns false. - * @param shardingKey the sharding key to be validated against this connection + * @param shardingKey the sharding key to be validated against this connection. + * The sharding key may be {@code null} * @param timeout time in seconds before which the validation process is expected to * be completed,else the validation process is aborted. A value of 0 indicates * the validation process will not time out. @@ -1643,8 +1653,8 @@ * set on this connection; false if the sharding key is not valid or * the timeout period expires before the operation completes. * @throws SQLException if there is an error while performing this validation; - * this method is called on a closed {@code connection}; the {@code shardingkey} - * is {@code null}; or the {@code timeout} value is less than 0. + * this method is called on a closed {@code connection}; + * or the {@code timeout} value is negative. * @throws SQLFeatureNotSupportedException if the driver does not support sharding * @since 9 * @see ShardingKey @@ -1664,12 +1674,12 @@ * This method sets the specified sharding keys but does not require a * round trip to the database to validate that the sharding keys are valid * for the {@code Connection}. - * @param shardingKey the sharding key to set on this connection. + * @param shardingKey the sharding key to set on this connection. The sharding + * key may be {@code null} * @param superShardingKey the super sharding key to set on this connection. * The super sharding key may be {@code null} * @throws SQLException if an error occurs setting the sharding keys; - * this method is called on a closed {@code connection}; - * the {@code shardingkey} is {@code null}; or + * this method is called on a closed {@code connection}; or * a {@code superSharedingKey} is specified without a {@code shardingKey} * @throws SQLFeatureNotSupportedException if the driver does not support sharding * @since 9 @@ -1690,10 +1700,10 @@ * This method sets the specified sharding key but does not require a * round trip to the database to validate that the sharding key is valid * for the {@code Connection}. - * @param shardingKey the sharding key to set on this connection. - * @throws SQLException if an error occurs setting the sharding key; - * this method is called on a closed {@code connection}; or the - * {@code shardkingKey} is {@code null} + * @param shardingKey the sharding key to set on this connection. The sharding + * key may be {@code null} + * @throws SQLException if an error occurs setting the sharding key; or + * this method is called on a closed {@code connection} * @throws SQLFeatureNotSupportedException if the driver does not support sharding * @since 9 * @see ShardingKey ljanders-mac:sql ljanders$ ?????????? Best Lance > On Apr 7, 2017, at 6:24 PM, Brian Burkhalter wrote: > > Hi Lance, > > Minor comments inline. > > Brian > > On Apr 7, 2017, at 2:11 PM, Lance Andersen > wrote: > >> Please review the following minor update to the Connection javadocs. The CCC has been approved. >> >> ?????????? >> $ hg diff >> diff -r 45b226ad2e05 src/java.sql/share/classes/java/sql/Connection.java >> --- a/src/java.sql/share/classes/java/sql/Connection.java Thu Mar 16 16:56:29 2017 -0400 >> +++ b/src/java.sql/share/classes/java/sql/Connection.java Fri Apr 07 15:12:08 2017 -0400 >> @@ -1535,8 +1535,9 @@ >> *
  • The connection pool caches {@code PooledConnection} objects
  • >> *
  • Returns a logical connection handle when {@code getConnection} is >> * called by the application
  • >> - *
  • The pool manager calls {@code Connection.close} on the logical connection handle >> - * prior to returning the {@code PooledConnection} back to the cache
  • >> + *
  • The logical {@code Connection} is closed by calling >> + * {@code Connection.close} prior to returning the {@code PooledConnection} >> + * back to the cache.
  • > > I would delete ?back? in the previous line. > >> * >> * @throws SQLException if an error occurs >> * @since 9 >> @@ -1577,8 +1578,9 @@ >> *
  • The connection pool caches {@code PooledConnection} objects
  • >> *
  • Returns a logical connection handle when {@code getConnection} is >> * called by the application
  • >> - *
  • The pool manager calls {@code Connection.close} on the logical connection handle >> - * prior to returning the {@code PooledConnection} back to the cache
  • >> + *
  • The logical {@code Connection} is closed by calling >> + * {@code Connection.close} prior to returning the {@code PooledConnection} >> + * back to the cache.
  • > > Same here. > >> * >> * @throws SQLException if an error occurs >> * @since 9 >> @@ -1590,7 +1592,10 @@ >> } >> >> /** >> - * Sets and validates the sharding keys for this connection. >> + * Sets and validates the sharding keys for this connection. A {@code null} >> + * value may be specified for the sharding Key. The validity >> + * of a {@code null} sharding key is vendor specific. Consult your vendors > > I would hyphenate ?vendor-specific? and change ?vendors? to ?vendor?s" > >> + * documentation for additional information. >> * @implSpec >> * The default implementation will throw a >> * {@code SQLFeatureNotSupportedException}. >> @@ -1600,7 +1605,8 @@ >> * {@code Connection}. The timeout value indicates how long the driver >> * should wait for the {@code Connection} to verify that the sharding key >> * is valid before {@code setShardingKeyIfValid} returns false. >> - * @param shardingKey the sharding key to be validated against this connection >> + * @param shardingKey the sharding key to be validated against this connection. >> + * The sharding key may be {@code null} >> * @param superShardingKey the super sharding key to be validated against this >> * connection. The super sharding key may be {@code null}. >> * @param timeout time in seconds before which the validation process is expected to >> @@ -1610,7 +1616,7 @@ >> * and set on this connection; false if the sharding keys are not valid or >> * the timeout period expires before the operation completes. >> * @throws SQLException if an error occurs while performing this validation; >> - * the {@code shardingkey} is {@code null}; a {@code superSharedingKey} is specified >> + * a {@code superSharedingKey} is specified >> * without a {@code shardingKey}; >> * this method is called on a closed {@code connection}; or >> * the {@code timeout} value is less than 0. > > ?less than 0? could be simple ?negative." > >> @@ -1626,7 +1632,10 @@ >> } >> >> /** >> - * Sets and validates the sharding key for this connection. >> + * Sets and validates the sharding key for this connection. A {@code null} >> + * value may be specified for the sharding Key. The validity >> + * of a {@code null} sharding key is vendor specific. Consult your vendors > > Again I would hyphenate ?vendor-specific? and change ?vendors? to ?vendor?s" > >> + * documentation for additional information. >> * @implSpec >> * The default implementation will throw a >> * {@code SQLFeatureNotSupportedException}. >> @@ -1635,7 +1644,8 @@ >> * {@code Connection}. The timeout value indicates how long the driver >> * should wait for the {@code Connection} to verify that the sharding key >> * is valid before {@code setShardingKeyIfValid} returns false. >> - * @param shardingKey the sharding key to be validated against this connection >> + * @param shardingKey the sharding key to be validated against this connection. >> + * The sharding key may be {@code null} >> * @param timeout time in seconds before which the validation process is expected to >> * be completed,else the validation process is aborted. A value of 0 indicates >> * the validation process will not time out. >> @@ -1643,8 +1653,8 @@ >> * set on this connection; false if the sharding key is not valid or >> * the timeout period expires before the operation completes. >> * @throws SQLException if there is an error while performing this validation; >> - * this method is called on a closed {@code connection}; the {@code shardingkey} >> - * is {@code null}; or the {@code timeout} value is less than 0. >> + * this method is called on a closed {@code connection}; >> + * or the {@code timeout} value is less than 0. > > Again ?less than 0? could be simple ?negative." > >> * @throws SQLFeatureNotSupportedException if the driver does not support sharding >> * @since 9 >> * @see ShardingKey >> @@ -1664,12 +1674,12 @@ >> * This method sets the specified sharding keys but does not require a >> * round trip to the database to validate that the sharding keys are valid >> * for the {@code Connection}. >> - * @param shardingKey the sharding key to set on this connection. >> + * @param shardingKey the sharding key to set on this connection. The sharding >> + * key may be {@code null} >> * @param superShardingKey the super sharding key to set on this connection. >> * The super sharding key may be {@code null} >> * @throws SQLException if an error occurs setting the sharding keys; >> - * this method is called on a closed {@code connection}; >> - * the {@code shardingkey} is {@code null}; or >> + * this method is called on a closed {@code connection}; or >> * a {@code superSharedingKey} is specified without a {@code shardingKey} >> * @throws SQLFeatureNotSupportedException if the driver does not support sharding >> * @since 9 >> @@ -1690,10 +1700,10 @@ >> * This method sets the specified sharding key but does not require a >> * round trip to the database to validate that the sharding key is valid >> * for the {@code Connection}. >> - * @param shardingKey the sharding key to set on this connection. >> - * @throws SQLException if an error occurs setting the sharding key; >> - * this method is called on a closed {@code connection}; or the >> - * {@code shardkingKey} is {@code null} >> + * @param shardingKey the sharding key to set on this connection. The sharding >> + * key may be {@code null} >> + * @throws SQLException if an error occurs setting the sharding key; or >> + * this method is called on a closed {@code connection} >> * @throws SQLFeatureNotSupportedException if the driver does not support sharding >> * @since 9 >> * @see ShardingKey > 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 brian.burkhalter at oracle.com Fri Apr 7 22:50:19 2017 From: brian.burkhalter at oracle.com (Brian Burkhalter) Date: Fri, 7 Apr 2017 15:50:19 -0700 Subject: RFR: 8178130: Minor update to the Connection javadocs In-Reply-To: <72EF7E38-A474-45EC-9E74-B4BB6009F90D@oracle.com> References: <7E91DED6-C202-416C-9122-51F804FE28A6@oracle.com> <72EF7E38-A474-45EC-9E74-B4BB6009F90D@oracle.com> Message-ID: <3258F920-847C-4223-9ABF-03EBCB75F735@oracle.com> Looks good! Brian On Apr 7, 2017, at 3:45 PM, Lance Andersen wrote: > Thank you for your input. Here is the revised version: From stuart.marks at oracle.com Sat Apr 8 00:22:53 2017 From: stuart.marks at oracle.com (Stuart Marks) Date: Fri, 7 Apr 2017 17:22:53 -0700 Subject: JDK 9 RFR(s): 8150488: add note to Scanner.findAll()regardingpossible infinite streams In-Reply-To: <58e644e8.6585df0a.cb334.d1ae@mx.google.com> References: <58DC7E53.6040603@oracle.com> <58dd2aba.298fdf0a.86cca.3418@mx.google.com> <58E427E8.2020901@oracle.com> <89d5129f-faff-20cb-eb86-6d3bb4151958@oracle.com> <58e644e8.6585df0a.cb334.d1ae@mx.google.com> Message-ID: <1adc45d8-af7e-9cd2-aed0-a91db14b29de@oracle.com> On 4/6/17 6:38 AM, Timo Kinnunen wrote: > IMHO there should be a notice added in findAll which excludes the behavior of > the stream after an empty match from any compatibility requirements while the > notice remains in place. This would be to ensure that findAll and the stream it > returns can be changed independently from the other methods which also have this > issue. Just in case. In general we don't use @apiNote to document implementation limits or restrictions that might be modified in the future, e.g. by bugfixes. And also note that @apiNote is non-normative, so it doesn't affect compatibility. But also, Sherman came up with a prototype for a fix that we might be able to get into 9, so we're pursuing that at the moment. s'marks From weijun.wang at oracle.com Sat Apr 8 00:39:59 2017 From: weijun.wang at oracle.com (Weijun Wang) Date: Sat, 8 Apr 2017 08:39:59 +0800 Subject: [9] RFR 8177969: Faster FilePermission::implies by avoiding the use of Path::relativize In-Reply-To: References: <4f1e0c02-a11d-2694-84ad-cf8804021f3c@oracle.com> <9f96ed4d-9282-d776-f767-d3fe060ba895@Oracle.com> Message-ID: <769a4646-7f6b-5a17-8671-8333cb7042b1@oracle.com> Webrev updated at http://cr.openjdk.java.net/~weijun/8177969/webrev.02/ Changes since webrev.01: 1. Comments. 2. Another enhancement when I am writing comments. Since we can be sure that a path has no ".." by only looking at its head, we can also be sure that a path is all ".." by only looking at its tail. JPRT core+jaxp runs fine. JCK tests run fine. Now benchmark result (after adjusting the granted permission to "../../../../-") is: Benchmark Mode Cnt Score Error Units checkReadNewUnfixed thrpt 15 174963.698 ? 5952.239 ops/s checkReadNewFixed00 thrpt 15 417692.698 ? 24994.735 ops/s checkReadNewFixed02 thrpt 15 447824.218 ? 20199.194 ops/s checkReadOld200 thrpt 15 425353.705 ? 3546.411 ops/s checkReadOld201 thrpt 15 2045.070 ? 57.287 ops/s This time checkReadNewFixed02 looks even better than checkReadOld200 running on jdk8u131. I dare not run it again. :-) Thanks Max On 04/08/2017 04:48 AM, Sean Mullan wrote: > This fix looks good to me. However, I would suggest adding some > additional comments to the body of the containsPath method explaining > what it is doing so that it is easier to understand. > > --Sean > > On 4/7/17 10:50 AM, Weijun Wang wrote: >> Webrev updated at >> >> http://cr.openjdk.java.net/~weijun/8177969/webrev.01/ >> >> Changes since webrev.00 [1] >> >> 1. Copyright years. >> >> 2. Test fix. check() should include Windows drive tests like contains() >> does. >> >> Thanks >> Max >> >> [1] >> http://cr.openjdk.java.net/~weijun/8177969/webrev.01/interdiff.patch.html >> >> On 04/05/2017 10:13 PM, Roger Riggs wrote: >>> Hi Max, >>> >>> The code looks ok. >>> >>> How much faster does it make FilePermission compares? >>> >>> I assume if it is not accepted to be fixed in JDK 9, you will push it to >>> JDK 10. >>> >>> Roger >>> >>> >>> On 4/3/2017 11:30 AM, Weijun Wang wrote: >>>> http://cr.openjdk.java.net/~weijun/8177969/webrev.00/ >>>> >>>> This new implementation of containsPath(Path,Path) uses the logic of >>>> Path::relativize without directly calling it, which is much faster now. >>>> >>>> Thanks >>>> Max >>> From sean.mullan at oracle.com Mon Apr 10 14:08:09 2017 From: sean.mullan at oracle.com (Sean Mullan) Date: Mon, 10 Apr 2017 10:08:09 -0400 Subject: [9] RFR 8177969: Faster FilePermission::implies by avoiding the use of Path::relativize In-Reply-To: <769a4646-7f6b-5a17-8671-8333cb7042b1@oracle.com> References: <4f1e0c02-a11d-2694-84ad-cf8804021f3c@oracle.com> <9f96ed4d-9282-d776-f767-d3fe060ba895@Oracle.com> <769a4646-7f6b-5a17-8671-8333cb7042b1@oracle.com> Message-ID: The updated webrev looks good. Thanks, Sean On 4/7/17 8:39 PM, Weijun Wang wrote: > Webrev updated at > > http://cr.openjdk.java.net/~weijun/8177969/webrev.02/ > > Changes since webrev.01: > > 1. Comments. > > 2. Another enhancement when I am writing comments. Since we can be sure > that a path has no ".." by only looking at its head, we can also be sure > that a path is all ".." by only looking at its tail. > > JPRT core+jaxp runs fine. JCK tests run fine. > > Now benchmark result (after adjusting the granted permission to > "../../../../-") is: > > Benchmark Mode Cnt Score Error Units > checkReadNewUnfixed thrpt 15 174963.698 ? 5952.239 ops/s > checkReadNewFixed00 thrpt 15 417692.698 ? 24994.735 ops/s > checkReadNewFixed02 thrpt 15 447824.218 ? 20199.194 ops/s > checkReadOld200 thrpt 15 425353.705 ? 3546.411 ops/s > checkReadOld201 thrpt 15 2045.070 ? 57.287 ops/s > > This time checkReadNewFixed02 looks even better than checkReadOld200 > running on jdk8u131. I dare not run it again. :-) > > Thanks > Max > > On 04/08/2017 04:48 AM, Sean Mullan wrote: >> This fix looks good to me. However, I would suggest adding some >> additional comments to the body of the containsPath method explaining >> what it is doing so that it is easier to understand. >> >> --Sean >> >> On 4/7/17 10:50 AM, Weijun Wang wrote: >>> Webrev updated at >>> >>> http://cr.openjdk.java.net/~weijun/8177969/webrev.01/ >>> >>> Changes since webrev.00 [1] >>> >>> 1. Copyright years. >>> >>> 2. Test fix. check() should include Windows drive tests like contains() >>> does. >>> >>> Thanks >>> Max >>> >>> [1] >>> http://cr.openjdk.java.net/~weijun/8177969/webrev.01/interdiff.patch.html >>> >>> >>> On 04/05/2017 10:13 PM, Roger Riggs wrote: >>>> Hi Max, >>>> >>>> The code looks ok. >>>> >>>> How much faster does it make FilePermission compares? >>>> >>>> I assume if it is not accepted to be fixed in JDK 9, you will push >>>> it to >>>> JDK 10. >>>> >>>> Roger >>>> >>>> >>>> On 4/3/2017 11:30 AM, Weijun Wang wrote: >>>>> http://cr.openjdk.java.net/~weijun/8177969/webrev.00/ >>>>> >>>>> This new implementation of containsPath(Path,Path) uses the logic of >>>>> Path::relativize without directly calling it, which is much faster >>>>> now. >>>>> >>>>> Thanks >>>>> Max >>>> From claes.redestad at oracle.com Mon Apr 10 14:09:43 2017 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 10 Apr 2017 16:09:43 +0200 Subject: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers Message-ID: Hi, profiling initializers in java.lang.invoke shows we're still doing various things during class initialization which could be done lazily or not at all. The proposed patch reduce bytecode executed, memory churn and retained heap footprint when initializing java.lang.invoke: Webrev: http://cr.openjdk.java.net/~redestad/8178384/jdk.01/ Bug: https://bugs.openjdk.java.net/browse/JDK-8178384 Testing: java.lang.invoke jtreg tests, sanity performance testing Thanks! /Claes From vladimir.x.ivanov at oracle.com Mon Apr 10 15:19:12 2017 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Mon, 10 Apr 2017 18:19:12 +0300 Subject: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers In-Reply-To: References: Message-ID: Looks good. One small suggestion [1] Best regards, Vladimir Ivanov [1] diff --git a/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java b/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java --- a/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java +++ b/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java @@ -456,6 +456,7 @@ static final String MH = "java/lang/invoke/MethodHandle"; static final String MH_SIG = "L"+MH+";"; static final String BMH = "java/lang/invoke/BoundMethodHandle"; + static final String BMH_NAME = "java.lang.invoke.BoundMethodHandle"; static final String BMH_SIG = "L"+BMH+";"; static final String SPECIES_DATA = "java/lang/invoke/BoundMethodHandle$SpeciesData"; static final String SPECIES_DATA_SIG = "L"+SPECIES_DATA+";"; @@ -463,7 +464,7 @@ static final String SPECIES_PREFIX_NAME = "Species_"; static final String SPECIES_PREFIX_PATH = BMH + "$" + SPECIES_PREFIX_NAME; - static final String SPECIES_CLASS_PREFIX = SPECIES_PREFIX_PATH.replace('/', '.'); + static final String SPECIES_CLASS_PREFIX = BMH_NAME + "$" + SPECIES_PREFIX_NAME; static final String BMHSPECIES_DATA_EWI_SIG = "(B)" + SPECIES_DATA_SIG; static final String BMHSPECIES_DATA_GFC_SIG = "(" + JLS_SIG + JLC_SIG + ")" + SPECIES_DATA_SIG; On 4/10/17 5:09 PM, Claes Redestad wrote: > Hi, > > profiling initializers in java.lang.invoke shows we're still doing > various things during > class initialization which could be done lazily or not at all. The > proposed patch > reduce bytecode executed, memory churn and retained heap footprint when > initializing java.lang.invoke: > > Webrev: http://cr.openjdk.java.net/~redestad/8178384/jdk.01/ > Bug: https://bugs.openjdk.java.net/browse/JDK-8178384 > > Testing: java.lang.invoke jtreg tests, sanity performance testing > > Thanks! > > /Claes From claes.redestad at oracle.com Mon Apr 10 15:20:10 2017 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 10 Apr 2017 17:20:10 +0200 Subject: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers In-Reply-To: References: Message-ID: <6f3d6678-4f14-0987-415d-9e9a68287fbb@oracle.com> On 04/10/2017 05:19 PM, Vladimir Ivanov wrote: > Looks good. Thanks for reviewing! > > One small suggestion [1] Sure, updated in-place. /Claes > > Best regards, > Vladimir Ivanov > > [1] diff --git > a/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java > b/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java > --- a/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java > +++ b/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java > @@ -456,6 +456,7 @@ > static final String MH = "java/lang/invoke/MethodHandle"; > static final String MH_SIG = "L"+MH+";"; > static final String BMH = > "java/lang/invoke/BoundMethodHandle"; > + static final String BMH_NAME = > "java.lang.invoke.BoundMethodHandle"; > static final String BMH_SIG = "L"+BMH+";"; > static final String SPECIES_DATA = > "java/lang/invoke/BoundMethodHandle$SpeciesData"; > static final String SPECIES_DATA_SIG = "L"+SPECIES_DATA+";"; > @@ -463,7 +464,7 @@ > > static final String SPECIES_PREFIX_NAME = "Species_"; > static final String SPECIES_PREFIX_PATH = BMH + "$" + > SPECIES_PREFIX_NAME; > - static final String SPECIES_CLASS_PREFIX = > SPECIES_PREFIX_PATH.replace('/', '.'); > + static final String SPECIES_CLASS_PREFIX = BMH_NAME + "$" + > SPECIES_PREFIX_NAME; > > static final String BMHSPECIES_DATA_EWI_SIG = "(B)" + > SPECIES_DATA_SIG; > static final String BMHSPECIES_DATA_GFC_SIG = "(" + JLS_SIG + > JLC_SIG + ")" + SPECIES_DATA_SIG; From claes.redestad at oracle.com Mon Apr 10 15:37:34 2017 From: claes.redestad at oracle.com (Claes Redestad) Date: Mon, 10 Apr 2017 17:37:34 +0200 Subject: [10] RFR: 8178387: Reduce memory churn when creating java.lang.invoke entities Message-ID: <415bf1e3-b612-1c34-8b55-21ba9b2b40a4@oracle.com> Hi, another startup optimization for java.lang.invoke, this one collecting a set of small fixes I've been wanting to get done for a while, including: - no need to generate the signature strings in BoundMethodHandle.makeCbmhCtor - trusted MethodType lookups could be promoted without constructing new objects - InvokerBytecodeGenerator: creation of className and sourceFile can be done lazily, which reduces String allocations in those cases where there's a pre-generated form to be found - MethodType lookup done twice when looking up pregenerated members (oops!) - A lot of vararg array creation during startup in various places. A larger rewrite could be warranted, but we can some startup gain by simply constant-izing oft-used constant arguments such as MethodType.invokerType Webrev: http://cr.openjdk.java.net/~redestad/8178387/jdk.01/ Bug: https://bugs.openjdk.java.net/browse/JDK-8178387 Test: java.lang.invoke jtreg tests, verified each change in this patch (and JDK-8178384) reduces the amount of bytecode executed during lambda bootstrap. Thanks! /Claes From paul.sandoz at oracle.com Mon Apr 10 16:18:07 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 10 Apr 2017 09:18:07 -0700 Subject: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers In-Reply-To: References: Message-ID: <7C080227-8B26-4FF2-844D-530E9EEF30C6@oracle.com> +1 These named functions really wanna be LDC?ed but i suspect using constant dynamic + representation in source (when available) might result in it?s own bootstrap issues, still it would be interesting to try when available. Paul. > On 10 Apr 2017, at 07:09, Claes Redestad wrote: > > Hi, > > profiling initializers in java.lang.invoke shows we're still doing various things during > class initialization which could be done lazily or not at all. The proposed patch > reduce bytecode executed, memory churn and retained heap footprint when > initializing java.lang.invoke: > > Webrev: http://cr.openjdk.java.net/~redestad/8178384/jdk.01/ > Bug: https://bugs.openjdk.java.net/browse/JDK-8178384 > > Testing: java.lang.invoke jtreg tests, sanity performance testing > > Thanks! > > /Claes From forax at univ-mlv.fr Mon Apr 10 16:32:31 2017 From: forax at univ-mlv.fr (Remi Forax) Date: Mon, 10 Apr 2017 16:32:31 +0000 Subject: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers In-Reply-To: <7C080227-8B26-4FF2-844D-530E9EEF30C6@oracle.com> References: <7C080227-8B26-4FF2-844D-530E9EEF30C6@oracle.com> Message-ID: <9B8481A0-3BFF-4F8C-B69C-C293D9D60547@univ-mlv.fr> Currently playing with a pattern matching representation for Amber, if think we need a form of array constant that does not require a bootstrap method. Afaik, an array of any existing constants does not need a Java code to construct itself. R?mi On April 10, 2017 6:18:07 PM GMT+02:00, Paul Sandoz wrote: >+1 > >These named functions really wanna be LDC?ed but i suspect using >constant dynamic + representation in source (when available) might >result in it?s own bootstrap issues, still it would be interesting to >try when available. > >Paul. > >> On 10 Apr 2017, at 07:09, Claes Redestad >wrote: >> >> Hi, >> >> profiling initializers in java.lang.invoke shows we're still doing >various things during >> class initialization which could be done lazily or not at all. The >proposed patch >> reduce bytecode executed, memory churn and retained heap footprint >when >> initializing java.lang.invoke: >> >> Webrev: http://cr.openjdk.java.net/~redestad/8178384/jdk.01/ >> Bug: https://bugs.openjdk.java.net/browse/JDK-8178384 >> >> Testing: java.lang.invoke jtreg tests, sanity performance testing >> >> Thanks! >> >> /Claes -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From paul.sandoz at oracle.com Mon Apr 10 16:48:05 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Mon, 10 Apr 2017 09:48:05 -0700 Subject: [10] RFR: 8178387: Reduce memory churn when creating java.lang.invoke entities In-Reply-To: <415bf1e3-b612-1c34-8b55-21ba9b2b40a4@oracle.com> References: <415bf1e3-b612-1c34-8b55-21ba9b2b40a4@oracle.com> Message-ID: <11370D0A-7A7D-4E51-A286-13E1265CFE10@oracle.com> Hi, Looks good. LambdaForm.java -- 851 MethodType invokerType = methodType(); 852 assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType)); ? 1183 assert(checkArgumentTypes(arguments, methodType())); ? 1201 assert(checkArgumentTypes(arguments, methodType())); I am always wary of removing asserts, do you think these are redundant? ? From this and the last fixes how much have you cut from the start up time? Paul. > On 10 Apr 2017, at 08:37, Claes Redestad wrote: > > Hi, > > another startup optimization for java.lang.invoke, this one collecting a set of small fixes I've been wanting to get done for a while, including: > > - no need to generate the signature strings in BoundMethodHandle.makeCbmhCtor > - trusted MethodType lookups could be promoted without constructing new objects > - InvokerBytecodeGenerator: creation of className and sourceFile can be done lazily, which reduces String allocations in those cases where there's a pre-generated form to be found > - MethodType lookup done twice when looking up pregenerated members (oops!) > - A lot of vararg array creation during startup in various places. A larger rewrite could be warranted, but we can some startup gain by simply constant-izing oft-used constant arguments such as MethodType.invokerType > > Webrev: http://cr.openjdk.java.net/~redestad/8178387/jdk.01/ > Bug: https://bugs.openjdk.java.net/browse/JDK-8178387 > > Test: java.lang.invoke jtreg tests, verified each change in this patch (and JDK-8178384) reduces the amount of bytecode executed during lambda bootstrap. > > Thanks! > > /Claes From mandy.chung at oracle.com Mon Apr 10 17:22:26 2017 From: mandy.chung at oracle.com (Mandy Chung) Date: Mon, 10 Apr 2017 10:22:26 -0700 Subject: Review Request: JDK-8177855: Clean up legal files Message-ID: <14133C4B-818D-4192-8A6D-09CED6691F4F@oracle.com> Webrev: http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8177855/webrev.00/index.html The patch is trivial: diff --git a/src/jdk.xml.bind/share/legal/relaxngdatatype.md b/src/jdk.xml.bind/share/legal/relaxngdatatype.md --- a/src/jdk.xml.bind/share/legal/relaxngdatatype.md +++ b/src/jdk.xml.bind/share/legal/relaxngdatatype.md @@ -3,7 +3,7 @@ ### RelaxNG Datatype License
     
    -Copyright (c) 2001, Thai Open Source Software Center Ltd, Sun Microsystems.
    +Copyright (c) 2005, 2010 Thai Open Source Software Center Ltd
     All rights reserved.
     
     Redistribution and use in source and binary forms, with or without
    
    diff --git a/src/java.desktop/share/legal/jpeg.md b/src/java.desktop/share/legal/jpeg.md
    --- a/src/java.desktop/share/legal/jpeg.md
    +++ b/src/java.desktop/share/legal/jpeg.md
    @@ -1,4 +1,4 @@
    -## JPEG release 6b
    +## Independent JPEG Group: JPEG release 6b
     
     ### JPEG License
     
    diff --git a/src/jdk.crypto.ec/share/legal/ecc.md b/src/jdk.crypto.ec/share/legal/ecc.md
    --- a/src/jdk.crypto.ec/share/legal/ecc.md
    +++ b/src/jdk.crypto.ec/share/legal/ecc.md
    @@ -6,7 +6,8 @@
     This notice is provided with respect to Elliptic Curve Cryptography,
     which is included with JRE, JDK, and OpenJDK.
     
    -You are receiving a copy of the Elliptic Curve Cryptography library in source
    +You are receiving a [copy](http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/bd00098fc2d7/src/jdk.crypto.ec/share/native/libsunec/impl)
    +of the Elliptic Curve Cryptography library in source
     form with the JDK and OpenJDK source distributions, and as object code in
     the JRE & JDK runtimes.
     
    
    
    
    From claes.redestad at oracle.com  Mon Apr 10 17:31:16 2017
    From: claes.redestad at oracle.com (Claes Redestad)
    Date: Mon, 10 Apr 2017 19:31:16 +0200
    Subject: [10] RFR: 8178387: Reduce memory churn when creating
     java.lang.invoke entities
    In-Reply-To: <11370D0A-7A7D-4E51-A286-13E1265CFE10@oracle.com>
    References: <415bf1e3-b612-1c34-8b55-21ba9b2b40a4@oracle.com>
     <11370D0A-7A7D-4E51-A286-13E1265CFE10@oracle.com>
    Message-ID: <6ca9480e-8def-d80b-7de0-2450e3ff9df7@oracle.com>
    
    Hi,
    
    
    On 2017-04-10 18:48, Paul Sandoz wrote:
    > Hi,
    >
    > Looks good.
    
    Thanks!
    
    >
    > LambdaForm.java
    > --
    >
    >   851         MethodType invokerType = methodType();
    >   852         assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType));
    
    This one was accidentally removed, will put it back (without the local 
    invokerType var).
    
    >
    > ?
    >
    > 1183             assert(checkArgumentTypes(arguments, methodType()));
    >
    > ?
    >
    > 1201                 assert(checkArgumentTypes(arguments, methodType()));
    
    The checkArgumentTypes method has been shortcutted for quite some time 
    (if (true) return true;),
    so the asserts aren't doing anything but making -Xcomp tests run slower 
    and emit a lot of warnings
    in my IDE.
    
    >
    > I am always wary of removing asserts, do you think these are redundant?
    >
    >
    > ?
    >
    >  From this and the last fixes how much have you cut from the start up time?
    
    Don't expect too much! These two add up to about ~60k fewer bytecode 
    executed to bootstrap j.l.invoke
    and run a trivial lambda, which is about 13% of the total and shows up 
    as around or somewhat less than a
    millisecond improvement on my machine (out of the ~19-20ms it now takes 
    to bootstrap and execute the
    first lambda on my machine).
    
    Thanks!
    
    /Claes
    
    >
    > Paul.
    >
    >> On 10 Apr 2017, at 08:37, Claes Redestad  wrote:
    >>
    >> Hi,
    >>
    >> another startup optimization for java.lang.invoke, this one collecting a set of small fixes I've been wanting to get done for a while, including:
    >>
    >> - no need to generate the signature strings in BoundMethodHandle.makeCbmhCtor
    >> - trusted MethodType lookups could be promoted without constructing new objects
    >> - InvokerBytecodeGenerator: creation of className and sourceFile can be done lazily, which reduces String allocations in those cases where there's a pre-generated form to be found
    >> - MethodType lookup done twice when looking up pregenerated members (oops!)
    >> - A lot of vararg array creation during startup in various places. A larger rewrite could be warranted, but we can some startup gain by simply constant-izing oft-used constant arguments such as MethodType.invokerType
    >>
    >> Webrev: http://cr.openjdk.java.net/~redestad/8178387/jdk.01/
    >> Bug: https://bugs.openjdk.java.net/browse/JDK-8178387
    >>
    >> Test: java.lang.invoke jtreg tests, verified each change in this patch (and JDK-8178384) reduces the amount of bytecode executed during lambda bootstrap.
    >>
    >> Thanks!
    >>
    >> /Claes
    
    
    From paul.sandoz at oracle.com  Mon Apr 10 17:41:31 2017
    From: paul.sandoz at oracle.com (Paul Sandoz)
    Date: Mon, 10 Apr 2017 10:41:31 -0700
    Subject: [10] RFR: 8178387: Reduce memory churn when creating
     java.lang.invoke entities
    In-Reply-To: <6ca9480e-8def-d80b-7de0-2450e3ff9df7@oracle.com>
    References: <415bf1e3-b612-1c34-8b55-21ba9b2b40a4@oracle.com>
     <11370D0A-7A7D-4E51-A286-13E1265CFE10@oracle.com>
     <6ca9480e-8def-d80b-7de0-2450e3ff9df7@oracle.com>
    Message-ID: <60202B50-73C5-4061-AD2B-CDCC3B31BEF8@oracle.com>
    
    
    > On 10 Apr 2017, at 10:31, Claes Redestad  wrote:
    > 
    > Hi,
    > 
    > 
    > On 2017-04-10 18:48, Paul Sandoz wrote:
    >> Hi,
    >> 
    >> Looks good.
    > 
    > Thanks!
    > 
    >> 
    >> LambdaForm.java
    >> --
    >> 
    >>  851         MethodType invokerType = methodType();
    >>  852         assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType));
    > 
    > This one was accidentally removed, will put it back (without the local invokerType var).
    > 
    
    Ok.
    
    
    >> 
    >> ?
    >> 
    >> 1183             assert(checkArgumentTypes(arguments, methodType()));
    >> 
    >> ?
    >> 
    >> 1201                 assert(checkArgumentTypes(arguments, methodType()));
    > 
    > The checkArgumentTypes method has been shortcutted for quite some time (if (true) return true;),
    > so the asserts aren't doing anything but making -Xcomp tests run slower and emit a lot of warnings
    > in my IDE.
    > 
    
    Ok.
    
    
    >> 
    >> I am always wary of removing asserts, do you think these are redundant?
    >> 
    >> 
    >> ?
    >> 
    >> From this and the last fixes how much have you cut from the start up time?
    > 
    > Don't expect too much! These two add up to about ~60k fewer bytecode executed to bootstrap j.l.invoke
    > and run a trivial lambda, which is about 13% of the total and shows up as around or somewhat less than a
    > millisecond improvement on my machine (out of the ~19-20ms it now takes to bootstrap and execute the
    > first lambda on my machine).
    > 
    
    Keep chipping away, every bit helps :-)
    
    Separately, i am curious how much GC activity occurs at startup before the main method is called. Would it be possible to overlay hotspot activity on the Java flame graph?
    
    Paul.
    
    From Alan.Bateman at oracle.com  Mon Apr 10 17:57:35 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Mon, 10 Apr 2017 18:57:35 +0100
    Subject: Review Request: JDK-8177855: Clean up legal files
    In-Reply-To: <14133C4B-818D-4192-8A6D-09CED6691F4F@oracle.com>
    References: <14133C4B-818D-4192-8A6D-09CED6691F4F@oracle.com>
    Message-ID: 
    
    
    
    On 10/04/2017 18:22, Mandy Chung wrote:
    > Webrev:
    >    http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8177855/webrev.00/index.html
    This looks okay to me.
    
    -Alan
    
    From claes.redestad at oracle.com  Mon Apr 10 18:00:39 2017
    From: claes.redestad at oracle.com (Claes Redestad)
    Date: Mon, 10 Apr 2017 20:00:39 +0200
    Subject: [10] RFR: 8178387: Reduce memory churn when creating
     java.lang.invoke entities
    In-Reply-To: <60202B50-73C5-4061-AD2B-CDCC3B31BEF8@oracle.com>
    References: <415bf1e3-b612-1c34-8b55-21ba9b2b40a4@oracle.com>
     <11370D0A-7A7D-4E51-A286-13E1265CFE10@oracle.com>
     <6ca9480e-8def-d80b-7de0-2450e3ff9df7@oracle.com>
     <60202B50-73C5-4061-AD2B-CDCC3B31BEF8@oracle.com>
    Message-ID: <3f9e24fc-0796-dd43-9500-af7b9bee106a@oracle.com>
    
    
    
    On 2017-04-10 19:41, Paul Sandoz wrote:
    >> On 10 Apr 2017, at 10:31, Claes Redestad  wrote:
    >> Don't expect too much! These two add up to about ~60k fewer bytecode executed to bootstrap j.l.invoke
    >> and run a trivial lambda, which is about 13% of the total and shows up as around or somewhat less than a
    >> millisecond improvement on my machine (out of the ~19-20ms it now takes to bootstrap and execute the
    >> first lambda on my machine).
    >>
    > Keep chipping away, every bit helps :-)
    >
    > Separately, i am curious how much GC activity occurs at startup before the main method is called. Would it be possible to overlay hotspot activity on the Java flame graph?
    
    Depends on the GC and initial heap sizes, but on the small tests I'm 
    looking at, G1 has typically not even started a concurrent cycle, so choice
    of GC doesn't matter that much... (G1 has some minor issues shutting 
    down promptly - seeing delays of up to 15ms to get all theads to realize
    they should stop what they're doing - which causes some headache though)
    
    ... on the other hand I'm seeing a lot of noise on my 2-socket 
    workstation when not pinning to a single socket, that appears to come 
    from JIT
    threads *and* the main java thread spending more time. My best guess 
    right now is some interaction between interpreter and JIT threads,
    possibly some contention/sharing effects when installing compiled 
    methods, and have been starting to ask around for someone who can give
    me a tour through that code to investigate deeper... :-)
    
    W.r.t. overlaying native and java flame graphs then it's quite easy to 
    generate native-only and java-only startup graphs separately, but 
    surprisingly(?)
    hard to create something mixed that capture what happens during the 
    earliest bootstrap with any precision. There's some wonderful work out 
    there
    using agents to map JIT disassembly to perf output and such, but I'm not 
    sure it's feasible to use that approach to see what's happening during
    interpreter-heavy/warmup phases.
    
    Thanks!
    
    /Claes
    
    
    
    From joe.darcy at oracle.com  Mon Apr 10 18:03:28 2017
    From: joe.darcy at oracle.com (joe darcy)
    Date: Mon, 10 Apr 2017 11:03:28 -0700
    Subject: Review Request: JDK-8177855: Clean up legal files
    In-Reply-To: <14133C4B-818D-4192-8A6D-09CED6691F4F@oracle.com>
    References: <14133C4B-818D-4192-8A6D-09CED6691F4F@oracle.com>
    Message-ID: <02239ed1-ff5e-7445-2cbd-747d0def45ac@oracle.com>
    
    Hello,
    
    Would it be better for the for the URL
    
    (http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/bd00098fc2d7/src/jdk.crypto.ec/share/native/libsunec/impl)
    
    to use "tip"
    
    (http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/jdk.crypto.ec/share/native/libsunec/impl)
    
    Cheers,
    
    -Joe
    
    
    On 4/10/2017 10:22 AM, Mandy Chung wrote:
    > Webrev:
    >    http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8177855/webrev.00/index.html
    >
    > The patch is trivial:
    >
    > diff --git a/src/jdk.xml.bind/share/legal/relaxngdatatype.md b/src/jdk.xml.bind/share/legal/relaxngdatatype.md
    > --- a/src/jdk.xml.bind/share/legal/relaxngdatatype.md
    > +++ b/src/jdk.xml.bind/share/legal/relaxngdatatype.md
    > @@ -3,7 +3,7 @@
    >   ### RelaxNG Datatype License
    >   
    >   
    > -Copyright (c) 2001, Thai Open Source Software Center Ltd, Sun Microsystems.
    > +Copyright (c) 2005, 2010 Thai Open Source Software Center Ltd
    >   All rights reserved.
    >   
    >   Redistribution and use in source and binary forms, with or without
    >
    > diff --git a/src/java.desktop/share/legal/jpeg.md b/src/java.desktop/share/legal/jpeg.md
    > --- a/src/java.desktop/share/legal/jpeg.md
    > +++ b/src/java.desktop/share/legal/jpeg.md
    > @@ -1,4 +1,4 @@
    > -## JPEG release 6b
    > +## Independent JPEG Group: JPEG release 6b
    >   
    >   ### JPEG License
    >   
    > diff --git a/src/jdk.crypto.ec/share/legal/ecc.md b/src/jdk.crypto.ec/share/legal/ecc.md
    > --- a/src/jdk.crypto.ec/share/legal/ecc.md
    > +++ b/src/jdk.crypto.ec/share/legal/ecc.md
    > @@ -6,7 +6,8 @@
    >   This notice is provided with respect to Elliptic Curve Cryptography,
    >   which is included with JRE, JDK, and OpenJDK.
    >   
    > -You are receiving a copy of the Elliptic Curve Cryptography library in source
    > +You are receiving a [copy](http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/bd00098fc2d7/src/jdk.crypto.ec/share/native/libsunec/impl)
    > +of the Elliptic Curve Cryptography library in source
    >   form with the JDK and OpenJDK source distributions, and as object code in
    >   the JRE & JDK runtimes.
    >   
    >
    >
    
    
    From mandy.chung at oracle.com  Mon Apr 10 18:04:34 2017
    From: mandy.chung at oracle.com (Mandy Chung)
    Date: Mon, 10 Apr 2017 11:04:34 -0700
    Subject: Review Request: JDK-8177855: Clean up legal files
    In-Reply-To: <02239ed1-ff5e-7445-2cbd-747d0def45ac@oracle.com>
    References: <14133C4B-818D-4192-8A6D-09CED6691F4F@oracle.com>
     <02239ed1-ff5e-7445-2cbd-747d0def45ac@oracle.com>
    Message-ID: 
    
    I think so.  Will fix before push.
    
    Mandy
    
    > On Apr 10, 2017, at 11:03 AM, joe darcy  wrote:
    > 
    > Hello,
    > 
    > Would it be better for the for the URL
    > 
    > (http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/bd00098fc2d7/src/jdk.crypto.ec/share/native/libsunec/impl)
    > 
    > to use "tip"
    > 
    > (http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/tip/src/jdk.crypto.ec/share/native/libsunec/impl)
    > 
    > Cheers,
    > 
    > -Joe
    > 
    > 
    > On 4/10/2017 10:22 AM, Mandy Chung wrote:
    >> Webrev:
    >>   http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8177855/webrev.00/index.html
    >> 
    >> The patch is trivial:
    >> 
    >> diff --git a/src/jdk.xml.bind/share/legal/relaxngdatatype.md b/src/jdk.xml.bind/share/legal/relaxngdatatype.md
    >> --- a/src/jdk.xml.bind/share/legal/relaxngdatatype.md
    >> +++ b/src/jdk.xml.bind/share/legal/relaxngdatatype.md
    >> @@ -3,7 +3,7 @@
    >>  ### RelaxNG Datatype License
    >>  
    >>  -Copyright (c) 2001, Thai Open Source Software Center Ltd, Sun Microsystems.
    >> +Copyright (c) 2005, 2010 Thai Open Source Software Center Ltd
    >>  All rights reserved.
    >>    Redistribution and use in source and binary forms, with or without
    >> 
    >> diff --git a/src/java.desktop/share/legal/jpeg.md b/src/java.desktop/share/legal/jpeg.md
    >> --- a/src/java.desktop/share/legal/jpeg.md
    >> +++ b/src/java.desktop/share/legal/jpeg.md
    >> @@ -1,4 +1,4 @@
    >> -## JPEG release 6b
    >> +## Independent JPEG Group: JPEG release 6b
    >>    ### JPEG License
    >>  
    >> diff --git a/src/jdk.crypto.ec/share/legal/ecc.md b/src/jdk.crypto.ec/share/legal/ecc.md
    >> --- a/src/jdk.crypto.ec/share/legal/ecc.md
    >> +++ b/src/jdk.crypto.ec/share/legal/ecc.md
    >> @@ -6,7 +6,8 @@
    >>  This notice is provided with respect to Elliptic Curve Cryptography,
    >>  which is included with JRE, JDK, and OpenJDK.
    >>  -You are receiving a copy of the Elliptic Curve Cryptography library in source
    >> +You are receiving a [copy](http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/bd00098fc2d7/src/jdk.crypto.ec/share/native/libsunec/impl)
    >> +of the Elliptic Curve Cryptography library in source
    >>  form with the JDK and OpenJDK source distributions, and as object code in
    >>  the JRE & JDK runtimes.
    >>  
    >> 
    > 
    
    
    From sergey.kuksenko at oracle.com  Mon Apr 10 18:43:23 2017
    From: sergey.kuksenko at oracle.com (Sergey Kuksenko)
    Date: Mon, 10 Apr 2017 11:43:23 -0700
    Subject: JDK 10 RFR of 8176894: Provide specialized implementation for
     default methods putIfAbsent, computeIfAbsent, computeIfPresent, compute in
     TreeMap
    In-Reply-To: 
    References: <048a8a8d-20ac-4d32-1b49-244e85afdfd5@oracle.com>
     
     <507d83cf-2334-303a-1ae3-2bb8b1e9bd4c@oracle.com>
     <75959b26-9023-c662-bfda-87860a614a2c@oracle.com>
     
    Message-ID: 
    
    Hi Claes,
    
    There is no need to backport it to 8 & 9. 8 & 9 uses default 
    implementation, which is free from such tree corruption issue.
    
    
    On 04/06/2017 03:45 AM, Claes Redestad wrote:
    > Hi Sergey,
    >
    > this looks good to me*, but I can't help wonder if the modCount 
    > checking is something that should be done separately as a bug fix 
    > (with a higher priority) and be backported to 8 and 9? Alternatively 
    > re-categorize this fix as such.
    >
    > Thanks!
    >
    > /Claes
    >
    > * I wouldn't mind seeing the cleanup Martin suggested, i.e., write the 
    > remapValue as:
    >
    >     private V remapValue(Entry t, K key, BiFunction super V, ? extends V> remappingFunction) {
    >         V newValue = remappingFunction.apply(key, t.value);
    >         if (newValue == null) {
    >             deleteEntry(t);
    >         } else {
    >             // replace old mapping
    >             t.value = newValue;
    >         }
    >         return newValue;
    >      }
    >
    > On 2017-03-28 21:22, Sergey Kuksenko wrote:
    >> Friendly reminder.
    >>
    >> Have you have chance to review the latest version?
    >>
    >>
    >> On 03/17/2017 12:45 PM, Sergey Kuksenko wrote:
    >>> Hi, All.
    >>>
    >>> I realized (thanks Tagir V.) that if we don't check modCount after 
    >>> calling mapping function we may get corrupted tree structure.
    >>> new webrev for review:
    >>> http://cr.openjdk.java.net/~skuksenko/corelibs/utils/8176894/webrev.01/
    >>>
    >>> On 03/17/2017 11:29 AM, Martin Buchholz wrote:
    >>>> Thanks!  This looks pretty good.  I have a similar effort in 
    >>>> progress to improve bulk collection operations, most of which made 
    >>>> it into jdk9.
    >>>>
    >>>> ---
    >>>>
    >>>> Please use standard java.util whitespace, as Aleksey suggested.
    >>>>
    >>>> ---
    >>>>
    >>>> Below (and in compute) I wpuld simply
    >>>> return newValue;
    >>>> saving a line of code and making it clearer that we are returning 
    >>>> the result of the remappingFunction
    >>>>
    >>>>  676     private V remapValue(Entry t, K key, BiFunction>>> super K, ? super V, ? extends V> remappingFunction) {
    >>>>  677         V newValue = remappingFunction.apply(key, t.value);
    >>>>  678         if (newValue == null) {
    >>>>  679             deleteEntry(t);
    >>>>  680             return null;
    >>>>  681         } else {
    >>>>  682             // replace old mapping
    >>>>  683             t.value = newValue;
    >>>>  684             return newValue;
    >>>>  685         }
    >>>>  686     }
    >>>> ---
    >>>>
    >>>> This code is surely tested but testing could also surely be 
    >>>> improved.  That's probably not your job though (it may be mine!)
    >>>>
    >>>> I would probably try hand-injecting some bugs into a copy of the 
    >>>> code and seeing if our jtreg tests catch it, to increase coverage 
    >>>> confidence.
    >>>>
    >>>>
    >>>> On Thu, Mar 16, 2017 at 12:04 PM, Sergey Kuksenko 
    >>>> > 
    >>>> wrote:
    >>>>
    >>>>     Hi All,
    >>>>
    >>>>     Please, review:
    >>>>     https://bugs.openjdk.java.net/browse/JDK-8176894
    >>>>     
    >>>> http://cr.openjdk.java.net/~skuksenko/corelibs/utils/8176894/webrev.00/ 
    >>>>
    >>>>  
    >>>>
    >>>>
    >>>>     The issue was created for JDK10 in order to don't disturb JDK9
    >>>>     before launch.
    >>>>
    >>>>     --     Best regards,
    >>>>     Sergey Kuksenko
    >>>>
    >>>>
    >>>
    >>
    >
    
    -- 
    Best regards,
    Sergey Kuksenko
    
    
    From claes.redestad at oracle.com  Mon Apr 10 18:50:42 2017
    From: claes.redestad at oracle.com (Claes Redestad)
    Date: Mon, 10 Apr 2017 20:50:42 +0200
    Subject: JDK 10 RFR of 8176894: Provide specialized implementation for
     default methods putIfAbsent, computeIfAbsent, computeIfPresent, compute in
     TreeMap
    In-Reply-To: 
    References: <048a8a8d-20ac-4d32-1b49-244e85afdfd5@oracle.com>
     
     <507d83cf-2334-303a-1ae3-2bb8b1e9bd4c@oracle.com>
     <75959b26-9023-c662-bfda-87860a614a2c@oracle.com>
     
     
    Message-ID: <5295622c-940f-486d-4e5d-d24fbd3a804c@oracle.com>
    
    On 2017-04-10 20:43, Sergey Kuksenko wrote:
    > Hi Claes,
    >
    > There is no need to backport it to 8 & 9. 8 & 9 uses default 
    > implementation, which is free from such tree corruption issue. 
    
    Ah, I misread the situation then, sorry for the noise.
    
    /Claes
    
    From Roger.Riggs at Oracle.com  Mon Apr 10 19:17:07 2017
    From: Roger.Riggs at Oracle.com (Roger Riggs)
    Date: Mon, 10 Apr 2017 15:17:07 -0400
    Subject: [9] RFR 8177969: Faster FilePermission::implies by avoiding the
     use of Path::relativize
    In-Reply-To: 
    References: <4f1e0c02-a11d-2694-84ad-cf8804021f3c@oracle.com>
     <9f96ed4d-9282-d776-f767-d3fe060ba895@Oracle.com>
     
     
     <769a4646-7f6b-5a17-8671-8333cb7042b1@oracle.com>
     
    Message-ID: <7123db7f-e4b1-d6f2-2876-9e56702aa4c7@Oracle.com>
    
    +1, looks good.
    
    Thanks, Roger
    
    
    On 4/10/2017 10:08 AM, Sean Mullan wrote:
    > The updated webrev looks good.
    >
    > Thanks,
    > Sean
    >
    > On 4/7/17 8:39 PM, Weijun Wang wrote:
    >> Webrev updated at
    >>
    >>   http://cr.openjdk.java.net/~weijun/8177969/webrev.02/
    >>
    >> Changes since webrev.01:
    >>
    >> 1. Comments.
    >>
    >> 2. Another enhancement when I am writing comments. Since we can be sure
    >> that a path has no ".." by only looking at its head, we can also be sure
    >> that a path is all ".." by only looking at its tail.
    >>
    >> JPRT core+jaxp runs fine. JCK tests run fine.
    >>
    >> Now benchmark result (after adjusting the granted permission to
    >> "../../../../-") is:
    >>
    >> Benchmark                         Mode  Cnt       Score Error  Units
    >> checkReadNewUnfixed  thrpt   15  174963.698 ?  5952.239  ops/s
    >> checkReadNewFixed00  thrpt   15  417692.698 ? 24994.735  ops/s
    >> checkReadNewFixed02  thrpt   15  447824.218 ? 20199.194  ops/s
    >> checkReadOld200      thrpt   15  425353.705 ?  3546.411  ops/s
    >> checkReadOld201      thrpt   15    2045.070 ?    57.287  ops/s
    >>
    >> This time checkReadNewFixed02 looks even better than checkReadOld200
    >> running on jdk8u131. I dare not run it again. :-)
    >>
    >> Thanks
    >> Max
    >>
    >> On 04/08/2017 04:48 AM, Sean Mullan wrote:
    >>> This fix looks good to me. However, I would suggest adding some
    >>> additional comments to the body of the containsPath method explaining
    >>> what it is doing so that it is easier to understand.
    >>>
    >>> --Sean
    >>>
    >>> On 4/7/17 10:50 AM, Weijun Wang wrote:
    >>>> Webrev updated at
    >>>>
    >>>>    http://cr.openjdk.java.net/~weijun/8177969/webrev.01/
    >>>>
    >>>> Changes since webrev.00 [1]
    >>>>
    >>>> 1. Copyright years.
    >>>>
    >>>> 2. Test fix. check() should include Windows drive tests like 
    >>>> contains()
    >>>> does.
    >>>>
    >>>> Thanks
    >>>> Max
    >>>>
    >>>> [1]
    >>>> http://cr.openjdk.java.net/~weijun/8177969/webrev.01/interdiff.patch.html 
    >>>>
    >>>>
    >>>>
    >>>> On 04/05/2017 10:13 PM, Roger Riggs wrote:
    >>>>> Hi Max,
    >>>>>
    >>>>> The code looks ok.
    >>>>>
    >>>>> How much faster does it make FilePermission compares?
    >>>>>
    >>>>> I assume if it is not accepted to be fixed in JDK 9, you will push
    >>>>> it to
    >>>>> JDK 10.
    >>>>>
    >>>>> Roger
    >>>>>
    >>>>>
    >>>>> On 4/3/2017 11:30 AM, Weijun Wang wrote:
    >>>>>> http://cr.openjdk.java.net/~weijun/8177969/webrev.00/
    >>>>>>
    >>>>>> This new implementation of containsPath(Path,Path) uses the logic of
    >>>>>> Path::relativize without directly calling it, which is much faster
    >>>>>> now.
    >>>>>>
    >>>>>> Thanks
    >>>>>> Max
    >>>>>
    
    
    From martinrb at google.com  Mon Apr 10 21:19:23 2017
    From: martinrb at google.com (Martin Buchholz)
    Date: Mon, 10 Apr 2017 14:19:23 -0700
    Subject: RFR: jsr166 jdk10 integration wave 1
    In-Reply-To: 
    References: 
     
     
     
     
    Message-ID: 
    
    Non-thread-pool changes committed while we wait for thread-pool CCC.
    
    From igor.ignatyev at oracle.com  Mon Apr 10 22:42:04 2017
    From: igor.ignatyev at oracle.com (Igor Ignatyev)
    Date: Mon, 10 Apr 2017 15:42:04 -0700
    Subject: RFR(XS) : 8178340: remove unneeded "throws" from
     ProcessTools::createJavaProcessBuilder
    Message-ID: <30D206D1-8044-4205-A687-26AF48784FAC@oracle.com>
    
    http://cr.openjdk.java.net/~iignatyev//8178340/webrev.00/index.html
    > 8 lines changed: 0 ins; 2 del; 6 mod; 
    Hi all,
    
    could you please review this tiny fix which clean up testlibary?
    
    ProcessTools::createJavaProcessBuilder methods can not throw any checked exceptions, but were declared with 'throws Exception', which forced all users of these methods to either have redundant try-catch or throws. the fix cleans up the method declaration in all three copies of testlibary. 
    
    webrev: http://cr.openjdk.java.net/~iignatyev//8178340/webrev.00/index.html
    jbs: https://bugs.openjdk.java.net/browse/JDK-8178340
    testing: hotspot, jdk, langtools and jaxp tests
    
    Thanks,
    -- Igor
    
    
    From amy.lu at oracle.com  Tue Apr 11 02:15:49 2017
    From: amy.lu at oracle.com (Amy Lu)
    Date: Tue, 11 Apr 2017 10:15:49 +0800
    Subject: JDK 9 RFR of JDK-8169971:
     tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java fails
     intermittently
    Message-ID: <2cd4bae2-03d0-a097-1977-45a4228ae77d@oracle.com>
    
    Please review this test-only change.
    
    tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java
    
    This test fails intermittently on Windows platform in the final cleanup 
    step, @AfterClass, in which test tries to delete all dirs and files it 
    created. Though it?s okay to leave this cleanup work to jtreg, I still 
    make it done in test by making test to create everything under 
    ./testoutput (testdir), and delete this testdir directly with 
    FileUtils.deleteFileTreeWithRetry(testdir).
    
    Moreover, in FileUtils, as it tries to delete path with retry, we might 
    want to give it a chance to "retry" in case of DirectoryNotEmptyException.
    
    bug: https://bugs.openjdk.java.net/browse/JDK-8169971
    webrev: http://cr.openjdk.java.net/~amlu/8169971/webrev.00/
    
    Thanks,
    Amy
    
    
    From david.holmes at oracle.com  Tue Apr 11 07:04:38 2017
    From: david.holmes at oracle.com (David Holmes)
    Date: Tue, 11 Apr 2017 17:04:38 +1000
    Subject: RFR(XS) : 8178340: remove unneeded "throws" from
     ProcessTools::createJavaProcessBuilder
    In-Reply-To: <30D206D1-8044-4205-A687-26AF48784FAC@oracle.com>
    References: <30D206D1-8044-4205-A687-26AF48784FAC@oracle.com>
    Message-ID: 
    
    Hi Igor,
    
    This looks fine to me.
    
    I was a little concerned any tests with a try/catch around these calls 
    would fail to compile due to exception checking, but class Exception is 
    exempt from that checking.
    
    Thanks,
    David
    
    On 11/04/2017 8:42 AM, Igor Ignatyev wrote:
    > http://cr.openjdk.java.net/~iignatyev//8178340/webrev.00/index.html
    >> 8 lines changed: 0 ins; 2 del; 6 mod;
    > Hi all,
    >
    > could you please review this tiny fix which clean up testlibary?
    >
    > ProcessTools::createJavaProcessBuilder methods can not throw any checked exceptions, but were declared with 'throws Exception', which forced all users of these methods to either have redundant try-catch or throws. the fix cleans up the method declaration in all three copies of testlibary.
    >
    > webrev: http://cr.openjdk.java.net/~iignatyev//8178340/webrev.00/index.html
    > jbs: https://bugs.openjdk.java.net/browse/JDK-8178340
    > testing: hotspot, jdk, langtools and jaxp tests
    >
    > Thanks,
    > -- Igor
    >
    
    From claes.redestad at oracle.com  Tue Apr 11 08:37:45 2017
    From: claes.redestad at oracle.com (Claes Redestad)
    Date: Tue, 11 Apr 2017 10:37:45 +0200
    Subject: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers
    In-Reply-To: <9B8481A0-3BFF-4F8C-B69C-C293D9D60547@univ-mlv.fr>
    References: 
     <7C080227-8B26-4FF2-844D-530E9EEF30C6@oracle.com>
     <9B8481A0-3BFF-4F8C-B69C-C293D9D60547@univ-mlv.fr>
    Message-ID: 
    
    Sounds like you want https://bugs.openjdk.java.net/browse/JDK-8061402 - 
    which was originally filed back in 2002 but was closed since it got 
    filed on the wrong component or something... ?\_(?)_/?
    
    There's still a number of char[] foo = "FOO".toCharArray() in the JDK 
    since this allows for a more compact representation in bytecode (but is 
    likely a bit slower during startup, especially since compact strings).
    
    /Claes
    
    On 04/10/2017 06:32 PM, Remi Forax wrote:
    > Currently playing with a pattern matching representation for Amber, if 
    > think we need a form of array constant that does not require a 
    > bootstrap method.
    > Afaik, an array of any existing constants does not need a Java code to 
    > construct itself.
    >
    > R?mi
    >
    >
    > On April 10, 2017 6:18:07 PM GMT+02:00, Paul Sandoz 
    >  wrote:
    >
    >     +1
    >
    >     These named functions really wanna be LDC?ed but i suspect using constant dynamic + representation in source (when available) might result in it?s own bootstrap issues, still it would be interesting to try when available.
    >
    >     Paul.
    >
    >         On 10 Apr 2017, at 07:09, Claes Redestad
    >          wrote: Hi, profiling initializers
    >         in java.lang.invoke shows we're still doing various things
    >         during class initialization which could be done lazily or not
    >         at all. The proposed patch reduce bytecode executed, memory
    >         churn and retained heap footprint when initializing
    >         java.lang.invoke: Webrev:
    >         http://cr.openjdk.java.net/~redestad/8178384/jdk.01
    >         / Bug:
    >         https://bugs.openjdk.java.net/browse/JDK-8178384 Testing:
    >         java.lang.invoke jtreg tests, sanity performance testing
    >         Thanks! /Claes 
    >
    >
    >
    >
    > -- 
    > Sent from my Android device with K-9 Mail. Please excuse my brevity. 
    
    
    From claes.redestad at oracle.com  Tue Apr 11 09:06:42 2017
    From: claes.redestad at oracle.com (Claes Redestad)
    Date: Tue, 11 Apr 2017 11:06:42 +0200
    Subject: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers
    In-Reply-To: <6f3d6678-4f14-0987-415d-9e9a68287fbb@oracle.com>
    References: 
     
     <6f3d6678-4f14-0987-415d-9e9a68287fbb@oracle.com>
    Message-ID: 
    
    
    
    On 04/10/2017 05:20 PM, Claes Redestad wrote:
    >
    > On 04/10/2017 05:19 PM, Vladimir Ivanov wrote:
    >> Looks good.
    >
    > Thanks for reviewing!
    >
    >>
    >> One small suggestion [1]
    >
    > Sure, updated in-place.
    
    Taking a second look at these constants, it turned out that a few of 
    them were unused, but since they
    weren't private this wasn't called out in my IDE.  Mind if I clean this 
    up (add private modifier, remove
    unused JLS_SIG, JLC_SIG, BMHSPECIES_DATA_GFC_SIG, VOID_SIG) as part of 
    this patch?
    
    I've verified none of the remaining constants are used anywhere outside 
    the class, i.e., no synthetic
    accessor methods are added by this refactoring.
    
    Thanks!
    
    /Claes
    
    diff -r 524eb921da04 
    src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java
    --- 
    a/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java 
    Tue Apr 11 10:51:05 2017 +0200
    +++ 
    b/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java 
    Tue Apr 11 11:01:22 2017 +0200
    @@ -450,33 +450,29 @@
           */
          static class Factory {
    
    -        static final String JLO_SIG  = "Ljava/lang/Object;";
    -        static final String JLS_SIG  = "Ljava/lang/String;";
    -        static final String JLC_SIG  = "Ljava/lang/Class;";
    -        static final String MH       = "java/lang/invoke/MethodHandle";
    -        static final String MH_SIG   = "L"+MH+";";
    -        static final String BMH      = 
    "java/lang/invoke/BoundMethodHandle";
    -        static final String BMH_NAME = 
    "java.lang.invoke.BoundMethodHandle";
    -        static final String BMH_SIG  = "L"+BMH+";";
    -        static final String SPECIES_DATA     = 
    "java/lang/invoke/BoundMethodHandle$SpeciesData";
    -        static final String SPECIES_DATA_SIG = "L"+SPECIES_DATA+";";
    -        static final String STABLE_SIG       = 
    "Ljdk/internal/vm/annotation/Stable;";
    +        private static final String JLO_SIG  = "Ljava/lang/Object;";
    +        private static final String MH       = 
    "java/lang/invoke/MethodHandle";
    +        private static final String MH_SIG   = "L"+MH+";";
    +        private static final String BMH      = 
    "java/lang/invoke/BoundMethodHandle";
    +        private static final String BMH_NAME = 
    "java.lang.invoke.BoundMethodHandle";
    +        private static final String BMH_SIG  = "L"+BMH+";";
    +        private static final String SPECIES_DATA     = 
    "java/lang/invoke/BoundMethodHandle$SpeciesData";
    +        private static final String SPECIES_DATA_SIG = 
    "L"+SPECIES_DATA+";";
    +        private static final String STABLE_SIG       = 
    "Ljdk/internal/vm/annotation/Stable;";
    
    -        static final String SPECIES_PREFIX_NAME = "Species_";
    -        static final String SPECIES_PREFIX_PATH = BMH + "$" + 
    SPECIES_PREFIX_NAME;
    -        static final String SPECIES_CLASS_PREFIX = BMH_NAME + "$" + 
    SPECIES_PREFIX_NAME;
    +        private static final String SPECIES_PREFIX_NAME = "Species_";
    +        private static final String SPECIES_PREFIX_PATH = BMH + "$" + 
    SPECIES_PREFIX_NAME;
    +        private static final String SPECIES_CLASS_PREFIX = BMH_NAME + 
    "$" + SPECIES_PREFIX_NAME;
    
    -        static final String BMHSPECIES_DATA_EWI_SIG = "(B)" + 
    SPECIES_DATA_SIG;
    -        static final String BMHSPECIES_DATA_GFC_SIG = "(" + JLS_SIG + 
    JLC_SIG + ")" + SPECIES_DATA_SIG;
    -        static final String MYSPECIES_DATA_SIG = "()" + SPECIES_DATA_SIG;
    -        static final String VOID_SIG   = "()V";
    -        static final String INT_SIG    = "()I";
    +        private static final String BMHSPECIES_DATA_EWI_SIG = "(B)" + 
    SPECIES_DATA_SIG;
    +        private static final String MYSPECIES_DATA_SIG = "()" + 
    SPECIES_DATA_SIG;
    +        private static final String INT_SIG    = "()I";
    
    -        static final String SIG_INCIPIT = 
    "(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;";
    +        private static final String SIG_INCIPIT = 
    "(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;";
    
    -        static final String[] E_THROWABLE = new String[] { 
    "java/lang/Throwable" };
    +        private static final String[] E_THROWABLE = new String[] { 
    "java/lang/Throwable" };
    
    -        static final ConcurrentMap> CLASS_CACHE = new ConcurrentHashMap<>();
    +        private static final ConcurrentMap> CLASS_CACHE = new ConcurrentHashMap<>();
    
              /**
               * Get a concrete subclass of BMH for a given combination of 
    bound types.
    
    
    >
    > /Claes
    
    
    From vladimir.x.ivanov at oracle.com  Tue Apr 11 09:16:11 2017
    From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov)
    Date: Tue, 11 Apr 2017 12:16:11 +0300
    Subject: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers
    In-Reply-To: 
    References: 
     
     <6f3d6678-4f14-0987-415d-9e9a68287fbb@oracle.com>
     
    Message-ID: <6dcde0d7-3a16-2ee6-e92b-5e36b0e8bcd0@oracle.com>
    
    Reviewed.
    
    Best regards,
    Vladimir Ivanov
    
    On 4/11/17 12:06 PM, Claes Redestad wrote:
    >
    >
    > On 04/10/2017 05:20 PM, Claes Redestad wrote:
    >>
    >> On 04/10/2017 05:19 PM, Vladimir Ivanov wrote:
    >>> Looks good.
    >>
    >> Thanks for reviewing!
    >>
    >>>
    >>> One small suggestion [1]
    >>
    >> Sure, updated in-place.
    >
    > Taking a second look at these constants, it turned out that a few of
    > them were unused, but since they
    > weren't private this wasn't called out in my IDE.  Mind if I clean this
    > up (add private modifier, remove
    > unused JLS_SIG, JLC_SIG, BMHSPECIES_DATA_GFC_SIG, VOID_SIG) as part of
    > this patch?
    >
    > I've verified none of the remaining constants are used anywhere outside
    > the class, i.e., no synthetic
    > accessor methods are added by this refactoring.
    >
    > Thanks!
    >
    > /Claes
    >
    > diff -r 524eb921da04
    > src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java
    > ---
    > a/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java
    > Tue Apr 11 10:51:05 2017 +0200
    > +++
    > b/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java
    > Tue Apr 11 11:01:22 2017 +0200
    > @@ -450,33 +450,29 @@
    >       */
    >      static class Factory {
    >
    > -        static final String JLO_SIG  = "Ljava/lang/Object;";
    > -        static final String JLS_SIG  = "Ljava/lang/String;";
    > -        static final String JLC_SIG  = "Ljava/lang/Class;";
    > -        static final String MH       = "java/lang/invoke/MethodHandle";
    > -        static final String MH_SIG   = "L"+MH+";";
    > -        static final String BMH      =
    > "java/lang/invoke/BoundMethodHandle";
    > -        static final String BMH_NAME =
    > "java.lang.invoke.BoundMethodHandle";
    > -        static final String BMH_SIG  = "L"+BMH+";";
    > -        static final String SPECIES_DATA     =
    > "java/lang/invoke/BoundMethodHandle$SpeciesData";
    > -        static final String SPECIES_DATA_SIG = "L"+SPECIES_DATA+";";
    > -        static final String STABLE_SIG       =
    > "Ljdk/internal/vm/annotation/Stable;";
    > +        private static final String JLO_SIG  = "Ljava/lang/Object;";
    > +        private static final String MH       =
    > "java/lang/invoke/MethodHandle";
    > +        private static final String MH_SIG   = "L"+MH+";";
    > +        private static final String BMH      =
    > "java/lang/invoke/BoundMethodHandle";
    > +        private static final String BMH_NAME =
    > "java.lang.invoke.BoundMethodHandle";
    > +        private static final String BMH_SIG  = "L"+BMH+";";
    > +        private static final String SPECIES_DATA     =
    > "java/lang/invoke/BoundMethodHandle$SpeciesData";
    > +        private static final String SPECIES_DATA_SIG =
    > "L"+SPECIES_DATA+";";
    > +        private static final String STABLE_SIG       =
    > "Ljdk/internal/vm/annotation/Stable;";
    >
    > -        static final String SPECIES_PREFIX_NAME = "Species_";
    > -        static final String SPECIES_PREFIX_PATH = BMH + "$" +
    > SPECIES_PREFIX_NAME;
    > -        static final String SPECIES_CLASS_PREFIX = BMH_NAME + "$" +
    > SPECIES_PREFIX_NAME;
    > +        private static final String SPECIES_PREFIX_NAME = "Species_";
    > +        private static final String SPECIES_PREFIX_PATH = BMH + "$" +
    > SPECIES_PREFIX_NAME;
    > +        private static final String SPECIES_CLASS_PREFIX = BMH_NAME +
    > "$" + SPECIES_PREFIX_NAME;
    >
    > -        static final String BMHSPECIES_DATA_EWI_SIG = "(B)" +
    > SPECIES_DATA_SIG;
    > -        static final String BMHSPECIES_DATA_GFC_SIG = "(" + JLS_SIG +
    > JLC_SIG + ")" + SPECIES_DATA_SIG;
    > -        static final String MYSPECIES_DATA_SIG = "()" + SPECIES_DATA_SIG;
    > -        static final String VOID_SIG   = "()V";
    > -        static final String INT_SIG    = "()I";
    > +        private static final String BMHSPECIES_DATA_EWI_SIG = "(B)" +
    > SPECIES_DATA_SIG;
    > +        private static final String MYSPECIES_DATA_SIG = "()" +
    > SPECIES_DATA_SIG;
    > +        private static final String INT_SIG    = "()I";
    >
    > -        static final String SIG_INCIPIT =
    > "(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;";
    > +        private static final String SIG_INCIPIT =
    > "(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;";
    >
    > -        static final String[] E_THROWABLE = new String[] {
    > "java/lang/Throwable" };
    > +        private static final String[] E_THROWABLE = new String[] {
    > "java/lang/Throwable" };
    >
    > -        static final ConcurrentMap BoundMethodHandle>> CLASS_CACHE = new ConcurrentHashMap<>();
    > +        private static final ConcurrentMap BoundMethodHandle>> CLASS_CACHE = new ConcurrentHashMap<>();
    >
    >          /**
    >           * Get a concrete subclass of BMH for a given combination of
    > bound types.
    >
    >
    >>
    >> /Claes
    >
    
    From claes.redestad at oracle.com  Tue Apr 11 09:24:42 2017
    From: claes.redestad at oracle.com (Claes Redestad)
    Date: Tue, 11 Apr 2017 11:24:42 +0200
    Subject: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers
    In-Reply-To: <6dcde0d7-3a16-2ee6-e92b-5e36b0e8bcd0@oracle.com>
    References: 
     
     <6f3d6678-4f14-0987-415d-9e9a68287fbb@oracle.com>
     
     <6dcde0d7-3a16-2ee6-e92b-5e36b0e8bcd0@oracle.com>
    Message-ID: <1dbbba09-60db-9ef6-e1d9-42dc3bcf8b92@oracle.com>
    
    Thanks! Pushed.
    
    /Claes
    
    On 04/11/2017 11:16 AM, Vladimir Ivanov wrote:
    > Reviewed.
    >
    > Best regards,
    > Vladimir Ivanov
    
    
    From Roger.Riggs at Oracle.com  Tue Apr 11 15:55:40 2017
    From: Roger.Riggs at Oracle.com (Roger Riggs)
    Date: Tue, 11 Apr 2017 11:55:40 -0400
    Subject: RFR 9: 8178347 Process and ProcessHandle getPid method name
     inconsistency
    Message-ID: 
    
    Please review this change to the name of the ProcessHandle.getPid and 
    Process.getPid methods
    as observed and recommended in email: [1]
    
    The methods are new in JDK 9 and the renaming corrects the method name 
    style to be
    consistent within each class.
    
    The change sets propagate the name change to the openjdk uses of the pid 
    method.
    Libraries using getPid will need to be updated.
    
    Issue:
      https://bugs.openjdk.java.net/browse/JDK-8178347
    
    Webrevs:
    
    http://cr.openjdk.java.net/~rriggs/webrev-pid-8178347
    http://cr.openjdk.java.net/~rriggs/webrev-pid-jaxp-8178347
    http://cr.openjdk.java.net/~rriggs/webrev-pid-jdk-8178347
    http://cr.openjdk.java.net/~rriggs/webrev-pid-hotspot-8178347
    
    Thanks, Roger
    
    [1] 
    http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-April/047103.html
    
    
    
    
    From brian.burkhalter at oracle.com  Tue Apr 11 17:11:55 2017
    From: brian.burkhalter at oracle.com (Brian Burkhalter)
    Date: Tue, 11 Apr 2017 10:11:55 -0700
    Subject: RFR 9: 8178347 Process and ProcessHandle getPid method name
     inconsistency
    In-Reply-To: 
    References: 
    Message-ID: 
    
    Hi Roger,
    
    Looks fine to me, modulo the usual copyright date.
    
    Thanks,
    
    Brian
    
    On Apr 11, 2017, at 8:55 AM, Roger Riggs  wrote:
    
    > Please review this change to the name of the ProcessHandle.getPid and Process.getPid methods
    > as observed and recommended in email: [1]
    > 
    > The methods are new in JDK 9 and the renaming corrects the method name style to be
    > consistent within each class.
    > 
    > The change sets propagate the name change to the openjdk uses of the pid method.
    > Libraries using getPid will need to be updated.
    > 
    > Issue:
    > https://bugs.openjdk.java.net/browse/JDK-8178347
    > 
    > Webrevs:
    > 
    > http://cr.openjdk.java.net/~rriggs/webrev-pid-8178347
    > http://cr.openjdk.java.net/~rriggs/webrev-pid-jaxp-8178347
    > http://cr.openjdk.java.net/~rriggs/webrev-pid-jdk-8178347
    > http://cr.openjdk.java.net/~rriggs/webrev-pid-hotspot-8178347
    > 
    > Thanks, Roger
    > 
    > [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-April/047103.html
    
    From Alan.Bateman at oracle.com  Tue Apr 11 17:12:45 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Tue, 11 Apr 2017 18:12:45 +0100
    Subject: RFR 9: 8178347 Process and ProcessHandle getPid method name
     inconsistency
    In-Reply-To: 
    References: 
    Message-ID: 
    
    
    
    On 11/04/2017 16:55, Roger Riggs wrote:
    > Please review this change to the name of the ProcessHandle.getPid and 
    > Process.getPid methods
    > as observed and recommended in email: [1]
    >
    I looked through the jdk repo and the changes look fine. In passing then 
    I assume the links in Process of the form {@link #getPid() process id} 
    should be @linkplain.
    
    -Alan
    
    From jan.lahoda at oracle.com  Tue Apr 11 17:26:38 2017
    From: jan.lahoda at oracle.com (Jan Lahoda)
    Date: Tue, 11 Apr 2017 19:26:38 +0200
    Subject: RFR 9: JDK-8178012: Finish removal of -Xmodule:
    Message-ID: <58ED11CE.5010608@oracle.com>
    
    Hi,
    
    javac used to have an option, -Xmodule:, that allowed to compile given 
    sources as if they were part of the specified module.
    
    This functionality has been merged into the --patch-module option, but 
    the -Xmodule: option couldn't be fully removed at that time, as some 
    tests and tools (e.g. jtreg) depended on it. The option was however 
    removed from the javac help, etc.
    
    Since jtreg can use --patch-module instead of -Xmodule: now, I'd like to 
    propose further demoting the option to an unsupported -XD-Xmodule: 
    setting (the functionality is not removed completely, as there is a 
    small amount of remaining dependencies). The option may be removed 
    completely eventually when the remaining dependencies are resolved.
    
    The patch spans many repositories besides langtools, as it adjusts 
    TEST.ROOT files, and the 
    /test/lib/jdk/test/lib/InMemoryJavaCompiler.java. The latter 
    is used by hotspot tests, and this change is a small tweak to translate 
    -Xmodule: to --patch-module. This could be later improved by enhancing 
    the test library API to pass the module name explicitly.
    
    Bug:
    https://bugs.openjdk.java.net/browse/JDK-8178012
    
    Webrev:
    http://cr.openjdk.java.net/~jlahoda/8178012/webrev.00/
    
    Any feedback is welcome.
    
    Thanks,
         Jan
    
    From Roger.Riggs at Oracle.com  Tue Apr 11 18:09:18 2017
    From: Roger.Riggs at Oracle.com (Roger Riggs)
    Date: Tue, 11 Apr 2017 14:09:18 -0400
    Subject: RFR 9: 8178347 Process and ProcessHandle getPid method name
     inconsistency
    In-Reply-To: 
    References: 
     
    Message-ID: 
    
    Hi Alan, Brian,
    
    Updated in place with copyrights and corrections to @linkplain in 
    java.lang.Process.
    
    Thanks, Roger
    
    http://cr.openjdk.java.net/~rriggs/webrev-pid-8178347
    http://cr.openjdk.java.net/~rriggs/webrev-pid-jaxp-8178347
    http://cr.openjdk.java.net/~rriggs/webrev-pid-jdk-8178347
    http://cr.openjdk.java.net/~rriggs/webrev-pid-hotspot-8178347
    
    On 4/11/2017 1:12 PM, Alan Bateman wrote:
    >
    >
    > On 11/04/2017 16:55, Roger Riggs wrote:
    >> Please review this change to the name of the ProcessHandle.getPid and 
    >> Process.getPid methods
    >> as observed and recommended in email: [1]
    >>
    > I looked through the jdk repo and the changes look fine. In passing 
    > then I assume the links in Process of the form {@link #getPid() 
    > process id} should be @linkplain.
    >
    > -Alan
    
    
    From forax at univ-mlv.fr  Tue Apr 11 18:20:41 2017
    From: forax at univ-mlv.fr (forax at univ-mlv.fr)
    Date: Tue, 11 Apr 2017 20:20:41 +0200 (CEST)
    Subject: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers
    In-Reply-To: 
    References: 
     <7C080227-8B26-4FF2-844D-530E9EEF30C6@oracle.com>
     <9B8481A0-3BFF-4F8C-B69C-C293D9D60547@univ-mlv.fr>
     
    Message-ID: <195172564.891606.1491934841074.JavaMail.zimbra@u-pem.fr>
    
    Hi Claes,
    yes !
    
    We use something equivalent to "FOO".toCharArray() at several place in ASM because there is no constant pool constant arrays [1].
    
    Terence Parr also mentions that issue at the JVM Summit 2009 [2].
    
    R?mi
    [1] http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/645c0d3e3977/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassWriter.java#l556 
    [2] http://parrt.cs.usfca.edu/doc/impl-parsers-in-java.pdf
    
    
    ----- Mail original -----
    > De: "Claes Redestad" 
    > ?: "Remi Forax" , core-libs-dev at openjdk.java.net, "Paul Sandoz" 
    > Envoy?: Mardi 11 Avril 2017 10:37:45
    > Objet: Re: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers
    
    > Sounds like you want https://bugs.openjdk.java.net/browse/JDK-8061402 -
    > which was originally filed back in 2002 but was closed since it got
    > filed on the wrong component or something... ?\_(?)_/?
    > 
    > There's still a number of char[] foo = "FOO".toCharArray() in the JDK
    > since this allows for a more compact representation in bytecode (but is
    > likely a bit slower during startup, especially since compact strings).
    > 
    > /Claes
    > 
    > On 04/10/2017 06:32 PM, Remi Forax wrote:
    >> Currently playing with a pattern matching representation for Amber, if
    >> think we need a form of array constant that does not require a
    >> bootstrap method.
    >> Afaik, an array of any existing constants does not need a Java code to
    >> construct itself.
    >>
    >> R?mi
    >>
    >>
    >> On April 10, 2017 6:18:07 PM GMT+02:00, Paul Sandoz
    >>  wrote:
    >>
    >>     +1
    >>
    >>     These named functions really wanna be LDC?ed but i suspect using constant
    >>     dynamic + representation in source (when available) might result in it?s own
    >>     bootstrap issues, still it would be interesting to try when available.
    >>
    >>     Paul.
    >>
    >>         On 10 Apr 2017, at 07:09, Claes Redestad
    >>          wrote: Hi, profiling initializers
    >>         in java.lang.invoke shows we're still doing various things
    >>         during class initialization which could be done lazily or not
    >>         at all. The proposed patch reduce bytecode executed, memory
    >>         churn and retained heap footprint when initializing
    >>         java.lang.invoke: Webrev:
    >>         http://cr.openjdk.java.net/~redestad/8178384/jdk.01
    >>         / Bug:
    >>         https://bugs.openjdk.java.net/browse/JDK-8178384 Testing:
    >>         java.lang.invoke jtreg tests, sanity performance testing
    >>         Thanks! /Claes
    >>
    >>
    >>
    >>
    >> --
    > > Sent from my Android device with K-9 Mail. Please excuse my brevity.
    
    From forax at univ-mlv.fr  Tue Apr 11 18:35:05 2017
    From: forax at univ-mlv.fr (Remi Forax)
    Date: Tue, 11 Apr 2017 20:35:05 +0200 (CEST)
    Subject: RFR 9: JDK-8178012: Finish removal of -Xmodule:
    In-Reply-To: <58ED11CE.5010608@oracle.com>
    References: <58ED11CE.5010608@oracle.com>
    Message-ID: <882534875.892667.1491935705947.JavaMail.zimbra@u-pem.fr>
    
    Yes, please hide -Xmodule,
    currently people get confused by -Xmodule vs --patch-module, i had several questions related to that at DevoxxFR.
    
    R?mi
    
    ----- Mail original -----
    > De: "Jan Lahoda" 
    > ?: "compiler-dev" , "Java Core Libs" ,
    > hotspot-dev at openjdk.java.net
    > Envoy?: Mardi 11 Avril 2017 19:26:38
    > Objet: RFR 9: JDK-8178012: Finish removal of -Xmodule:
    
    > Hi,
    > 
    > javac used to have an option, -Xmodule:, that allowed to compile given
    > sources as if they were part of the specified module.
    > 
    > This functionality has been merged into the --patch-module option, but
    > the -Xmodule: option couldn't be fully removed at that time, as some
    > tests and tools (e.g. jtreg) depended on it. The option was however
    > removed from the javac help, etc.
    > 
    > Since jtreg can use --patch-module instead of -Xmodule: now, I'd like to
    > propose further demoting the option to an unsupported -XD-Xmodule:
    > setting (the functionality is not removed completely, as there is a
    > small amount of remaining dependencies). The option may be removed
    > completely eventually when the remaining dependencies are resolved.
    > 
    > The patch spans many repositories besides langtools, as it adjusts
    > TEST.ROOT files, and the
    > /test/lib/jdk/test/lib/InMemoryJavaCompiler.java. The latter
    > is used by hotspot tests, and this change is a small tweak to translate
    > -Xmodule: to --patch-module. This could be later improved by enhancing
    > the test library API to pass the module name explicitly.
    > 
    > Bug:
    > https://bugs.openjdk.java.net/browse/JDK-8178012
    > 
    > Webrev:
    > http://cr.openjdk.java.net/~jlahoda/8178012/webrev.00/
    > 
    > Any feedback is welcome.
    > 
    > Thanks,
    >      Jan
    
    From brian.burkhalter at oracle.com  Tue Apr 11 18:54:42 2017
    From: brian.burkhalter at oracle.com (Brian Burkhalter)
    Date: Tue, 11 Apr 2017 11:54:42 -0700
    Subject: RFR 9: 8178347 Process and ProcessHandle getPid method name
     inconsistency
    In-Reply-To: 
    References: 
     
     
    Message-ID: 
    
    Hi Roger,
    
    OK by me.
    
    Brian
    
    On Apr 11, 2017, at 11:09 AM, Roger Riggs  wrote:
    
    > Updated in place with copyrights and corrections to @linkplain in java.lang.Process.
    
    
    From claes.redestad at oracle.com  Tue Apr 11 19:16:10 2017
    From: claes.redestad at oracle.com (Claes Redestad)
    Date: Tue, 11 Apr 2017 21:16:10 +0200
    Subject: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers
    In-Reply-To: <195172564.891606.1491934841074.JavaMail.zimbra@u-pem.fr>
    References: 
     <7C080227-8B26-4FF2-844D-530E9EEF30C6@oracle.com>
     <9B8481A0-3BFF-4F8C-B69C-C293D9D60547@univ-mlv.fr>
     
     <195172564.891606.1491934841074.JavaMail.zimbra@u-pem.fr>
    Message-ID: <92a2ea5f-a71f-56a7-7e19-8a77b660df17@oracle.com>
    
    Yes, I've seen some of these dirty hacks in the ASM code, as they show 
    up here and there in
    my startup graphs when I add some lambdas to the mix[1]... ;-)
    
    I hadn't considered the 64K bytecode per method limitation, which means 
    you couldn't even
    generate a fraction of that number of elements in an array statically in 
    a single method, so in
    those cases the "FOO".toCharArray() hack makes more sense.
    
    I think constant pool arrays could be a welcome bonus if it can be 
    shaken out of the other
    things we're doing for amber and valhalla...
    
    Thanks!
    
    /Claes
    
    [1] Since Compact Strings the cost of String.charAt-loops and 
    String.toCharArray has jumped
    somewhat during startup, but will of course get compiled away and most 
    often outperform
    after warmup.
    
    On 2017-04-11 20:20, forax at univ-mlv.fr wrote:
    > Hi Claes,
    > yes !
    >
    > We use something equivalent to "FOO".toCharArray() at several place in ASM because there is no constant pool constant arrays [1].
    >
    > Terence Parr also mentions that issue at the JVM Summit 2009 [2].
    >
    > R?mi
    > [1] http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/645c0d3e3977/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassWriter.java#l556
    > [2] http://parrt.cs.usfca.edu/doc/impl-parsers-in-java.pdf
    >
    >
    > ----- Mail original -----
    >> De: "Claes Redestad" 
    >> ?: "Remi Forax" , core-libs-dev at openjdk.java.net, "Paul Sandoz" 
    >> Envoy?: Mardi 11 Avril 2017 10:37:45
    >> Objet: Re: [10] RFR: 8178384: Reduce work in java.lang.invoke initializers
    >> Sounds like you want https://bugs.openjdk.java.net/browse/JDK-8061402 -
    >> which was originally filed back in 2002 but was closed since it got
    >> filed on the wrong component or something... ?\_(?)_/?
    >>
    >> There's still a number of char[] foo = "FOO".toCharArray() in the JDK
    >> since this allows for a more compact representation in bytecode (but is
    >> likely a bit slower during startup, especially since compact strings).
    >>
    >> /Claes
    >>
    >> On 04/10/2017 06:32 PM, Remi Forax wrote:
    >>> Currently playing with a pattern matching representation for Amber, if
    >>> think we need a form of array constant that does not require a
    >>> bootstrap method.
    >>> Afaik, an array of any existing constants does not need a Java code to
    >>> construct itself.
    >>>
    >>> R?mi
    >>>
    >>>
    >>> On April 10, 2017 6:18:07 PM GMT+02:00, Paul Sandoz
    >>>  wrote:
    >>>
    >>>      +1
    >>>
    >>>      These named functions really wanna be LDC?ed but i suspect using constant
    >>>      dynamic + representation in source (when available) might result in it?s own
    >>>      bootstrap issues, still it would be interesting to try when available.
    >>>
    >>>      Paul.
    >>>
    >>>          On 10 Apr 2017, at 07:09, Claes Redestad
    >>>           wrote: Hi, profiling initializers
    >>>          in java.lang.invoke shows we're still doing various things
    >>>          during class initialization which could be done lazily or not
    >>>          at all. The proposed patch reduce bytecode executed, memory
    >>>          churn and retained heap footprint when initializing
    >>>          java.lang.invoke: Webrev:
    >>>          http://cr.openjdk.java.net/~redestad/8178384/jdk.01
    >>>          / Bug:
    >>>          https://bugs.openjdk.java.net/browse/JDK-8178384 Testing:
    >>>          java.lang.invoke jtreg tests, sanity performance testing
    >>>          Thanks! /Claes
    >>>
    >>>
    >>>
    >>>
    >>> --
    >>> Sent from my Android device with K-9 Mail. Please excuse my brevity.
    
    
    From claes.redestad at oracle.com  Tue Apr 11 19:42:36 2017
    From: claes.redestad at oracle.com (Claes Redestad)
    Date: Tue, 11 Apr 2017 21:42:36 +0200
    Subject: RFR: 8178480: Wrong exception being thrown on an invalid MethodType
    Message-ID: <07b31def-03b7-3556-64f9-7fee62430cc3@oracle.com>
    
    Hi,
    
    JDK-8178387 subtly and inadvertently changed what exception was being 
    thrown by LambdaForm.compileToBytecode in
    certain cases - this patch reverts this simplification and adds a 
    comment to warn against future attempts to
    simplify too much..
    
    Bug: https://bugs.openjdk.java.net/browse/JDK-8178480
    
    diff -r 9363dd4a4fb9 
    src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
    --- 
    a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java 
    Tue Apr 11 18:57:46 2017 +0200
    +++ 
    b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java 
    Tue Apr 11 21:35:59 2017 +0200
    @@ -673,9 +673,7 @@
          /**
           * Generate customized bytecode for a given LambdaForm.
           */
    -    static MemberName generateCustomizedCode(LambdaForm form) {
    -        final MethodType invokerType = form.methodType();
    -
    +    static MemberName generateCustomizedCode(LambdaForm form, 
    MethodType invokerType) {
              MemberName pregenerated = lookupPregenerated(form, invokerType);
              if (pregenerated != null)  return pregenerated; // 
    pre-generated bytecode
    
    diff -r 9363dd4a4fb9 
    src/java.base/share/classes/java/lang/invoke/LambdaForm.java
    --- a/src/java.base/share/classes/java/lang/invoke/LambdaForm.java Tue 
    Apr 11 18:57:46 2017 +0200
    +++ b/src/java.base/share/classes/java/lang/invoke/LambdaForm.java Tue 
    Apr 11 21:35:59 2017 +0200
    @@ -847,9 +847,10 @@
              if (vmentry != null && isCompiled) {
                  return;  // already compiled somehow
              }
    -        assert(vmentry == null || 
    vmentry.getMethodType().basicType().equals(methodType()));
    +        MethodType invokerType = methodType(); // forces IAE to happen 
    outside try-catch block
    +        assert(vmentry == null || 
    vmentry.getMethodType().basicType().equals(invokerType));
              try {
    -            vmentry = 
    InvokerBytecodeGenerator.generateCustomizedCode(this);
    +            vmentry = 
    InvokerBytecodeGenerator.generateCustomizedCode(this, invokerType);
                  if (TRACE_INTERPRETER)
                      traceInterpreter("compileToBytecode", this);
                  isCompiled = true;
    
    
    Thanks!
    
    /Claes
    
    From paul.sandoz at oracle.com  Tue Apr 11 19:53:27 2017
    From: paul.sandoz at oracle.com (Paul Sandoz)
    Date: Tue, 11 Apr 2017 12:53:27 -0700
    Subject: [PATCH] 8178117: Add public state constructors for
     Int/Long/DoubleSummaryStatistics
    In-Reply-To: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com>
    References: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com>
    Message-ID: <9E35282E-793B-411A-9A21-0B5762B68A28@oracle.com>
    
    Hi Chris,
    
    Thanks for looking at this.
    
    There is some rudimentary testing using streams in CollectAndSummaryStatisticsTest.java.
    
    I think we should enforce constraints where we reliably can:
    
    1) count >= 0
    
    2) count = 0, then min/max/sum are ignored and it?s as if the default constructor was called. (I thought it might be appropriate to reject since a caller might be passing in incorrect information in error, but the defaults for min/max are important and would be a burden for the caller to pass those values.) In this respect having count as the first parameter of the constructor would be useful.
    
    3)  min <= max
    
    Since for count > 0 the constraints, count * max >= sum, count * min <= sum, cannot be reliably enforced due to overflow i am inclined to not bother and just document.
    
    
    Note this is gonna be blocked from pushing until the new Compatibility and Specification Review (CSR) process is opened up, which i understand is ?soon"ish :-) but that should not block adding some further tests in the interim and tidying up the javadoc.
    
    Paul.
    
    
    > On 6 Apr 2017, at 07:08, Chris Dennis  wrote:
    > 
    > Hi Paul (et al)
    > 
    > Like all things API there are wrinkles here when it comes to implementing.
    > 
    > This patch isn?t final, there appears to be no existing test coverage for these classes beyond testing the compensating summation used in the double implementation, and I left off adding any until it was decided how much parameter validation we want (since that?s the only testing that can really occur here).
    > 
    > The wrinkles relate to the issues around instances that have suffered overflow in count and/or sum which the existing implementation doesn?t defend against:
    > 
    > * I chose to ignore all parameters if 'count == 0? and just leave the instance empty. I held off from validating min, max and count however. This obviously 'breaks things? (beyond how broken they would already be) if count == 0 only due to overflow.
    > * I chose to fail if count is negative.
    > * I chose to enforce that max and min are logically consistent with count and sum, this can break the moment either one of the overflows as well (I?m also pretty sure that the FPU logic is going to suffer here too - there might be some magic I can do with a pessimistic bit of rounding on the FPU multiplication result).
    > 
    > I intentionally went with the most aggressive parameter validation here to establish one end of what could be implemented.  There are arguments for this and also arguments for the other extreme (no validation at all).  Personally I?m in favor of the current version where the creation will fail if the inputs are only possible through overflow (modulo fixing the FPU precision issues above) even though it?s at odds with approach of the existing implementation.
    > 
    > Would appreciate thoughts/feedback.  Thanks.
    > 
    > Chris
    > 
    > 
    > P.S. I presume tests would be required for the parameter checking (once it is finalized)?
    > 
    > <8178117.patch>
    
    
    From Alan.Bateman at oracle.com  Tue Apr 11 19:55:28 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Tue, 11 Apr 2017 20:55:28 +0100
    Subject: RFR 9: 8178347 Process and ProcessHandle getPid method name
     inconsistency
    In-Reply-To: 
    References: 
     
     
    Message-ID: <01ff612c-4ec1-9300-c452-adef4fd6eecd@oracle.com>
    
    On 11/04/2017 19:09, Roger Riggs wrote:
    
    > Hi Alan, Brian,
    >
    > Updated in place with copyrights and corrections to @linkplain in 
    > java.lang.Process.
    >
    > Thanks, Roger
    >
    > http://cr.openjdk.java.net/~rriggs/webrev-pid-8178347
    > http://cr.openjdk.java.net/~rriggs/webrev-pid-jaxp-8178347
    > http://cr.openjdk.java.net/~rriggs/webrev-pid-jdk-8178347
    > http://cr.openjdk.java.net/~rriggs/webrev-pid-hotspot-8178347
    >
    Looks good.
    
    -Alan
    
    From paul.sandoz at oracle.com  Tue Apr 11 20:15:59 2017
    From: paul.sandoz at oracle.com (Paul Sandoz)
    Date: Tue, 11 Apr 2017 13:15:59 -0700
    Subject: RFR: 8178480: Wrong exception being thrown on an invalid
     MethodType
    In-Reply-To: <07b31def-03b7-3556-64f9-7fee62430cc3@oracle.com>
    References: <07b31def-03b7-3556-64f9-7fee62430cc3@oracle.com>
    Message-ID: <4A7FA43C-F891-45B1-A936-9AE259A2E50F@oracle.com>
    
    Tricky!
    
    Would you mind making the comment a little more descriptive? e.g.
    
    // Obtain the invoker MethodType outside of the following try block.
    // This ensures that an IllegalArgumentException is directly thrown if the
    // type would have 256 or more parameters
    
    (IAE can be confused with Access or Argument)
    
    Paul.
    
    > On 11 Apr 2017, at 12:42, Claes Redestad  wrote:
    > 
    > Hi,
    > 
    > JDK-8178387 subtly and inadvertently changed what exception was being thrown by LambdaForm.compileToBytecode in
    > certain cases - this patch reverts this simplification and adds a comment to warn against future attempts to
    > simplify too much..
    > 
    > Bug: https://bugs.openjdk.java.net/browse/JDK-8178480
    > 
    > diff -r 9363dd4a4fb9 src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
    > --- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Tue Apr 11 18:57:46 2017 +0200
    > +++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Tue Apr 11 21:35:59 2017 +0200
    > @@ -673,9 +673,7 @@
    >     /**
    >      * Generate customized bytecode for a given LambdaForm.
    >      */
    > -    static MemberName generateCustomizedCode(LambdaForm form) {
    > -        final MethodType invokerType = form.methodType();
    > -
    > +    static MemberName generateCustomizedCode(LambdaForm form, MethodType invokerType) {
    >         MemberName pregenerated = lookupPregenerated(form, invokerType);
    >         if (pregenerated != null)  return pregenerated; // pre-generated bytecode
    > 
    > diff -r 9363dd4a4fb9 src/java.base/share/classes/java/lang/invoke/LambdaForm.java
    > --- a/src/java.base/share/classes/java/lang/invoke/LambdaForm.java Tue Apr 11 18:57:46 2017 +0200
    > +++ b/src/java.base/share/classes/java/lang/invoke/LambdaForm.java Tue Apr 11 21:35:59 2017 +0200
    > @@ -847,9 +847,10 @@
    >         if (vmentry != null && isCompiled) {
    >             return;  // already compiled somehow
    >         }
    > -        assert(vmentry == null || vmentry.getMethodType().basicType().equals(methodType()));
    > +        MethodType invokerType = methodType(); // forces IAE to happen outside try-catch block
    > +        assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType));
    >         try {
    > -            vmentry = InvokerBytecodeGenerator.generateCustomizedCode(this);
    > +            vmentry = InvokerBytecodeGenerator.generateCustomizedCode(this, invokerType);
    >             if (TRACE_INTERPRETER)
    >                 traceInterpreter("compileToBytecode", this);
    >             isCompiled = true;
    > 
    > 
    > Thanks!
    > 
    > /Claes
    
    
    From joe.darcy at oracle.com  Tue Apr 11 20:16:50 2017
    From: joe.darcy at oracle.com (joe darcy)
    Date: Tue, 11 Apr 2017 13:16:50 -0700
    Subject: [PATCH] 8178117: Add public state constructors for
     Int/Long/DoubleSummaryStatistics
    In-Reply-To: <9E35282E-793B-411A-9A21-0B5762B68A28@oracle.com>
    References: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com>
     <9E35282E-793B-411A-9A21-0B5762B68A28@oracle.com>
    Message-ID: <961938eb-8bde-a88c-ea05-de940c954ddd@oracle.com>
    
    On an API design note, I would prefer to DoubleSummaryStatistics took a 
    double... argument to pass in the state of the summation. This 
    flexibility is necessary to more fully preserve the computed sum. Also, 
    the we want flexibility to change the amount of internal state 
    DoubleSummaryStats keeps so we don't want to hard-code that into as 
    aspect of the API.
    
    Thanks,
    
    -Joe
    
    
    On 4/11/2017 12:53 PM, Paul Sandoz wrote:
    > Hi Chris,
    >
    > Thanks for looking at this.
    >
    > There is some rudimentary testing using streams in CollectAndSummaryStatisticsTest.java.
    >
    > I think we should enforce constraints where we reliably can:
    >
    > 1) count >= 0
    >
    > 2) count = 0, then min/max/sum are ignored and it?s as if the default constructor was called. (I thought it might be appropriate to reject since a caller might be passing in incorrect information in error, but the defaults for min/max are important and would be a burden for the caller to pass those values.) In this respect having count as the first parameter of the constructor would be useful.
    >
    > 3)  min <= max
    >
    > Since for count > 0 the constraints, count * max >= sum, count * min <= sum, cannot be reliably enforced due to overflow i am inclined to not bother and just document.
    >
    >
    > Note this is gonna be blocked from pushing until the new Compatibility and Specification Review (CSR) process is opened up, which i understand is ?soon"ish :-) but that should not block adding some further tests in the interim and tidying up the javadoc.
    >
    > Paul.
    >
    >
    >> On 6 Apr 2017, at 07:08, Chris Dennis  wrote:
    >>
    >> Hi Paul (et al)
    >>
    >> Like all things API there are wrinkles here when it comes to implementing.
    >>
    >> This patch isn?t final, there appears to be no existing test coverage for these classes beyond testing the compensating summation used in the double implementation, and I left off adding any until it was decided how much parameter validation we want (since that?s the only testing that can really occur here).
    >>
    >> The wrinkles relate to the issues around instances that have suffered overflow in count and/or sum which the existing implementation doesn?t defend against:
    >>
    >> * I chose to ignore all parameters if 'count == 0? and just leave the instance empty. I held off from validating min, max and count however. This obviously 'breaks things? (beyond how broken they would already be) if count == 0 only due to overflow.
    >> * I chose to fail if count is negative.
    >> * I chose to enforce that max and min are logically consistent with count and sum, this can break the moment either one of the overflows as well (I?m also pretty sure that the FPU logic is going to suffer here too - there might be some magic I can do with a pessimistic bit of rounding on the FPU multiplication result).
    >>
    >> I intentionally went with the most aggressive parameter validation here to establish one end of what could be implemented.  There are arguments for this and also arguments for the other extreme (no validation at all).  Personally I?m in favor of the current version where the creation will fail if the inputs are only possible through overflow (modulo fixing the FPU precision issues above) even though it?s at odds with approach of the existing implementation.
    >>
    >> Would appreciate thoughts/feedback.  Thanks.
    >>
    >> Chris
    >>
    >>
    >> P.S. I presume tests would be required for the parameter checking (once it is finalized)?
    >>
    >> <8178117.patch>
    
    
    From igor.ignatyev at oracle.com  Tue Apr 11 20:33:07 2017
    From: igor.ignatyev at oracle.com (Igor Ignatyev)
    Date: Tue, 11 Apr 2017 13:33:07 -0700
    Subject: RFR(XS) : 8178340: remove unneeded "throws" from
     ProcessTools::createJavaProcessBuilder
    In-Reply-To: 
    References: <30D206D1-8044-4205-A687-26AF48784FAC@oracle.com>
     
    Message-ID: <0F943181-F9CD-471E-8883-837E822CBBD2@oracle.com>
    
    Hi David,
    
    thanks for review.
    
    -- Igor
    
    > On Apr 11, 2017, at 12:04 AM, David Holmes  wrote:
    > 
    > Hi Igor,
    > 
    > This looks fine to me.
    > 
    > I was a little concerned any tests with a try/catch around these calls would fail to compile due to exception checking, but class Exception is exempt from that checking.
    > 
    > Thanks,
    > David
    > 
    > On 11/04/2017 8:42 AM, Igor Ignatyev wrote:
    >> http://cr.openjdk.java.net/~iignatyev//8178340/webrev.00/index.html
    >>> 8 lines changed: 0 ins; 2 del; 6 mod;
    >> Hi all,
    >> 
    >> could you please review this tiny fix which clean up testlibary?
    >> 
    >> ProcessTools::createJavaProcessBuilder methods can not throw any checked exceptions, but were declared with 'throws Exception', which forced all users of these methods to either have redundant try-catch or throws. the fix cleans up the method declaration in all three copies of testlibary.
    >> 
    >> webrev: http://cr.openjdk.java.net/~iignatyev//8178340/webrev.00/index.html
    >> jbs: https://bugs.openjdk.java.net/browse/JDK-8178340
    >> testing: hotspot, jdk, langtools and jaxp tests
    >> 
    >> Thanks,
    >> -- Igor
    >> 
    
    
    From claes.redestad at oracle.com  Tue Apr 11 20:35:40 2017
    From: claes.redestad at oracle.com (Claes Redestad)
    Date: Tue, 11 Apr 2017 22:35:40 +0200
    Subject: RFR: 8178480: Wrong exception being thrown on an invalid
     MethodType
    In-Reply-To: <4A7FA43C-F891-45B1-A936-9AE259A2E50F@oracle.com>
    References: <07b31def-03b7-3556-64f9-7fee62430cc3@oracle.com>
     <4A7FA43C-F891-45B1-A936-9AE259A2E50F@oracle.com>
    Message-ID: 
    
    On 2017-04-11 22:15, Paul Sandoz wrote
    > Would you mind making the comment a little more descriptive? e.g.
    >
    > // Obtain the invoker MethodType outside of the following try block.
    > // This ensures that an IllegalArgumentException is directly thrown if the
    > // type would have 256 or more parameters
    
    Sure, I'll use that. Thanks for the quick review!
    
    /Claes
    
    
    From chris.w.dennis at gmail.com  Tue Apr 11 20:48:03 2017
    From: chris.w.dennis at gmail.com (Chris Dennis)
    Date: Tue, 11 Apr 2017 16:48:03 -0400
    Subject: [PATCH] 8178117: Add public state constructors for
     Int/Long/DoubleSummaryStatistics
    In-Reply-To: <961938eb-8bde-a88c-ea05-de940c954ddd@oracle.com>
    References: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com>
     <9E35282E-793B-411A-9A21-0B5762B68A28@oracle.com>
     <961938eb-8bde-a88c-ea05-de940c954ddd@oracle.com>
    Message-ID: 
    
    Color me confused? what would the javadoc on the parameter say? It could I guess have an @implNote documenting the meanings of the parameters? but then what use is it? The proposed API simply limits the precision with which a DoubleSummaryStatistic can be copied to be the same as the precision with which it can be ?accessed?.  That doesn?t seem an enormous problem since I suspect that bulk of usages would be to marshall a ?finished? instance and therefore there is no real loss occuring. If we wanted to support arbitrary precision wouldn?t it be better to have a constructor variant that took a BigDecimal, and a matching getPreciseSum() that returned a BigDecimal?
    
    Chris
    
    > On Apr 11, 2017, at 4:16 PM, joe darcy  wrote:
    > 
    > On an API design note, I would prefer to DoubleSummaryStatistics took a double... argument to pass in the state of the summation. This flexibility is necessary to more fully preserve the computed sum. Also, the we want flexibility to change the amount of internal state DoubleSummaryStats keeps so we don't want to hard-code that into as aspect of the API.
    > 
    > Thanks,
    > 
    > -Joe
    > 
    > 
    > On 4/11/2017 12:53 PM, Paul Sandoz wrote:
    >> Hi Chris,
    >> 
    >> Thanks for looking at this.
    >> 
    >> There is some rudimentary testing using streams in CollectAndSummaryStatisticsTest.java.
    >> 
    >> I think we should enforce constraints where we reliably can:
    >> 
    >> 1) count >= 0
    >> 
    >> 2) count = 0, then min/max/sum are ignored and it?s as if the default constructor was called. (I thought it might be appropriate to reject since a caller might be passing in incorrect information in error, but the defaults for min/max are important and would be a burden for the caller to pass those values.) In this respect having count as the first parameter of the constructor would be useful.
    >> 
    >> 3)  min <= max
    >> 
    >> Since for count > 0 the constraints, count * max >= sum, count * min <= sum, cannot be reliably enforced due to overflow i am inclined to not bother and just document.
    >> 
    >> 
    >> Note this is gonna be blocked from pushing until the new Compatibility and Specification Review (CSR) process is opened up, which i understand is ?soon"ish :-) but that should not block adding some further tests in the interim and tidying up the javadoc.
    >> 
    >> Paul.
    >> 
    >> 
    >>> On 6 Apr 2017, at 07:08, Chris Dennis  wrote:
    >>> 
    >>> Hi Paul (et al)
    >>> 
    >>> Like all things API there are wrinkles here when it comes to implementing.
    >>> 
    >>> This patch isn?t final, there appears to be no existing test coverage for these classes beyond testing the compensating summation used in the double implementation, and I left off adding any until it was decided how much parameter validation we want (since that?s the only testing that can really occur here).
    >>> 
    >>> The wrinkles relate to the issues around instances that have suffered overflow in count and/or sum which the existing implementation doesn?t defend against:
    >>> 
    >>> * I chose to ignore all parameters if 'count == 0? and just leave the instance empty. I held off from validating min, max and count however. This obviously 'breaks things? (beyond how broken they would already be) if count == 0 only due to overflow.
    >>> * I chose to fail if count is negative.
    >>> * I chose to enforce that max and min are logically consistent with count and sum, this can break the moment either one of the overflows as well (I?m also pretty sure that the FPU logic is going to suffer here too - there might be some magic I can do with a pessimistic bit of rounding on the FPU multiplication result).
    >>> 
    >>> I intentionally went with the most aggressive parameter validation here to establish one end of what could be implemented.  There are arguments for this and also arguments for the other extreme (no validation at all).  Personally I?m in favor of the current version where the creation will fail if the inputs are only possible through overflow (modulo fixing the FPU precision issues above) even though it?s at odds with approach of the existing implementation.
    >>> 
    >>> Would appreciate thoughts/feedback.  Thanks.
    >>> 
    >>> Chris
    >>> 
    >>> 
    >>> P.S. I presume tests would be required for the parameter checking (once it is finalized)?
    >>> 
    >>> <8178117.patch>
    > 
    
    
    From chris.w.dennis at gmail.com  Wed Apr 12 00:44:20 2017
    From: chris.w.dennis at gmail.com (Chris Dennis)
    Date: Tue, 11 Apr 2017 20:44:20 -0400
    Subject: [PATCH] 8178117: Add public state constructors for
     Int/Long/DoubleSummaryStatistics
    In-Reply-To: 
    References: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com>
     <9E35282E-793B-411A-9A21-0B5762B68A28@oracle.com>
     <961938eb-8bde-a88c-ea05-de940c954ddd@oracle.com>
     
    Message-ID: 
    
    Updated patch with the changed parameter validation, updated javadoc and added test coverage.
    
    -------------- next part --------------
    An embedded and charset-unspecified text was scrubbed...
    Name: 8178117.2.patch.txt
    URL: 
    -------------- next part --------------
    
    
    > On Apr 11, 2017, at 4:48 PM, Chris Dennis  wrote:
    > 
    > Color me confused? what would the javadoc on the parameter say? It could I guess have an @implNote documenting the meanings of the parameters? but then what use is it? The proposed API simply limits the precision with which a DoubleSummaryStatistic can be copied to be the same as the precision with which it can be ?accessed?.  That doesn?t seem an enormous problem since I suspect that bulk of usages would be to marshall a ?finished? instance and therefore there is no real loss occuring. If we wanted to support arbitrary precision wouldn?t it be better to have a constructor variant that took a BigDecimal, and a matching getPreciseSum() that returned a BigDecimal?
    > 
    > Chris
    > 
    >> On Apr 11, 2017, at 4:16 PM, joe darcy  wrote:
    >> 
    >> On an API design note, I would prefer to DoubleSummaryStatistics took a double... argument to pass in the state of the summation. This flexibility is necessary to more fully preserve the computed sum. Also, the we want flexibility to change the amount of internal state DoubleSummaryStats keeps so we don't want to hard-code that into as aspect of the API.
    >> 
    >> Thanks,
    >> 
    >> -Joe
    >> 
    >> 
    >> On 4/11/2017 12:53 PM, Paul Sandoz wrote:
    >>> Hi Chris,
    >>> 
    >>> Thanks for looking at this.
    >>> 
    >>> There is some rudimentary testing using streams in CollectAndSummaryStatisticsTest.java.
    >>> 
    >>> I think we should enforce constraints where we reliably can:
    >>> 
    >>> 1) count >= 0
    >>> 
    >>> 2) count = 0, then min/max/sum are ignored and it?s as if the default constructor was called. (I thought it might be appropriate to reject since a caller might be passing in incorrect information in error, but the defaults for min/max are important and would be a burden for the caller to pass those values.) In this respect having count as the first parameter of the constructor would be useful.
    >>> 
    >>> 3)  min <= max
    >>> 
    >>> Since for count > 0 the constraints, count * max >= sum, count * min <= sum, cannot be reliably enforced due to overflow i am inclined to not bother and just document.
    >>> 
    >>> 
    >>> Note this is gonna be blocked from pushing until the new Compatibility and Specification Review (CSR) process is opened up, which i understand is ?soon"ish :-) but that should not block adding some further tests in the interim and tidying up the javadoc.
    >>> 
    >>> Paul.
    >>> 
    >>> 
    >>>> On 6 Apr 2017, at 07:08, Chris Dennis  wrote:
    >>>> 
    >>>> Hi Paul (et al)
    >>>> 
    >>>> Like all things API there are wrinkles here when it comes to implementing.
    >>>> 
    >>>> This patch isn?t final, there appears to be no existing test coverage for these classes beyond testing the compensating summation used in the double implementation, and I left off adding any until it was decided how much parameter validation we want (since that?s the only testing that can really occur here).
    >>>> 
    >>>> The wrinkles relate to the issues around instances that have suffered overflow in count and/or sum which the existing implementation doesn?t defend against:
    >>>> 
    >>>> * I chose to ignore all parameters if 'count == 0? and just leave the instance empty. I held off from validating min, max and count however. This obviously 'breaks things? (beyond how broken they would already be) if count == 0 only due to overflow.
    >>>> * I chose to fail if count is negative.
    >>>> * I chose to enforce that max and min are logically consistent with count and sum, this can break the moment either one of the overflows as well (I?m also pretty sure that the FPU logic is going to suffer here too - there might be some magic I can do with a pessimistic bit of rounding on the FPU multiplication result).
    >>>> 
    >>>> I intentionally went with the most aggressive parameter validation here to establish one end of what could be implemented.  There are arguments for this and also arguments for the other extreme (no validation at all).  Personally I?m in favor of the current version where the creation will fail if the inputs are only possible through overflow (modulo fixing the FPU precision issues above) even though it?s at odds with approach of the existing implementation.
    >>>> 
    >>>> Would appreciate thoughts/feedback.  Thanks.
    >>>> 
    >>>> Chris
    >>>> 
    >>>> 
    >>>> P.S. I presume tests would be required for the parameter checking (once it is finalized)?
    >>>> 
    >>>> <8178117.patch>
    >> 
    > 
    
    
    From igor.ignatyev at oracle.com  Wed Apr 12 02:29:01 2017
    From: igor.ignatyev at oracle.com (Igor Ignatyev)
    Date: Tue, 11 Apr 2017 19:29:01 -0700
    Subject: RFR(S) : 8178415: remove ProcessTools::getPlatformSpecificVMArgs from
     testlibary
    Message-ID: <74A681EB-977E-4EA7-B028-36C6C238E20A@oracle.com>
    
    http://cr.openjdk.java.net/~iignatyev/8178415/webrev.00/
    > 59 lines changed: 0 ins; 59 del; 0 mod;
    
    Hi all,
    
    could you please review this small clean up of testlibaries?
    the only platform specific vm arguments which we had were -d64/32. they were deprecated in jdk9 by 8168010 and will be removed in jdk10 by 8169646. therefore ProcessTools::getPlatformSpecificVMArgs method is not needed anymore and should be removed.
    
    JBS: https://bugs.openjdk.java.net/browse/JDK-8178415
    webrev: http://cr.openjdk.java.net/~iignatyev/8178415/webrev.00/
    testing: :jdk_tier{1-3}, :hotspot_all
    8168010: https://bugs.openjdk.java.net/browse/JDK-8168010
    8169646: https://bugs.openjdk.java.net/browse/JDK-8169646
    
    Thanks,
    -- Igor
    
    From david.holmes at oracle.com  Wed Apr 12 02:47:31 2017
    From: david.holmes at oracle.com (David Holmes)
    Date: Wed, 12 Apr 2017 12:47:31 +1000
    Subject: RFR(S) : 8178415: remove ProcessTools::getPlatformSpecificVMArgs
     from testlibary
    In-Reply-To: <74A681EB-977E-4EA7-B028-36C6C238E20A@oracle.com>
    References: <74A681EB-977E-4EA7-B028-36C6C238E20A@oracle.com>
    Message-ID: 
    
    Hi Igor,
    
    On 12/04/2017 12:29 PM, Igor Ignatyev wrote:
    > http://cr.openjdk.java.net/~iignatyev/8178415/webrev.00/
    >> 59 lines changed: 0 ins; 59 del; 0 mod;
    >
    > Hi all,
    >
    > could you please review this small clean up of testlibaries?
    > the only platform specific vm arguments which we had were -d64/32. they were deprecated in jdk9 by 8168010 and will be removed in jdk10 by 8169646. therefore ProcessTools::getPlatformSpecificVMArgs method is not needed anymore and should be removed.
    >
    > JBS: https://bugs.openjdk.java.net/browse/JDK-8178415
    > webrev: http://cr.openjdk.java.net/~iignatyev/8178415/webrev.00/
    > testing: :jdk_tier{1-3}, :hotspot_all
    > 8168010: https://bugs.openjdk.java.net/browse/JDK-8168010
    > 8169646: https://bugs.openjdk.java.net/browse/JDK-8169646
    
    These changes look good to me.
    
    Thanks,
    David
    
    > Thanks,
    > -- Igor
    >
    
    From igor.ignatyev at oracle.com  Wed Apr 12 02:48:16 2017
    From: igor.ignatyev at oracle.com (Igor Ignatyev)
    Date: Tue, 11 Apr 2017 19:48:16 -0700
    Subject: RFR(S) : 8178415: remove ProcessTools::getPlatformSpecificVMArgs
     from testlibary
    In-Reply-To: 
    References: <74A681EB-977E-4EA7-B028-36C6C238E20A@oracle.com>
     
    Message-ID: <91BF0B5F-7BD2-4928-AFA9-8C0CB8D81D56@oracle.com>
    
    Hi David,
    
    thank you for such a prompt review!
    
    -- Igor
    > On Apr 11, 2017, at 7:47 PM, David Holmes  wrote:
    > 
    > Hi Igor,
    > 
    > On 12/04/2017 12:29 PM, Igor Ignatyev wrote:
    >> http://cr.openjdk.java.net/~iignatyev/8178415/webrev.00/
    >>> 59 lines changed: 0 ins; 59 del; 0 mod;
    >> 
    >> Hi all,
    >> 
    >> could you please review this small clean up of testlibaries?
    >> the only platform specific vm arguments which we had were -d64/32. they were deprecated in jdk9 by 8168010 and will be removed in jdk10 by 8169646. therefore ProcessTools::getPlatformSpecificVMArgs method is not needed anymore and should be removed.
    >> 
    >> JBS: https://bugs.openjdk.java.net/browse/JDK-8178415
    >> webrev: http://cr.openjdk.java.net/~iignatyev/8178415/webrev.00/
    >> testing: :jdk_tier{1-3}, :hotspot_all
    >> 8168010: https://bugs.openjdk.java.net/browse/JDK-8168010
    >> 8169646: https://bugs.openjdk.java.net/browse/JDK-8169646
    > 
    > These changes look good to me.
    > 
    > Thanks,
    > David
    > 
    >> Thanks,
    >> -- Igor
    >> 
    
    
    From dmitry.fazunenko at oracle.com  Wed Apr 12 07:59:35 2017
    From: dmitry.fazunenko at oracle.com (Dmitry Fazunenko)
    Date: Wed, 12 Apr 2017 10:59:35 +0300
    Subject: RFR(S) : 8178415: remove ProcessTools::getPlatformSpecificVMArgs
     from testlibary
    In-Reply-To: <74A681EB-977E-4EA7-B028-36C6C238E20A@oracle.com>
    References: <74A681EB-977E-4EA7-B028-36C6C238E20A@oracle.com>
    Message-ID: <3f0d3013-f86e-893f-f3a0-2773006dd265@oracle.com>
    
    Hi Igor,
    
    The fix looks, thanks for doing it.
    Please update the copyrights before integration :)
    
    Thanks,
    Dima
    
    On 12.04.2017 5:29, Igor Ignatyev wrote:
    > http://cr.openjdk.java.net/~iignatyev/8178415/webrev.00/
    >> 59 lines changed: 0 ins; 59 del; 0 mod;
    > Hi all,
    >
    > could you please review this small clean up of testlibaries?
    > the only platform specific vm arguments which we had were -d64/32. they were deprecated in jdk9 by 8168010 and will be removed in jdk10 by 8169646. therefore ProcessTools::getPlatformSpecificVMArgs method is not needed anymore and should be removed.
    >
    > JBS: https://bugs.openjdk.java.net/browse/JDK-8178415
    > webrev: http://cr.openjdk.java.net/~iignatyev/8178415/webrev.00/
    > testing: :jdk_tier{1-3}, :hotspot_all
    > 8168010: https://bugs.openjdk.java.net/browse/JDK-8168010
    > 8169646: https://bugs.openjdk.java.net/browse/JDK-8169646
    >
    > Thanks,
    > -- Igor
    
    
    From peter.levart at gmail.com  Wed Apr 12 14:41:29 2017
    From: peter.levart at gmail.com (Peter Levart)
    Date: Wed, 12 Apr 2017 16:41:29 +0200
    Subject: [PATCH] 8178117: Add public state constructors for
     Int/Long/DoubleSummaryStatistics
    In-Reply-To: 
    References: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com>
     <9E35282E-793B-411A-9A21-0B5762B68A28@oracle.com>
     <961938eb-8bde-a88c-ea05-de940c954ddd@oracle.com>
     
    Message-ID: 
    
    Hi Dennis,
    
    On 04/11/2017 10:48 PM, Chris Dennis wrote:
    > Color me confused? what would the javadoc on the parameter say? It could I guess have an @implNote documenting the meanings of the parameters? but then what use is it? The proposed API simply limits the precision with which a DoubleSummaryStatistic can be copied to be the same as the precision with which it can be ?accessed?.  That doesn?t seem an enormous problem since I suspect that bulk of usages would be to marshall a ?finished? instance and therefore there is no real loss occuring. If we wanted to support arbitrary precision wouldn?t it be better to have a constructor variant that took a BigDecimal, and a matching getPreciseSum() that returned a BigDecimal?
    
    And how would you compute the value for BigDecimal getPreciseSum() so 
    that you could then set 3 internal double fields from BigDecimal without 
    loss of information?
    
    I can imagine a "distributed" implementation of Stream that must 
    transport partial results across VM boundaries and then combine them. It 
    would be bad if the results of such summation differed from default 
    local Stream implementation. If we don't want to make 
    XxxSummaryStatistics objects Serializable themselves, then perhaps we 
    need some other API to support transporting the state over the wire with 
    evolvability in mind. What about something like the following:
    
         public DoubleSummaryStatistics(DataInput dataInput) throws 
    IOException {
             int version = dataInput.readByte();
             if (version == 1) {
                 long count = dataInput.readLong();
                 double sum = dataInput.readDouble();
                 double sumCompensation = dataInput.readDouble();
                 double simpleSum = dataInput.readDouble();
                 double min = dataInput.readDouble();
                 double max = dataInput.readDouble();
                 // validation of arguments ...
    
                 // ... assignment to fields
                 this.count = count;
                 this.sum = sum;
                 this.sumCompensation = sumCompensation;
                 this.simpleSum = simpleSum;
                 this.min = min;
                 this.max = max;
             } else {
                 throw new IllegalArgumentException(
                     "Invalid version in DataInput stream: " + version);
             }
         }
    
         public void writeTo(DataOutput dataOutput) throws IOException {
             dataOutput.writeByte(1);
             dataOutput.writeLong(count);
             dataOutput.writeDouble(sum);
             dataOutput.writeDouble(sumCompensation);
             dataOutput.writeDouble(simpleSum);
             dataOutput.writeDouble(min);
             dataOutput.writeDouble(max);
         }
    
    
    Both members could be made protected so that a Serializable subclass 
    could be devised and they would not show up as public API.
    
    Regards, Peter
    
    
    >
    > Chris
    >
    >> On Apr 11, 2017, at 4:16 PM, joe darcy  wrote:
    >>
    >> On an API design note, I would prefer to DoubleSummaryStatistics took a double... argument to pass in the state of the summation. This flexibility is necessary to more fully preserve the computed sum. Also, the we want flexibility to change the amount of internal state DoubleSummaryStats keeps so we don't want to hard-code that into as aspect of the API.
    >>
    >> Thanks,
    >>
    >> -Joe
    >>
    >>
    >> On 4/11/2017 12:53 PM, Paul Sandoz wrote:
    >>> Hi Chris,
    >>>
    >>> Thanks for looking at this.
    >>>
    >>> There is some rudimentary testing using streams in CollectAndSummaryStatisticsTest.java.
    >>>
    >>> I think we should enforce constraints where we reliably can:
    >>>
    >>> 1) count >= 0
    >>>
    >>> 2) count = 0, then min/max/sum are ignored and it?s as if the default constructor was called. (I thought it might be appropriate to reject since a caller might be passing in incorrect information in error, but the defaults for min/max are important and would be a burden for the caller to pass those values.) In this respect having count as the first parameter of the constructor would be useful.
    >>>
    >>> 3)  min <= max
    >>>
    >>> Since for count > 0 the constraints, count * max >= sum, count * min <= sum, cannot be reliably enforced due to overflow i am inclined to not bother and just document.
    >>>
    >>>
    >>> Note this is gonna be blocked from pushing until the new Compatibility and Specification Review (CSR) process is opened up, which i understand is ?soon"ish :-) but that should not block adding some further tests in the interim and tidying up the javadoc.
    >>>
    >>> Paul.
    >>>
    >>>
    >>>> On 6 Apr 2017, at 07:08, Chris Dennis  wrote:
    >>>>
    >>>> Hi Paul (et al)
    >>>>
    >>>> Like all things API there are wrinkles here when it comes to implementing.
    >>>>
    >>>> This patch isn?t final, there appears to be no existing test coverage for these classes beyond testing the compensating summation used in the double implementation, and I left off adding any until it was decided how much parameter validation we want (since that?s the only testing that can really occur here).
    >>>>
    >>>> The wrinkles relate to the issues around instances that have suffered overflow in count and/or sum which the existing implementation doesn?t defend against:
    >>>>
    >>>> * I chose to ignore all parameters if 'count == 0? and just leave the instance empty. I held off from validating min, max and count however. This obviously 'breaks things? (beyond how broken they would already be) if count == 0 only due to overflow.
    >>>> * I chose to fail if count is negative.
    >>>> * I chose to enforce that max and min are logically consistent with count and sum, this can break the moment either one of the overflows as well (I?m also pretty sure that the FPU logic is going to suffer here too - there might be some magic I can do with a pessimistic bit of rounding on the FPU multiplication result).
    >>>>
    >>>> I intentionally went with the most aggressive parameter validation here to establish one end of what could be implemented.  There are arguments for this and also arguments for the other extreme (no validation at all).  Personally I?m in favor of the current version where the creation will fail if the inputs are only possible through overflow (modulo fixing the FPU precision issues above) even though it?s at odds with approach of the existing implementation.
    >>>>
    >>>> Would appreciate thoughts/feedback.  Thanks.
    >>>>
    >>>> Chris
    >>>>
    >>>>
    >>>> P.S. I presume tests would be required for the parameter checking (once it is finalized)?
    >>>>
    >>>> <8178117.patch>
    
    
    From peter.levart at gmail.com  Wed Apr 12 16:27:20 2017
    From: peter.levart at gmail.com (Peter Levart)
    Date: Wed, 12 Apr 2017 18:27:20 +0200
    Subject: [PATCH] 8178117: Add public state constructors for
     Int/Long/DoubleSummaryStatistics
    In-Reply-To: 
    References: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com>
     <9E35282E-793B-411A-9A21-0B5762B68A28@oracle.com>
     <961938eb-8bde-a88c-ea05-de940c954ddd@oracle.com>
     
     
    Message-ID: <0815b9cc-4074-131b-460e-e061771fc18c@gmail.com>
    
    
    
    On 04/12/2017 04:41 PM, Peter Levart wrote:
    > On 04/11/2017 10:48 PM, Chris Dennis wrote:
    >> Color me confused? what would the javadoc on the parameter say? It 
    >> could I guess have an @implNote documenting the meanings of the 
    >> parameters? but then what use is it? The proposed API simply limits 
    >> the precision with which a DoubleSummaryStatistic can be copied to be 
    >> the same as the precision with which it can be ?accessed?. That 
    >> doesn?t seem an enormous problem since I suspect that bulk of usages 
    >> would be to marshall a ?finished? instance and therefore there is no 
    >> real loss occuring. If we wanted to support arbitrary precision 
    >> wouldn?t it be better to have a constructor variant that took a 
    >> BigDecimal, and a matching getPreciseSum() that returned a BigDecimal?
    >
    > And how would you compute the value for BigDecimal getPreciseSum() so 
    > that you could then set 3 internal double fields from BigDecimal 
    > without loss of information? 
    
    
    ...perhaps we could use the BigDecimal getPreciseSum() together with 
    getSum() to reconstruct the state. For exmaple:
    
         /**
          * Construct an instance with values obtained from another instance.
          *
          * @param count what was returned from another instance's {@link 
    #getCount()}
          * @param sum what was returned from another instance's {@link 
    #getSum()}
          * @param preciseSum what was returned from another instance's 
    {@link #getPreciseSum()}
          * @param min what was returned from another instance's {@link 
    #getMin()}
          * @param max what was returned from another instance's {@link 
    #getMax()}
          */
         public DoubleSummaryStatistics(long count,
                                        double sum, BigDecimal preciseSum,
                                        double min, double max) {
             if (count < 0L) {
                 throw new IllegalArgumentException("count < 0");
             } else if (count > 0L) {
                 if (min > max) {
                     throw new IllegalArgumentException("min > max");
                 }
                 this.count = count;
                 this.min = min;
                 this.max = max;
                 setSum(sum, preciseSum);
             }
         }
    
         /**
          * If {@link #getSum()} returns {@link Double#NaN} or {@link 
    Double#POSITIVE_INFINITY}
          * or {@link Double#NEGATIVE_INFINITY}, then this method returns 
    {@code null},
          * otherwise it returns a value that is a more precise 
    representation of the
          * sum of values recorded and can be used in
          * {@link #DoubleSummaryStatistics(long, double, BigDecimal, 
    double, double)}
          * to construct an object with internal state that closely 
    resembles the state of
          * original object.
          *
          * @return a precise sum in BigDecimal form.
          */
         public final BigDecimal getPreciseSum() {
             double sum = getSum();
             if (Double.isNaN(sum) || Double.isInfinite(sum)) {
                 return null;
             } else {
                 return new BigDecimal(this.sum).add(
                     new BigDecimal(this.sumCompensation));
             }
         }
    
         private void setSum(double sum, BigDecimal preciseSum) {
             if (preciseSum == null) {
                 if (!Double.isNaN(sum) && !Double.isInfinite(sum)) {
                     throw new IllegalArgumentException(
                         "preciseSum is null but sum is not a NaN and not 
    Infinite");
                 }
                 this.sum = this.simpleSum = sum;
                 this.sumCompensation = 0d;
             } else {
                 if (Double.isNaN(sum) || Double.isInfinite(sum)) {
                     throw new IllegalArgumentException(
                         "preciseSum is non-null but sum is NaN or Infinite");
                 }
                 this.sum = this.simpleSum = preciseSum.doubleValue();
                 this.sumCompensation = preciseSum.subtract(new 
    BigDecimal(this.sum)).doubleValue();
             }
         }
    
    
    Hm....
    
    
    Regards, Peter
    
    
    From paul.sandoz at oracle.com  Wed Apr 12 16:36:14 2017
    From: paul.sandoz at oracle.com (Paul Sandoz)
    Date: Wed, 12 Apr 2017 09:36:14 -0700
    Subject: JDK 9 RFR of JDK-8169971:
     tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java fails
     intermittently
    In-Reply-To: <2cd4bae2-03d0-a097-1977-45a4228ae77d@oracle.com>
    References: <2cd4bae2-03d0-a097-1977-45a4228ae77d@oracle.com>
    Message-ID: <1815B805-1FC8-460D-88CE-7CA842B998F7@oracle.com>
    
    Hi Amy,
    
    FileUtils
    ?
    
    -            } catch (NoSuchFileException | DirectoryNotEmptyException x) {
    +            } catch (NoSuchFileException x) {
    
    
    You removed the catch and rethrow of DirectoryNotEmptyException. The documentation of deleteFIleIfExistsWithRetry states:
    
      72     /**
      73      * Deletes a file, retrying if necessary.
      74      * No exception thrown if file doesn't exist.
      75      *
      76      * @param path  the file to delete
      77      *
      78      * @throws NoSuchFileException
      79      *         if the file does not exist (optional specific exception)
      80      * @throws DirectoryNotEmptyException
      81      *         if the file is a directory and could not otherwise be deleted
      82      *         because the directory is not empty (optional specific exception)
      83      * @throws IOException
      84      *         if an I/O error occurs
      85      */
      86     public static void deleteFileIfExistsWithRetry(Path path)
    
    
    I dunno what it means by "(optional specific exception)?, but what happens now if deleteFileIfExistsWithRetry is called with a non-empty directory?
    
    It?s amazing how hard it is to actually forcibly delete something. Such ?simple? ( :-) ) utilities should be part of the JDK.
    
    ?
    
    Do you think it?s simpler just to let jtreg cleanup? There are a few Mr.Jar tests that clean up after themselves but i wonder if it?s just simpler to let jtreg do it? any thoughts on that?
    
    Paul.
    
    > On 10 Apr 2017, at 19:15, Amy Lu  wrote:
    > 
    > Please review this test-only change.
    > 
    > tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java
    > 
    > This test fails intermittently on Windows platform in the final cleanup step, @AfterClass, in which test tries to delete all dirs and files it created. Though it?s okay to leave this cleanup work to jtreg, I still make it done in test by making test to create everything under ./testoutput (testdir), and delete this testdir directly with FileUtils.deleteFileTreeWithRetry(testdir).
    > 
    > Moreover, in FileUtils, as it tries to delete path with retry, we might want to give it a chance to "retry" in case of DirectoryNotEmptyException.
    > 
    > bug: https://bugs.openjdk.java.net/browse/JDK-8169971
    > webrev: http://cr.openjdk.java.net/~amlu/8169971/webrev.00/
    > 
    > Thanks,
    > Amy
    > 
    
    
    From Alan.Bateman at oracle.com  Wed Apr 12 16:42:56 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Wed, 12 Apr 2017 17:42:56 +0100
    Subject: JDK 9 RFR of JDK-8169971:
     tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java fails
     intermittently
    In-Reply-To: <1815B805-1FC8-460D-88CE-7CA842B998F7@oracle.com>
    References: <2cd4bae2-03d0-a097-1977-45a4228ae77d@oracle.com>
     <1815B805-1FC8-460D-88CE-7CA842B998F7@oracle.com>
    Message-ID: <318cf669-42db-a4ac-2ff9-ae3f9aba373c@oracle.com>
    
    On 12/04/2017 17:36, Paul Sandoz wrote:
    
    > Such ?simple? ( :-) ) utilities should be part of the JDK.
    >
    I think this utility method in the test library may the pre-date in 
    jtreg that does retry. As to why we retry, then it's virus checkers and 
    the like locking files that are in use by the test. I don't know why 
    they are configured to run in test environments as they regularly cause 
    interference.
    
    -Alan
    
    From chris.w.dennis at gmail.com  Wed Apr 12 17:08:08 2017
    From: chris.w.dennis at gmail.com (Chris Dennis)
    Date: Wed, 12 Apr 2017 13:08:08 -0400
    Subject: [PATCH] 8178117: Add public state constructors for
     Int/Long/DoubleSummaryStatistics
    In-Reply-To: <0815b9cc-4074-131b-460e-e061771fc18c@gmail.com>
    References: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com>
     <9E35282E-793B-411A-9A21-0B5762B68A28@oracle.com>
     <961938eb-8bde-a88c-ea05-de940c954ddd@oracle.com>
     
     
     <0815b9cc-4074-131b-460e-e061771fc18c@gmail.com>
    Message-ID: <652752D2-A328-477F-9466-97DC06F0B78F@gmail.com>
    
    Something like that was what I was envisioning (of course the inability to represent NaN or infinity with a BigDecimal is annoying). To me this approach really only breaks down when you stop using an actual iteration to perform the computation? as long as a ?sum? in some form is part of the internal state then this still works.
    
    > On Apr 12, 2017, at 12:27 PM, Peter Levart  wrote:
    > 
    > 
    > 
    > On 04/12/2017 04:41 PM, Peter Levart wrote:
    >> On 04/11/2017 10:48 PM, Chris Dennis wrote:
    >>> Color me confused? what would the javadoc on the parameter say? It could I guess have an @implNote documenting the meanings of the parameters? but then what use is it? The proposed API simply limits the precision with which a DoubleSummaryStatistic can be copied to be the same as the precision with which it can be ?accessed?. That doesn?t seem an enormous problem since I suspect that bulk of usages would be to marshall a ?finished? instance and therefore there is no real loss occuring. If we wanted to support arbitrary precision wouldn?t it be better to have a constructor variant that took a BigDecimal, and a matching getPreciseSum() that returned a BigDecimal?
    >> 
    >> And how would you compute the value for BigDecimal getPreciseSum() so that you could then set 3 internal double fields from BigDecimal without loss of information? 
    > 
    > 
    > ...perhaps we could use the BigDecimal getPreciseSum() together with getSum() to reconstruct the state. For exmaple:
    > 
    >    /**
    >     * Construct an instance with values obtained from another instance.
    >     *
    >     * @param count what was returned from another instance's {@link #getCount()}
    >     * @param sum what was returned from another instance's {@link #getSum()}
    >     * @param preciseSum what was returned from another instance's {@link #getPreciseSum()}
    >     * @param min what was returned from another instance's {@link #getMin()}
    >     * @param max what was returned from another instance's {@link #getMax()}
    >     */
    >    public DoubleSummaryStatistics(long count,
    >                                   double sum, BigDecimal preciseSum,
    >                                   double min, double max) {
    >        if (count < 0L) {
    >            throw new IllegalArgumentException("count < 0");
    >        } else if (count > 0L) {
    >            if (min > max) {
    >                throw new IllegalArgumentException("min > max");
    >            }
    >            this.count = count;
    >            this.min = min;
    >            this.max = max;
    >            setSum(sum, preciseSum);
    >        }
    >    }
    > 
    >    /**
    >     * If {@link #getSum()} returns {@link Double#NaN} or {@link Double#POSITIVE_INFINITY}
    >     * or {@link Double#NEGATIVE_INFINITY}, then this method returns {@code null},
    >     * otherwise it returns a value that is a more precise representation of the
    >     * sum of values recorded and can be used in
    >     * {@link #DoubleSummaryStatistics(long, double, BigDecimal, double, double)}
    >     * to construct an object with internal state that closely resembles the state of
    >     * original object.
    >     *
    >     * @return a precise sum in BigDecimal form.
    >     */
    >    public final BigDecimal getPreciseSum() {
    >        double sum = getSum();
    >        if (Double.isNaN(sum) || Double.isInfinite(sum)) {
    >            return null;
    >        } else {
    >            return new BigDecimal(this.sum).add(
    >                new BigDecimal(this.sumCompensation));
    >        }
    >    }
    > 
    >    private void setSum(double sum, BigDecimal preciseSum) {
    >        if (preciseSum == null) {
    >            if (!Double.isNaN(sum) && !Double.isInfinite(sum)) {
    >                throw new IllegalArgumentException(
    >                    "preciseSum is null but sum is not a NaN and not Infinite");
    >            }
    >            this.sum = this.simpleSum = sum;
    >            this.sumCompensation = 0d;
    >        } else {
    >            if (Double.isNaN(sum) || Double.isInfinite(sum)) {
    >                throw new IllegalArgumentException(
    >                    "preciseSum is non-null but sum is NaN or Infinite");
    >            }
    >            this.sum = this.simpleSum = preciseSum.doubleValue();
    >            this.sumCompensation = preciseSum.subtract(new BigDecimal(this.sum)).doubleValue();
    >        }
    >    }
    > 
    > 
    > Hm....
    > 
    > 
    > Regards, Peter
    > 
    
    
    From joe.darcy at oracle.com  Wed Apr 12 17:59:29 2017
    From: joe.darcy at oracle.com (Joseph D. Darcy)
    Date: Wed, 12 Apr 2017 10:59:29 -0700
    Subject: [PATCH] 8178117: Add public state constructors for
     Int/Long/DoubleSummaryStatistics
    In-Reply-To: 
    References: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com>
     <9E35282E-793B-411A-9A21-0B5762B68A28@oracle.com>
     <961938eb-8bde-a88c-ea05-de940c954ddd@oracle.com>
     
    Message-ID: <58EE6B01.5040908@oracle.com>
    
    On 4/11/2017 1:48 PM, Chris Dennis wrote:
    > Color me confused? what would the javadoc on the parameter say? It could I guess have an @implNote documenting the meanings of the parameters? but then what use is it? The proposed API simply limits the precision with which a DoubleSummaryStatistic can be copied to be the same as the precision with which it can be ?accessed?.  That doesn?t seem an enormous problem since I suspect that bulk of usages would be to marshall a ?finished? instance and therefore there is no real loss occuring. If we wanted to support arbitrary precision wouldn?t it be better to have a constructor variant that took a BigDecimal, and a matching getPreciseSum() that returned a BigDecimal?
    >
    
    The javadoc would say something like "takes an array of double values 
    representing a sum." In other words, rather than forcing the in-progress 
    sum to be represented as a single double, it could be represented as 
    more than one double.
    
    The current implementation basically uses two doubles internally to 
    represent the on-going summation. This extra state prevents many 
    numerically poor outcomes occurring when computing the sum. Greater 
    accuracy would be possible if additional internal state were used.
    
    -Joe
    
    
    
    From chris.hegarty at oracle.com  Wed Apr 12 19:16:32 2017
    From: chris.hegarty at oracle.com (Chris Hegarty)
    Date: Wed, 12 Apr 2017 20:16:32 +0100
    Subject: JDK 9 RFR of JDK-8169971:
     tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java fails
     intermittently
    In-Reply-To: <1815B805-1FC8-460D-88CE-7CA842B998F7@oracle.com>
    References: <2cd4bae2-03d0-a097-1977-45a4228ae77d@oracle.com>
     <1815B805-1FC8-460D-88CE-7CA842B998F7@oracle.com>
    Message-ID: <342AEE60-097D-480B-BEB3-A541D4356F09@oracle.com>
    
    
    > On 12 Apr 2017, at 17:36, Paul Sandoz  wrote:
    > ..
    > Do you think it?s simpler just to let jtreg cleanup? There are a few Mr.Jar tests that clean up after themselves but i wonder if it?s just simpler to let jtreg do it? any thoughts on that?
    
    I added these test library utility methods. Some times you actually
    need to clean up, other times you can leave it to jtreg ( if the files
    are all within the working/scratch directory ). Jtreg has similar
    retry logic when deleting files on Windows.
    
    It is common to see tests cleanup after themselves, as the original
    author may have been running the test standalone, not in jtreg,
    but we're mostly past that now. 
    
    In this particular case it may be ok to leave it to jtreg to do the
    clean up.
    
    -Chris.
    
    From peter.levart at gmail.com  Wed Apr 12 20:58:54 2017
    From: peter.levart at gmail.com (Peter Levart)
    Date: Wed, 12 Apr 2017 22:58:54 +0200
    Subject: [PATCH] 8178117: Add public state constructors for
     Int/Long/DoubleSummaryStatistics
    In-Reply-To: <58EE6B01.5040908@oracle.com>
    References: <595F8B9A-8AB0-4C13-8ECE-FD822C15FF3F@gmail.com>
     <9E35282E-793B-411A-9A21-0B5762B68A28@oracle.com>
     <961938eb-8bde-a88c-ea05-de940c954ddd@oracle.com>
     
     <58EE6B01.5040908@oracle.com>
    Message-ID: <2316c028-3360-24e7-5831-63d469bde791@gmail.com>
    
    Hi Joe,
    
    On 04/12/2017 07:59 PM, Joseph D. Darcy wrote:
    > On 4/11/2017 1:48 PM, Chris Dennis wrote:
    >> Color me confused? what would the javadoc on the parameter say? It 
    >> could I guess have an @implNote documenting the meanings of the 
    >> parameters? but then what use is it? The proposed API simply limits 
    >> the precision with which a DoubleSummaryStatistic can be copied to be 
    >> the same as the precision with which it can be ?accessed?.  That 
    >> doesn?t seem an enormous problem since I suspect that bulk of usages 
    >> would be to marshall a ?finished? instance and therefore there is no 
    >> real loss occuring. If we wanted to support arbitrary precision 
    >> wouldn?t it be better to have a constructor variant that took a 
    >> BigDecimal, and a matching getPreciseSum() that returned a BigDecimal?
    >>
    >
    > The javadoc would say something like "takes an array of double values 
    > representing a sum." In other words, rather than forcing the 
    > in-progress sum to be represented as a single double, it could be 
    > represented as more than one double.
    >
    > The current implementation basically uses two doubles internally to 
    > represent the on-going summation. This extra state prevents many 
    > numerically poor outcomes occurring when computing the sum. Greater 
    > accuracy would be possible if additional internal state were used.
    >
    > -Joe
    >
    >
    
    But constructor taking this state is not enough for the solution to the 
    problem. There would have to be a getter returning that state too, 
    otherwise there's no point in having such constructor, right?
    
    Are you envisioning that any possible future enhancements of the 
    summation would all keep the state as a series of double values?
    
    Regards, Peter
    
    
    From amy.lu at oracle.com  Thu Apr 13 10:28:35 2017
    From: amy.lu at oracle.com (Amy Lu)
    Date: Thu, 13 Apr 2017 18:28:35 +0800
    Subject: JDK 9 RFR of JDK-8169971:
     tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java fails
     intermittently
    In-Reply-To: <342AEE60-097D-480B-BEB3-A541D4356F09@oracle.com>
    References: <2cd4bae2-03d0-a097-1977-45a4228ae77d@oracle.com>
     <1815B805-1FC8-460D-88CE-7CA842B998F7@oracle.com>
     <342AEE60-097D-480B-BEB3-A541D4356F09@oracle.com>
    Message-ID: 
    
    Thank you for the comments!
    
    Yes, let's just make it simple, let jtreg to do the final clean up.
    
    Please review the updated webrev: 
    http://cr.openjdk.java.net/~amlu/8169971/webrev.01/
    
    (Tested on one win64 and one win32, loop run 500 times, all pass.)
    
    Thanks,
    Amy
    
    
    On 4/13/17 3:16 AM, Chris Hegarty wrote:
    >> On 12 Apr 2017, at 17:36, Paul Sandoz  wrote:
    >> ..
    >> Do you think it?s simpler just to let jtreg cleanup? There are a few Mr.Jar tests that clean up after themselves but i wonder if it?s just simpler to let jtreg do it? any thoughts on that?
    > I added these test library utility methods. Some times you actually
    > need to clean up, other times you can leave it to jtreg ( if the files
    > are all within the working/scratch directory ). Jtreg has similar
    > retry logic when deleting files on Windows.
    >
    > It is common to see tests cleanup after themselves, as the original
    > author may have been running the test standalone, not in jtreg,
    > but we're mostly past that now.
    >
    > In this particular case it may be ok to leave it to jtreg to do the
    > clean up.
    >
    > -Chris.
    
    
    From chris.hegarty at oracle.com  Thu Apr 13 10:42:32 2017
    From: chris.hegarty at oracle.com (Chris Hegarty)
    Date: Thu, 13 Apr 2017 11:42:32 +0100
    Subject: JDK 9 RFR of JDK-8169971:
     tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java fails
     intermittently
    In-Reply-To: 
    References: <2cd4bae2-03d0-a097-1977-45a4228ae77d@oracle.com>
     <1815B805-1FC8-460D-88CE-7CA842B998F7@oracle.com>
     <342AEE60-097D-480B-BEB3-A541D4356F09@oracle.com>
     
    Message-ID: <9B9D9370-1E4C-4716-BC01-CBA78432FC3A@oracle.com>
    
    
    > On 13 Apr 2017, at 11:28, Amy Lu  wrote:
    > 
    > Thank you for the comments!
    > 
    > Yes, let's just make it simple, let jtreg to do the final clean up.
    > 
    > Please review the updated webrev: http://cr.openjdk.java.net/~amlu/8169971/webrev.01/
    
    Looks ok to me.
    
    -Chris.
    
    From paul.sandoz at oracle.com  Thu Apr 13 17:35:25 2017
    From: paul.sandoz at oracle.com (Paul Sandoz)
    Date: Thu, 13 Apr 2017 10:35:25 -0700
    Subject: JDK 9 RFR of JDK-8169971:
     tools/jlink/multireleasejar/JLinkMultiReleaseJarTest.java fails
     intermittently
    In-Reply-To: <9B9D9370-1E4C-4716-BC01-CBA78432FC3A@oracle.com>
    References: <2cd4bae2-03d0-a097-1977-45a4228ae77d@oracle.com>
     <1815B805-1FC8-460D-88CE-7CA842B998F7@oracle.com>
     <342AEE60-097D-480B-BEB3-A541D4356F09@oracle.com>
     
     <9B9D9370-1E4C-4716-BC01-CBA78432FC3A@oracle.com>
    Message-ID: 
    
    
    > On 13 Apr 2017, at 03:42, Chris Hegarty  wrote:
    > 
    > 
    >> On 13 Apr 2017, at 11:28, Amy Lu  wrote:
    >> 
    >> Thank you for the comments!
    >> 
    >> Yes, let's just make it simple, let jtreg to do the final clean up.
    >> 
    >> Please review the updated webrev: http://cr.openjdk.java.net/~amlu/8169971/webrev.01/
    > 
    > Looks ok to me.
    > 
    
    +1
    
    Paul.
    
    From volker.simonis at gmail.com  Thu Apr 13 18:50:32 2017
    From: volker.simonis at gmail.com (Volker Simonis)
    Date: Thu, 13 Apr 2017 20:50:32 +0200
    Subject: [9] RFR(S): 8178726: Can't load classes from classpath if it is a UNC
     share
    Message-ID: 
    
    Hi,
    
    can you please review the following change which fixes a problem with
    UNC paths on the Windows class path:
    
    http://cr.openjdk.java.net/~simonis/webrevs/2017/8178726/
    https://bugs.openjdk.java.net/browse/JDK-8178726
    
    I would appreciate if somebody could run this trough JPRT for me. I
    won't be available until Tuesday after Easter so there's some time for
    testing :)
    
    Here comes the detailed problem description (also included in the bug report):
    
    If we set the classpath to a UNC share (e.g. '-cp \\foo\bar\classes')
    java won't be able to find classes there. This is also true if we set
    the classpath to a drive letter which maps to a network drive (e.g.
    '-cp Z:\classes' where 'Z:' is a short-cut for '\\foo\bar').
    
    This error is clearly a regression and should be fixed before Java 9 GA.
    
    The problem is caused by the refactoring of the application class loader:
    
    Before Java 9 the application class loader was a URLClassLoader
    (actually sun.misc.Launcher$AppClassLoader which extends
    URLClassLoader). It took the classpath from the "java.class.path"
    property and transformed it into a File[] by calling
    Launcher.getClassPath(). This File[] was then converted into a URL[]
    by calling Launcher.pathToURLs() which in turn called
    Launcher.getFileURL() which finally called
    sun.net.www.ParseUtil.fileToEncodedURL() to convert a File into an
    URL. This last function explicitly creates URLs with protocol 'file'
    and empty authority (i.e. if the File contained an authority part like
    "\\foo" in "\\foo\bar\classs"), this was saved in the path part of the
    URL (i.e. 'return new URL("file", "", path)');
    
    Later, these URLs were used to access classes on the classpath. This
    was done by creating new File objects from the path components of the
    corresponding URLs and because these path components already contained
    the full UNC path, everything worked fine.
    
    In JDK 9 now, the legacy class path is constructed in
    jdk.internal.loader.ClassLoaders. It also takes the "java.class.path"
    property as a starting point but calls addClassPathToUCP() which in
    turn calls toFileURL() which finally uses
    'Paths.get(s).toRealPath().toUri().toURL()' to transform a string 's'
    into an URL. This conversion creates URLs where the authority part
    contains the hostname and the path component contains the remaining
    path from the UNC paths in the classpath.
    
    The problem is now that during class loading, the new application
    class loader jdk.internal.loader.ClassLoaders$AppClassLoader calls
    jdk.internal.loader.BuiltinClassLoader.loadClass() which calls
    loadClassOrNull() which calls findClassOnClassPathOrNull() which calls
    jdk.internal.loader.URLClassPath.getResource(). The class URLClassPath
    has a list of all the previously created URLs for each entry of the
    classpath. For each of these URLs it creates a
    jdk.internal.loader.URLClassPath$Loader by calling getLoader(). If the
    corresponding URL represents a file, it will create a
    jdk.internal.loader.URLClassPath$FileLoader (which derives from
    URLClassPath$Loader). The FileLoader class uses the file component of
    the URL to construct a File object for accessing the underlying
    ressources. But unlike the jdk8 case, the file part of the URL now
    only contains the path component WITHOUT the authority (i.e. 'host')
    part. This will be interpreted as a relative path realtively to the
    current drive and obviously fail.
    
    Thanks,
    Volker
    
    From huaming.li at oracle.com  Fri Apr 14 06:33:39 2017
    From: huaming.li at oracle.com (Hamlin Li)
    Date: Fri, 14 Apr 2017 14:33:39 +0800
    Subject: RFR of JDK-8145163: Test Task for Platform Logging API and Service --
     for moduralization
    Message-ID: <2089ddd7-9f1d-eb06-3d91-45faa193d72f@oracle.com>
    
    Would you please review the below patch?
    
    bug: https://bugs.openjdk.java.net/browse/JDK-8145163
    
    webrev: http://cr.openjdk.java.net/~mli/8145163/webrev.00/
    
    Thank you
    
    -Hamlin
    
    
    From Alan.Bateman at oracle.com  Fri Apr 14 08:41:06 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Fri, 14 Apr 2017 09:41:06 +0100
    Subject: [9] RFR(S): 8178726: Can't load classes from classpath if it is a
     UNC share
    In-Reply-To: 
    References: 
    Message-ID: <0633380e-0b8d-fcd5-8983-91c514b1cf0d@oracle.com>
    
    On 13/04/2017 19:50, Volker Simonis wrote:
    
    > Hi,
    >
    > can you please review the following change which fixes a problem with
    > UNC paths on the Windows class path:
    >
    > http://cr.openjdk.java.net/~simonis/webrevs/2017/8178726/
    > https://bugs.openjdk.java.net/browse/JDK-8178726
    >
    > I would appreciate if somebody could run this trough JPRT for me. I
    > won't be available until Tuesday after Easter so there's some time for
    > testing :)
    Yes, this is a regression, it seems specific to a class path with 
    exploded classes on a network share. The issue has been there since 
    jdk-9+111 but I don't think has been reported before now.
    
    I can do some testing with your patch. My general concern is that there 
    are lot of conversions going on, specifically URL -> URI -> Path -> File 
    (this is after the initial setup that amounts to String -> Path -> URI 
    -> URL). I think URLClassPath (which dates back to JDK 1.2 I think) is 
    crying out to be replaced and we probably should have done a long time 
    ago. Too late now as we have to be cautious.
    
    Given that `dir` is only needed when the resource name contains a ".." 
    then there shouldn't be any need to initialize it in the constructor, it 
    can be lazy. That would reduce the risk with changing this fragile area. 
    It would also remove some of the overhead with a really long class path. 
    Once JDK 9 is out of the way then I think we should replace 
    URLClassPath.FileLoader, if not all of URLClassPath.
    
    -Alan
    
    From weijun.wang at oracle.com  Fri Apr 14 09:02:58 2017
    From: weijun.wang at oracle.com (Weijun Wang)
    Date: Fri, 14 Apr 2017 17:02:58 +0800
    Subject: [9] RFR(S): 8178726: Can't load classes from classpath if it is a
     UNC share
    In-Reply-To: <0633380e-0b8d-fcd5-8983-91c514b1cf0d@oracle.com>
    References: 
     <0633380e-0b8d-fcd5-8983-91c514b1cf0d@oracle.com>
    Message-ID: 
    
    I see some changes:
    
    - relative url won't be supported
    
    - path is no longer canonicalized
    
    Maybe these are no problem for URLClassPath. Just my 2 cents.
    
    --Max
    
    On 04/14/2017 04:41 PM, Alan Bateman wrote:
    > On 13/04/2017 19:50, Volker Simonis wrote:
    >
    >> Hi,
    >>
    >> can you please review the following change which fixes a problem with
    >> UNC paths on the Windows class path:
    >>
    >> http://cr.openjdk.java.net/~simonis/webrevs/2017/8178726/
    >> https://bugs.openjdk.java.net/browse/JDK-8178726
    >>
    >> I would appreciate if somebody could run this trough JPRT for me. I
    >> won't be available until Tuesday after Easter so there's some time for
    >> testing :)
    > Yes, this is a regression, it seems specific to a class path with
    > exploded classes on a network share. The issue has been there since
    > jdk-9+111 but I don't think has been reported before now.
    >
    > I can do some testing with your patch. My general concern is that there
    > are lot of conversions going on, specifically URL -> URI -> Path -> File
    > (this is after the initial setup that amounts to String -> Path -> URI
    > -> URL). I think URLClassPath (which dates back to JDK 1.2 I think) is
    > crying out to be replaced and we probably should have done a long time
    > ago. Too late now as we have to be cautious.
    >
    > Given that `dir` is only needed when the resource name contains a ".."
    > then there shouldn't be any need to initialize it in the constructor, it
    > can be lazy. That would reduce the risk with changing this fragile area.
    > It would also remove some of the overhead with a really long class path.
    > Once JDK 9 is out of the way then I think we should replace
    > URLClassPath.FileLoader, if not all of URLClassPath.
    >
    > -Alan
    
    From daniel.fuchs at oracle.com  Fri Apr 14 10:31:43 2017
    From: daniel.fuchs at oracle.com (Daniel Fuchs)
    Date: Fri, 14 Apr 2017 11:31:43 +0100
    Subject: RFR of JDK-8145163: Test Task for Platform Logging API and
     Service -- for moduralization
    In-Reply-To: <2089ddd7-9f1d-eb06-3d91-45faa193d72f@oracle.com>
    References: <2089ddd7-9f1d-eb06-3d91-45faa193d72f@oracle.com>
    Message-ID: 
    
    Hi Hamlin,
    
    Thank you very much for contributing these tests.
    They look good to me!
    I'm particularly happy to see that some of them tests the
    API with a smaller image built with jlink.
    None of the existing logging tests did that!
    
    best regards
    
    -- daniel
    
    On 14/04/2017 07:33, Hamlin Li wrote:
    > Would you please review the below patch?
    >
    > bug: https://bugs.openjdk.java.net/browse/JDK-8145163
    >
    > webrev: http://cr.openjdk.java.net/~mli/8145163/webrev.00/
    >
    > Thank you
    >
    > -Hamlin
    >
    
    
    From huaming.li at oracle.com  Fri Apr 14 10:49:35 2017
    From: huaming.li at oracle.com (Hamlin Li)
    Date: Fri, 14 Apr 2017 18:49:35 +0800
    Subject: RFR of JDK-8145163: Test Task for Platform Logging API and
     Service -- for moduralization
    In-Reply-To: 
    References: <2089ddd7-9f1d-eb06-3d91-45faa193d72f@oracle.com>
     
    Message-ID: <2a9b7ea3-3688-b161-eb80-3b6de2718894@oracle.com>
    
    
    Since this is a test development, I think it does not have to go through 
    the JDK 9 ramp down 2 approval procedures, I suppose now I'm OK to push 
    the code as usual?
    
    Thank you
    
    -Hamlin
    
    
    On 2017/4/14 18:31, Daniel Fuchs wrote:
    > Hi Hamlin,
    >
    > Thank you very much for contributing these tests.
    > They look good to me!
    > I'm particularly happy to see that some of them tests the
    > API with a smaller image built with jlink.
    > None of the existing logging tests did that!
    >
    > best regards
    >
    > -- daniel
    >
    > On 14/04/2017 07:33, Hamlin Li wrote:
    >> Would you please review the below patch?
    >>
    >> bug: https://bugs.openjdk.java.net/browse/JDK-8145163
    >>
    >> webrev: http://cr.openjdk.java.net/~mli/8145163/webrev.00/
    >>
    >> Thank you
    >>
    >> -Hamlin
    >>
    >
    
    
    From daniel.fuchs at oracle.com  Fri Apr 14 10:51:44 2017
    From: daniel.fuchs at oracle.com (Daniel Fuchs)
    Date: Fri, 14 Apr 2017 11:51:44 +0100
    Subject: RFR of JDK-8145163: Test Task for Platform Logging API and
     Service -- for moduralization
    In-Reply-To: <2a9b7ea3-3688-b161-eb80-3b6de2718894@oracle.com>
    References: <2089ddd7-9f1d-eb06-3d91-45faa193d72f@oracle.com>
     
     <2a9b7ea3-3688-b161-eb80-3b6de2718894@oracle.com>
    Message-ID: <64f26811-552c-5018-f0c8-65bc6a2c190f@oracle.com>
    
    On 14/04/2017 11:49, Hamlin Li wrote:
    >
    > Since this is a test development, I think it does not have to go through
    > the JDK 9 ramp down 2 approval procedures, I suppose now I'm OK to push
    > the code as usual?
    
    That's my understanding as well.
    
    best regards,
    
    -- daniel
    
    >
    > Thank you
    >
    > -Hamlin
    
    
    From huaming.li at oracle.com  Fri Apr 14 10:53:33 2017
    From: huaming.li at oracle.com (Hamlin Li)
    Date: Fri, 14 Apr 2017 18:53:33 +0800
    Subject: RFR of JDK-8145163: Test Task for Platform Logging API and
     Service -- for moduralization
    In-Reply-To: <64f26811-552c-5018-f0c8-65bc6a2c190f@oracle.com>
    References: <2089ddd7-9f1d-eb06-3d91-45faa193d72f@oracle.com>
     
     <2a9b7ea3-3688-b161-eb80-3b6de2718894@oracle.com>
     <64f26811-552c-5018-f0c8-65bc6a2c190f@oracle.com>
    Message-ID: 
    
    
    On 2017/4/14 18:51, Daniel Fuchs wrote:
    > On 14/04/2017 11:49, Hamlin Li wrote:
    >>
    >> Since this is a test development, I think it does not have to go through
    >> the JDK 9 ramp down 2 approval procedures, I suppose now I'm OK to push
    >> the code as usual?
    >
    > That's my understanding as well.
    Hi Daniel,
    
    Got it, thank you! will push the code later.
    
    Thank you
    -Hamlin
    >
    > best regards,
    >
    > -- daniel
    >
    >>
    >> Thank you
    >>
    >> -Hamlin
    >
    
    
    From Alan.Bateman at oracle.com  Fri Apr 14 12:41:39 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Fri, 14 Apr 2017 13:41:39 +0100
    Subject: [9] RFR(S): 8178726: Can't load classes from classpath if it is a
     UNC share
    In-Reply-To: 
    References: 
     <0633380e-0b8d-fcd5-8983-91c514b1cf0d@oracle.com>
     
    Message-ID: 
    
    On 14/04/2017 10:02, Weijun Wang wrote:
    
    > I see some changes:
    >
    > - relative url won't be supported
    >
    > - path is no longer canonicalized
    >
    > Maybe these are no problem for URLClassPath. Just my 2 cents.
    The URLs are already constructed from canonicalized file paths but maybe 
    you are thinking about usages of URLClassPath by other code?
    
    -Alan
    
    From chris.hegarty at oracle.com  Fri Apr 14 13:02:45 2017
    From: chris.hegarty at oracle.com (Chris Hegarty)
    Date: Fri, 14 Apr 2017 14:02:45 +0100
    Subject: [9] RFR(S): 8178726: Can't load classes from classpath if it is a
     UNC share
    In-Reply-To: 
    References: 
    Message-ID: <2a1ec694-f3d4-ca25-a08c-36b7d3511bdf@oracle.com>
    
    Volker,
    
    On 13/04/17 19:50, Volker Simonis wrote:
    > Hi,
    >
    > can you please review the following change which fixes a problem with
    > UNC paths on the Windows class path:
    >
    > http://cr.openjdk.java.net/~simonis/webrevs/2017/8178726/
    > https://bugs.openjdk.java.net/browse/JDK-8178726
    >
    > I would appreciate if somebody could run this trough JPRT for me. I
    > won't be available until Tuesday after Easter so there's some time for
    > testing :)
    
    I know that Alan has provided some comments on this, but I just
    grabbed your patch and sent it through our internal build and test
    system. I observed a few failures:
    
    1)java/nio/file/spi/SetDefaultProvider.java ( all platforms )
    
    STDERR:
    Error: A JNI error has occurred, please check your installation and try 
    again
    Exception in thread "main" java.lang.Error: java.lang.NullPointerException
    	at 
    java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(FileSystems.java:139)
    	at 
    java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.access$100(FileSystems.java:100)
    	at 
    java.base/java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:109)
    	at 
    java.base/java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:107)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at 
    java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.defaultFileSystem(FileSystems.java:107)
    	at 
    java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.(FileSystems.java:101)
    	at java.base/java.nio.file.FileSystems.getDefault(FileSystems.java:188)
    	at java.base/java.nio.file.Paths.get(Paths.java:138)
    	at 
    java.base/jdk.internal.loader.URLClassPath$FileLoader.(URLClassPath.java:1049)
    	at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:417)
    	at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:411)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at 
    java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:410)
    	at 
    java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:379)
    	at 
    java.base/jdk.internal.loader.URLClassPath.getResource(URLClassPath.java:245)
    	at 
    java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:666)
    	at 
    java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:592)
    	at 
    java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:550)
    	at 
    java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
    	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:473)
    	at java.base/java.lang.Class.forName0(Native Method)
    	at java.base/java.lang.Class.forName(Class.java:374)
    	at 
    java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:628)
    	at 
    java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:524)
    Caused by: java.lang.NullPointerException
    	at java.base/java.nio.file.Paths.get(Paths.java:138)
    	at 
    java.base/jdk.internal.loader.URLClassPath$FileLoader.(URLClassPath.java:1049)
    	at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:417)
    	at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:411)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at 
    java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:410)
    	at 
    java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:379)
    	at 
    java.base/jdk.internal.loader.URLClassPath.getResource(URLClassPath.java:245)
    	at 
    java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:666)
    	at 
    java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:592)
    	at 
    java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:550)
    	at 
    java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
    	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:473)
    	at java.base/java.lang.Class.forName0(Native Method)
    	at java.base/java.lang.Class.forName(Class.java:374)
    	at 
    java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(FileSystems.java:129)
    	... 24 more
    
    2) java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh
         ( all platforms )
    
    Exception in thread "main" java.lang.IllegalArgumentException: URI is 
    not hierarchical
    	at java.base/sun.nio.fs.UnixUriUtils.fromUri(UnixUriUtils.java:48)
    	at 
    java.base/sun.nio.fs.UnixFileSystemProvider.getPath(UnixFileSystemProvider.java:99)
    	at java.base/java.nio.file.Paths.get(Paths.java:138)
    	at 
    java.base/jdk.internal.loader.URLClassPath$FileLoader.(URLClassPath.java:1049)
    	at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:417)
    	at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:411)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at 
    java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:410)
    	at 
    java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:379)
    	at 
    java.base/jdk.internal.loader.URLClassPath.getResource(URLClassPath.java:245)
    	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:450)
    	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:447)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:446)
    	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:540)
    	at 
    ClassLoaderDeadlock$DelayClassLoader.loadClass(ClassLoaderDeadlock.java:87)
    	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:473)
    	at ClassLoaderDeadlock.main(ClassLoaderDeadlock.java:38)
    
    3) test\java\net\URLClassLoader\closetest\CloseTest.java ( Windows )
    
    java.lang.IllegalArgumentException: uri
    	at 
    java.base/jdk.internal.loader.URLClassPath$FileLoader.(URLClassPath.java:1051)
    	at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:417)
    	at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:411)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at 
    java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:410)
    	at 
    java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:379)
    	at 
    java.base/jdk.internal.loader.URLClassPath.getResource(URLClassPath.java:245)
    	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:450)
    	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:447)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:446)
    	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:540)
    	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:473)
    	at java.base/java.lang.Class.forName0(Native Method)
    	at java.base/java.lang.Class.forName(Class.java:374)
    	at Common.loadClass(Common.java:80)
    	at CloseTest.test(CloseTest.java:109)
    	at CloseTest.main(CloseTest.java:83)
    	at 
    java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
    Method)
    	at 
    java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at 
    java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:563)
    	at 
    com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
    	at java.base/java.lang.Thread.run(Thread.java:844)
    Caused by: java.net.URISyntaxException: Illegal character in opaque part 
    at index 7: 
    file:C:\jprt\T\P1\101420.chhegar\s\jdk\testoutput\jdk_net\JTwork\classes\java\net\URLClassLoader\closetest/testdir/
    	at java.base/java.net.URI$Parser.fail(URI.java:2904)
    	at java.base/java.net.URI$Parser.checkChars(URI.java:3075)
    	at java.base/java.net.URI$Parser.parse(URI.java:3111)
    	at java.base/java.net.URI.(URI.java:590)
    	at java.base/java.net.URL.toURI(URL.java:1018)
    	at 
    java.base/jdk.internal.loader.URLClassPath$FileLoader.(URLClassPath.java:1049)
    	... 23 more
    
    4) java/net/URLClassLoader/closetest/GetResourceAsStream.java ( Windows )
    
    STDOUT:
    Doing tests with URL: 
    file:/C:/jprt/T/P1/101420.chhegar/s/jdk/testoutput/jdk_net/JTwork/classes/java/net/URLClassLoader/closetest/test.jar
      ... OK
    Doing tests with URL: 
    file:/C:/jprt/T/P1/101420.chhegar/s/jdk/testoutput/jdk_net/JTwork/classes/java/net/URLClassLoader/closetest/test.jar
      ... OK
    Doing tests with URL: 
    file:/C:/jprt/T/P1/101420.chhegar/s/jdk/testoutput/jdk_net/JTwork/classes/java/net/URLClassLoader/closetest/test.jar
      ... OK
    STDERR:
    java.lang.RuntimeException: Dir exists: 
    C:\jprt\T\P1\101420.chhegar\s\jdk\testoutput\jdk_net\JTwork\classes\java\net\URLClassLoader\closetest\testdir
    	at Common.copyDir(Common.java:62)
    	at GetResourceAsStream.main(GetResourceAsStream.java:71)
    	at 
    java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
    Method)
    	at 
    java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at 
    java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:563)
    	at 
    com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
    	at java.base/java.lang.Thread.run(Thread.java:844)
    
    -Chris.
    
    From Alan.Bateman at oracle.com  Fri Apr 14 13:13:27 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Fri, 14 Apr 2017 14:13:27 +0100
    Subject: [9] RFR(S): 8178726: Can't load classes from classpath if it is a
     UNC share
    In-Reply-To: <2a1ec694-f3d4-ca25-a08c-36b7d3511bdf@oracle.com>
    References: 
     <2a1ec694-f3d4-ca25-a08c-36b7d3511bdf@oracle.com>
    Message-ID: <4067cfb5-a01c-73e3-7f5d-c4d729830b28@oracle.com>
    
    On 14/04/2017 14:02, Chris Hegarty wrote:
    
    >
    > I know that Alan has provided some comments on this, but I just
    > grabbed your patch and sent it through our internal build and test
    > system. I observed a few failures:
    Yes, I think URLClassLoader will be broken (Max is right, I forgot that 
    URLClassPath is essentially the implementation of URLClassLoader).
    
    I think Volker will need to change this so that 
    ClassLoaders.toFileURL(String) uses toFile().toURI().toURL(). That will 
    ensure that URLClassPath doesn't get URLs with the server name in the 
    authority component.
    
    -Alan
    
    From stuart.marks at oracle.com  Fri Apr 14 22:36:40 2017
    From: stuart.marks at oracle.com (Stuart Marks)
    Date: Fri, 14 Apr 2017 15:36:40 -0700
    Subject: JDK 9 RFR(s): 8177789 fix collections framework links to point to
     java.util package doc
    Message-ID: 
    
    Hi all,
    
    Please review this changeset that fixes up links around the JDK that point to 
    the old Collections technotes/guides area. This changeset points them to the 
    java.util package summary instead.
    
    Most of the changes here simply adjust a link location. The file that's 
    different is java/util/package-info.java, which adds the anchor to which all the 
    other links point.
    
    Martin,
    
    This changeset includes a bunch of changes to java.util.concurrent classes, as 
    well as to files like ArrayDeque which straddle the border between the JDK and 
    the JSR166 repo. How did you want to handle these changes? I could just push 
    this and you could merge upstream, or I could slice off the diffs from selected 
    files and have you put them into JSR166 and then merge into the JDK. In any 
    case, the changes are all one-liners, so I don't expect any conflicts. Let me know.
    
    Webrev:
    
    http://cr.openjdk.java.net/~smarks/reviews/8177789/webrev.0/
    
    Thanks,
    
    s'marks
    
    From brent.christian at oracle.com  Sat Apr 15 00:18:01 2017
    From: brent.christian at oracle.com (Brent Christian)
    Date: Fri, 14 Apr 2017 17:18:01 -0700
    Subject: JDK 9 RFR(s): 8177789 fix collections framework links to point to
     java.util package doc
    In-Reply-To: 
    References: 
    Message-ID: <62cafae9-19df-15fa-3ac0-c2adddf759b5@oracle.com>
    
    Hi, Stuart
    
    The changes look fine.  You found and changed all the references I could 
    find.   Having the @index I think will be nice.
    
    -Brent
    
    On 4/14/17 3:36 PM, Stuart Marks wrote:
    > Hi all,
    >
    > Please review this changeset that fixes up links around the JDK that
    > point to the old Collections technotes/guides area. This changeset
    > points them to the java.util package summary instead.
    >
    > Most of the changes here simply adjust a link location. The file that's
    > different is java/util/package-info.java, which adds the anchor to which
    > all the other links point.
    >
    > Martin,
    >
    > This changeset includes a bunch of changes to java.util.concurrent
    > classes, as well as to files like ArrayDeque which straddle the border
    > between the JDK and the JSR166 repo. How did you want to handle these
    > changes? I could just push this and you could merge upstream, or I could
    > slice off the diffs from selected files and have you put them into
    > JSR166 and then merge into the JDK. In any case, the changes are all
    > one-liners, so I don't expect any conflicts. Let me know.
    >
    > Webrev:
    >
    > http://cr.openjdk.java.net/~smarks/reviews/8177789/webrev.0/
    >
    > Thanks,
    >
    > s'marks
    
    From gil at azul.com  Sat Apr 15 15:51:38 2017
    From: gil at azul.com (Gil Tene)
    Date: Sat, 15 Apr 2017 15:51:38 +0000
    Subject: RFR 9: 8165641 : Deprecate Object.finalize
    In-Reply-To: 
    References: 
     <96fe9ae0-993a-aea6-cabf-f079450dc128@Oracle.com>
     <49eb0b85-130a-b74d-e760-120674de6ebc@oracle.com>
     
     
     
    Message-ID: 
    
    IMO, so long as the JDK's own performance-sensitive methods do not follow this advice, it will be hard to "educate" people to use reachabilityFence responsibly.
    
    To be specific:
    
    As long as java.nioDirectByteBuffer.get() is effectively coded like this (after the templates are applied):
    
        public byte get() {
            return (unsafe.getByte(ix(nextGetIndex())));
        }
    
    Instead of like this:
    
        public byte get() {
    	try {
            	return (unsafe.getByte(ix(nextGetIndex())));
    	} finally {
    		Reference.reachabilityFence(this);
    	}
        }
    
    People will copy it and extend on it, replicating the reachability bug and the use-after-free problem in the current code.
    
    It is hard to ask people to code "responsibly" when the JDK itself doesn't. This is especially true when the bug in the above code is not obvious, and (as Hans points out earlier) it takes a long time to convince people it actually exists. This is especially true since the "well, when was the last time someone complained about DirectByteBuffer.get() doing getting a SEGV on access to a freed buffer?" argument holds some water. And that's where you actually end up usually when discussing the above missing reachabilityFence?
    
    A few things are keeping the JDK code from evolving to properly use Reference.reachabilityFence(this):
    
    a. It didn't exist until recently. [That's a very good excuse]
    
    b. While Reference.reachabilityFence exists now, it's implementation is sub-optimal. IUUC it is modeled [currently] as an opaque method call, which prohibits enough useful optimizations to significantly hurt DirectByteBuffer.get() if it were actually included in the code right now.
    
    c. As Hans notes below, the compilers may temporarily dodge this issue by inhibiting dead variable elimination for references. They do so to allow the actual (semantically buggy) current JDK code to execute safely and performantly.
    
    As long as the compilers paper over this by temporarily dodging the issue and inhibiting dead variable elimination for references, we are giving people a continued excuse to ignore the need for adding reachabilityFences to their code. And this situation will probably continue (for practical purposes) at least as long as using reachabilityFence in the above common form is not optimized in practice to be equivalent to just inhibiting dead variable elimination of (this) across the same scope [and not just implemented as a much more expensive opaque method effect].
    
    This makes the subject somewhat premature for wide public education IMO. A practical set of steps might look like this:
    
    0. Add Reference.reachabilityFence() to the platform [this is basically the existing "collect underpants" step]
    
    1. make try { } finally { Reference.reachabilityFence(this); } optimize well (to be no more expensive than inhibiting dead variable elimination for 'this' across the try block).
    
    2. Change JDK code to actually make use of this code idiom in the various places where it is actually needed for correctness.
    
    3. Relax compiler limitation crutches that currently help make the correctness bugs not trigger often. But do so first with a non-default -XX flag, and later transition to default with a backout flag (since a lot of user code will start breaking when the crutch is taken away).
    
    4. Educate and evangelize for proper use of Reference.reachabilityFence(this); (maybe even add a method annotation for people who like that sort of thing? E.g. @AlwaysReachableThis)
    
    5. Profit
    
    
    > On Apr 1, 2017, at 10:19 AM, Hans Boehm  wrote:
    > 
    > That also sounds fine to me.
    > 
    > The difficulty with applying this, especially in the JNI case, is that you
    > may need several reachability fences at the end of each method, guarding
    > parameters and temporaries, not all of which may be naturally in scope at
    > the end. But we're not going to be able to include a full discussion here.
    > 
    > In the interest of full disclosure, we currently, at least temporarily,
    > dodge this issue by inhibiting dead variable elimination for references.
    > 
    > 
    > On Apr 1, 2017 01:55, "Andrew Haley"  wrote:
    > 
    > On 31/03/17 19:56, Hans Boehm wrote:
    >> This method should be used when cleanup actions (finalize() calls, or
    >> Reference enqueuing, Cleaner invocation) could otherwise be triggered
    > while
    >> a resource under control of the object is still in use. This method should
    >> normally be called when these cleanup facilities are used to perform
    >> actions other than simply issuing a warning.
    > 
    > It's still pretty confusing.  It would be simpler to say that
    > reachabilityFence should be used at the end of every method of a class
    > which has cleanup actions if you don't want those cleanup actions to
    > be run before the end of that method.  In that case, reachabilityFence
    > only makes any difference in cases where otherwise you'd have a bug.
    > 
    > Andrew.
    
    
    From hboehm at google.com  Sat Apr 15 17:14:57 2017
    From: hboehm at google.com (Hans Boehm)
    Date: Sat, 15 Apr 2017 10:14:57 -0700
    Subject: RFR 9: 8165641 : Deprecate Object.finalize
    In-Reply-To: 
    References: 
     <96fe9ae0-993a-aea6-cabf-f079450dc128@Oracle.com>
     <49eb0b85-130a-b74d-e760-120674de6ebc@oracle.com>
     
     
     
     
    Message-ID: 
    
    The approach Gil is advocating certainly has its attraction. The reason I'm
    not really enthusiastic, and don't really view the language design problem
    as solved anymore, is that I'm no longer certain that the majority of
    programmers will ever be able to use reachabilityFence correctly. The rules
    are really, really subtle and unintuitive, especially for JNI-intensive
    code. I don't have a termination proof for Gil's step 4.
    
    Android's BigInt.java is a good illustration of the problem. This is a
    wrapper around a native (BoringSSL) bignum package, which generally
    forwards most operations directly to native code. But functions routinely
    take BigInt arguments in addition to "this". Those each need
    reachabilityFences, even for those that currently have one-liner
    implementations. Often temporary BigInts are allocated, filled in, and
    possibly returned as results. Those need reachabilityFences, just in case
    the result is not used. The rules for constructors are not 100% clear to
    me. But I think those, counterintuitively, also generally need
    reachabilityFences to deal with the case in which the protected field is
    not subsequently used. I have little confidence I could get this right
    without a number of iterations.
    
    I agree that it would be good to make the JDK reachabilityFence-correct.
    It's the only available tool, so it's necessary for correctness. But I
    would also view it as a feasibility experiment, keeping in mind that the
    hardest code to deal with is probably in third-party libraries. My guess is
    that we haven't gotten to the final solution here.
    
    On Sat, Apr 15, 2017 at 8:51 AM, Gil Tene  wrote:
    
    > IMO, so long as the JDK's own performance-sensitive methods do not follow
    > this advice, it will be hard to "educate" people to use reachabilityFence
    > responsibly.
    >
    > To be specific:
    >
    > As long as java.nioDirectByteBuffer.get() is effectively coded like this
    > (after the templates are applied):
    >
    >     public byte get() {
    >         return (unsafe.getByte(ix(nextGetIndex())));
    >     }
    >
    > Instead of like this:
    >
    >     public byte get() {
    >         try {
    >                 return (unsafe.getByte(ix(nextGetIndex())));
    >         } finally {
    >                 Reference.reachabilityFence(this);
    >         }
    >     }
    >
    > People will copy it and extend on it, replicating the reachability bug and
    > the use-after-free problem in the current code.
    >
    > It is hard to ask people to code "responsibly" when the JDK itself
    > doesn't. This is especially true when the bug in the above code is not
    > obvious, and (as Hans points out earlier) it takes a long time to convince
    > people it actually exists. This is especially true since the "well, when
    > was the last time someone complained about DirectByteBuffer.get() doing
    > getting a SEGV on access to a freed buffer?" argument holds some water. And
    > that's where you actually end up usually when discussing the above missing
    > reachabilityFence?
    >
    > A few things are keeping the JDK code from evolving to properly use
    > Reference.reachabilityFence(this):
    >
    > a. It didn't exist until recently. [That's a very good excuse]
    >
    > b. While Reference.reachabilityFence exists now, it's implementation is
    > sub-optimal. IUUC it is modeled [currently] as an opaque method call, which
    > prohibits enough useful optimizations to significantly hurt
    > DirectByteBuffer.get() if it were actually included in the code right now.
    >
    > c. As Hans notes below, the compilers may temporarily dodge this issue by
    > inhibiting dead variable elimination for references. They do so to allow
    > the actual (semantically buggy) current JDK code to execute safely and
    > performantly.
    >
    > As long as the compilers paper over this by temporarily dodging the issue
    > and inhibiting dead variable elimination for references, we are giving
    > people a continued excuse to ignore the need for adding reachabilityFences
    > to their code. And this situation will probably continue (for practical
    > purposes) at least as long as using reachabilityFence in the above common
    > form is not optimized in practice to be equivalent to just inhibiting dead
    > variable elimination of (this) across the same scope [and not just
    > implemented as a much more expensive opaque method effect].
    >
    > This makes the subject somewhat premature for wide public education IMO. A
    > practical set of steps might look like this:
    >
    > 0. Add Reference.reachabilityFence() to the platform [this is basically
    > the existing "collect underpants" step]
    >
    > 1. make try { } finally { Reference.reachabilityFence(this); } optimize
    > well (to be no more expensive than inhibiting dead variable elimination for
    > 'this' across the try block).
    >
    > 2. Change JDK code to actually make use of this code idiom in the various
    > places where it is actually needed for correctness.
    >
    > 3. Relax compiler limitation crutches that currently help make the
    > correctness bugs not trigger often. But do so first with a non-default -XX
    > flag, and later transition to default with a backout flag (since a lot of
    > user code will start breaking when the crutch is taken away).
    >
    > 4. Educate and evangelize for proper use of Reference.reachabilityFence(this);
    > (maybe even add a method annotation for people who like that sort of thing?
    > E.g. @AlwaysReachableThis)
    >
    > 5. Profit
    >
    >
    > > On Apr 1, 2017, at 10:19 AM, Hans Boehm  wrote:
    > >
    > > That also sounds fine to me.
    > >
    > > The difficulty with applying this, especially in the JNI case, is that
    > you
    > > may need several reachability fences at the end of each method, guarding
    > > parameters and temporaries, not all of which may be naturally in scope at
    > > the end. But we're not going to be able to include a full discussion
    > here.
    > >
    > > In the interest of full disclosure, we currently, at least temporarily,
    > > dodge this issue by inhibiting dead variable elimination for references.
    > >
    > >
    > > On Apr 1, 2017 01:55, "Andrew Haley"  wrote:
    > >
    > > On 31/03/17 19:56, Hans Boehm wrote:
    > >> This method should be used when cleanup actions (finalize() calls, or
    > >> Reference enqueuing, Cleaner invocation) could otherwise be triggered
    > > while
    > >> a resource under control of the object is still in use. This method
    > should
    > >> normally be called when these cleanup facilities are used to perform
    > >> actions other than simply issuing a warning.
    > >
    > > It's still pretty confusing.  It would be simpler to say that
    > > reachabilityFence should be used at the end of every method of a class
    > > which has cleanup actions if you don't want those cleanup actions to
    > > be run before the end of that method.  In that case, reachabilityFence
    > > only makes any difference in cases where otherwise you'd have a bug.
    > >
    > > Andrew.
    >
    >
    
    From martinrb at google.com  Sat Apr 15 17:34:52 2017
    From: martinrb at google.com (Martin Buchholz)
    Date: Sat, 15 Apr 2017 10:34:52 -0700
    Subject: JDK 9 RFR(s): 8177789 fix collections framework links to point to
     java.util package doc
    In-Reply-To: 
    References: 
    Message-ID: 
    
    On Fri, Apr 14, 2017 at 3:36 PM, Stuart Marks 
    wrote:
    
    >
    > Martin,
    >
    > This changeset includes a bunch of changes to java.util.concurrent
    > classes, as well as to files like ArrayDeque which straddle the border
    > between the JDK and the JSR166 repo. How did you want to handle these
    > changes? I could just push this and you could merge upstream, or I could
    > slice off the diffs from selected files and have you put them into JSR166
    > and then merge into the JDK. In any case, the changes are all one-liners,
    > so I don't expect any conflicts. Let me know.
    >
    
    Just commit your changes; they look fine; we will merge into jsr166 CVS.
    
    I have the usual doc-related gripes ... all the docs for openjdk should be
    checked into mercurial so they can be maintained along with the classes
    they document ... @index is new to me; I couldn't find any documentation
    for it.
    
    From aleksej.efimov at oracle.com  Sun Apr 16 22:02:35 2017
    From: aleksej.efimov at oracle.com (Aleks Efimov)
    Date: Mon, 17 Apr 2017 01:02:35 +0300
    Subject: JDK 9 RFR: 8176168: Performance drop due to SAXParser SymbolTable
     reset
    Message-ID: 
    
    Hi,
    
    Please, help to review the fix [1] for a performance regression in 
    SPECjvm2008-XML benchmark. The cause of this regression was the 
    unconditional reset of SAX parsers symbol table during each reset() 
    operation introduced by JDK-8173390.
    Proposed fix introduces new system property (CCC request is still 
    pending approval) that provides ability to control the symbol table 
    reset functionality. By default the reset table functionality is 
    disabled, similar to pre JDK-8173390 behavior. JAXWS parsers pool 
    implementation was updated to utilize new property to reset symbol table 
    only in JAXWS use-cases that helped to restore the performance levels to 
    pre JDK-8173390 level.
    
    Modified regression test and XML related JCK tests passes on build with 
    proposed changes.
    
    With Best Regards,
    Aleksei
    
    [1] http://cr.openjdk.java.net/~aefimov/8176168/00/
    
    From sha.jiang at oracle.com  Mon Apr 17 02:52:58 2017
    From: sha.jiang at oracle.com (sha.jiang at oracle.com)
    Date: Mon, 17 Apr 2017 10:52:58 +0800
    Subject: RFR[9] JDK-8178840: Adds FieldSetAccessibleTest.java and
     VerifyJimage.java to ProblemList
    Message-ID: 
    
    Hi,
    Because of JDK-8178776, 
    java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java and 
    tools/jimage/VerifyJimage.java should be added to ProblemList.
    
    diff -r 9ba6760481a8 test/ProblemList.txt
    --- a/test/ProblemList.txt    Sat Apr 15 16:54:33 2017 -0400
    +++ b/test/ProblemList.txt    Sun Apr 16 19:30:49 2017 -0700
    @@ -124,6 +124,7 @@
      # jdk_lang
    
      java/lang/StringCoding/CheckEncodings.sh 7008363 generic-all
    +java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java 8178776 
    generic-all
    
      jdk/internal/misc/JavaLangAccess/NewUnsafeString.java 8176188 generic-all
    
    @@ -255,6 +256,8 @@
      tools/jimage/JImageListTest.java 8170120 generic-all
      tools/jimage/JImageVerifyTest.java 8170120 generic-all
    
    +tools/jimage/VerifyJimage.java 8178776 generic-all
    +
      ############################################################################
    
      # jdk_jdi
    
    Best regards,
    John Jiang
    
    
    From Alan.Bateman at oracle.com  Mon Apr 17 07:07:13 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Mon, 17 Apr 2017 08:07:13 +0100
    Subject: RFR[9] JDK-8178840: Adds FieldSetAccessibleTest.java and
     VerifyJimage.java to ProblemList
    In-Reply-To: 
    References: 
    Message-ID: 
    
    On 17/04/2017 03:52, sha.jiang at oracle.com wrote:
    
    > Hi,
    > Because of JDK-8178776, 
    > java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java and 
    > tools/jimage/VerifyJimage.java should be added to ProblemList.
    >
    Temporarily excluding these tests for a few days is okay. However, we 
    need to get attention on the real issue, we should never create a 
    run-time image containing types that can't link to their super types.
    
    -Alan
    
    From lance.andersen at oracle.com  Mon Apr 17 15:56:19 2017
    From: lance.andersen at oracle.com (Lance Andersen)
    Date: Mon, 17 Apr 2017 11:56:19 -0400
    Subject: JDK 9 RFR: 8176168: Performance drop due to SAXParser SymbolTable
     reset
    In-Reply-To: 
    References: 
    Message-ID: 
    
    Hi Aleksei,
    
    I think the change makes sense and pending CCC approval should be good to go :-)
    
    Best
    Lance
    > On Apr 16, 2017, at 6:02 PM, Aleks Efimov  wrote:
    > 
    > Hi,
    > 
    > Please, help to review the fix [1] for a performance regression in SPECjvm2008-XML benchmark. The cause of this regression was the unconditional reset of SAX parsers symbol table during each reset() operation introduced by JDK-8173390.
    > Proposed fix introduces new system property (CCC request is still pending approval) that provides ability to control the symbol table reset functionality. By default the reset table functionality is disabled, similar to pre JDK-8173390 behavior. JAXWS parsers pool implementation was updated to utilize new property to reset symbol table only in JAXWS use-cases that helped to restore the performance levels to pre JDK-8173390 level.
    > 
    > Modified regression test and XML related JCK tests passes on build with proposed changes.
    > 
    > With Best Regards,
    > Aleksei
    > 
    > [1] http://cr.openjdk.java.net/~aefimov/8176168/00/
    
     
      
     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 brent.christian at oracle.com  Mon Apr 17 16:05:57 2017
    From: brent.christian at oracle.com (Brent Christian)
    Date: Mon, 17 Apr 2017 09:05:57 -0700
    Subject: JDK 9 RFR(s): 8177789 fix collections framework links to point to
     java.util package doc
    In-Reply-To: 
    References: 
     
    Message-ID: 
    
    On 4/15/17 10:34 AM, Martin Buchholz wrote:
    >@index is new to me; I couldn't find any documentation
    > for it.
    
    @index is part of JEP 225, Javadoc Search (right?)
    
    https://bugs.openjdk.java.net/browse/JDK-8044243
    
    -Brent
    
    From mandy.chung at oracle.com  Mon Apr 17 16:11:20 2017
    From: mandy.chung at oracle.com (Mandy Chung)
    Date: Mon, 17 Apr 2017 09:11:20 -0700
    Subject: RFR[9] JDK-8178840: Adds FieldSetAccessibleTest.java and
     VerifyJimage.java to ProblemList
    In-Reply-To: 
    References: 
     
    Message-ID: <8DA24FCF-52CD-4AC0-9D63-2809DAF0AA6F@oracle.com>
    
    
    > On Apr 17, 2017, at 12:07 AM, Alan Bateman  wrote:
    > 
    > On 17/04/2017 03:52, sha.jiang at oracle.com wrote:
    > 
    >> Hi,
    >> Because of JDK-8178776, java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java and tools/jimage/VerifyJimage.java should be added to ProblemList.
    >> 
    > Temporarily excluding these tests for a few days is okay. However, we need to get attention on the real issue, we should never create a run-time image containing types that can't link to their super types.
    
    Agree.  It?s fine to problem list these tests for a few days and resolve this soon.
    
    Mandy
    
    
    From paul.sandoz at oracle.com  Mon Apr 17 16:54:20 2017
    From: paul.sandoz at oracle.com (Paul Sandoz)
    Date: Mon, 17 Apr 2017 09:54:20 -0700
    Subject: RFR 9: 8165641 : Deprecate Object.finalize
    In-Reply-To: 
    References: 
     <96fe9ae0-993a-aea6-cabf-f079450dc128@Oracle.com>
     <49eb0b85-130a-b74d-e760-120674de6ebc@oracle.com>
     
     
     
     
    Message-ID: <9AAE9B07-868A-4137-AA6E-8DB533F9FB73@oracle.com>
    
    
    > On 15 Apr 2017, at 08:51, Gil Tene  wrote:
    > A few things are keeping the JDK code from evolving to properly use Reference.reachabilityFence(this):
    > 
    > a. It didn't exist until recently. [That's a very good excuse]
    > 
    > b. While Reference.reachabilityFence exists now, it's implementation is sub-optimal. IUUC it is modeled [currently] as an opaque method call, which prohibits enough useful optimizations to significantly hurt DirectByteBuffer.get() if it were actually included in the code right now.
    > 
    
    Correct, reachabilityFence is sort of bodged using @DontInline, which was a fine technique for getting this method in, ok for stuff that ain?t so performance sensitive (many of the use cases?), but not really ok for use within DBB (and for Panama stuff). See:
    
      https://bugs.openjdk.java.net/browse/JDK-8169605 (IMHO the priority should be higher, P4 if not P3)
      https://bugs.openjdk.java.net/browse/JDK-8149610 (more for the comment).
    
    Paul.
    
    From naoto.sato at oracle.com  Mon Apr 17 19:47:51 2017
    From: naoto.sato at oracle.com (Naoto Sato)
    Date: Mon, 17 Apr 2017 12:47:51 -0700
    Subject: [9] RFR: 8177314: java VM fails to start with a Japanese ShiftJIS
     locale
    Message-ID: <6b53e117-7fad-209c-2a87-5d8cd4868bc1@oracle.com>
    
    Hi,
    
    Please review the fix for the following issue:
    
    https://bugs.openjdk.java.net/browse/JDK-8177314
    
    The proposed change is located at:
    
    http://cr.openjdk.java.net/~naoto/8177314/webrev.00/
    
    The change is to move SJIS based encodings into java.base module on 
    Linux so that SJIS locale can be used as the default locale to start the 
    JVM. Although they are not the default locale in Linux distributions, 
    they still seem to be widely used.
    
    Naoto
    
    From kim.barrett at oracle.com  Mon Apr 17 20:47:04 2017
    From: kim.barrett at oracle.com (Kim Barrett)
    Date: Mon, 17 Apr 2017 16:47:04 -0400
    Subject: RFR[9]: 8178832: (ref) jdk.lang.ref.disableClearBeforeEnqueue
     property is ignored
    Message-ID: 
    
    Please review this fix for a bug in JDK-8175797: the mechanism
    provided by that change for reverting to the old behavior of
    Reference.enqueue (for backward compatibility) does not work.
    
    Also fixed the ReferenceEnqueue test changes also made as part of
    JDK-8175797.  That test would havecaught the problem with the property
    but for bugs in the test.
    
    CR:
    https://bugs.openjdk.java.net/browse/JDK-8178832
    
    Webrev:
    http://cr.openjdk.java.net/~kbarrett/8178832/jdk00/
    
    Testing:
    Ran fixed test with unfixed enqueue, and verified expected failure.
    Ran fixed test with fixed enqueue, and verified expected pass.
    
    
    From mandy.chung at oracle.com  Mon Apr 17 20:53:16 2017
    From: mandy.chung at oracle.com (Mandy Chung)
    Date: Mon, 17 Apr 2017 13:53:16 -0700
    Subject: RFR[9]: 8178832: (ref) jdk.lang.ref.disableClearBeforeEnqueue
     property is ignored
    In-Reply-To: 
    References: 
    Message-ID: <91D4AA88-F7FD-4268-B178-1C74B2CC9F47@oracle.com>
    
    
    > On Apr 17, 2017, at 1:47 PM, Kim Barrett  wrote:
    > 
    > Please review this fix for a bug in JDK-8175797: the mechanism
    > provided by that change for reverting to the old behavior of
    > Reference.enqueue (for backward compatibility) does not work.
    > 
    > Also fixed the ReferenceEnqueue test changes also made as part of
    > JDK-8175797.  That test would havecaught the problem with the property
    > but for bugs in the test.
    > 
    > CR:
    > https://bugs.openjdk.java.net/browse/JDK-8178832
    > 
    > Webrev:
    > http://cr.openjdk.java.net/~kbarrett/8178832/jdk00/
    
    Looks good.  Thanks for catching this and the typo in the test.
    
    Mandy
    
    From xueming.shen at oracle.com  Mon Apr 17 20:51:15 2017
    From: xueming.shen at oracle.com (Xueming Shen)
    Date: Mon, 17 Apr 2017 13:51:15 -0700
    Subject: [9] RFR: 8177314: java VM fails to start with a Japanese ShiftJIS
     locale
    In-Reply-To: <6b53e117-7fad-209c-2a87-5d8cd4868bc1@oracle.com>
    References: <6b53e117-7fad-209c-2a87-5d8cd4868bc1@oracle.com>
    Message-ID: <58F52AC3.5060605@oracle.com>
    
    looks fine.
    
    On 04/17/2017 12:47 PM, Naoto Sato wrote:
    > Hi,
    >
    > Please review the fix for the following issue:
    >
    > https://bugs.openjdk.java.net/browse/JDK-8177314
    >
    > The proposed change is located at:
    >
    > http://cr.openjdk.java.net/~naoto/8177314/webrev.00/
    >
    > The change is to move SJIS based encodings into java.base module on Linux so that SJIS locale can be used as the default locale to start the JVM. Although they are not the default locale in Linux distributions, they still seem to be widely used.
    >
    > Naoto
    
    
    From mandy.chung at oracle.com  Mon Apr 17 21:08:56 2017
    From: mandy.chung at oracle.com (Mandy Chung)
    Date: Mon, 17 Apr 2017 14:08:56 -0700
    Subject: [9] RFR: 8177314: java VM fails to start with a Japanese ShiftJIS
     locale
    In-Reply-To: <6b53e117-7fad-209c-2a87-5d8cd4868bc1@oracle.com>
    References: <6b53e117-7fad-209c-2a87-5d8cd4868bc1@oracle.com>
    Message-ID: <2652CD4B-BEF6-4E80-B2E6-FC50D5A1262C@oracle.com>
    
    
    > On Apr 17, 2017, at 12:47 PM, Naoto Sato  wrote:
    > 
    > Hi,
    > 
    > Please review the fix for the following issue:
    > 
    > https://bugs.openjdk.java.net/browse/JDK-8177314
    > 
    > The proposed change is located at:
    > 
    > http://cr.openjdk.java.net/~naoto/8177314/webrev.00/
    
    Looks fine.  Just curious - how much does this add to java.base size?
    
    Mandy
    
    From naoto.sato at oracle.com  Mon Apr 17 21:28:50 2017
    From: naoto.sato at oracle.com (Naoto Sato)
    Date: Mon, 17 Apr 2017 14:28:50 -0700
    Subject: [9] RFR: 8177314: java VM fails to start with a Japanese ShiftJIS
     locale
    In-Reply-To: <2652CD4B-BEF6-4E80-B2E6-FC50D5A1262C@oracle.com>
    References: <6b53e117-7fad-209c-2a87-5d8cd4868bc1@oracle.com>
     <2652CD4B-BEF6-4E80-B2E6-FC50D5A1262C@oracle.com>
    Message-ID: <50a40205-498f-e5f7-78ac-e14711a1ebef@oracle.com>
    
    On 04/17/2017 02:08 PM, Mandy Chung wrote:
    
    > Looks fine.  Just curious - how much does this add to java.base size?
    >
    > Mandy
    >
    
    On my test build, these two classes are now moved into java.base from 
    jdk.charset:
    
    -rw-r--r-- 1 nsato wheel 26711 Apr 17 14:25 SJIS.class
    -rw-r--r-- 1 nsato wheel 38385 Apr 17 14:25 MS932.class
    
    Naoto
    
    From mandy.chung at oracle.com  Mon Apr 17 21:39:52 2017
    From: mandy.chung at oracle.com (Mandy Chung)
    Date: Mon, 17 Apr 2017 14:39:52 -0700
    Subject: [9] RFR: 8177314: java VM fails to start with a Japanese ShiftJIS
     locale
    In-Reply-To: <50a40205-498f-e5f7-78ac-e14711a1ebef@oracle.com>
    References: <6b53e117-7fad-209c-2a87-5d8cd4868bc1@oracle.com>
     <2652CD4B-BEF6-4E80-B2E6-FC50D5A1262C@oracle.com>
     <50a40205-498f-e5f7-78ac-e14711a1ebef@oracle.com>
    Message-ID: <19F8B59C-084D-46DA-A853-A323BCA077D5@oracle.com>
    
    
    > On Apr 17, 2017, at 2:28 PM, Naoto Sato  wrote:
    > 
    > On 04/17/2017 02:08 PM, Mandy Chung wrote:
    > 
    >> Looks fine.  Just curious - how much does this add to java.base size?
    >> 
    >> Mandy
    >> 
    > 
    > On my test build, these two classes are now moved into java.base from jdk.charset:
    > 
    > -rw-r--r-- 1 nsato wheel 26711 Apr 17 14:25 SJIS.class
    > -rw-r--r-- 1 nsato wheel 38385 Apr 17 14:25 MS932.class
    
    Good to know. Thanks.
    
    Mandy
    
    
    From stuart.marks at oracle.com  Mon Apr 17 23:01:09 2017
    From: stuart.marks at oracle.com (Stuart Marks)
    Date: Mon, 17 Apr 2017 16:01:09 -0700
    Subject: JDK 9 RFR(s): 8177789 fix collections framework links to point to
     java.util package doc
    In-Reply-To: 
    References: 
     
    Message-ID: 
    
    
    
    On 4/15/17 10:34 AM, Martin Buchholz wrote:
    > Just commit your changes; they look fine; we will merge into jsr166 CVS.
    
    OK, will do, thanks.
    
    > I have the usual doc-related gripes ... all the docs for openjdk should be
    > checked into mercurial so they can be maintained along with the classes they
    > document
    
    Yeah, docs are a problem, as usual. There is some progress, though. See JEP 299 
    [1] which proposes to reorganize the docs from the "brick wall" diagram. At 
    least the various specification documents buried under here (e.g., JNI, 
    Serialization, ..., but not JVMS & JLS) will end up in OpenJDK. Various bits of 
    docs about component technologies will also be moved into OpenJDK, as I've 
    proposed to do for collections with JDK-8177788.
    
    s'marks
    
    [1] http://openjdk.java.net/jeps/299
    
    
    From Alan.Bateman at oracle.com  Tue Apr 18 07:42:09 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Tue, 18 Apr 2017 08:42:09 +0100
    Subject: [9] RFR: 8177314: java VM fails to start with a Japanese ShiftJIS
     locale
    In-Reply-To: <6b53e117-7fad-209c-2a87-5d8cd4868bc1@oracle.com>
    References: <6b53e117-7fad-209c-2a87-5d8cd4868bc1@oracle.com>
    Message-ID: <2f5efafc-8860-1d7c-8105-88c20ad606c5@oracle.com>
    
    On 17/04/2017 20:47, Naoto Sato wrote:
    
    > Hi,
    >
    > Please review the fix for the following issue:
    >
    > https://bugs.openjdk.java.net/browse/JDK-8177314
    >
    > The proposed change is located at:
    >
    > http://cr.openjdk.java.net/~naoto/8177314/webrev.00/
    >
    > The change is to move SJIS based encodings into java.base module on 
    > Linux so that SJIS locale can be used as the default locale to start 
    > the JVM. Although they are not the default locale in Linux 
    > distributions, they still seem to be widely used.
    Looks good. Is there anything to check into on other platforms or is 
    this just a Linux only concern.
    
    -Alan
    
    From claes.redestad at oracle.com  Tue Apr 18 12:28:27 2017
    From: claes.redestad at oracle.com (Claes Redestad)
    Date: Tue, 18 Apr 2017 14:28:27 +0200
    Subject: RFR: 8178889: Move creation of AbstractChronology comparators to call
     sites
    Message-ID: <8b9e41a9-69ae-6d38-bf01-ef7351d5a031@oracle.com>
    
    Hi,
    
    in AbstractChronology we define a number of comparators which could be 
    moved to their
    respective call site and thus be lazily initialized when needed with no 
    performance
    penalty.
    
    Bug: https://bugs.openjdk.java.net/browse/JDK-8178889
    Webrev: http://cr.openjdk.java.net/~redestad/8178889/jdk.01/
    
    Testing/analysis:
    - naive micro to show this doesn't cause a regression in steady 
    state[1], for those in
    doubt
    - reduces executed bytecode by ~127K and drops 5 generated classes from 
    startup of
    applications that depend on AbstractChronology but don't use any of 
    these comparators
    - pass all java/time tests
    
    Thanks!
    
    /Claes
    
    [1]
    package org.openjdk;
    import org.openjdk.jmh.annotations.Benchmark;
    import java.time.chrono.*;
    import java.lang.reflect.*;
    
    public class ChronoComparatorBench {
    
         public static Method timeLineOrder;
    
         static {
             try {
                 timeLineOrder = 
    ChronoLocalDate.class.getDeclaredMethod("timeLineOrder");
             } catch (Exception e) {
                 throw new RuntimeException(e);
             }
         }
    
         @Benchmark
         public Object getComparator() throws Exception {
             return timeLineOrder.invoke(null);
         }
    }
    
    -f 1 -tu us -bm avgt
    
    Benchmark                            Mode  Cnt  Score   Error Units
    ChronoComparatorBench.getComparator  avgt   20 5.979 ? 0.067  ns/op  # 
    before
    ChronoComparatorBench.getComparator  avgt   20 5.975 ? 0.054  ns/op  # after
    
    From Roger.Riggs at Oracle.com  Tue Apr 18 15:00:17 2017
    From: Roger.Riggs at Oracle.com (Roger Riggs)
    Date: Tue, 18 Apr 2017 11:00:17 -0400
    Subject: RFR: 8178889: Move creation of AbstractChronology comparators to
     call sites
    In-Reply-To: <8b9e41a9-69ae-6d38-bf01-ef7351d5a031@oracle.com>
    References: <8b9e41a9-69ae-6d38-bf01-ef7351d5a031@oracle.com>
    Message-ID: <2b8b6023-3224-bbed-649c-18acebe1ed85@Oracle.com>
    
    Hi Claes,
    
    Looks fine
    
    Roger
    
    On 4/18/2017 8:28 AM, Claes Redestad wrote:
    > Hi,
    >
    > in AbstractChronology we define a number of comparators which could be 
    > moved to their
    > respective call site and thus be lazily initialized when needed with 
    > no performance
    > penalty.
    >
    > Bug: https://bugs.openjdk.java.net/browse/JDK-8178889
    > Webrev: http://cr.openjdk.java.net/~redestad/8178889/jdk.01/
    >
    > Testing/analysis:
    > - naive micro to show this doesn't cause a regression in steady 
    > state[1], for those in
    > doubt
    > - reduces executed bytecode by ~127K and drops 5 generated classes 
    > from startup of
    > applications that depend on AbstractChronology but don't use any of 
    > these comparators
    > - pass all java/time tests
    >
    > Thanks!
    >
    > /Claes
    >
    > [1]
    > package org.openjdk;
    > import org.openjdk.jmh.annotations.Benchmark;
    > import java.time.chrono.*;
    > import java.lang.reflect.*;
    >
    > public class ChronoComparatorBench {
    >
    >     public static Method timeLineOrder;
    >
    >     static {
    >         try {
    >             timeLineOrder = 
    > ChronoLocalDate.class.getDeclaredMethod("timeLineOrder");
    >         } catch (Exception e) {
    >             throw new RuntimeException(e);
    >         }
    >     }
    >
    >     @Benchmark
    >     public Object getComparator() throws Exception {
    >         return timeLineOrder.invoke(null);
    >     }
    > }
    >
    > -f 1 -tu us -bm avgt
    >
    > Benchmark                            Mode  Cnt  Score   Error Units
    > ChronoComparatorBench.getComparator  avgt   20 5.979 ? 0.067 ns/op  # 
    > before
    > ChronoComparatorBench.getComparator  avgt   20 5.975 ? 0.054 ns/op  # 
    > after
    
    
    From naoto.sato at oracle.com  Tue Apr 18 15:48:09 2017
    From: naoto.sato at oracle.com (Naoto Sato)
    Date: Tue, 18 Apr 2017 08:48:09 -0700
    Subject: [9] RFR: 8177314: java VM fails to start with a Japanese ShiftJIS
     locale
    In-Reply-To: <2f5efafc-8860-1d7c-8105-88c20ad606c5@oracle.com>
    References: <6b53e117-7fad-209c-2a87-5d8cd4868bc1@oracle.com>
     <2f5efafc-8860-1d7c-8105-88c20ad606c5@oracle.com>
    Message-ID: 
    
    Hi Alan,
    
    On 4/18/17 12:42 AM, Alan Bateman wrote:
    >> The change is to move SJIS based encodings into java.base module on
    >> Linux so that SJIS locale can be used as the default locale to start
    >> the JVM. Although they are not the default locale in Linux
    >> distributions, they still seem to be widely used.
    > Looks good. Is there anything to check into on other platforms or is
    > this just a Linux only concern.
    
    Java runtime for Windows already includes SJIS in java.base so there 
    should be no issue there. I don't see any convincing reason for 
    macOS/Solaris to have SJIS in java.base, as Solaris has PCK which is 
    SJIS equivalent, and macOS has been using UTF-8 as the default at least 
    since MacOSX was released.
    
    Naoto
    
    From volker.simonis at gmail.com  Tue Apr 18 17:44:37 2017
    From: volker.simonis at gmail.com (Volker Simonis)
    Date: Tue, 18 Apr 2017 19:44:37 +0200
    Subject: [9] RFR(S): 8178726: Can't load classes from classpath if it is a
     UNC share
    In-Reply-To: <4067cfb5-a01c-73e3-7f5d-c4d729830b28@oracle.com>
    References: 
     <2a1ec694-f3d4-ca25-a08c-36b7d3511bdf@oracle.com>
     <4067cfb5-a01c-73e3-7f5d-c4d729830b28@oracle.com>
    Message-ID: 
    
    Hi Alan, Chris,
    
    thanks for your help and feedback.
    It seems my fix was indeed "too optimistic". I've only briefly looked into
    the errors reported by Chris. The first one is due to a cyclic dependency
    between Paths.get() and FileSystems.getDefault().
    
    So I've finally decided to go with Alan's proposal which is probably the
    least invasive one:
    
    http://cr.openjdk.java.net/~simonis/webrevs/2017/8178726.v1/
    
    It would be great if someone could verify this new version once again by
    running it through JPRT (I've verified that the reported problems don't
    occur any more, but who knows :)
    
    Thank you and best regards,
    Volker
    
    
    On Fri, Apr 14, 2017 at 3:13 PM, Alan Bateman 
    wrote:
    
    > On 14/04/2017 14:02, Chris Hegarty wrote:
    >
    >
    >> I know that Alan has provided some comments on this, but I just
    >> grabbed your patch and sent it through our internal build and test
    >> system. I observed a few failures:
    >>
    > Yes, I think URLClassLoader will be broken (Max is right, I forgot that
    > URLClassPath is essentially the implementation of URLClassLoader).
    >
    > I think Volker will need to change this so that
    > ClassLoaders.toFileURL(String) uses toFile().toURI().toURL(). That will
    > ensure that URLClassPath doesn't get URLs with the server name in the
    > authority component.
    >
    > -Alan
    >
    
    From Roger.Riggs at Oracle.com  Tue Apr 18 17:48:28 2017
    From: Roger.Riggs at Oracle.com (Roger Riggs)
    Date: Tue, 18 Apr 2017 13:48:28 -0400
    Subject: RFR [9] 8177738: Runtime.Version must be a value-based class
    In-Reply-To: <4547C274-290D-442F-BBD6-AB7E7837936A@oracle.com>
    References: 
     
     <23774589-8C1C-4BA1-B5E8-4A25BCF58560@oracle.com>
     <4547C274-290D-442F-BBD6-AB7E7837936A@oracle.com>
    Message-ID: 
    
    Hi Pavel,
    
    These changes look fine.
    
    I think you can update the JEP to match the updated patterns mentioned 
    below.
    
    Regards, Roger
    
    
    On 4/3/2017 7:50 PM, Paul Sandoz wrote:
    >> On 3 Apr 2017, at 16:40, Pavel Rappo  wrote:
    >>
    >>
    >>> On 3 Apr 2017, at 20:39, Paul Sandoz  wrote:
    >>>
    >>> Hi,
    >>>
    >>> 962 * [1-9][0-9]*((\.0)*\.[1-9][0-9]*)*
    >>>
    >>> You removed the initial ?^? which is still mentioned in JDK-8148822
    >>>
    >>> < `^[1-9][0-9]*(((\.0)*\.[1-9][0-9]*)*)*$`. The sequence may be of arbitrary
    >>> ---
    >>>> `^[1-9][0-9]*((\.0)*\.[1-9][0-9]*)*$`. The sequence may be of arbitrary
    >>> JEP 223 is still using the former. Which is correct?
    >> The patch from the thread [1] I referred to in my previous email removes ^ and $.
    >> So in this case I simply reused the patch and, once again [2], I do agree this
    >> is an odd place to use boundary matchers, given $VNUM is only a prefix in $VSTR
    >> and not the whole regex.
    >>
    >> As for the JEP question, it's more for original designers/authors. If we agree
    >> on it I will update the JEP.
    >>
    > Ok, no objections, i was just unsure as to which was the proposed authoritative answer. Perhaps for the record you should also update the description of JDK-8148822?
    >
    >
    >>> Since Version is now value based i think you need to check where it?s identity is used and replace with equals (which means ensuring that equals is efficient and could use identity under the covers). See usages in JarFile.
    >> Will do, thanks!
    >>
    >>> ?
    >>>
    >>> Separately i wish we could avoid using List as the internal representation, it?s very inefficient, int[] is much better, the cost is then on the version() method but it?s easy to create an immutable List wrapping the array. (I logged an issue for that, but cannot remember the number.)
    >> What are you concerns specifically?
    > It?s just not particularly efficient to box int to Integer into a List on the heap esp for the expected number of version components, and i suspect the version() method probably not something that will often be called, so taking a hit there with a AbstractList wrapper is fine. It?s quite a simple change, esp. with the the foundation you have set up, so seems worthwhile (separate issue, not this one).
    >
    > Paul.
    >
    >
    >> The startup time?
    >> The amount of simultaneously existing Version objects at runtime?
    >> The use of `Integer` wrapper?
    >>
    >> --------------------------------------------------------------------------------
    >> [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-October/044277.html
    >> [2] http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-March/046941.html
    >>
    >>
    
    
    From alexandre.iline at oracle.com  Tue Apr 18 18:19:45 2017
    From: alexandre.iline at oracle.com (Alexandre (Shura) Iline)
    Date: Tue, 18 Apr 2017 11:19:45 -0700
    Subject: RFR: 8178910 Problemlist sample tests
    Message-ID: <4E80B9C3-5C79-4FCD-B84F-22AFC8E88639@oracle.com>
    
    Hi.
    
    Could you please review a quick fix to temporarily disable a couple of tests:
    
    $ hg diff ProblemList.txt 
    diff --git a/test/ProblemList.txt b/test/ProblemList.txt
    --- a/test/ProblemList.txt
    +++ b/test/ProblemList.txt
    @@ -308,4 +308,7 @@
     
     org/omg/CORBA/OrbPropertiesTest.java			        8175177 generic-all
     
    +sample/mergesort/MergeSortTest.java				8178912 generic-all
    +sample/chatserver/ChatTest.java					8178912 generic-all
    +
     ############################################################################
    $
    
    Thank you.
    
    Shura
    
    
    From joe.darcy at oracle.com  Tue Apr 18 18:22:28 2017
    From: joe.darcy at oracle.com (joe darcy)
    Date: Tue, 18 Apr 2017 11:22:28 -0700
    Subject: RFR: 8178910 Problemlist sample tests
    In-Reply-To: <4E80B9C3-5C79-4FCD-B84F-22AFC8E88639@oracle.com>
    References: <4E80B9C3-5C79-4FCD-B84F-22AFC8E88639@oracle.com>
    Message-ID: <139fb042-6af5-a56f-3876-791843d99402@oracle.com>
    
    Looks fine Shura; thanks,
    
    -Joe
    
    
    On 4/18/2017 11:19 AM, Alexandre (Shura) Iline wrote:
    > Hi.
    >
    > Could you please review a quick fix to temporarily disable a couple of tests:
    >
    > $ hg diff ProblemList.txt
    > diff --git a/test/ProblemList.txt b/test/ProblemList.txt
    > --- a/test/ProblemList.txt
    > +++ b/test/ProblemList.txt
    > @@ -308,4 +308,7 @@
    >   
    >   org/omg/CORBA/OrbPropertiesTest.java			        8175177 generic-all
    >   
    > +sample/mergesort/MergeSortTest.java				8178912 generic-all
    > +sample/chatserver/ChatTest.java					8178912 generic-all
    > +
    >   ############################################################################
    > $
    >
    > Thank you.
    >
    > Shura
    >
    
    
    From lance.andersen at oracle.com  Tue Apr 18 18:26:00 2017
    From: lance.andersen at oracle.com (Lance Andersen)
    Date: Tue, 18 Apr 2017 14:26:00 -0400
    Subject: RFR: 8178910 Problemlist sample tests
    In-Reply-To: <4E80B9C3-5C79-4FCD-B84F-22AFC8E88639@oracle.com>
    References: <4E80B9C3-5C79-4FCD-B84F-22AFC8E88639@oracle.com>
    Message-ID: <31A01CA7-686D-45B2-877C-BE17843A0733@oracle.com>
    
    +1
    > On Apr 18, 2017, at 2:19 PM, Alexandre (Shura) Iline  wrote:
    > 
    > Hi.
    > 
    > Could you please review a quick fix to temporarily disable a couple of tests:
    > 
    > $ hg diff ProblemList.txt 
    > diff --git a/test/ProblemList.txt b/test/ProblemList.txt
    > --- a/test/ProblemList.txt
    > +++ b/test/ProblemList.txt
    > @@ -308,4 +308,7 @@
    > 
    > org/omg/CORBA/OrbPropertiesTest.java			        8175177 generic-all
    > 
    > +sample/mergesort/MergeSortTest.java				8178912 generic-all
    > +sample/chatserver/ChatTest.java					8178912 generic-all
    > +
    > ############################################################################
    > $
    > 
    > Thank you.
    > 
    > Shura
    > 
    
     
      
     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 kumar.x.srinivasan at oracle.com  Tue Apr 18 18:39:08 2017
    From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan)
    Date: Tue, 18 Apr 2017 11:39:08 -0700
    Subject: RFR: 8076417: Update test/jdk/asm/AsmSanity.java with modules
    Message-ID: <58F65D4C.9000707@oracle.com>
    
    Hello,
    
    Please review [1] which addresses bug [2]. This test is unnecessary, as 
    there
    are other components and tests within the jdk, which will fail if ASM
    is not included, therefore this test is  removed.
    
    Thanks
    Kumar
    
    [1] http://cr.openjdk.java.net/~ksrini/8076417/webrev.00/
    [2] https://bugs.openjdk.java.net/browse/JDK-8076417
    
    From stuart.marks at oracle.com  Wed Apr 19 01:23:24 2017
    From: stuart.marks at oracle.com (Stuart Marks)
    Date: Tue, 18 Apr 2017 18:23:24 -0700
    Subject: JDK 9 RFR(s): 8167981: Optional: add notes explaining intended use
    Message-ID: <247a3b98-3304-97a9-3a49-23d81350b3bc@oracle.com>
    
    Hi all,
    
    Please review this small set of non-normative documentation changes for 
    java.util.Optional and related classes.
    
    The notes describe the primary intent of Optional to be used as a return value, 
    and recommend avoiding using null as the value of a variable of Optional type. 
    Also, a note is added to get() directing readers to look at orElse() and 
    orElseGet().
    
    Corresponding changes are also made to the primitive specializations 
    OptionalDouble, OptionalInt, and OptionalLong.
    
    Bug:
    	https://bugs.openjdk.java.net/browse/JDK-8167981
    
    Webrev:
    	http://cr.openjdk.java.net/~smarks/reviews/8167981/webrev.0/
    
    Thanks,
    
    s'marks
    
    From sundararajan.athijegannathan at oracle.com  Wed Apr 19 02:54:23 2017
    From: sundararajan.athijegannathan at oracle.com (Sundararajan Athijegannathan)
    Date: Wed, 19 Apr 2017 08:24:23 +0530
    Subject: RFR: 8076417: Update test/jdk/asm/AsmSanity.java with modules
    In-Reply-To: <58F65D4C.9000707@oracle.com>
    References: <58F65D4C.9000707@oracle.com>
    Message-ID: <58F6D15F.7020402@oracle.com>
    
    +1
    
    -Sundar
    
    On 19/04/17, 12:09 AM, Kumar Srinivasan wrote:
    > Hello,
    >
    > Please review [1] which addresses bug [2]. This test is unnecessary, 
    > as there
    > are other components and tests within the jdk, which will fail if ASM
    > is not included, therefore this test is  removed.
    >
    > Thanks
    > Kumar
    >
    > [1] http://cr.openjdk.java.net/~ksrini/8076417/webrev.00/
    > [2] https://bugs.openjdk.java.net/browse/JDK-8076417
    
    From martinrb at google.com  Wed Apr 19 03:29:52 2017
    From: martinrb at google.com (Martin Buchholz)
    Date: Tue, 18 Apr 2017 20:29:52 -0700
    Subject: JDK 9 RFR(s): 8167981: Optional: add notes explaining intended use
    In-Reply-To: <247a3b98-3304-97a9-3a49-23d81350b3bc@oracle.com>
    References: <247a3b98-3304-97a9-3a49-23d81350b3bc@oracle.com>
    Message-ID: 
    
    +     * The methods {@link #orElse(java.lang.Object) orElse()} and
    
    It's sad that in 2017 we still can't write
    {@link #orElse(T)}
    ... but ... we can and should write
    {@link #orElse(Object) orElse(T)}
    making the source and html more readable (orElse is not nullary)
    
    + * {@code OptionalDouble} is primarily intended for use as a method return
    type where
    + * there is a clear need to represent "no result," and where using {@code
    null}
    + * is likely to cause errors. A variable whose type is {@code
    OptionalDouble} should
    
    The obvious alternative to returning OptionalDouble is returning double,
    where null is not possible. I would elide """and where using {@code null}
    + * is likely to cause errors""" unless you want to explicitly compare with
    the alternative of returning Double,not double.
    
    (More generally, it seems like Optional would have more value if there was
    compiler enforcement of its never-null-ness.)
    
    
    On Tue, Apr 18, 2017 at 6:23 PM, Stuart Marks 
    wrote:
    
    > Hi all,
    >
    > Please review this small set of non-normative documentation changes for
    > java.util.Optional and related classes.
    >
    > The notes describe the primary intent of Optional to be used as a return
    > value, and recommend avoiding using null as the value of a variable of
    > Optional type. Also, a note is added to get() directing readers to look at
    > orElse() and orElseGet().
    >
    > Corresponding changes are also made to the primitive specializations
    > OptionalDouble, OptionalInt, and OptionalLong.
    >
    > Bug:
    >         https://bugs.openjdk.java.net/browse/JDK-8167981
    >
    > Webrev:
    >         http://cr.openjdk.java.net/~smarks/reviews/8167981/webrev.0/
    >
    > Thanks,
    >
    > s'marks
    >
    
    From amy.lu at oracle.com  Wed Apr 19 03:32:22 2017
    From: amy.lu at oracle.com (Amy Lu)
    Date: Wed, 19 Apr 2017 11:32:22 +0800
    Subject: RFR: 8076417: Update test/jdk/asm/AsmSanity.java with modules
    In-Reply-To: <58F65D4C.9000707@oracle.com>
    References: <58F65D4C.9000707@oracle.com>
    Message-ID: <59658d95-45d5-6f84-b478-23b4250b3ce5@oracle.com>
    
    Hi, Kumar
    
    As the removed test is the only one test under jdk/asm, it needs to be 
    removed from jdk_other test group:
    
    --- a/test/TEST.groups
    +++ b/test/TEST.groups
    @@ -269,7 +269,6 @@
          javax/transaction \
          javax/xml \
          -javax/xml/crypto \
    -    jdk/asm \
    
    
    Thanks,
    Amy
    
    On 4/19/17 2:39 AM, Kumar Srinivasan wrote:
    > Hello,
    >
    > Please review [1] which addresses bug [2]. This test is unnecessary, 
    > as there
    > are other components and tests within the jdk, which will fail if ASM
    > is not included, therefore this test is  removed.
    >
    > Thanks
    > Kumar
    >
    > [1] http://cr.openjdk.java.net/~ksrini/8076417/webrev.00/
    > [2] https://bugs.openjdk.java.net/browse/JDK-8076417
    
    
    From Sunny.Chan at gs.com  Wed Apr 19 04:44:20 2017
    From: Sunny.Chan at gs.com (Chan, Sunny)
    Date: Wed, 19 Apr 2017 04:44:20 +0000
    Subject: "unsafe" instances in sun.nio.fs.WindowsFileSystem
    Message-ID: <7540281ca3c7401c8de96b2cf7b11faa@gsdghkp03etn1.firmwide.corp.gs.com>
    
    While reading the code for sun.nio.fs.WindowsFileSystemProvider and sun.nio.fs.WindowsUserDefinedFileAttributeView, I noticed that there is a private static variable to the Unsafe instance but it doesn't seems to be used anywhere in the code - am I missing something here or should I propose a patch to remove them?
    
    Sunny Chan
    Executive Director
    Technology
    
    Goldman Sachs (Asia) L.L.C. | 39th Floor | The Center | 99 Queens Road Central | Hong Kong
    Email:  sunny.chan at gs.com | Tel: +852 2978 6481 | Fax: +852 2978 0633
    
    Learn more about Goldman Sachs
    GS.com | Blog | LinkedIn | YouTube | Twitter
    
    This message may contain information that is confidential or privileged.  If you are not the intended recipient, please advise the sender immediately and delete this message.  See http://www.gs.com/disclaimer/email for further information on confidentiality and the risks inherent in electronic communication.
    
    
    From Alan.Bateman at oracle.com  Wed Apr 19 06:44:05 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Wed, 19 Apr 2017 07:44:05 +0100
    Subject: "unsafe" instances in sun.nio.fs.WindowsFileSystem
    In-Reply-To: <7540281ca3c7401c8de96b2cf7b11faa@gsdghkp03etn1.firmwide.corp.gs.com>
    References: <7540281ca3c7401c8de96b2cf7b11faa@gsdghkp03etn1.firmwide.corp.gs.com>
    Message-ID: <00694934-e867-30a6-efde-714979d336c7@oracle.com>
    
    On 19/04/2017 05:44, Chan, Sunny wrote:
    
    > While reading the code for sun.nio.fs.WindowsFileSystemProvider and sun.nio.fs.WindowsUserDefinedFileAttributeView, I noticed that there is a private static variable to the Unsafe instance but it doesn't seems to be used anywhere in the code - am I missing something here or should I propose a patch to remove them?
    >
    I suspect these are left over from past refactoring and shouldn't be an 
    issue removing them.
    
    -Alan
    
    From Alan.Bateman at oracle.com  Wed Apr 19 07:03:57 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Wed, 19 Apr 2017 08:03:57 +0100
    Subject: [9] RFR(S): 8178726: Can't load classes from classpath if it is a
     UNC share
    In-Reply-To: 
    References: 
     <2a1ec694-f3d4-ca25-a08c-36b7d3511bdf@oracle.com>
     <4067cfb5-a01c-73e3-7f5d-c4d729830b28@oracle.com>
     
    Message-ID: 
    
    On 18/04/2017 18:44, Volker Simonis wrote:
    
    > Hi Alan, Chris,
    >
    > thanks for your help and feedback.
    > It seems my fix was indeed "too optimistic". I've only briefly looked 
    > into the errors reported by Chris. The first one is due to a cyclic 
    > dependency between Paths.get() and FileSystems.getDefault().
    >
    > So I've finally decided to go with Alan's proposal which is probably 
    > the least invasive one:
    >
    > http://cr.openjdk.java.net/~simonis/webrevs/2017/8178726.v1/ 
    > 
    >
    > It would be great if someone could verify this new version once again 
    > by running it through JPRT (I've verified that the reported problems 
    > don't occur any more, but who knows :)
    I ran it through the build+test system and don't see any issues. It's 
    great that you found this issue before GA, I suspect testing with a 
    directory of .class files on a UNC isn't too common (for performance 
    reasons) which is why it wasn't noticed (the issue has been in JDK 9 for 
    more than a year).
    
    One additional suggestion is to include a comment, something like:
    
    // use File::toURL as URLClassPath can't handle URLs with a UNC
    // server name in the authority component
    
    as it won't be immediately clear to readers why the toFile() is needed 
    in the chain.
    
    -Alan
    
    From peter.levart at gmail.com  Wed Apr 19 09:02:31 2017
    From: peter.levart at gmail.com (Peter Levart)
    Date: Wed, 19 Apr 2017 11:02:31 +0200
    Subject: RFR[9]: 8178832: (ref) jdk.lang.ref.disableClearBeforeEnqueue
     property is ignored
    In-Reply-To: <91D4AA88-F7FD-4268-B178-1C74B2CC9F47@oracle.com>
    References: 
     <91D4AA88-F7FD-4268-B178-1C74B2CC9F47@oracle.com>
    Message-ID: <69c4ee3b-bea7-cdb6-97f4-c8e428bed1fd@gmail.com>
    
    Hi Mandy, Kim,
    
    On 04/17/2017 10:53 PM, Mandy Chung wrote:
    >> On Apr 17, 2017, at 1:47 PM, Kim Barrett  wrote:
    >>
    >> Please review this fix for a bug in JDK-8175797: the mechanism
    >> provided by that change for reverting to the old behavior of
    >> Reference.enqueue (for backward compatibility) does not work.
    >>
    >> Also fixed the ReferenceEnqueue test changes also made as part of
    >> JDK-8175797.  That test would havecaught the problem with the property
    >> but for bugs in the test.
    >>
    >> CR:
    >> https://bugs.openjdk.java.net/browse/JDK-8178832
    >>
    >> Webrev:
    >> http://cr.openjdk.java.net/~kbarrett/8178832/jdk00/
    > Looks good.  Thanks for catching this and the typo in the test.
    >
    > Mandy
    
    I wonder if there are (or will be) other places where such silent 
    swallowing of run-time exceptions happens or will happen. Wouldn't it be 
    good to "fix" Boolean.getBoolean() and friends?
    
    I filed the following bug to track this:
    
    https://bugs.openjdk.java.net/browse/JDK-8178966
    
    Regards, Peter
    
    
    From volker.simonis at gmail.com  Wed Apr 19 09:18:59 2017
    From: volker.simonis at gmail.com (Volker Simonis)
    Date: Wed, 19 Apr 2017 11:18:59 +0200
    Subject: [9] RFR(S): 8178726: Can't load classes from classpath if it is a
     UNC share
    In-Reply-To: 
    References: 
     <2a1ec694-f3d4-ca25-a08c-36b7d3511bdf@oracle.com>
     <4067cfb5-a01c-73e3-7f5d-c4d729830b28@oracle.com>
     
     
    Message-ID: 
    
    On Wed, Apr 19, 2017 at 9:03 AM, Alan Bateman  wrote:
    > On 18/04/2017 18:44, Volker Simonis wrote:
    >
    > Hi Alan, Chris,
    >
    > thanks for your help and feedback.
    > It seems my fix was indeed "too optimistic". I've only briefly looked into
    > the errors reported by Chris. The first one is due to a cyclic dependency
    > between Paths.get() and FileSystems.getDefault().
    >
    > So I've finally decided to go with Alan's proposal which is probably the
    > least invasive one:
    >
    > http://cr.openjdk.java.net/~simonis/webrevs/2017/8178726.v1/
    >
    > It would be great if someone could verify this new version once again by
    > running it through JPRT (I've verified that the reported problems don't
    > occur any more, but who knows :)
    >
    > I ran it through the build+test system and don't see any issues. It's great
    > that you found this issue before GA, I suspect testing with a directory of
    > .class files on a UNC isn't too common (for performance reasons) which is
    > why it wasn't noticed (the issue has been in JDK 9 for more than a year).
    >
    > One additional suggestion is to include a comment, something like:
    >
    > // use File::toURL as URLClassPath can't handle URLs with a UNC
    > // server name in the authority component
    >
    > as it won't be immediately clear to readers why the toFile() is needed in
    > the chain.
    
    That's a good suggestion. I've updated the patch with a slightly
    modified comment:
    
    // Use an intermediate File object to construct a URI/URL without
    // authority component as URLClassPath can't handle URLs with a UNC
    // server name in the authority component.
    
    and also updated the copyright year:
    
    http://cr.openjdk.java.net/~simonis/webrevs/2017/8178726.v2/
    
    Can you please add a "jdk9-fix-yes" label to the bug such that I can
    push the change?
    
    Thanks,
    Volker
    
    >
    > -Alan
    
    From chris.hegarty at oracle.com  Wed Apr 19 09:25:29 2017
    From: chris.hegarty at oracle.com (Chris Hegarty)
    Date: Wed, 19 Apr 2017 10:25:29 +0100
    Subject: [9] RFR(S): 8178726: Can't load classes from classpath if it is a
     UNC share
    In-Reply-To: 
    References: 
     <2a1ec694-f3d4-ca25-a08c-36b7d3511bdf@oracle.com>
     <4067cfb5-a01c-73e3-7f5d-c4d729830b28@oracle.com>
     
     
     
    Message-ID: <5EBD3D45-F8C8-4119-998E-04E2F75CCC01@oracle.com>
    
    
    > On 19 Apr 2017, at 10:18, Volker Simonis  wrote:
    > 
    >> ...
    > 
    > That's a good suggestion. I've updated the patch with a slightly
    > modified comment:
    > 
    > // Use an intermediate File object to construct a URI/URL without
    > // authority component as URLClassPath can't handle URLs with a UNC
    > // server name in the authority component.
    > 
    > and also updated the copyright year:
    > 
    > http://cr.openjdk.java.net/~simonis/webrevs/2017/8178726.v2/
    
    The changes look good. Thanks Volker.
    
    -Chris.
    
    
    From Alan.Bateman at oracle.com  Wed Apr 19 10:22:17 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Wed, 19 Apr 2017 11:22:17 +0100
    Subject: [9] RFR(S): 8178726: Can't load classes from classpath if it is a
     UNC share
    In-Reply-To: 
    References: 
     <2a1ec694-f3d4-ca25-a08c-36b7d3511bdf@oracle.com>
     <4067cfb5-a01c-73e3-7f5d-c4d729830b28@oracle.com>
     
     
     
    Message-ID: <5853aa53-fe95-f68a-34ec-5a31dac42b6a@oracle.com>
    
    On 19/04/2017 10:18, Volker Simonis wrote:
    
    > :
    > That's a good suggestion. I've updated the patch with a slightly
    > modified comment:
    >
    > // Use an intermediate File object to construct a URI/URL without
    > // authority component as URLClassPath can't handle URLs with a UNC
    > // server name in the authority component.
    >
    > and also updated the copyright year:
    >
    > http://cr.openjdk.java.net/~simonis/webrevs/2017/8178726.v2/
    >
    > Can you please add a "jdk9-fix-yes" label to the bug such that I can
    > push the change?
    >
    The update webrev looks good.
    
    -Alan
    
    From volker.simonis at gmail.com  Wed Apr 19 12:21:03 2017
    From: volker.simonis at gmail.com (Volker Simonis)
    Date: Wed, 19 Apr 2017 14:21:03 +0200
    Subject: [9] RFR(S): 8178726: Can't load classes from classpath if it is a
     UNC share
    In-Reply-To: <5853aa53-fe95-f68a-34ec-5a31dac42b6a@oracle.com>
    References: 
     <2a1ec694-f3d4-ca25-a08c-36b7d3511bdf@oracle.com>
     <4067cfb5-a01c-73e3-7f5d-c4d729830b28@oracle.com>
     
     
     
     <5853aa53-fe95-f68a-34ec-5a31dac42b6a@oracle.com>
    Message-ID: 
    
    On Wed, Apr 19, 2017 at 12:22 PM, Alan Bateman  wrote:
    > On 19/04/2017 10:18, Volker Simonis wrote:
    >
    >> :
    >> That's a good suggestion. I've updated the patch with a slightly
    >> modified comment:
    >>
    >> // Use an intermediate File object to construct a URI/URL without
    >> // authority component as URLClassPath can't handle URLs with a UNC
    >> // server name in the authority component.
    >>
    >> and also updated the copyright year:
    >>
    >> http://cr.openjdk.java.net/~simonis/webrevs/2017/8178726.v2/
    >>
    >> Can you please add a "jdk9-fix-yes" label to the bug such that I can
    >> push the change?
    >>
    > The update webrev looks good.
    
    Thanks Chris, Alan!
    I've just pushed the change.
    
    Regards,
    Volker
    
    >
    > -Alan
    
    From magnus.ihse.bursie at oracle.com  Wed Apr 19 12:54:44 2017
    From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie)
    Date: Wed, 19 Apr 2017 14:54:44 +0200
    Subject: RFR: JDK-8178037 Move information from jdi-overview.html into jdk.jdi
     module-info.java
    Message-ID: <9bdbdbca-f699-f569-3021-d029555799ab@oracle.com>
    
    With JDK-8172312, the file src/jdk.jdi/share/classes/jdi-overview.html 
    is no longer included in the generated documentation. The information 
    provided by that file should move to 
    src/jdk.jdi/share/classes/module-info.java instead.
    
    I also took the liberty of removing a bunch of other overview.html files 
    that are not included in the Javadoc anymore. They provided no real 
    informational value, and what text they contained is already expressed 
    similarly or better in the corresponding module-info.java files instead.
    
    Bug: https://bugs.openjdk.java.net/browse/JDK-8178037
    WebRev: 
    http://cr.openjdk.java.net/~ihse/JDK-8178037-fix-obsolete-overview-files/webrev.01
    
    /Magnus
    
    
    From erik.joelsson at oracle.com  Wed Apr 19 12:58:09 2017
    From: erik.joelsson at oracle.com (Erik Joelsson)
    Date: Wed, 19 Apr 2017 14:58:09 +0200
    Subject: RFR: JDK-8178037 Move information from jdi-overview.html into
     jdk.jdi module-info.java
    In-Reply-To: <9bdbdbca-f699-f569-3021-d029555799ab@oracle.com>
    References: <9bdbdbca-f699-f569-3021-d029555799ab@oracle.com>
    Message-ID: <3d150f84-aa75-0ddd-c445-15fdaf2eb970@oracle.com>
    
    Looks good to me.
    
    /Erik
    
    
    On 2017-04-19 14:54, Magnus Ihse Bursie wrote:
    > With JDK-8172312, the file src/jdk.jdi/share/classes/jdi-overview.html 
    > is no longer included in the generated documentation. The information 
    > provided by that file should move to 
    > src/jdk.jdi/share/classes/module-info.java instead.
    >
    > I also took the liberty of removing a bunch of other overview.html 
    > files that are not included in the Javadoc anymore. They provided no 
    > real informational value, and what text they contained is already 
    > expressed similarly or better in the corresponding module-info.java 
    > files instead.
    >
    > Bug: https://bugs.openjdk.java.net/browse/JDK-8178037
    > WebRev: 
    > http://cr.openjdk.java.net/~ihse/JDK-8178037-fix-obsolete-overview-files/webrev.01
    >
    > /Magnus
    >
    
    
    From Alan.Bateman at oracle.com  Wed Apr 19 13:01:23 2017
    From: Alan.Bateman at oracle.com (Alan Bateman)
    Date: Wed, 19 Apr 2017 14:01:23 +0100
    Subject: RFR: JDK-8178037 Move information from jdi-overview.html into
     jdk.jdi module-info.java
    In-Reply-To: <9bdbdbca-f699-f569-3021-d029555799ab@oracle.com>
    References: <9bdbdbca-f699-f569-3021-d029555799ab@oracle.com>
    Message-ID: 
    
    On 19/04/2017 13:54, Magnus Ihse Bursie wrote:
    
    > With JDK-8172312, the file src/jdk.jdi/share/classes/jdi-overview.html 
    > is no longer included in the generated documentation. The information 
    > provided by that file should move to 
    > src/jdk.jdi/share/classes/module-info.java instead.
    >
    > I also took the liberty of removing a bunch of other overview.html 
    > files that are not included in the Javadoc anymore. They provided no 
    > real informational value, and what text they contained is already 
    > expressed similarly or better in the corresponding module-info.java 
    > files instead.
    >
    > Bug: https://bugs.openjdk.java.net/browse/JDK-8178037
    > WebRev: 
    > http://cr.openjdk.java.net/~ihse/JDK-8178037-fix-obsolete-overview-files/webrev.01
    The serviceability-dev mailing list is the best place to discuss the 
    debugger API.
    
    However, what you have looks okay. I think I would use the opportunity 
    to replace "The JDI" with just "JDI" in the second and third paragraphs.
    
    -Alan
    
    From brian.burkhalter at oracle.com  Wed Apr 19 14:37:47 2017
    From: brian.burkhalter at oracle.com (Brian Burkhalter)
    Date: Wed, 19 Apr 2017 07:37:47 -0700
    Subject: "unsafe" instances in sun.nio.fs.WindowsFileSystem
    In-Reply-To: <00694934-e867-30a6-efde-714979d336c7@oracle.com>
    References: <7540281ca3c7401c8de96b2cf7b11faa@gsdghkp03etn1.firmwide.corp.gs.com>
     <00694934-e867-30a6-efde-714979d336c7@oracle.com>
    Message-ID: 
    
    [Looping in nio-dev]
    
    I can file an issue and look into it.
    
    Brian
    
    On Apr 18, 2017, at 11:44 PM, Alan Bateman  wrote:
    
    > On 19/04/2017 05:44, Chan, Sunny wrote:
    > 
    >> While reading the code for sun.nio.fs.WindowsFileSystemProvider and sun.nio.fs.WindowsUserDefinedFileAttributeView, I noticed that there is a private static variable to the Unsafe instance but it doesn't seems to be used anywhere in the code - am I missing something here or should I propose a patch to remove them?
    >> 
    > I suspect these are left over from past refactoring and shouldn't be an issue removing them.
    > 
    > -Alan
    
    
    From mandy.chung at oracle.com  Wed Apr 19 16:40:32 2017
    From: mandy.chung at oracle.com (Mandy Chung)
    Date: Wed, 19 Apr 2017 09:40:32 -0700
    Subject: RFR: JDK-8178037 Move information from jdi-overview.html into
     jdk.jdi module-info.java
    In-Reply-To: <9bdbdbca-f699-f569-3021-d029555799ab@oracle.com>
    References: <9bdbdbca-f699-f569-3021-d029555799ab@oracle.com>
    Message-ID: <38E8D569-C58F-4573-A630-A175EEABE240@oracle.com>
    
    
    > On Apr 19, 2017, at 5:54 AM, Magnus Ihse Bursie  wrote:
    > 
    > With JDK-8172312, the file src/jdk.jdi/share/classes/jdi-overview.html is no longer included in the generated documentation. The information provided by that file should move to src/jdk.jdi/share/classes/module-info.java instead.
    > 
    > I also took the liberty of removing a bunch of other overview.html files that are not included in the Javadoc anymore. They provided no real informational value, and what text they contained is already expressed similarly or better in the corresponding module-info.java files instead.
    > 
    > Bug: https://bugs.openjdk.java.net/browse/JDK-8178037
    > WebRev: http://cr.openjdk.java.net/~ihse/JDK-8178037-fix-obsolete-overview-files/webrev.01
    
    
    Moving the content from jdi-overview.html to module-info.java is the right choice.
    
    Nit: if you don?t mind, can you replace ? with {@code ?}
    
    Otherwise, looks fine.
    
    The following sentence reads a little strange to me that contains a couple of ???.
    I just want to point it out and we should leave it as is.
    
      36  * The JDI also provides explicit control over a virtual machine's execution.
      37  * The ability to suspend and resume threads, and to set breakpoints,
      38  * watchpoints, ... Notification of exceptions, class loading, thread
      39  * creation... The ability to inspect a suspended thread's state, local
      40  * variables, stack backtrace?
    
    Mandy
    
    From paul.sandoz at oracle.com  Wed Apr 19 16:58:53 2017
    From: paul.sandoz at oracle.com (Paul Sandoz)
    Date: Wed, 19 Apr 2017 09:58:53 -0700
    Subject: JDK 9 RFR(s): 8167981: Optional: add notes explaining intended use
    In-Reply-To: 
    References: <247a3b98-3304-97a9-3a49-23d81350b3bc@oracle.com>
     
    Message-ID: <054D5B5E-BD04-4F91-8A95-EA1DE2258932@oracle.com>
    
    
    > On 18 Apr 2017, at 20:29, Martin Buchholz  wrote:
    > 
    > +     * The methods {@link #orElse(java.lang.Object) orElse()} and
    > 
    > It's sad that in 2017 we still can't write
    > {@link #orElse(T)}
    > ... but ... we can and should write
    > {@link #orElse(Object) orElse(T)}
    > making the source and html more readable (orElse is not nullary)
    > 
    > + * {@code OptionalDouble} is primarily intended for use as a method return
    > type where
    > + * there is a clear need to represent "no result," and where using {@code
    > null}
    > + * is likely to cause errors. A variable whose type is {@code
    > OptionalDouble} should
    > 
    > The obvious alternative to returning OptionalDouble is returning double,
    > where null is not possible. I would elide """and where using {@code null}
    > + * is likely to cause errors""" unless you want to explicitly compare with
    > the alternative of returning Double,not double.
    > 
    
    ?? and where using the default value (@code {0.0d}) is likely to cause errors."
    
    ?
    
    Paul.
    
    > (More generally, it seems like Optional would have more value if there was
    > compiler enforcement of its never-null-ness.)
    > 
    > 
    > On Tue, Apr 18, 2017 at 6:23 PM, Stuart Marks 
    > wrote:
    > 
    >> Hi all,
    >> 
    >> Please review this small set of non-normative documentation changes for
    >> java.util.Optional and related classes.
    >> 
    >> The notes describe the primary intent of Optional to be used as a return
    >> value, and recommend avoiding using null as the value of a variable of
    >> Optional type. Also, a note is added to get() directing readers to look at
    >> orElse() and orElseGet().
    >> 
    >> Corresponding changes are also made to the primitive specializations
    >> OptionalDouble, OptionalInt, and OptionalLong.
    >> 
    >> Bug:
    >>        https://bugs.openjdk.java.net/browse/JDK-8167981
    >> 
    >> Webrev:
    >>        http://cr.openjdk.java.net/~smarks/reviews/8167981/webrev.0/
    >> 
    >> Thanks,
    >> 
    >> s'marks
    >> 
    
    
    From kumar.x.srinivasan at oracle.com  Wed Apr 19 17:52:37 2017
    From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan)
    Date: Wed, 19 Apr 2017 10:52:37 -0700
    Subject: RFR: 8076417: Update test/jdk/asm/AsmSanity.java with modules
    In-Reply-To: <59658d95-45d5-6f84-b478-23b4250b3ce5@oracle.com>
    References: <58F65D4C.9000707@oracle.com>
     <59658d95-45d5-6f84-b478-23b4250b3ce5@oracle.com>
    Message-ID: <58F7A3E5.4040505@oracle.com>
    
    
    Ah, yes, good catch. Thanks Amy.
    
    Kumar
    
    > Hi, Kumar
    >
    > As the removed test is the only one test under jdk/asm, it needs to be 
    > removed from jdk_other test group:
    >
    > --- a/test/TEST.groups
    > +++ b/test/TEST.groups
    > @@ -269,7 +269,6 @@
    >      javax/transaction \
    >      javax/xml \
    >      -javax/xml/crypto \
    > -    jdk/asm \
    >
    >
    > Thanks,
    > Amy
    >
    > On 4/19/17 2:39 AM, Kumar Srinivasan wrote:
    >> Hello,
    >>
    >> Please review [1] which addresses bug [2]. This test is unnecessary, 
    >> as there
    >> are other components and tests within the jdk, which will fail if ASM
    >> is not included, therefore this test is  removed.
    >>
    >> Thanks
    >> Kumar
    >>
    >> [1] http://cr.openjdk.java.net/~ksrini/8076417/webrev.00/
    >> [2] https://bugs.openjdk.java.net/browse/JDK-8076417
    >
    
    
    From kumar.x.srinivasan at oracle.com  Wed Apr 19 18:26:49 2017
    From: kumar.x.srinivasan at oracle.com (Kumar Srinivasan)
    Date: Wed, 19 Apr 2017 11:26:49 -0700
    Subject: RFR: 8076417: Update test/jdk/asm/AsmSanity.java with modules
    In-Reply-To: <59658d95-45d5-6f84-b478-23b4250b3ce5@oracle.com>
    References: <58F65D4C.9000707@oracle.com>
     <59658d95-45d5-6f84-b478-23b4250b3ce5@oracle.com>
    Message-ID: <58F7ABE9.2030905@oracle.com>
    
    
    Made the change you recommended, and here is the updated webrev
    http://cr.openjdk.java.net/~ksrini/8076417/webrev.01/
    
    Thanks
    Kumar
    
    > Hi, Kumar
    >
    > As the removed test is the only one test under jdk/asm, it needs to be 
    > removed from jdk_other test group:
    >
    > --- a/test/TEST.groups
    > +++ b/test/TEST.groups
    > @@ -269,7 +269,6 @@
    >      javax/transaction \
    >      javax/xml \
    >      -javax/xml/crypto \
    > -    jdk/asm \
    >
    >
    > Thanks,
    > Amy
    >
    > On 4/19/17 2:39 AM, Kumar Srinivasan wrote:
    >> Hello,
    >>
    >> Please review [1] which addresses bug [2]. This test is unnecessary, 
    >> as there
    >> are other components and tests within the jdk, which will fail if ASM
    >> is not included, therefore this test is  removed.
    >>
    >> Thanks
    >> Kumar
    >>
    >> [1] http://cr.openjdk.java.net/~ksrini/8076417/webrev.00/
    >> [2] https://bugs.openjdk.java.net/browse/JDK-8076417
    >
    
    
    From huizhe.wang at oracle.com  Wed Apr 19 18:41:59 2017
    From: huizhe.wang at oracle.com (huizhe wang)
    Date: Wed, 19 Apr 2017 11:41:59 -0700
    Subject: JDK 9 RFR: 8176168: Performance drop due to SAXParser SymbolTable
     reset
    In-Reply-To: 
    References: 
    Message-ID: 
    
    Hi Aleksej,
    
    The changes look good. Some changes to the notes in the test may make it 
    a bit clearer on what scenarios are tested: move the current notes for 
    the method testResetEnabled to parseAndCheckReset, and then add scenario 
    description to the three test* methods, for example, testNoFeatureSet 
    verifies two scenarios: resetSymbolTable is and is not requested through 
    the System property, while testResetEnabled tests that the feature is 
    set  and testResetDisabled unset by using SAXParserFactory's setFeature 
    method regardless of whether the System property is set.
    
    Best regards,
    Joe
    
    On 4/16/2017 3:02 PM, Aleks Efimov wrote:
    > Hi,
    >
    > Please, help to review the fix [1] for a performance regression in 
    > SPECjvm2008-XML benchmark. The cause of this regression was the 
    > unconditional reset of SAX parsers symbol table during each reset() 
    > operation introduced by JDK-8173390.
    > Proposed fix introduces new system property (CCC request is still 
    > pending approval) that provides ability to control the symbol table 
    > reset functionality. By default the reset table functionality is 
    > disabled, similar to pre JDK-8173390 behavior. JAXWS parsers pool 
    > implementation was updated to utilize new property to reset symbol 
    > table only in JAXWS use-cases that helped to restore the performance 
    > levels to pre JDK-8173390 level.
    >
    > Modified regression test and XML related JCK tests passes on build 
    > with proposed changes.
    >
    > With Best Regards,
    > Aleksei
    >
    > [1] http://cr.openjdk.java.net/~aefimov/8176168/00/
    
    
    From stuart.marks at oracle.com  Wed Apr 19 18:48:07 2017
    From: stuart.marks at oracle.com (Stuart Marks)
    Date: Wed, 19 Apr 2017 11:48:07 -0700
    Subject: JDK 9 RFR(s): 8167981: Optional: add notes explaining intended use
    In-Reply-To: <054D5B5E-BD04-4F91-8A95-EA1DE2258932@oracle.com>
    References: <247a3b98-3304-97a9-3a49-23d81350b3bc@oracle.com>
     
     <054D5B5E-BD04-4F91-8A95-EA1DE2258932@oracle.com>
    Message-ID: 
    
    
    Martin wrote:
    > + * The methods {@link #orElse(java.lang.Object) orElse()} and
    > It's sad that in 2017 we still can't write
    > {@link #orElse(T)}
    > ... but ... we can and should write
    > {@link #orElse(Object) orElse(T)}
    > making the source and html more readable (orElse is not nullary)
    
    Well we're not going to fix the tooling right now, but I take your point about 
    the trailing empty parens. I often use foo() as a typographic marker to indicate 
    that "foo" is a method, even if it's not nullary; the javadocs aren't terribly 
    consistent about this. However, in this case I agree that they're unnecessary 
    since the wording clearly indicates that it's a method, and it's also a link 
    directly to the method declaration. So, I've removed the parens.
    
    > + * {@code OptionalDouble} is primarily intended for use as a method return type where
    > + * there is a clear need to represent "no result," and where using {@code null}
    > + * is likely to cause errors. A variable whose type is {@code OptionalDouble} should
    >
    > The obvious alternative to returning OptionalDouble is returning double, where null is not possible. I would elide """and where using {@code null}
    > + * is likely to cause errors""" unless you want to explicitly compare with the alternative of returning Double,not double.
    
    I did have in mind the possibility of the return of a nullable Double 
    (respectively, Integer and Long). I did a quick grepcode search and I was pretty 
    easily able to find occurrences of methods that returned nullable Integer 
    references. I couldn't tell whether these were intended to indicate "no result" 
    or whether it was just sloppy programming.
    
    But Paul also points out that 0.0d (resp., 0 and 0L) might be used as default 
    values. For int and long I can also imagine -1, MIN_VALUE, etc. also being used 
    as sentinels for "no result."
    
    In any case I think it's best to sidestep this entire discussion for the 
    purposes of this text and simply omit the mention of null as Martin suggests. 
    This results in
    
        OptionalDouble is primarily intended for use as a method return type where
        there is a clear need to represent "no result."
    
    Full stop. (Respectively for OptionalInt and OptionalLong.) I think that's clear 
    enough.
    
    Revised webrev:
    
    http://cr.openjdk.java.net/~smarks/reviews/8167981/webrev.1/
    
    s'marks
    
    
    
    On 4/19/17 9:58 AM, Paul Sandoz wrote:
    >
    >> On 18 Apr 2017, at 20:29, Martin Buchholz  wrote:
    >>
    >> +     * The methods {@link #orElse(java.lang.Object) orElse()} and
    >>
    >> It's sad that in 2017 we still can't write
    >> {@link #orElse(T)}
    >> ... but ... we can and should write
    >> {@link #orElse(Object) orElse(T)}
    >> making the source and html more readable (orElse is not nullary)
    >>
    >> + * {@code OptionalDouble} is primarily intended for use as a method return
    >> type where
    >> + * there is a clear need to represent "no result," and where using {@code
    >> null}
    >> + * is likely to cause errors. A variable whose type is {@code
    >> OptionalDouble} should
    >>
    >> The obvious alternative to returning OptionalDouble is returning double,
    >> where null is not possible. I would elide """and where using {@code null}
    >> + * is likely to cause errors""" unless you want to explicitly compare with
    >> the alternative of returning Double,not double.
    >>
    >
    > ?? and where using the default value (@code {0.0d}) is likely to cause errors."
    >
    > ?
    >
    > Paul.
    >
    >> (More generally, it seems like Optional would have more value if there was
    >> compiler enforcement of its never-null-ness.)
    >>
    >>
    >> On Tue, Apr 18, 2017 at 6:23 PM, Stuart Marks 
    >> wrote:
    >>
    >>> Hi all,
    >>>
    >>> Please review this small set of non-normative documentation changes for
    >>> java.util.Optional and related classes.
    >>>
    >>> The notes describe the primary intent of Optional to be used as a return
    >>> value, and recommend avoiding using null as the value of a variable of
    >>> Optional type. Also, a note is added to get() directing readers to look at
    >>> orElse() and orElseGet().
    >>>
    >>> Corresponding changes are also made to the primitive specializations
    >>> OptionalDouble, OptionalInt, and OptionalLong.
    >>>
    >>> Bug:
    >>>        https://bugs.openjdk.java.net/browse/JDK-8167981
    >>>
    >>> Webrev:
    >>>        http://cr.openjdk.java.net/~smarks/reviews/8167981/webrev.0/
    >>>
    >>> Thanks,
    >>>
    >>> s'marks
    >>>
    >
    
    From mandy.chung at oracle.com  Wed Apr 19 18:51:12 2017
    From: mandy.chung at oracle.com (Mandy Chung)
    Date: Wed, 19 Apr 2017 11:51:12 -0700
    Subject: RFR[9]: 8178832: (ref) jdk.lang.ref.disableClearBeforeEnqueue
     property is ignored
    In-Reply-To: <69c4ee3b-bea7-cdb6-97f4-c8e428bed1fd@gmail.com>
    References: 
     <91D4AA88-F7FD-4268-B178-1C74B2CC9F47@oracle.com>
     <69c4ee3b-bea7-cdb6-97f4-c8e428bed1fd@gmail.com>
    Message-ID: <7523F914-B955-4332-A802-97C6EFE8FF5A@oracle.com>
    
    
    > On Apr 19, 2017, at 2:02 AM, Peter Levart  wrote:
    > 
    > I wonder if there are (or will be) other places where such silent swallowing of run-time exceptions happens or will happen. Wouldn't it be good to "fix" Boolean.getBoolean() and friends?
    > 
    > I filed the following bug to track this:
    > 
    > https://bugs.openjdk.java.net/browse/JDK-8178966
    > 
    
    Thanks for creating the issue.  I fully agree that we should fix this and silent swallowing the exceptions makes the underlying problem unnoticed.
    
    Your proposed patch looks good to me.  NPE would be thrown if it?s called before the system properties are initialized. 
    
    Mandy
    
    
    From kim.barrett at oracle.com  Wed Apr 19 23:57:43 2017
    From: kim.barrett at oracle.com (Kim Barrett)
    Date: Wed, 19 Apr 2017 19:57:43 -0400
    Subject: RFR[9]: 8178832: (ref) jdk.lang.ref.disableClearBeforeEnqueue
     property is ignored
    In-Reply-To: <7523F914-B955-4332-A802-97C6EFE8FF5A@oracle.com>
    References: 
     <91D4AA88-F7FD-4268-B178-1C74B2CC9F47@oracle.com>
     <69c4ee3b-bea7-cdb6-97f4-c8e428bed1fd@gmail.com>
     <7523F914-B955-4332-A802-97C6EFE8FF5A@oracle.com>
    Message-ID: <39A27ADF-BDF1-4DE4-9396-2891738755EC@oracle.com>
    
    > On Apr 19, 2017, at 2:51 PM, Mandy Chung  wrote:
    > 
    > 
    >> On Apr 19, 2017, at 2:02 AM, Peter Levart  wrote:
    >> 
    >> I wonder if there are (or will be) other places where such silent swallowing of run-time exceptions happens or will happen. Wouldn't it be good to "fix" Boolean.getBoolean() and friends?
    >> 
    >> I filed the following bug to track this:
    >> 
    >> https://bugs.openjdk.java.net/browse/JDK-8178966
    >> 
    > 
    > Thanks for creating the issue.  I fully agree that we should fix this and silent swallowing the exceptions makes the underlying problem unnoticed.
    > 
    > Your proposed patch looks good to me.  NPE would be thrown if it?s called before the system properties are initialized. 
    > 
    > Mandy
    
    This looks like a good idea to me too.
    
    
    From amy.lu at oracle.com  Thu Apr 20 01:14:24 2017
    From: amy.lu at oracle.com (Amy Lu)
    Date: Thu, 20 Apr 2017 09:14:24 +0800
    Subject: RFR: 8076417: Update test/jdk/asm/AsmSanity.java with modules
    In-Reply-To: <58F7ABE9.2030905@oracle.com>
    References: <58F65D4C.9000707@oracle.com>
     <59658d95-45d5-6f84-b478-23b4250b3ce5@oracle.com>
     <58F7ABE9.2030905@oracle.com>
    Message-ID: <61eda458-2bc2-fc8e-e31b-fec01a49243c@oracle.com>
    
    On 4/20/17 2:26 AM, Kumar Srinivasan wrote:
    >
    > Made the change you recommended, and here is the updated webrev
    > http://cr.openjdk.java.net/~ksrini/8076417/webrev.01/
    Thank you Kumar!Looks good.
    
    (I'm not official reviewer)
    Thanks,
    Amy
    
    >
    > Thanks
    > Kumar
    >
    >> Hi, Kumar
    >>
    >> As the removed test is the only one test under jdk/asm, it needs to 
    >> be removed from jdk_other test group:
    >>
    >> --- a/test/TEST.groups
    >> +++ b/test/TEST.groups
    >> @@ -269,7 +269,6 @@
    >>      javax/transaction \
    >>      javax/xml \
    >>      -javax/xml/crypto \
    >> -    jdk/asm \
    >>
    >>
    >> Thanks,
    >> Amy
    >>
    >> On 4/19/17 2:39 AM, Kumar Srinivasan wrote:
    >>> Hello,
    >>>
    >>> Please review [1] which addresses bug [2]. This test is unnecessary, 
    >>> as there
    >>> are other components and tests within the jdk, which will fail if ASM
    >>> is not included, therefore this test is  removed.
    >>>
    >>> Thanks
    >>> Kumar
    >>>
    >>> [1] http://cr.openjdk.java.net/~ksrini/8076417/webrev.00/
    >>> [2] https://bugs.openjdk.java.net/browse/JDK-8076417
    >>
    >
    
    
    From mandy.chung at oracle.com  Thu Apr 20 01:35:39 2017
    From: mandy.chung at oracle.com (Mandy Chung)
    Date: Wed, 19 Apr 2017 18:35:39 -0700
    Subject: RFR: 8076417: Update test/jdk/asm/AsmSanity.java with modules
    In-Reply-To: <58F7ABE9.2030905@oracle.com>
    References: <58F65D4C.9000707@oracle.com>
     <59658d95-45d5-6f84-b478-23b4250b3ce5@oracle.com>
     <58F7ABE9.2030905@oracle.com>
    Message-ID: <543A22BB-A48B-4406-BCE4-337020038CA2@oracle.com>
    
    
    > On Apr 19, 2017, at 11:26 AM, Kumar Srinivasan  wrote:
    > 
    > 
    > Made the change you recommended, and here is the updated webrev
    > http://cr.openjdk.java.net/~ksrini/8076417/webrev.01/
    
    +1
    
    Mandy
    
    From david.holmes at oracle.com  Thu Apr 20 02:21:21 2017
    From: david.holmes at oracle.com (David Holmes)
    Date: Thu, 20 Apr 2017 12:21:21 +1000
    Subject: RFR: JDK-8178037 Move information from jdi-overview.html into
     jdk.jdi module-info.java
    In-Reply-To: <9bdbdbca-f699-f569-3021-d029555799ab@oracle.com>
    References: <9bdbdbca-f699-f569-3021-d029555799ab@oracle.com>
    Message-ID: <4e664f6d-98a0-eaf2-b65f-9d44788e117c@oracle.com>
    
    On 19/04/2017 10:54 PM, Magnus Ihse Bursie wrote:
    > With JDK-8172312, the file src/jdk.jdi/share/classes/jdi-overview.html
    > is no longer included in the generated documentation. The information
    > provided by that file should move to
    > src/jdk.jdi/share/classes/module-info.java instead.
    
    Looks good, but highlighted an error with the existing text:
    
       /**
        * Defines the Java Debugger Interface.
    +  * 

    + * The Java™ Debug Interface (JDI) is a high level Java API providing The first line should read "Debug" not "Debugger". Contrary to what Alan suggested (sorry Alan!) I think plain "JDI" should be replaced by "The JDI". Thanks, David > I also took the liberty of removing a bunch of other overview.html files > that are not included in the Javadoc anymore. They provided no real > informational value, and what text they contained is already expressed > similarly or better in the corresponding module-info.java files instead. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8178037 > WebRev: > http://cr.openjdk.java.net/~ihse/JDK-8178037-fix-obsolete-overview-files/webrev.01 > > > /Magnus > From heiko.wagner at apis.de Thu Apr 20 07:38:11 2017 From: heiko.wagner at apis.de (Heiko Wagner) Date: Thu, 20 Apr 2017 09:38:11 +0200 Subject: Deprecated Java EE Modules in JDK9 Message-ID: Sorry for my ignotance, but I need some advice on how to properly write a desktop app that uses JAX-WS to pull some data from a WS-I Service. I can understand why JAX-WS is deprecated and marked for removel to help out the Java EE crwod to migrate their application servers to JDK9, but I don't fully understand what the right thing would be to do in my situation. Is the java.xml.ws module just "moved" to Java EE or is it completely removed and replaced with a module that has a new name? In the first case I ussume it would be the right thing to decare a dependency on java.xml.ws and rely on the presence of the module in Java SE 9 and ship a module implementing JAX-WS in Java SE 10 along my application. I assume jlink would help me out to get a appropriate runtime image in both cases. This would be just like the Java Mail API case, where there is nothing wrong with using it in th Java SE context, when you make sure you supply a implementation with your app and rely on the platform to provide a implementation in the Java EE context. In the latter case, is there already a proper new module name or module alias I can depend on in my application? Thanks for the help, Heiko -- Heiko Wagner - APIS Informationstechnologien GmbH Gewerbepark A 13, 93086 W?rth a.d. Donau, Deutschland Web: http://www.apis.de E-Mail: heiko.wagner at apis.de Tel.: +49 (0) 9482 - 9415 - 0 Fax: +49 (0) 9482 - 9415 - 25 Sitz der GmbH: W?rth/Donau, Amtsgericht Regensburg (HRB 6684) Gesch?ftsf?hrer: Julia Anna Dietz, J?rgen Eilers, Peter Rosenbeck From magnus.ihse.bursie at oracle.com Thu Apr 20 07:57:54 2017 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Thu, 20 Apr 2017 09:57:54 +0200 Subject: RFR: JDK-8178037 Move information from jdi-overview.html into jdk.jdi module-info.java In-Reply-To: <4e664f6d-98a0-eaf2-b65f-9d44788e117c@oracle.com> References: <9bdbdbca-f699-f569-3021-d029555799ab@oracle.com> <4e664f6d-98a0-eaf2-b65f-9d44788e117c@oracle.com> Message-ID: <968b1798-fdd5-2bfb-d0ae-8d49fa644b31@oracle.com> On 2017-04-20 04:21, David Holmes wrote: > On 19/04/2017 10:54 PM, Magnus Ihse Bursie wrote: >> With JDK-8172312, the file src/jdk.jdi/share/classes/jdi-overview.html >> is no longer included in the generated documentation. The information >> provided by that file should move to >> src/jdk.jdi/share/classes/module-info.java instead. > > Looks good, but highlighted an error with the existing text: > > /** > * Defines the Java Debugger Interface. > + *

    > + * The Java™ Debug Interface (JDI) is a high level Java API > providing > > The first line should read "Debug" not "Debugger". Good catch. I really didn't plan to make any editorial changes in this review, only to move the contents to a place were it was once again included. However, the text was apparently in need of some freshing up, so I tried to fix what was pointed out. > > Contrary to what Alan suggested (sorry Alan!) I think plain "JDI" > should be replaced by "The JDI". I love it when I get conflicting reviews! ;-) I'm sorry Dave, I'm afraid I can't do that. :-) "The JDI" just sounds weird, and that's not how acronyms are typically referred to. So I've sided with Alan here. If you don't agree, I'll back out that change and you can fight it out by yourselves. :) And Mandy: I agree with the weird ellipses. I changed that to "etc.", which I think captures the intent that the list was not exhaustive. Here is an updated review. It fixes the "Debugger" in the title, "The JDI" -> "JDI" in two places, "..." -> "etc." and -> {@code}. http://cr.openjdk.java.net/~ihse/JDK-8178037-fix-obsolete-overview-files/webrev.02/ /Magnus > > Thanks, > David > >> I also took the liberty of removing a bunch of other overview.html files >> that are not included in the Javadoc anymore. They provided no real >> informational value, and what text they contained is already expressed >> similarly or better in the corresponding module-info.java files instead. >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8178037 >> WebRev: >> http://cr.openjdk.java.net/~ihse/JDK-8178037-fix-obsolete-overview-files/webrev.01 >> >> >> >> /Magnus >> From david.holmes at oracle.com Thu Apr 20 08:25:53 2017 From: david.holmes at oracle.com (David Holmes) Date: Thu, 20 Apr 2017 18:25:53 +1000 Subject: RFR: JDK-8178037 Move information from jdi-overview.html into jdk.jdi module-info.java In-Reply-To: <968b1798-fdd5-2bfb-d0ae-8d49fa644b31@oracle.com> References: <9bdbdbca-f699-f569-3021-d029555799ab@oracle.com> <4e664f6d-98a0-eaf2-b65f-9d44788e117c@oracle.com> <968b1798-fdd5-2bfb-d0ae-8d49fa644b31@oracle.com> Message-ID: On 20/04/2017 5:57 PM, Magnus Ihse Bursie wrote: > On 2017-04-20 04:21, David Holmes wrote: >> On 19/04/2017 10:54 PM, Magnus Ihse Bursie wrote: >>> With JDK-8172312, the file src/jdk.jdi/share/classes/jdi-overview.html >>> is no longer included in the generated documentation. The information >>> provided by that file should move to >>> src/jdk.jdi/share/classes/module-info.java instead. >> >> Looks good, but highlighted an error with the existing text: >> >> /** >> * Defines the Java Debugger Interface. >> + *

    >> + * The Java™ Debug Interface (JDI) is a high level Java API >> providing >> >> The first line should read "Debug" not "Debugger". > > Good catch. > > I really didn't plan to make any editorial changes in this review, only > to move the contents to a place were it was once again included. > However, the text was apparently in need of some freshing up, so I tried > to fix what was pointed out. > >> >> Contrary to what Alan suggested (sorry Alan!) I think plain "JDI" >> should be replaced by "The JDI". > > I love it when I get conflicting reviews! ;-) > > I'm sorry Dave, I'm afraid I can't do that. :-) "The JDI" just sounds > weird, and that's not how acronyms are typically referred to. So I've > sided with Alan here. If you don't agree, I'll back out that change and > you can fight it out by yourselves. :) It depends on the exact nature of the acronym. If you wrote this out you would say "The Java Debug Interface .." hence you should say "The JDI ...". :) Cheers, David ----- > And Mandy: I agree with the weird ellipses. I changed that to "etc.", > which I think captures the intent that the list was not exhaustive. > > Here is an updated review. It fixes the "Debugger" in the title, "The > JDI" -> "JDI" in two places, "..." -> "etc." and -> {@code}. > > http://cr.openjdk.java.net/~ihse/JDK-8178037-fix-obsolete-overview-files/webrev.02/ > > > /Magnus > >> >> Thanks, >> David >> >>> I also took the liberty of removing a bunch of other overview.html files >>> that are not included in the Javadoc anymore. They provided no real >>> informational value, and what text they contained is already expressed >>> similarly or better in the corresponding module-info.java files instead. >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8178037 >>> WebRev: >>> http://cr.openjdk.java.net/~ihse/JDK-8178037-fix-obsolete-overview-files/webrev.01 >>> >>> >>> >>> /Magnus >>> > From amy.lu at oracle.com Thu Apr 20 09:10:46 2017 From: amy.lu at oracle.com (Amy Lu) Date: Thu, 20 Apr 2017 17:10:46 +0800 Subject: JDK 9 RFR of JDK-8174171: Move spliterator testing of BitSet into big memory tests BitSetStreamTest Message-ID: <7797193a-5507-7092-db34-b8ca6a8b09de@oracle.com> Please review this test-only change. Integer.MAX_VALUE bit set testdata in bitStreamTestcases of SpliteratorTraversingAndSplittingTest was removed in JDK-8169838 due to out of memory errors. It also cause issue in BitSetStreamTest (JDK-8079538). And yes, testing for this do consume lots of memory. This patch moved the spliterator testing of BitSet into big memory tests BitSetStreamTest: 1) bitStreamTestcases removed from SpliteratorTraversingAndSplittingTest 2) Above test cases, with adding back Integer.MAX_VALUE testdata, now is in the newly introduced @DataProvider and being tested in BitSetStreamTest. 3) It's better BitSetStreamTest not to be run concurrently with other test so to avoid memory usage conflict. With this purpose, BitSetStreamTest moved to java/util/BitSet/stream subdir, and this subdir added to exclusiveAccess.dirs bug: https://bugs.openjdk.java.net/browse/JDK-8174171 webrev: http://cr.openjdk.java.net/~amlu/8174171/webrev.00/ Thanks, Amy From ropalka at redhat.com Thu Apr 20 09:13:28 2017 From: ropalka at redhat.com (Richard Opalka) Date: Thu, 20 Apr 2017 11:13:28 +0200 Subject: Deprecated Java EE Modules in JDK9 In-Reply-To: References: Message-ID: Hi Heiko, On 04/20/2017 09:38 AM, Heiko Wagner wrote: > Sorry for my ignotance, but I need some advice on how to properly write > a desktop app that uses JAX-WS to pull some data from a WS-I Service. > > I can understand why JAX-WS is deprecated and marked for removel to help > out the Java EE crwod to migrate their application servers to JDK9, but > I don't fully understand what the right thing would be to do in my > situation. Is the java.xml.ws module just "moved" to Java EE or is it > completely removed and replaced with a module that has a new name? Java EE technology related modules are all 'upgradeable modules'. The upgrade process is based on module naming scheme. So Java EE related module names shouldn't change in the future. And yes, they are "moved" to Java EE. > In the first case I ussume it would be the right thing to decare a > dependency on java.xml.ws and rely on the presence of the module in Java > SE 9 and ship a module implementing JAX-WS in Java SE 10 along my > application. Correct. > In the latter case, is there already a proper new module name or module > alias I can depend on in my application? No AFAIK > > Thanks for the help, > > Heiko > Rio From Alan.Bateman at oracle.com Thu Apr 20 09:57:14 2017 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 20 Apr 2017 10:57:14 +0100 Subject: Deprecated Java EE Modules in JDK9 In-Reply-To: References: Message-ID: On 20/04/2017 08:38, Heiko Wagner wrote: > Sorry for my ignotance, but I need some advice on how to properly write > a desktop app that uses JAX-WS to pull some data from a WS-I Service. > > I can understand why JAX-WS is deprecated and marked for removel to help > out the Java EE crwod to migrate their application servers to JDK9, but > I don't fully understand what the right thing would be to do in my > situation. Is the java.xml.ws module just "moved" to Java EE or is it > completely removed and replaced with a module that has a new name? > > In the first case I ussume it would be the right thing to decare a > dependency on java.xml.ws and rely on the presence of the module in Java > SE 9 and ship a module implementing JAX-WS in Java SE 10 along my > application. I assume jlink would help me out to get a appropriate > runtime image in both cases. This would be just like the Java Mail API > case, where there is nothing wrong with using it in th Java SE context, > when you make sure you supply a implementation with your app and rely on > the platform to provide a implementation in the Java EE context. > > In the latter case, is there already a proper new module name or module > alias I can depend on in my application? > With JDK 9 then you have several choices. For existing code then it should continue to work with any of the following: 1. Compile/run with `--add-modules java.xml.ws` to use the java.xml.ws module in the JDK. 2. Deploy the standalone version of JAX-WS on the class path. 3. Deploy the standalone version of the java.xml.ws module on the upgrade module path (to override the module in the JDK) and compile/run with `--add-modules java.xml.ws` If you migrate your code to a module then your module will `requires java.xml.ws` so you won't need `--add-modules java.xml.ws` on the command line. You have the choice to use the java.xml.ws in the JDK or you can deploy the standalone version of the java.xml.ws on the upgrade module path. If java.xml.ws is dropped in Java SE 10, and if JDK 10 declines to bundle it, then deployments using the standalone version should continue to just work. To your question then I'm not aware of any proposal to rename the java.xml.ws module. However, I believe the standalone version has chosen to continue with the historical splitting of the API and implementation. The API module will be "java.xml.ws" and the implementation modules will have other names. This should be transparent to consumers of java.xml.ws of course. Dmitry Kornilov or Roman Grigoriadi may wish to comment on this as I think it would be useful to get some early testing of the standalone versions as modules to make sure that there aren't any issues. -Alan From huaming.li at oracle.com Thu Apr 20 10:23:04 2017 From: huaming.li at oracle.com (Hamlin Li) Date: Thu, 20 Apr 2017 18:23:04 +0800 Subject: JDK 9 RFR of JDK-8174171: Move spliterator testing of BitSet into big memory tests BitSetStreamTest In-Reply-To: <7797193a-5507-7092-db34-b8ca6a8b09de@oracle.com> References: <7797193a-5507-7092-db34-b8ca6a8b09de@oracle.com> Message-ID: Hi Amy, Thank you for taking this. Have some minor comments about BitSetStreamTest.java 1. is below line necessary? or 2g big enough? 51 * @requires os.maxMemory >= 2g 2. I'm not sure if Xmx1024m should be a bigger value. 55 * @run testng/othervm -Xms512m -Xmx1024m 3. spliteratorOfIntDataProvider is created only once and shared between multiple tests. I'm not sure if parallel is enabled, but if it is already enabled or enable some day in future, it might face issue although possibility is very low, so adding volatile might make it safe. Thank you -Hamlin On 2017/4/20 17:10, Amy Lu wrote: > Please review this test-only change. > > Integer.MAX_VALUE bit set testdata in bitStreamTestcases of > SpliteratorTraversingAndSplittingTest was removed in JDK-8169838 due > to out of memory errors. It also cause issue in BitSetStreamTest > (JDK-8079538). And yes, testing for this do consume lots of memory. > > This patch moved the spliterator testing of BitSet into big memory > tests BitSetStreamTest: > > 1) bitStreamTestcases removed from SpliteratorTraversingAndSplittingTest > 2) Above test cases, with adding back Integer.MAX_VALUE testdata, now > is in the newly introduced @DataProvider and being tested in > BitSetStreamTest. > 3) It's better BitSetStreamTest not to be run concurrently with other > test so to avoid memory usage conflict. With this purpose, > BitSetStreamTest moved to java/util/BitSet/stream subdir, and this > subdir added to exclusiveAccess.dirs > > bug: https://bugs.openjdk.java.net/browse/JDK-8174171 > webrev: http://cr.openjdk.java.net/~amlu/8174171/webrev.00/ > > Thanks, > Amy From lance.andersen at oracle.com Thu Apr 20 13:40:36 2017 From: lance.andersen at oracle.com (Lance Andersen) Date: Thu, 20 Apr 2017 09:40:36 -0400 Subject: RFR 8178915: Minor update to the PooledConnection javadoc Message-ID: Hi all, This RFR makes a minor update to the PooledConnection javadoc. The CCC has been approved. Here is the diff: ??????? $ hg diff diff -r 9ba6760481a8 src/java.sql/share/classes/javax/sql/PooledConnection.java --- a/src/java.sql/share/classes/javax/sql/PooledConnection.java Sat Apr 15 16:54:33 2017 -0400 +++ b/src/java.sql/share/classes/javax/sql/PooledConnection.java Tue Apr 18 14:50:44 2017 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, 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 @@ -69,8 +69,9 @@ *

    * If the connection pool manager wraps or provides a proxy to the logical * handle returned from a call to {@code PoolConnection.getConnection}, the pool - * manager must do - * one of the following when the application calls {@code Connection.close}: + * manager must do one of the following when the connection pool manager + * closes or returns the {@code PooledConnection} to the pool in response to + * the application calling {@code Connection.close}: *