Re: RFR 8015978: Incorrect transformation of XPath expression string(-0)

2013-06-07 Thread huizhe wang
Hi Aleksej, According to XPath spec, both positive and negative zero are converted to the string 0, so it seems doesn't matter. But if you want to detect the negative zero, you may do the following: if (d == 0.0 1/d 0.0) { d=0.0 } Recognizing that (-0.0 == 0.0), and

Re: hg: jdk8/tl/jdk: 8014383: StringJoiner example in class description not in sync with streams API

2013-06-07 Thread Paul Sandoz
Hi Roel, Would you like to submit a patch and contribute? Paul. On Jun 4, 2013, at 4:16 PM, Roel Spilker r.spil...@gmail.com wrote: Looking at the implementation, the code in toString suggest that it's worthwhile to optimize for an empty suffix (although I doubt that this optimization has

Re: Is there a better way to throw this exception?

2013-06-07 Thread David Holmes
Peter, On 7/06/2013 12:57 AM, Peter Levart wrote: On 06/06/2013 11:42 AM, Weijun Wang wrote: Hi All I have a method that could throw two kinds of checked exceptions and possibly other unchecked ones: void once() throws One, Two Now I have a wrapper method that calls once() for multiple

hg: jdk8/tl/jdk: 7177315: SimpleDateFormat parses wrong 2-digit year if input contains spaces

2013-06-07 Thread masayoshi . okutsu
Changeset: 6975eea0b458 Author:okutsu Date: 2013-06-07 17:07 +0900 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/6975eea0b458 7177315: SimpleDateFormat parses wrong 2-digit year if input contains spaces Reviewed-by: peytoia ! src/share/classes/java/text/SimpleDateFormat.java +

hg: jdk8/tl/jdk: 7064270: java/text/Format/DateFormat/WeekDateTest.java fails on OEL5.6 hi_IN.UTF-8

2013-06-07 Thread masayoshi . okutsu
Changeset: a286ed046116 Author:okutsu Date: 2013-06-07 17:37 +0900 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a286ed046116 7064270: java/text/Format/DateFormat/WeekDateTest.java fails on OEL5.6 hi_IN.UTF-8 Reviewed-by: peytoia !

Re: RFR 8016139: PrimitiveIterator.forEachRemaining

2013-06-07 Thread Paul Sandoz
Hi, The following patch defines the abstract method PrimitiveIterator.forEachRemaining. This is now consistent with Spliterator.OfPrimitive and there may be cases in the future where this is useful and if we don't do it now it becomes difficult to do so later on.

Request for review: 8016046 (process) Strict validation of input should be security manager case only [win]

2013-06-07 Thread Alexey Utkin
Hi, Please review the fix. Bug description: http://bugs.sun.com/view_bug.do?bug_id=8016046 https://jbs.oracle.com/bugs/browse/JDK-8016046 The suggested fix: http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016046/webrev.00/ Summary: In absence of the Security Manager the

RFR (S) CR 7177472: JSR292: MethodType interning penalizes scalability

2013-06-07 Thread Aleksey Shipilev
(posting this to hotspot-dev@ and cc-ing core-libs-dev@, as Christian T. suggested offline) Hi guys, The fix for scalability problem is here: http://cr.openjdk.java.net/~shade/7177472/webrev.00/ Testing: - Linux x86_64 builds OK - Linux x86_64 java/lang/invoke/ jtreg passes OK Since this

Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] {Package: con.sun. * java.lang*}

2013-06-07 Thread Otávio Gonçalves de Santana
Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] The string addition in the parameter will create another string buffer, append all the components, then convert that to a string so the you can be appended to your string buffer. So I replace this: sb.append(xxx: [ +

Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] {Package: sun.*}

2013-06-07 Thread Otávio Gonçalves de Santana
Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] The string addition in the parameter will create another string buffer, append all the components, then convert that to a string so the you can be appended to your string buffer. So I replace this: sb.append(xxx: [ +

Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] {Package: java. * without Swing}

2013-06-07 Thread Otávio Gonçalves de Santana
The string addition in the parameter will create another string buffer, append all the components, then convert that to a string so the you can be appended to your string buffer. So I replace this: sb.append(xxx: [ + getXXX() + ]\n); for this: sb.append(xxx:

Re: Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] {Package: con.sun. * java.lang*}

2013-06-07 Thread Andrew Haley
On 06/07/2013 02:18 PM, Otávio Gonçalves de Santana wrote: Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] The string addition in the parameter will create another string buffer, append all the components, then convert that to a string so the you can be appended to your

Re: Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] {Package: con.sun. * java.lang*}

2013-06-07 Thread Tom Hawtin
On 07/06/2013 14:54, Andrew Haley wrote: On 06/07/2013 02:18 PM, Otávio Gonçalves de Santana wrote: sb.append(xxx: [ + getXXX() + ]\n); for this: sb.append(xxx: [).append(getXXX()).append(]\n); Hmm. I wonder that a JIT can't do this automatically. Perhaps it already does; I

