Re: Java 8 RFR 8010430: Math.round has surprising behavior for odd values of ulp 1

2013-08-23 Thread Dmitry Nadezhin
Guy pointed to JLS 1 semantics. Yes, it was clearer. Ok. I agree that java.lang.Math.round() and IEEE 754-2008 roundToIntegralTiesToAway() has different semantics. The current API specification is a little misleading. I tried to implement JLS 1 semantics in a bit-twiddling way: === public stat

Re: Java 8 RFC 7189139: BigInteger's staticRandom field can be a source of bottlenecks

2013-08-23 Thread Mike Duigou
On Aug 23 2013, at 17:10 , Brian Burkhalter wrote: > > On Aug 23, 2013, at 5:06 PM, Mike Duigou wrote: > >> I would strongly recommend holding back on this change until someone >> familiar with the crypto implications takes a look at it. Unfortunately >> neither the random constructor nor pro

Re: Java 8 RFC 7189139: BigInteger's staticRandom field can be a source of bottlenecks

2013-08-23 Thread Brian Burkhalter
On Aug 23, 2013, at 5:06 PM, Mike Duigou wrote: > I would strongly recommend holding back on this change until someone familiar > with the crypto implications takes a look at it. Unfortunately neither the > random constructor nor probablePrime indicate any expectations regarding the > quality

Re: Java 8 RFC 7189139: BigInteger's staticRandom field can be a source of bottlenecks

2013-08-23 Thread Mike Duigou
I would strongly recommend holding back on this change until someone familiar with the crypto implications takes a look at it. Unfortunately neither the random constructor nor probablePrime indicate any expectations regarding the quality of random numbers needed from the offered PRNG. - Changin

Re: Java 8 RFC 7189139: BigInteger's staticRandom field can be a source of bottlenecks

2013-08-23 Thread Brian Burkhalter
On Aug 23, 2013, at 4:39 PM, Brian Burkhalter wrote: > With respect to this issue > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7189139 > > any comments on this potential fix > > file:///Users/bpb/Work/JSL/jdk/jdk8/tl8/jdk/7189139/index.html Correction to this webrev link: http://cr

Java 8 RFC 7189139: BigInteger's staticRandom field can be a source of bottlenecks

2013-08-23 Thread Brian Burkhalter
With respect to this issue http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7189139 any comments on this potential fix file:///Users/bpb/Work/JSL/jdk/jdk8/tl8/jdk/7189139/index.html would be appreciated. Rudimentary testing with JMH (http://openjdk.java.net/projects/code-tools/jmh/) did not

Re: RFR 8023463 Update HashMap and LinkedHashMap to use bins/buckets or trees (red/black)

2013-08-23 Thread Brent Christian
On 8/22/13 5:01 AM, Paul Sandoz wrote: On Aug 21, 2013, at 6:47 PM, Paul Sandoz wrote: I updated the webrev and replaced TreeBinSplitBackToEntries.java with: http://cr.openjdk.java.net/~psandoz/tl/JDK-8023463-Linked-HashMap-bin-and-tree/webrev/test/java/util/Map/MapBinToFromTreeTest.java.ht

Re: RFR: 8022176: Weaken contract of java.lang.AutoCloseable

2013-08-23 Thread Mike Duigou
Looks like the same text as agreed on the Lambda EG list. So, +1 Mike On Aug 23 2013, at 14:35 , Henry Jen wrote: > Hi, > > Please review the javadoc spec change for AutoCloseable. > > Basically, it clarifies that AutoCloseable is to be automatically closed > with try-with-resource construct,

Re: RFR: 8023681: Fix raw type warning caused by Sink

2013-08-23 Thread Ali Ebrahimi
you can try this. private static Function CASTING_IDENTITY = i -> i; @SuppressWarnings("unchecked") private static Function castingIdentity() { return (Function) CASTING_IDENTITY; } On Sat, Aug 24, 2013 at 2:10 AM, Mike Duigou wrote: > I considered that as well but s

Re: RFR: 8023681: Fix raw type warning caused by Sink

