Re: RFR: JDK-8202788: Explicitly reclaim cached thread-local direct buffers at thread exit

2018-06-19 Thread Tony Printezis
Good idea, as long as it re-uses the existing ThreadLocal infrastructure and doesn’t introduce an extra per-thread map. Making it a ThreadLocal subclass would be an excellent start. Tony — Tony Printezis | @TonyPrintezis | tprinte...@twitter.com On June 19, 2018 at 9:07:07 AM, David Lloyd

Re: BiCollector

2018-06-19 Thread Victor Williams Stafusa da Silva
What about forking? 2018-06-19 13:42 GMT-03:00 Paul Sandoz : > Gosh, this is a tricky one to name. > > collectingTo seems the best so far, although collect(collectingTo(…)) ... > > One last suggestion from me, “expanding”, as in the collector expands the > number of collectors the input elements

Re: [core-libs] RFR (L): 8010319: Implementation of JEP 181: Nest-Based Access Control

2018-06-19 Thread David Holmes
Sorry another update is imminent ... stay tuned. David On 19/06/2018 2:41 PM, David Holmes wrote: Discussions on the CSR request have led to further changes to the documentation involving nests and the new nest-related method. There are no semantic changes here just clearer explanations.

Re: RFR JDK-8066709 Make some JDK system properties read only

2018-06-19 Thread Brent Christian
On 6/19/18 8:08 AM, Roger Riggs wrote: * src/java.base/share/classes/java/lang/System.java : Should the @implNote with the list of cached properties be added everywhere the @apiNote is being added ?  Right now the @implNote is only added to getProperties(). The repetition was getting

RE: RFR(S): 8205194: Improve the Array Comparison when there is a mismatch at first element.

2018-06-19 Thread Deshpande, Vivek R
Thanks David. Sending it to core-libs-dev. I would like to contribute a patch which improves the array comparison when there is a mismatch for the first element. This avoids call to vectorizedMismatch method and gives ~80x speed up. Could you please review and sponsor the patch. Link to bug:

Re: BiCollector

2018-06-19 Thread Paul Sandoz
Gosh, this is a tricky one to name. collectingTo seems the best so far, although collect(collectingTo(…)) ... One last suggestion from me, “expanding”, as in the collector expands the number of collectors the input elements are applied to. Paul. > On Jun 19, 2018, at 7:47 AM, Brian Goetz

Re: BiCollector

2018-06-19 Thread Peter Levart
On 06/19/18 02:38, John Rose wrote: unzipping( Function f1, // defaults to identity Collector c1, Function f2, // defaults to identity Collector c2, BiFunction finisher) { return toBoth(mapping(f1,

Re: RFR(S): 8205194: Improve the Array Comparison when there is a mismatch at first element.

2018-06-19 Thread Paul Sandoz
Hi Vivek, Thanks for investigating this. 164 public static int mismatch(boolean[] a, 165boolean[] b, 166int length) { 167 int i = 0; 168 if (a[i] != b[i]) 169 return i; You might as well replace

RE: RFR(S): 8205194: Improve the Array Comparison when there is a mismatch at first element.

2018-06-19 Thread Deshpande, Vivek R
Hi Roger I will also test with zero length arrays and let you know. Thanks for the input. Regards, Vivek From: Deshpande, Vivek R Sent: Tuesday, June 19, 2018 10:17 AM To: 'Paul Sandoz' Cc: David Holmes ; core-libs-dev@openjdk.java.net; Viswanathan, Sandhya Subject: RE: RFR(S): 8205194:

Re: Proposal: optimization of Map.copyOf and Collectors.toUnmodifiableMap

2018-06-19 Thread Peter Levart
Hi Stuart, On 06/19/2018 04:09 AM, Stuart Marks wrote: On 6/17/18 4:23 PM, Peter Levart wrote: My attempt to optimize the Map.copyOf() was also using just public APIs (with the addition of an internal class). Well, it does speed-up Map.copyOf() by 30%. But I agree there are other

RE: RFR(S): 8205194: Improve the Array Comparison when there is a mismatch at first element.

2018-06-19 Thread Deshpande, Vivek R
Thanks Paul for quick review. I will work on the things you have mentioned and get back soon. I will also test this with test/jdk/java/util/Arrays/ArraysEqCmpTest.java. Regards, Vivek From: Paul Sandoz [mailto:paul.san...@oracle.com] Sent: Tuesday, June 19, 2018 9:55 AM To: Deshpande, Vivek R

Re: BiCollector

2018-06-19 Thread Zheka Kozlov
The function you propose is just a binary variant of mapping: Collector mapping( Function mapper, Collector downstream); (omitted '? super' for readability) So, it is logical to use the name biMapping: Collector biMapping(

RFR 8195650 Method references to VarHandle accessors

2018-06-19 Thread Paul Sandoz
Hi, Please review the following fix to ensure method references to VarHandle signature polymorphic methods are supported at runtime (specifically the method handle to a signature polymorphic method can be loaded from the constant pool):

RFC: Add new JCA provider to support hardware RNGs

2018-06-19 Thread Gustavo Romero
Hi, Please, could I get comments on the following change? Since it's related to security, I would be glad if security experts could also comment on that. webrev: http://cr.openjdk.java.net/~gromero/POWER9/darn/v6_rebased/ It introduces a way to get benefits from hardware instructions in

RFC: Add new JCA provider to support hardware RNGs

2018-06-19 Thread Gustavo Romero
Sorry for resending it. I missed a few MLs. -- Hi, Please, could I get comments on the following change? Since it's related to security, I would be glad if security experts could also comment on that. webrev: http://cr.openjdk.java.net/~gromero/POWER9/darn/v6_rebased/ It introduces a way to

Re: RFR: JDK-8202788: Explicitly reclaim cached thread-local direct buffers at thread exit

2018-06-19 Thread David Lloyd
It may be confusing (to some, I guess) but it is consistent: the ThreadLocal subclass author has absolute control over how the value is presented to the user. Adding compute() or many of the other suggested variants will break that guarantee, which seems like kind of a big deal to me. What about

Re: BiCollector

2018-06-19 Thread Zheka Kozlov
I don't like `distributing` for the same reason as `bisecting`: for me, it sounds like a Stream is giving each collector only a part of elements. 2018-06-19 19:44 GMT+07:00 Brian Goetz : > > > collectingToBoth >> > > This one is actually both evocative of what the method does, and in the >

Re: RFR JDK-8066709 Make some JDK system properties read only

2018-06-19 Thread Roger Riggs
Hi Brent, On 6/18/2018 6:53 PM, Brent Christian wrote: Hi, Roger On 6/18/18 7:31 AM, Roger Riggs wrote: The CSR and Webrev are updated. webrev: http://cr.openjdk.java.net/~rriggs/webrev-static-property-8066709 * src/java.base/share/classes/java/lang/System.java : Should the @implNote

Re: BiCollector

2018-06-19 Thread Brian Goetz
It is "distributing" in the same sense as the distributive law:     c*(a+b) = c*a + c*b (Think of the two collectors as the "sum" of a collector, and "distributing" says that you can send the elements to the sum by sending all of the elements to each.) That said, I agree that the less

Re: RFR(S): 8205194: Improve the Array Comparison when there is a mismatch at first element.

2018-06-19 Thread Roger Riggs
Hi Vivek, Do you need to concerned that the arrays are zero length? Are there any tests that test the zero length case. (I assume you ran the existing tests). Thanks, Roger On 6/18/2018 7:52 PM, Deshpande, Vivek R wrote: Hi All Forgot to add the links:

RFR(JDK11/NIO) 8205058 throw CharacterCodingException --> Re: RFR (JDK11/NIO) 8201276: (fs) Add methods to Files for reading/writing a string from/to a file

2018-06-19 Thread Joe Wang
Thanks Alan. I created 8205058 to capture your suggestions. Please see below for more details. On 6/14/18, 4:30 AM, Alan Bateman wrote: On 12/06/2018 17:52, Joe Wang wrote: Hi all, It's been a while since the 1st round of reviews. Thank you all for the valuable comments and suggestions!

Re: [core-libs] RFR (L): 8010319: Implementation of JEP 181: Nest-Based Access Control

2018-06-19 Thread mandy chung
The javadoc update looks good to me. Mandy On 6/19/18 9:56 PM, David Holmes wrote: Some further adjustments to getNestMembers() was made. Everything updated in place. Thanks, David On 20/06/2018 9:30 AM, David Holmes wrote: Sorry another update is imminent ... stay tuned. David On

Re: [core-libs] RFR (L): 8010319: Implementation of JEP 181: Nest-Based Access Control

2018-06-19 Thread David Holmes
Some further adjustments to getNestMembers() was made. Everything updated in place. Thanks, David On 20/06/2018 9:30 AM, David Holmes wrote: Sorry another update is imminent ... stay tuned. David On 19/06/2018 2:41 PM, David Holmes wrote: Discussions on the CSR request have led to further

Re: BiCollector

2018-06-19 Thread Dawid Weiss
Not that it's an important factor but as a non-native English speaker I like the simplest form of "toBoth()" best. I also doubt there will ever be a "Both" class in the JDK to worry about, even if such examples can be found in the wild [1]. Dawid [1]

Re: BiCollector

2018-06-19 Thread Peter Levart
On 06/19/18 09:43, Peter Levart wrote: We already have some toXxx() methods (toList, toSet, toCollection, toMap, ...), so toBoth seems to me as a natural extension of that naming principle: Well, on a second thought, toList, toSet, etc... they all name a type that is a result of the

Re: BiCollector

2018-06-19 Thread Kirk Pepperdine
> On Jun 19, 2018, at 9:11 AM, Zheka Kozlov wrote: > > The function you propose is just a binary variant of mapping: > > Collector mapping( > Function mapper, > Collector downstream); > > (omitted '? super' for readability) > > So,

Re: BiCollector

2018-06-19 Thread Zheka Kozlov
I agree that f1 and f2 are unnecessary. I also noticed that toBoth is a binary form of `collectingAndThen`: public static Collector collectingAndThen( Collector downstream, Function finisher); So what about `collectionToBothAndThen`? public static Collector

Re: BiCollector

2018-06-19 Thread Peter Levart
On 06/19/2018 12:21 AM, Brian Goetz wrote: distributing? More "replicating" than "distributing" (thinking of replicated vs. distributed caches for example). Peter

Re: RFR 8199435 : Unsafe publication of java.util.Properties.map

2018-06-19 Thread Peter Levart
On 06/18/2018 06:53 PM, Claes Redestad wrote: Plain write that follows in program a volatile write, can in theory float before the volatile write. So if you publish a Properties instance via data race (via plain write), the observer may still see uninitialized 'map' and 'defaults' fields.

Re: BiCollector

2018-06-19 Thread Brian Goetz
We already have some toXxx() methods (toList, toSet, toCollection, toMap, ...), so toBoth seems to me as a natural extension of that naming principle: For toXxx methods, the Xxx is terminal, and tied to the result type.  toArray converts to an array; toList to a List; toCollection to a

Re: BiCollector

2018-06-19 Thread Brian Goetz
collectingToBoth This one is actually both evocative of what the method does, and in the spirit of the existing naming conventions (collectingAndThen.) An n-ary version could just be called `collectingTo`, where it is passed a varargs of Collector.  Could we get away with collectingTo

Re: BiCollector

2018-06-19 Thread Brian Goetz
No. The essence of `mapping` is: apply this function, then pass them down to something else.  In that case, the something else is secondary to the mapping. The essence of this method is: split the stream into _two_ streams, so it can be operated on by two collectors.  Any mapping here is