Re: RFR 8016139: PrimitiveIterator.forEachRemaining

2013-06-07 Thread Alan Bateman
On 07/06/2013 10:05, Paul Sandoz wrote: Hi, The following patch defines the abstract method PrimitiveIterator.forEachRemaining. This is now consistent with Spliterator.OfPrimitive and there may be cases in the future where this is useful and if we don't do it now it becomes difficult to do

Re: RFR 8015978: Incorrect transformation of XPath expression string(-0)

2013-06-07 Thread David Chase
Wouldn't be more efficient to do the following, assuming that the full Java compilation chain respects the trickiness of 0 vs -0: if (d == 0.0) { d=0.0 // Jam -0 == +0 to +0, per http://www.w3.org/TR/xpath/#function-string } Division's plenty more expensive than assigning a

Re: Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] {Package: con.sun. * java.lang*}

2013-06-07 Thread Otávio Gonçalves de Santana
I wrote a simple test. public class BuilderTest{ public void testAppend(String name){ StringBuilder sb=new StringBuilder(); sb.append(hello).append( World: ).append(name); } public void testConcat(String name){ StringBuilder sb=new StringBuilder(); sb.append(hello + World: +name); }

Re: Request for review: 8016046 (process) Strict validation of input should be security manager case only [win]

2013-06-07 Thread Alan Bateman
On 07/06/2013 10:02, Alexey Utkin wrote: Hi, Please review the fix. Bug description: http://bugs.sun.com/view_bug.do?bug_id=8016046 https://jbs.oracle.com/bugs/browse/JDK-8016046 The suggested fix: http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8016046/webrev.00/ Summary: In

Re: RFR 8016139: PrimitiveIterator.forEachRemaining

2013-06-07 Thread Paul Sandoz
On Jun 7, 2013, at 5:35 PM, Alan Bateman alan.bate...@oracle.com wrote: On 07/06/2013 10:05, Paul Sandoz wrote: Hi, The following patch defines the abstract method PrimitiveIterator.forEachRemaining. This is now consistent with Spliterator.OfPrimitive and there may be cases in the

Re: RFR 8015978: Incorrect transformation of XPath expression string(-0)

2013-06-07 Thread Joe Darcy
I'll do you one better; you can turn a negative zero into a positive zero leaving other values unchanged like this: d = d + 0.0; In IEEE 754 under the round-to-nearest-even rounding mode required by Java -0.0 + 0.0 = (+)0.0 This trick is used in various places in Java's numerical

hg: jdk8/tl/jdk: 7051862: CookiePolicy spec conflicts with CookiePolicy.ACCEPT_ORIGINAL_SERVER

2013-06-07 Thread kurchi . subhra . hazra
Changeset: 8b65dfe8f509 Author:khazra Date: 2013-06-07 10:59 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/8b65dfe8f509 7051862: CookiePolicy spec conflicts with CookiePolicy.ACCEPT_ORIGINAL_SERVER Summary: Return false for null arguments in

RFR : 7129185 : (M) Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}

2013-06-07 Thread Mike Duigou
Hello all; I've incorporated feedback from previous rounds and expect to finalize this addition soon. http://cr.openjdk.java.net/~mduigou/JDK-7129185/2/webrev/ Any review feedback or suggestions of additional tests welcome. Thanks, Mike

hg: jdk8/tl/jdk: 8016101: Fix typo in SerialRef and missing @param in SerialStruct

2013-06-07 Thread lance . andersen
Changeset: e2333bd8514a Author:lancea Date: 2013-06-07 14:13 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/e2333bd8514a 8016101: Fix typo in SerialRef and missing @param in SerialStruct Reviewed-by: darcy ! src/share/classes/javax/sql/rowset/serial/SerialRef.java !

Re: RFR 8015978: Incorrect transformation of XPath expression string(-0)

2013-06-07 Thread huizhe wang
Nice. One-line change, I guess Aleksej would love it :-) On 6/7/2013 10:19 AM, Joe Darcy wrote: I'll do you one better; you can turn a negative zero into a positive zero leaving other values unchanged like this: d = d + 0.0; In IEEE 754 under the round-to-nearest-even rounding mode

Re: Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] {Package: con.sun. * java.lang*}

2013-06-07 Thread Victor Polischuk
Excuse me for asking something stupid but do empty appends in com.sun.tools.hat.internal.model.JavaValueArray make any sense? result.append().append(val); //Victor --- Original message --- From: Ot�vio Gon�alves de Santana otavioj...@java.net Date: 7 June 2013, 16:20:02 Inefficient use

hg: jdk8/tl/jdk: 8015728: (zipfs) demo/zipfs/basic.sh failing

2013-06-07 Thread xueming . shen
Changeset: aed2ad905da6 Author:sherman Date: 2013-06-07 13:49 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/aed2ad905da6 8015728: (zipfs) demo/zipfs/basic.sh failing Summary: to return the correct loc entry size from wirteLOC(); Reviewed-by: alanb !

