Re: Remove redundant calls of toString()

2014-04-28 Thread Paul Sandoz
Hi Otávio, Is there anyway you can experiment with publishing a webrev to dropbox or github, preferably so that it is browsable, otherwise the zip? Unfortunately the patches are hard to review, especially in response to reviews where code is updated. I realize until you have an openjdk

Re: inefficient indexof when String has one length

2014-04-28 Thread Paul Sandoz
On Apr 27, 2014, at 2:22 PM, Claes Redestad claes.redes...@oracle.com wrote: Possibly a few bytes in static class footprint, sure. Maybe this is something javac should optimize (javap on some trivial examples suggests this doesn't happen) rather than trying to root out all suboptimal cases,

Re: RFR 9: JDK-8040892 Incorrect message in Exception thrown by Collectors.toMap(Function, Function)

2014-04-28 Thread Paul Sandoz
On Apr 25, 2014, at 7:31 PM, Peter Levart peter.lev...@gmail.com wrote: Hi Paul, To make any sense of null return from the mergeFunction, which could mean that an entry with that key is absent from resulting map, such Collector would have to keep some more state - the collecting map (which

Re: Remove redundant calls of toString()

2014-04-28 Thread David Holmes
On 28/04/2014 1:05 PM, Otávio Gonçalves de Santana wrote: In my opinion not, because Objects.requireNonNull is more readable than just string.toString. This way is more understandable which field is required and doesn't impact on performance. An invocation of requireNonNull is potentially more

Re: RFR 9: JDK-8040892 Incorrect message in Exception thrown by Collectors.toMap(Function, Function)

2014-04-28 Thread Peter Levart
On 04/28/2014 10:20 AM, Paul Sandoz wrote: On Apr 25, 2014, at 7:31 PM, Peter Levart peter.lev...@gmail.com wrote: Hi Paul, To make any sense of null return from the mergeFunction, which could mean that an entry with that key is absent from resulting map, such Collector would have to keep

Re: RFR 9: JDK-8040892 Incorrect message in Exception thrown by Collectors.toMap(Function, Function)

2014-04-28 Thread Paul Sandoz
On Apr 28, 2014, at 12:30 PM, Peter Levart peter.lev...@gmail.com wrote: You could use the null return from Map.merge() as a signal to throw NPE, but this is only 100% safe in to*Map() methods that don't take a mapSupplier. Collections.toConcurrentMap(, SupplierM mapSupplier) could be

Re: Remove redundant calls of toString()

2014-04-28 Thread Otávio Gonçalves de Santana
Yes you are right, but I mean it doesn't too much expensive enough to don't use the requireNonNull. IMHO. On Mon, Apr 28, 2014 at 3:57 AM, David Holmes david.hol...@oracle.comwrote: On 28/04/2014 1:05 PM, Otávio Gonçalves de Santana wrote: In my opinion not, because Objects.requireNonNull is

RFR: 8040754: Break the circular dependency between SAAJ and JAXB

2014-04-28 Thread Miroslav Kos
Hi, this is review request for: 8040754: Break the circular dependency between SAAJ and JAXB JBS: https://bugs.openjdk.java.net/browse/JDK-8040754 WEBREV: http://cr.openjdk.java.net/~mkos/8040754/jaxws.01/ It is basically moving classes in order to fix dependency between SAAJ, JAX-B and

Re: Remove redundant calls of toString()

2014-04-28 Thread Otávio Gonçalves de Santana
Done. Link: https://dl.dropboxusercontent.com/u/16109193/open_jdk/string_to_string_uncessary.zip On Mon, Apr 28, 2014 at 4:34 AM, Paul Sandoz paul.san...@oracle.com wrote: Hi Otávio, Is there anyway you can experiment with publishing a webrev to dropbox or github, preferably so that it is

Re: inefficient indexof when String has one length

2014-04-28 Thread Otávio Gonçalves de Santana
link: https://dl.dropboxusercontent.com/u/16109193/open_jdk/index_of_with_char.zip On Mon, Apr 28, 2014 at 10:25 AM, Otávio Gonçalves de Santana otavioj...@java.net wrote: link: https://dl.dropboxusercontent.com/u/16109193/open_jdk/index_of_with_char.zip On Mon, Apr 28, 2014 at 4:42 AM,

Re: Remove redundant calls of toString()

2014-04-28 Thread Paul Benedict
I have to say that the expected NPE is quite hidden in the current code. I am actually surprised someone was able to catch that. The use of Objects.requreNonNull() is way more clear and I prefer that approach for the sake of clarity. On Mon, Apr 28, 2014 at 8:28 AM, Otávio Gonçalves de Santana

Re: RFR: 8040754: Break the circular dependency between SAAJ and JAXB

2014-04-28 Thread Chris Hegarty
Miran, This change looks good to me. Reviewed. I applied the patch to the latest jdk9/dev and all tests pass as expected. I see Mandy is sponsoring this for you. -Chris. On 28/04/14 13:01, Miroslav Kos wrote: Hi, this is review request for: 8040754: Break the circular dependency between

Re: Creating Thread in AccessController.doPrivileged()

2014-04-28 Thread Tom Hawtin
On 24/04/2014 06:06, Zhong Yu wrote: If a thread is created inside AccessController.doPrivileged(), it seems to inherit AccessControlContext from the calling thread, is that the expected/specified behavior? It should inherit the acc from when it was created. If that context was privileged by

Re: Remove redundant calls of toString()

2014-04-28 Thread Claes Redestad
On 04/28/2014 08:57 AM, David Holmes wrote: On 28/04/2014 1:05 PM, Otávio Gonçalves de Santana wrote: In my opinion not, because Objects.requireNonNull is more readable than just string.toString. This way is more understandable which field is required and doesn't impact on performance. An

Guidance about binary / data files for JTREG tests

2014-04-28 Thread Brian Burkhalter
This follows from my posting of last week http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-April/026604.html Firstly, I was informed that there are not supposed to be binary files in the jdk9/jdk/test tree. My webrev listed in the above post includes one such file, a GZIPped text file

Re: RFR: 8040754: Break the circular dependency between SAAJ and JAXB

2014-04-28 Thread Mandy Chung
Miran, Looks good to me. I'll sponsor this patch for you. Mandy On 4/28/14 7:30 AM, Chris Hegarty wrote: Miran, This change looks good to me. Reviewed. I applied the patch to the latest jdk9/dev and all tests pass as expected. I see Mandy is sponsoring this for you. -Chris. On

Re: Guidance about binary / data files for JTREG tests

2014-04-28 Thread Florian Weimer
On 04/28/2014 07:53 PM, Brian Burkhalter wrote: Meanwhile I suppose that I could convert my test file and use the sun.misc.UU{En,De}coder classes to handle it in the test. Uh-oh, we have java.util.Base64 these days. But in this case, it's probably simpler to use this code snippet instead

Re: Guidance about binary / data files for JTREG tests

2014-04-28 Thread Brian Burkhalter
On Apr 28, 2014, at 11:52 AM, Florian Weimer fwei...@redhat.com wrote: On 04/28/2014 07:53 PM, Brian Burkhalter wrote: Meanwhile I suppose that I could convert my test file and use the sun.misc.UU{En,De}coder classes to handle it in the test. Uh-oh, we have java.util.Base64 these days.

Re: Remove redundant calls of toString()

2014-04-28 Thread Phil Race
I am quite sure that you are right that these were deliberate so I am adding Jim who was the author of all of the 2d ones to explain the intent. BTW Otávio, changes in 2D code like this should not slip by on the core-libs list. It ought to go to 2d-dev. -phil. On 4/28/2014 9:24 AM, Louis

Re: Guidance about binary / data files for JTREG tests

2014-04-28 Thread Brian Burkhalter
For grins here’s an alternative implementation of your algorithm that is slower but likely takes less memory: private static BitSet primesBS(int n) { int nbits = n + 1; BitSet bs = new BitSet(nbits); bs.set(0, 2, true); for (int p = 2; p * p n;) {

Re: Remove redundant calls of toString()

2014-04-28 Thread Jim Graham
We refer to these strings as constants in many places. If you have: class Foo { static final String bar = really long string; } class Blah { // uses Foo.bar } Then Blah will incorporate that string by content, not by reference. I don't know why this is done this way, but Strings are

Re: JDK 9 RFR of 8026236: Add PrimeTest for BigInteger [TEST-ONLY]

2014-04-28 Thread Brian Burkhalter
Here is an updated patch http://cr.openjdk.java.net/~bpb/8026236/webrev.02/ which has been revised to obviate the need for a file source of prime numbers. Thanks, Brian On Apr 24, 2014, at 5:12 PM, Brian Burkhalter brian.burkhal...@oracle.com wrote: I have posted an updated patch here: