Re: please review draft JEP: Convenience Factory Methods for Collections

2014-07-17 Thread Michael Kay
Set.of() and List.of() look very attractive; Map.of() looks very ugly. I would much prefer to write something like Map.of( Map.pair(key, value), Map.pair(key, value), Map.pair(key, value) ); and have no limit on the number of pairs. (Don't care how it works internally...) The last thing

Re: FYC: 7197183 : Provide CharSequence.subSequenceView which allows for sub-sequence views of character sequences.

2014-07-17 Thread Michael Kay
In my own product (Saxon) I have a class CharSlice which is pretty much identical to your CharSubSequenceView. So yes, I think it is useful. Michael Kay Saxonica m...@saxonica.com +44 (0118) 946 5893 On 17 Jul 2014, at 01:09, Mike Duigou mike.dui...@oracle.com wrote: Hello all; In Java

Re: please review draft JEP: Convenience Factory Methods for Collections

2014-07-17 Thread Tom Hawtin
I note that with the basic proposal, HashSet.of and indeed NavigableSet.of still work. They just do the wrong thing. Tom

Re: please review draft JEP: Convenience Factory Methods for Collections

2014-07-17 Thread Michael Kay
On 17 Jul 2014, at 08:21, Michael Kay m...@saxonica.com wrote: Set.of() and List.of() look very attractive; Map.of() looks very ugly. I would much prefer to write something like Map.of( Map.pair(key, value), Map.pair(key, value), Map.pair(key, value) ); Another style that would

Re: please review draft JEP: Convenience Factory Methods for Collections

2014-07-17 Thread Remi Forax
On 07/17/2014 04:05 AM, Paul Benedict wrote: Regarding why you didn't choose a straight vararg solution, I prefer you do allow any number of key/values as long as you throw an exception if the array is not an even sized. You can not extract/infer the type of the key and the type of the value

Re: Review request for 8050804: (jdeps) Recommend supported API to replace use of JDK internal API

2014-07-17 Thread Daniel Fuchs
Hi Mandy, minor: JdepsTask.java:977 could be refactored to use putIfAbsent I wonder whether the summary table at the end should contain a warning for all the usage of jdk internals that have no replacement? Otherwise looks good! I like the output much better :-) best regards, -- daniel On

Re: RFR: JDK-8042589: String.toLowerCase do not work for some concatenated strings

2014-07-17 Thread Ulf Zibis
There is again another little optimization possible: instead hasSurr = true; we could use first = ~first; and save variable hasSurr. If there is register pressure (especially on older CPUs), this might be a performance advantage. Also I think we should not grow the result array for

Re: RFR: JDK-8042589: String.toLowerCase do not work for some concatenated strings

2014-07-17 Thread Ulf Zibis
Additionally I think, instead of retrieving String lang = locale.getLanguage() multiple times in chain, we could pass lang to the methods instead locale. -Ulf Am 17.07.2014 11:54, schrieb Ulf Zibis: There is again another little optimization possible: instead hasSurr = true; we could

Re: Fwd: JDK 9 RFR of JDK-8030942: Explicitly state floating-point summation requirements on non-finite inputs

2014-07-17 Thread Georgiy Rakov
Hello, let's consider following excerpt: 149 * It is possible for intermediate sums of finite values to 150 * overflow into opposite-signed infinities; if that occurs, the 151 * final sum will be NaN even if the recorded values are all 152 * finite. It says about

Re: Review request for 8050804: (jdeps) Recommend supported API to replace use of JDK internal API

2014-07-17 Thread Mandy Chung
On 7/17/2014 2:41 AM, Daniel Fuchs wrote: Hi Mandy, minor: JdepsTask.java:977 could be refactored to use putIfAbsent ok. I wonder whether the summary table at the end should contain a warning for all the usage of jdk internals that have no replacement? It's intentional. The list shown

Re: FYC: 7197183 : Provide CharSequence.subSequenceView which allows for sub-sequence views of character sequences.

2014-07-17 Thread Claes Redestad
Hi Mike, while nicely abstracting the problem, promoting developers to re-introduce some of the leakiness that the 7u6 String changes helped remove is something I think we should be wary of. If anything I think such an object should not be Serializable; maybe even have hashCode() throw

[9] RFR 8038970: Deprivilege JAX-WS/JAF code