Re: RFR : 7129185 : (M) Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}

2013-06-07 Thread Joseph Darcy
On 6/7/2013 2:51 PM, Martin Buchholz wrote: tt is denigrated in favor of {@code ? It is by me anyway! -Joe

Re: Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] {Package: con.sun. * java.lang*}

2013-06-07 Thread Otávio Gonçalves de Santana
Yes, I think you are right. I did one more refactoring in this packages. diff --git a/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java b/src/share/classes/com/sun/tools/example/debug/gui/ContextManager.java ---

Re: Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] {Package: java. * without Swing}

2013-06-07 Thread Otávio Gonçalves de Santana
I did one more refactoring in this packages. diff --git a/src/share/classes/javax/management/openmbean/ArrayType.java b/src/share/classes/javax/management/openmbean/ArrayType.java --- a/src/share/classes/javax/management/openmbean/ArrayType.java +++

Re: RFR : 7129185 : (M) Add Collections.{checked|empty|unmodifiable}Navigable{Map|Set}

2013-06-07 Thread Mike Duigou
Thank you for the review Martin. On Jun 7 2013, at 14:51 , Martin Buchholz wrote: tt is denigrated in favor of {@code ? Yes. {@code} is preferred because it treats the content as literals. This means you can use it to wrap text (usually generics) that have to represented using html entities

Re: Inefficient use StringBuffer or StringBuilder[Optimization|clean-up] {Package: sun.*}

2013-06-07 Thread Otávio Gonçalves de Santana
I did one more refactoring in this packages. diff --git a/src/share/classes/sun/management/Agent.java b/src/share/classes/sun/management/Agent.java --- a/src/share/classes/sun/management/Agent.java +++ b/src/share/classes/sun/management/Agent.java @@ -497,7 +497,7 @@ } else {

Re: AWT Dev [8] Review Request for 8009911 : [macosx] SWT app freeze when going full screen using Java 7 on Mac

2013-06-07 Thread Nicholas Rahn
+1 for this patch. (Thanks, Petr!) I have tried it in the latest jdk8 (b91) and it fixes both of the SWT+OpenJDK78 bugs that I submitted in the Eclipse bugzilla. Would be great if this could be accepted at least for jdk8 (if not jdk7u too). Cheers, Nick On Tue, May 21, 2013 at 1:07 PM, Petr

Re: Is there a better way to throw this exception?

2013-06-07 Thread John Rose
Puzzles! Probably you can use the new syntax catch (Ex1|Ex2 ex) to bind the first exception to a union type. You'll have to split the loop, but you could use a common iterator. for (Iterator it = all changes; it.hasNext(); ) { try { it.next(); once(); return; } catch (One|Two ex) {

hg: jdk8/tl/langtools: 8016193: Fix OAC issue in langtools docs

2013-06-07 Thread jonathan . gibbons
Changeset: fd31bf97340f Author:jjg Date: 2013-06-07 15:35 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/fd31bf97340f 8016193: Fix OAC issue in langtools docs Reviewed-by: darcy ! src/share/classes/com/sun/javadoc/Tag.java

RFR: JDK-8016209: TEST_BUG: non-compliant jmc in the bin directory hangs testing (XS)

2013-06-07 Thread Kumar Srinivasan
Hi, Can I get a quick review please, the fix excludes j2sdk-image/bin/jmc{.exe} from the test, which invokes the tool and verifies that -version and -Joptions work. As the subject says invoking this tool with any option puts up a window, hanging up the test. Thanks Kumar diff --git

RFR: 8016213 : (S) Convert j2se NetBeans project to new build infrastructure

2013-06-07 Thread Mike Duigou
Hello all; I took a look today at converting the existing J2SE NetBeans project to use the new build infrastructure. It turned out to be easier than I thought! Below is the patch needed to invoke the top level make file 'clean-jdk' and 'jdk' targets. It requires that have previously run the

Re: RFR: JDK-8016209: TEST_BUG: non-compliant jmc in the bin directory hangs testing (XS)

2013-06-07 Thread Joe Darcy
Approved. -Joe On 6/7/2013 5:52 PM, Kumar Srinivasan wrote: Hi, Can I get a quick review please, the fix excludes j2sdk-image/bin/jmc{.exe} from the test, which invokes the tool and verifies that -version and -Joptions work. As the subject says invoking this tool with any option puts up a

hg: jdk8/tl/jdk: 7124706: enable RetransformBigClass.sh test when fix for 8013063 is promoted

2013-06-07 Thread coleen . phillimore
Changeset: f18337edd201 Author:coleenp Date: 2013-06-07 22:15 -0400 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f18337edd201 7124706: enable RetransformBigClass.sh test when fix for 8013063 is promoted Summary: The code for this test is fixed now and integrated to TL repo and