2013-08-23 Thread Brian Goetz
Because non-capturing lambdas are *already* constants! The commonly used trick, that was needed with inner classes to avoid instantiating multiple instances of essentially identical objects: static final Comparator c = new Comparator() { ... } is effectively implemented automatically (and l

Re: RFR: 8023681: Fix raw type warning caused by Sink

2013-08-23 Thread Mike Duigou
I considered that as well but since the types are generics you'd have to cast anyway. The only viable declaration is: private static Function CASTING_IDENTITY = i -> i; On usage you'd have to add (Function) CASTING_IDENTITY (Which assumes the compiler would even accept this heinous cast, I hav

RFR: 8022176: Weaken contract of java.lang.AutoCloseable

2013-08-23 Thread Henry Jen
Hi, Please review the javadoc spec change for AutoCloseable. Basically, it clarifies that AutoCloseable is to be automatically closed with try-with-resource construct, and the implementation may or may not hold resources that need to be closed. http://cr.openjdk.java.net/~henryjen/ccc/8022176/we

Re: Java 8 RFR 8010430: Math.round has surprising behavior for odd values of ulp 1

2013-08-23 Thread Guy Steele
There seem to be two distinct issues here: (1) As originally specified in the first edition of JLS, java.lang.Math.round sometimes accepts an argument that is equal to a mathematical integer and returns a value that is another (larger) mathematical integer because IEEE rounding occurs in the ad

Re: RFR: 8023681: Fix raw type warning caused by Sink

2013-08-23 Thread Ali Ebrahimi
Why not to make castingIdentity method a constant? On Fri, Aug 23, 2013 at 11:47 PM, Henry Jen wrote: > Hi, > > Please kindly review the fix for eliminate some warnings in > java.util.stream package. > > Chained Sink is an internal implementation detail, add the type for > downstream is more pr

Re: Going once, going twice … (Java 8 RFR 6378503: In java.math.BigDecimal, division by one returns zero)

2013-08-23 Thread Brian Burkhalter
Thank you kind sir! Brian On Aug 23, 2013, at 2:13 PM, Martin Buchholz wrote: > Reviewer of last resort here. > > Looks good to me! >

Re: RFR: 8023681: Fix raw type warning caused by Sink

2013-08-23 Thread Mike Duigou
Nice cleanups. Looks good! Mike On Aug 23 2013, at 12:17 , Henry Jen wrote: > Hi, > > Please kindly review the fix for eliminate some warnings in > java.util.stream package. > > Chained Sink is an internal implementation detail, add the type for > downstream is more precise but verbose. > > I

Re: Going once, going twice … (Java 8 RFR 6378503: In java.math.BigDecimal, division by one returns zero)

2013-08-23 Thread Martin Buchholz
Reviewer of last resort here. Looks good to me! On Fri, Aug 23, 2013 at 11:32 AM, Brian Burkhalter < brian.burkhal...@oracle.com> wrote: > JDK 8 Reviewers: > > Might anyone be inclined to review (and approve?) the patch previous > proposed in this posting? > > > http://mail.openjdk.java.net/pip

Re: Java 8 RFR 8010430: Math.round has surprising behavior for odd values of ulp 1

2013-08-23 Thread Brian Burkhalter
This is an interesting point and roundToIntegralTiesToAway() does have an appealing symmetry, but I think it is a broader issue than the constrained case I originally posted. Whichever of the approaches obtains, it seems that if the floating point argument A represents a real number which is al

Additional source to guess the local timezone ID on linux

2013-08-23 Thread Omair Majid
Hi, The algorithm that OpenJDK uses to guess the local timezone ID on Linux goes like this: 1. If TZ environment variable is set, use that 2. If /etc/timezone is readable, read the time zone from there 3. If /etc/localtime is a symlink, resolve that, and use the name to guess the time zone. 4. Sc

Re: Java 8 RFR 8010430: Math.round has surprising behavior for odd values of ulp 1

2013-08-23 Thread Dmitry Nadezhin
I guess that the method java.lang.Math.round() should correspond to roundToIntegralTiesToAway of the IEEE 754-2008. Standard says about it (section 5.9): === roundToIntegralTiesToAway(x) rounds x to the nearest integral value, with halfway cases rounding away from zero === So the halfway cases are

Re: Java 8 RFR 8010430: Math.round has surprising behavior for odd values of ulp 1

2013-08-23 Thread Guy Steele
The specification of java.lang.Math.round in the first edition of the Java Language Specification is quite clear: public static int round(float a) The result is rounded to an integer by adding 1/2, taking the floor of the result, and casting the result to type int. In other words, the result

Re: Java 8 RFR 8010430: Math.round has surprising behavior for odd values of ulp 1

2013-08-23 Thread Brian Burkhalter
With respect to this issue, the argument satisfies the condition a == (int)a or a == (long)a so there really is no tie, unless I am missing something. The problem is that in the current implementation the intermediate result a + 0.5 is rounded according to the IEEE standard so the conditions

Re: Java 8 RFR 8010430: Math.round has surprising behavior for odd values of ulp 1

2013-08-23 Thread Dmitry Nadezhin
The specification of java.lang.Math.round() says * Returns the closest {@code int} to the argument, with ties * rounding up. It is not clarified what is "ties rounding up". I guess that it should correspond to the direction "roundTiesToAway" of IEEE 754-2008 and to the java.math.RoundingM

Re: RFR: 8023528: Rename Comparator combinators to disambiguate overloading methods

2013-08-23 Thread Mike Duigou
Looks OK to me. Mike On Aug 22 2013, at 20:21 , Henry Jen wrote: > Hi, > > Please review a relative simple webrev[1] that basically simply renaming > Comparator methods. The reason behind the renaming can be found at this > email thread[2]. The specdiff is also available here[3]. > > Cheers, >

Re: RFR: 8023681: Fix raw type warning caused by Sink

2013-08-23 Thread Brian Goetz
Nice. +1. On 8/23/2013 3:17 PM, Henry Jen wrote: Hi, Please kindly review the fix for eliminate some warnings in java.util.stream package. Chained Sink is an internal implementation detail, add the type for downstream is more precise but verbose. Included is also a couple other warnings clea

RFR: 8023681: Fix raw type warning caused by Sink

2013-08-23 Thread Henry Jen
Hi, Please kindly review the fix for eliminate some warnings in java.util.stream package. Chained Sink is an internal implementation detail, add the type for downstream is more precise but verbose. Included is also a couple other warnings cleanup. http://cr.openjdk.java.net/~henryjen/tl/8023681

hg: jdk8/tl/jdk: 8005899: Logger.getLogger(name, null) should not allow to reset a non-null resource bundle

2013-08-23 Thread daniel . fuchs
Changeset: 4ef82445ea20 Author:dfuchs Date: 2013-08-23 20:59 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/4ef82445ea20 8005899: Logger.getLogger(name, null) should not allow to reset a non-null resource bundle Reviewed-by: mchung, lancea ! src/share/classes/java/util/logg

Going once, going twice … (Java 8 RFR 6378503: In java.math.BigDecimal, division by one returns zero)

2013-08-23 Thread Brian Burkhalter
JDK 8 Reviewers: Might anyone be inclined to review (and approve?) the patch previous proposed in this posting? http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-August/019581.html Thanks, Brian

Java 8 RFR 8010430: Math.round has surprising behavior for odd values of ulp 1

2013-08-23 Thread Brian Burkhalter
This message follows the RFC http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-August/019560.html posted on August 2. The issue is http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8010430. The proposed patch http://cr.openjdk.java.net/~bpb/8010430/ has the effect of option (A) in the

Re: RFR: 8023528: Rename Comparator combinators to disambiguate overloading methods

2013-08-23 Thread Zhong Yu
I for one must express the concern that this is extremely ugly API. It is another blow to the reputation of Java Language. While we should not support overload with implicit lambda in general cases, we should and can support it in the restricted case where all overloading methods agree upon the la

Re: RFR: 8005899: Logger.getLogger(name, null) should not allow to reset a non-null resource bundle

2013-08-23 Thread Lance Andersen - Oracle
looks fine dan! On Aug 23, 2013, at 1:26 PM, Daniel Fuchs wrote: > On 8/23/13 5:50 PM, Mandy Chung wrote: >> Hi Daniel, >> >> The fix looks good. It might be good to clarify the spec in the case >> when the given resourceBundleName parameter is null? Perhaps in the >> @params resourceBundleN

Re: RFR: 8005899: Logger.getLogger(name, null) should not allow to reset a non-null resource bundle

2013-08-23 Thread Mandy Chung
Thumbs up. thanks Mandy On 8/23/2013 10:26 AM, Daniel Fuchs wrote: On 8/23/13 5:50 PM, Mandy Chung wrote: Hi Daniel, The fix looks good. It might be good to clarify the spec in the case when the given resourceBundleName parameter is null? Perhaps in the @params resourceBundleName of the g

Re: RFR: 8005899: Logger.getLogger(name, null) should not allow to reset a non-null resource bundle

2013-08-23 Thread Daniel Fuchs
On 8/23/13 5:50 PM, Mandy Chung wrote: Hi Daniel, The fix looks good. It might be good to clarify the spec in the case when the given resourceBundleName parameter is null? Perhaps in the @params resourceBundleName of the getLogger(String, String) method. * @param resourceBundleName n

Re: RFR: 8022343: j.l.Class.getAnnotatedSuperclass() doesn't return null in some cases

2013-08-23 Thread Joe Darcy
Looks good to go back; thanks, -Joe On 08/23/2013 09:54 AM, Joel Borggrén-Franck wrote: Fixed, http://cr.openjdk.java.net/~jfranck/8022343/webrev.02/ cheers /Joel On Aug 23, 2013, at 2:34 AM, Joseph Darcy wrote: Hi Joel, The new version is better, but for the testing in question I would

Re: RFR: 8022343: j.l.Class.getAnnotatedSuperclass() doesn't return null in some cases

2013-08-23 Thread Joel Borggrén-Franck
Fixed, http://cr.openjdk.java.net/~jfranck/8022343/webrev.02/ cheers /Joel On Aug 23, 2013, at 2:34 AM, Joseph Darcy wrote: > Hi Joel, > > The new version is better, but for the testing in question I would prefer to > see something even simpler like: > >public static void main(String[]

Re: RFR [8023130] (process) ProcessBuilder#inheritIO does not work on Windows

2013-08-23 Thread Ivan Gerasimov
Thank you Alan! On 23.08.2013 14:28, Alan Bateman wrote: On 23/08/2013 04:07, Ivan Gerasimov wrote: Hello everybody! The method ProcessBuilder#inheritIO() is reported to not have any effect on Windows platform. The same story is with redirectOutput/Input/Error(Redirect.INHERIT) methods. As

Re: RFR: 8023528: Rename Comparator combinators to disambiguate overloading methods

2013-08-23 Thread Henry Jen
Thanks Stuart for the review and correct link. Cheers, Henry On Aug 22, 2013, at 11:00 PM, Stuart Marks wrote: > Hi Henry, > > Changes look good. It's also good to see some now-extra casts and type > witnesses removed. It somewhat makes up for the longer, non-overloaded method > names. > >

Re: RFR: 8005899: Logger.getLogger(name, null) should not allow to reset a non-null resource bundle

2013-08-23 Thread Mandy Chung
Hi Daniel, The fix looks good. It might be good to clarify the spec in the case when the given resourceBundleName parameter is null? Perhaps in the @params resourceBundleName of the getLogger(String, String) method. * @param resourceBundleName name of ResourceBundle to be used for

Re: RFR: 8022445: fix RMISocketFactory example to avoid using localhost

2013-08-23 Thread Bernd Eckenfels
All Stream Sockets where you specify an bind address (different from InAddrAny aka "::" or 0.0.0.0) are only bound to a single address family. You can't bind a single listening socket to a dual stack localhost IP Address. getLoopbackAddress is either ::1 or 127.0.0.1 (depending on the stack pre

Re: hg: jdk8/tl/jdk: 8022228: Intermittent test failures in sun/security/ssl/javax/net/ssl/NewAPIs

2013-08-23 Thread Laxmi Narayan NIT DGP
is there are any chances of contribution for outsider of oracle and even student developers ?? * Laxmi Narayan Patel * * MCA NIT Durgapur (Pre final year) * * mob:-8345847473 * On Thu, Aug 22, 2013 at 8:16 AM, wrote: > Changeset: ec827a62070a > Author:xuele

Re: Please review fix for 8011944 : Sort fails with ArrayIndexOutOfBoundsException

2013-08-23 Thread roger riggs
Hi, I reviewed the algorithm of the test case and it seems to me that it produces the smallest number of total items to sort for a given stack depth. I ran it with other stack depths and confirmed that the implementation did not exceed the new limit. I was unable to discover a specific explanati

Re: RFR: 8005899: Logger.getLogger(name, null) should not allow to reset a non-null resource bundle

2013-08-23 Thread Lance Andersen - Oracle
Looking at the jdk7 source and comparing your change this looks OK. Would be good to get one more pair of eyes on this as well but I think you should be good to go Best Lance On Aug 23, 2013, at 10:41 AM, Daniel Fuchs wrote: > Hi, > > Please find below a fix for: > > 8005899: Logger.getLogg

Re: Please review fix for 8011944 : Sort fails with ArrayIndexOutOfBoundsException

2013-08-23 Thread Alan Bateman
On 22/08/2013 15:25, roger riggs wrote: Please review the fix for: JDK-8011944[1] : Sort fails with ArrayIndexOutOfBoundsException The pending run stack size is estimated based on the input size. The worst case sequence of inputs exceeds the current allocation and an exception occurs. Incre

RFR: 8005899: Logger.getLogger(name, null) should not allow to reset a non-null resource bundle

2013-08-23 Thread Daniel Fuchs
Hi, Please find below a fix for: 8005899: Logger.getLogger(name, null) should not allow to reset a non-null resource bundle The issue here is that whereas in JDK 7, Logger.getLogger("foo", null); will throw an IllegalArgumentException if "foo" has a non null bundle name, JDK 8 will

hg: jdk8/tl/nashorn: 12 new changesets

2013-08-23 Thread sundararajan . athijegannathan
Changeset: dbb0a20a6f27 Author:attila Date: 2013-08-21 13:39 +0200 URL: http://hg.openjdk.java.net/jdk8/tl/nashorn/rev/dbb0a20a6f27 8023373: allow super invocation for adapters Reviewed-by: lagergren, sundar ! src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.jav

Re: RFR (M) CR 8023234: StampedLock serializes readers on writer unlock

2013-08-23 Thread Aleksey Shipilev
Hm, I think I still need the second reviewer. Anyone? http://cr.openjdk.java.net/~shade/8023234/webrev.01/ -Aleksey. On 08/21/2013 11:05 PM, Aleksey Shipilev wrote: > Thanks Martin! > > I need a sponsor to push this. > > -Aleksey. > > P.S. The support for multi-threaded tests in jtreg/libra

Re: RFR [8023130] (process) ProcessBuilder#inheritIO does not work on Windows

2013-08-23 Thread Alan Bateman
On 23/08/2013 04:07, Ivan Gerasimov wrote: Hello everybody! The method ProcessBuilder#inheritIO() is reported to not have any effect on Windows platform. The same story is with redirectOutput/Input/Error(Redirect.INHERIT) methods. As the result, standard in/out/err aren't inherited. It turn

hg: jdk8/tl/jaxws: 8023636: Missing files from 8022885

2013-08-23 Thread chris . hegarty
Changeset: d8593d8581df Author:mkos Date: 2013-08-23 11:10 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jaxws/rev/d8593d8581df 8023636: Missing files from 8022885 Reviewed-by: alanb, chegar + src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/StreamingSOAP.java + src/sha

hg: jdk8/tl/jaxws: 8022885: Update JAX-WS RI integration to 2.2.9-b14140; ...

2013-08-23 Thread chris . hegarty
Changeset: b99d7e355d4b Author:mkos Date: 2013-08-23 09:57 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/jaxws/rev/b99d7e355d4b 8022885: Update JAX-WS RI integration to 2.2.9-b14140 8013016: Rebase 8009009 against the latest jdk8/jaxws Reviewed-by: alanb, chegar ! src/share/jaxws_

hg: jdk8/tl/jdk: 6470700: Math.random() / Math.initRNG() uses "double checked locking"

2013-08-23 Thread chris . hegarty
Changeset: 223be1d3494f Author:bpb Date: 2013-08-22 13:32 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/223be1d3494f 6470700: Math.random() / Math.initRNG() uses "double checked locking" Summary: Replace class Random variable with a static final holder class Reviewed-by: ala