2014-07-17 Thread Miroslav Kos
Hi everybody, here is a request for review for 8038970: Deprivilege JAX-WS/JAF code JBS: https://bugs.openjdk.java.net/browse/JDK-8038970 webrev: http://cr.openjdk.java.net/~mkos/8038970/jaxws.04/ This is first part of changes - after this also jdk build will have to be changed. Changeset has

Re: [9] RFR (M): 8050877: Improve code for pairwise argument conversions and value boxing/unboxing

2014-07-17 Thread Paul Sandoz
On Jul 16, 2014, at 6:28 PM, Vladimir Ivanov vladimir.x.iva...@oracle.com wrote: http://cr.openjdk.java.net/~vlivanov/8050877/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8050877 Improved MethodHandleImpl.makePairwiseConvert ValueConversions.unbox and small cleanups in related

Re: [9] RFR 8038970: Deprivilege JAX-WS/JAF code

2014-07-17 Thread Mandy Chung
On 7/17/2014 8:12 AM, Miroslav Kos wrote: Hi everybody, here is a request for review for 8038970: Deprivilege JAX-WS/JAF code JBS: https://bugs.openjdk.java.net/browse/JDK-8038970 webrev: http://cr.openjdk.java.net/~mkos/8038970/jaxws.04/ FYI. The href at the above links were wrong.

Re: [9] RFR (M): 8050884: Intrinsify ValueConversions.identity() functions

2014-07-17 Thread Paul Sandoz
On Jul 16, 2014, at 6:44 PM, Vladimir Ivanov vladimir.x.iva...@oracle.com wrote: http://cr.openjdk.java.net/~vlivanov/8050884/webrev.00/ https://bugs.openjdk.java.net/browse/JDK-8050884 Replace ValueConversions.identity() functions with intrinsics. Testing: jdk/java/lang/invoke,

Re: [9] RFR (S): 8050887: Intrinsify constants for default values

2014-07-17 Thread Paul Sandoz
On Jul 16, 2014, at 6:57 PM, Vladimir Ivanov vladimir.x.iva...@oracle.com wrote: http://cr.openjdk.java.net/~vlivanov/8050887/webrev.00 https://bugs.openjdk.java.net/browse/JDK-8050887 Intrinsify MethodHandles.constant() for default values. Testing: jdk/java/lang/invoke,

Re: Fwd: JDK 9 RFR of JDK-8030942: Explicitly state floating-point summation requirements on non-finite inputs

2014-07-17 Thread Joe Darcy
Hello, On 07/17/2014 04:33 AM, Georgiy Rakov wrote: Hello, let's consider following excerpt: 149 * It is possible for intermediate sums of finite values to 150 * overflow into opposite-signed infinities; if that occurs, the 151 * final sum will be NaN even if the recorded

Re: RFR: JDK-8042589: String.toLowerCase do not work for some concatenated strings

2014-07-17 Thread Xueming Shen
Let's fix the regression first, before make any more optimization :-) -Sherman On 07/17/2014 02:54 AM, Ulf Zibis wrote: There is again another little optimization possible: instead hasSurr = true; we could use first = ~first; and save variable hasSurr. If there is register pressure

Re: please review draft JEP: Convenience Factory Methods for Collections

2014-07-17 Thread Steven Schlansker
On Jul 16, 2014, at 5:46 PM, Stuart Marks stuart.ma...@oracle.com wrote: Hi all, Please review this draft JEP for Convenience Factory Methods for Collections: https://bugs.openjdk.java.net/browse/JDK-8048330 Brief background: several times over the years there have been proposals to

Re: please review draft JEP: Convenience Factory Methods for Collections

2014-07-17 Thread Dan Smith
The motivation section ought to more directly survey what we have now: - Collections.emptyList/emptySet/emptyMap - Collections.singletonList/singleton/singletonMap - Arrays.asList - EnumSet.of (varargs, plus some overloads) - Stream.empty and Stream.of (singleton plus varargs) - Constructors that,

Re: Covariant overrides on the Buffer Hierarchy redux

2014-07-17 Thread mark . reinhold
2014/7/15 22:58 -0700, paul.san...@oracle.com: There was discussion here: http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-April/026458.html https://bugs.openjdk.java.net/browse/JDK-4774077 http://cr.openjdk.java.net/~rwarburton/buffer-overrides-1/ The patch looks good.

Re: please review draft JEP: Convenience Factory Methods for Collections

2014-07-17 Thread Stuart Marks
On 7/17/14 12:21 AM, Michael Kay wrote: Set.of() and List.of() look very attractive; Map.of() looks very ugly. The proposed Map.of() API offends our sensibilities as programmers, because of its repetition and its lack of generality. I think that's what you mean by ugly. There is a indeed

Re: please review draft JEP: Convenience Factory Methods for Collections

2014-07-17 Thread Stuart Marks
On 7/17/14 12:46 AM, Tom Hawtin wrote: I note that with the basic proposal, HashSet.of and indeed NavigableSet.of still work. They just do the wrong thing. I should have made more clear in the JEP that the proposed APIs are static methods on the List/Map/Set interfaces, not default methods.

RFR: 8051057: (s) Optimize StringCharBuffer.toString(int, int)

2014-07-17 Thread Mike Duigou
Hello all; While investigating another issue I ran across some code in java.nio.StringCharBuffer.toString(int, int) which might be possible to improve. Currently the implementation calls toString() on the source CharSequence and then uses String.substring to create the desired range. For the

Re: please review draft JEP: Convenience Factory Methods for Collections

2014-07-17 Thread Stuart Marks
On 7/17/14 10:17 AM, Steven Schlansker wrote: This is fantastic, I think a large number of developers will cheer as more and more of Guava makes it into core libs :) Great! One thing I notice is that you take a lot of care to not specify how the Map or Set will be implemented. This could

Re: please review draft JEP: Convenience Factory Methods for Collections

2014-07-17 Thread Stuart Marks
Hi Dan, thanks for the feedback. On 7/17/14 10:40 AM, Dan Smith wrote: The motivation section ought to more directly survey what we have now: - Collections.emptyList/emptySet/emptyMap - Collections.singletonList/singleton/singletonMap - Arrays.asList - EnumSet.of (varargs, plus some overloads)

Re: [9] RFR (M): 8050052: Small cleanups in java.lang.invoke code

2014-07-17 Thread John Rose
On Jul 16, 2014, at 11:20 AM, Peter Levart peter.lev...@gmail.com wrote: An alternative could be: public Throwable throwIfUnchecked() { if (this instanceof RuntimeException) throw (RuntimeException) this; if (this instanceof Error) throw (Error) this; return this; } Then use it

Different notations for static and instance methods

2014-07-17 Thread Wang Weijun
We should define different notations for static and instance methods. For example, List.of and List::of, although I admit it is quite confusing. --Max On Jul 18, 2014, at 5:56, Stuart Marks stuart.ma...@oracle.com wrote: On 7/17/14 12:46 AM, Tom Hawtin wrote: I note that with the basic

Re: [9] RFR (M): 8050052: Small cleanups in java.lang.invoke code

2014-07-17 Thread John Rose
FTR, I captured this issue: https://bugs.openjdk.java.net/browse/JDK-8051294 (Wish they were all so easy to catch.) — John On Jul 17, 2014, at 5:12 PM, John Rose john.r.r...@oracle.com wrote: On Jul 16, 2014, at 11:20 AM, Peter Levart peter.lev...@gmail.com wrote: An alternative could

Re: please review draft JEP: Convenience Factory Methods for Collections

2014-07-17 Thread Tom Hawtin
On 17/07/2014 22:56, Stuart Marks wrote: On 7/17/14 12:46 AM, Tom Hawtin wrote: I note that with the basic proposal, HashSet.of and indeed NavigableSet.of still work. They just do the wrong thing. I should have made more clear in the JEP that the proposed APIs are static methods on the

Review request for 8050968: Extension class loader initialization fails on Win7 x64 zh_TW

2014-07-17 Thread Mandy Chung
This is a regression caused by JDK-8038177 that changed sun.nio.cs.ext.ExtendedCharsets to use lambda. It turns out that ExtendedCharsets is loaded during the initialization of the extension class loader when opening jre/lib/ext/meta-index on windows with system locale loading extended charsets

Re: Review request for 8050968: Extension class loader initialization fails on Win7 x64 zh_TW

2014-07-17 Thread David Holmes
Hi Mandy, On 18/07/2014 2:57 PM, Mandy Chung wrote: On 7/17/2014 9:56 PM, Mandy Chung wrote: This is a regression caused by JDK-8038177 that changed sun.nio.cs.ext.ExtendedCharsets to use lambda. It turns out that ExtendedCharsets is loaded during the initialization of the extension class